From 197faeae42f7a37cdd45814ca0d24c6895c3af83 Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Sat, 21 Dec 2024 09:46:27 +0100 Subject: [PATCH 01/13] Add strategy for SPLIT --- SPLIT.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 SPLIT.md diff --git a/SPLIT.md b/SPLIT.md new file mode 100644 index 000000000..2212a5170 --- /dev/null +++ b/SPLIT.md @@ -0,0 +1,5 @@ +# Split into many crates + +Strategy is to use [cargo-modules](https://github.com/regexident/cargo-modules) to analyze modules and plan crates. + +Goal is a *broad* and **not** a *deep* tree. \ No newline at end of file From fb8a1d7f5bb4b2530f46731cc6a6df8d560c2574 Mon Sep 17 00:00:00 2001 From: Alexander Cyon <116169792+CyonAlexRDX@users.noreply.github.com> Date: Mon, 23 Dec 2024 10:17:49 +0100 Subject: [PATCH 02/13] Ac/split plan (#320) Plan --- Cargo.lock | 21 +- SPLIT.md | 921 +++++++++++++++++- crates/sargon-uniffi/Cargo.toml | 10 - crates/sargon/Cargo.toml | 14 - .../sargon/src/core/utils/vector_samples.rs | 0 .../petition_transaction_outcome.rs | 6 +- .../system/sargon_os/sargon_os_accounts.rs | 1 - 7 files changed, 931 insertions(+), 42 deletions(-) delete mode 100644 crates/sargon/src/core/utils/vector_samples.rs diff --git a/Cargo.lock b/Cargo.lock index 430168b9f..2057cc1c2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -247,9 +247,9 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.4" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" +checksum = "43a2b323ccce0a1d90b449fd71f2a06ca7faa7c54c2751f06c9bd851fc061059" dependencies = [ "async-lock", "cfg-if", @@ -1120,9 +1120,9 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +checksum = "3c3e4e0dd3673c1139bf041f3008816d9cf2946bbfac2945c09e523b8d7b05b2" dependencies = [ "event-listener 5.3.1", "pin-project-lite", @@ -1256,9 +1256,9 @@ checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" -version = "2.3.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" +checksum = "cef40d21ae2c515b51041df9ed313ed21e572df340ea58a922a0aefe7e8891a1" dependencies = [ "fastrand", "futures-core", @@ -2142,9 +2142,9 @@ checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" [[package]] name = "polling" -version = "3.7.3" +version = "3.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" +checksum = "a604568c3202727d1507653cb121dbd627a58684eb09a820fd746bee38b4442f" dependencies = [ "cfg-if", "concurrent-queue", @@ -2772,7 +2772,6 @@ dependencies = [ "bip39", "camino 1.0.8", "cargo_toml 0.15.3 (git+https://gitlab.com/lib.rs/cargo_toml?rev=e498c94fc42a660c1ca1a28999ce1d757cfe77fe)", - "clap 4.5.1", "delegate", "derive_more 1.0.0", "enum-as-inner", @@ -2798,7 +2797,6 @@ dependencies = [ "radix-rust", "radix-transactions", "rand", - "regex 1.9.3 (git+https://github.com/rust-lang/regex/?rev=72f889ef3cca59ebac6a026f3646e8d92f056d88)", "reqwest", "sbor", "security-framework", @@ -2823,7 +2821,6 @@ dependencies = [ "async-trait", "base64 0.22.1 (git+https://github.com/marshallpierce/rust-base64.git?rev=e14400697453bcc85997119b874bc03d9601d0af)", "camino 1.0.8", - "cargo_toml 0.15.3 (git+https://gitlab.com/lib.rs/cargo_toml?rev=e498c94fc42a660c1ca1a28999ce1d757cfe77fe)", "clap 4.5.1", "delegate", "derive_more 1.0.0-beta.6", @@ -2842,8 +2839,6 @@ dependencies = [ "regex 1.9.3 (git+https://github.com/rust-lang/regex/?rev=72f889ef3cca59ebac6a026f3646e8d92f056d88)", "sargon", "sargon-uniffi-conversion-macros", - "security-framework", - "security-framework-sys", "strum 0.26.1", "thiserror 1.0.50", "uniffi", diff --git a/SPLIT.md b/SPLIT.md index 2212a5170..8d722d778 100644 --- a/SPLIT.md +++ b/SPLIT.md @@ -2,4 +2,923 @@ Strategy is to use [cargo-modules](https://github.com/regexident/cargo-modules) to analyze modules and plan crates. -Goal is a *broad* and **not** a *deep* tree. \ No newline at end of file +Goal is a _broad_ and **not** a _deep_ tree. + +# [TOC](#toc) + + + +- [`core`](#core) +- [`testing`](#testing) +- [`collections`](#collections) +- [`bytes`](#bytes) +- [`hash`](#hash) +- [`elliptic-curve-cryptography-core`](#elliptic-curve-cryptography-core) +- [`secp256k1`](#secp256k1) +- [`curve25519`](#curve25519) +- [`elliptic-curve-cryptography`](#elliptic-curve-cryptography) +- [`bip39`](#bip39) +- [`bip32`](#bip32) +- [`bip44-like-path`](#bip44-like-path) +- [`cap26-core`](#cap26-core) +- [`account-path`](#account-path) +- [`identity-path`](#identity-path) +- [`derivation-path`](#derivation-path) +- [`hd-elliptic-curve-cryptography`](#hd-elliptic-curve-cryptography) +- [`factor-source-kind`](#factor-source-kind) +- [`derivation`](#derivation) +- [`decimal192`](#decimal192) +- [`addresses`](#addresses) +- [`factor-source-id`](#factor-source-id) +- [`factor-sources`](#factor-sources) +- [`factor-instance`](#factor-instance) +- [`security-shields`](#security-shields) +- [`entity-security-state`](#entity-security-state) +- [`entity-core`](#entity-core) +- [`account`](#account) +- [`persona-data`](#persona-data) +- [`persona`](#persona) +- [`keys-collector`](#keys-collector) +- [`transaction-manifest-core`](#transaction-manifest-core) +- [`transaction-core`](#transaction-core) +- [`transaction-manifest-building`](#transaction-manifest-building) +- [`signatures-collector`](#signatures-collector) +- [`TEMPLATE`](#template) + + + +# Crates + +> [!NOTE] +> We might prefix all crates with `sargon-`, but omitted here for clarity. + +## `core`[^](#toc) + +Lowest level possible modules + +> [!IMPORTANT] > **All** crates below depend on `core` +> but it should be the only sargon crate that ALL crates depend on. + +
+ Click me + +- Contains many fundamental small enums types with no associated value (discriminator) +- No dependencies on any other sargon crates. +- Depends only on "small" external crates + +### Modules + +- `has_sample_values` +- `u11` +- `u30` +- `u31` +- `network_id` (move to a crate on top of `core`, `essentials`?) +- `factor_source_kind` (move to a crate on top of `core`, `essentials`?) +- `factor_source_list_kind` (move to a crate on top of `core`, `essentials`?) +- `role_kind` (move to a crate on top of `core`, `essentials`?) +- `key_kind` (move to a crate on top of `core`, `essentials`?) +- `entity_kind` (move to a crate on top of `core`, `essentials`?) +- `string_utils` +- `unsafe_id_stepper` +- `constants` - split out only non-radix specific ones, e.g. time +- `common_error` - must reduce complexity of associated values, we can then per crate declare tiny traits with helper ctors, e.g.: + +```diff +// in crate `core` +pub enum CommonError { + ... + #[error("Account Already Present {bad_value}")] +- AccountAlreadyPresent { bad_value: AccountAddress } = 10074, ++ AccountAlreadyPresent { bad_value: String } = 10074, + ... +} + ++ // in crate `addresses` ++ pub trait FromAccountAlreadyPresentErr { ++ fn account_already_present(bad_value: AccountAddress) -> CommonError { ++ CommonError::AccountAlreadyPresent { bad_value: bad_value.to_string() } ++ } ++ } ++ impl FromAccountAlreadyPresentErr for CommonError {} +``` + +### Dependencies + +#### Internal + +NONE + +#### External + +- `serde` - hmm can we make `serde` a feature flag for `core` crate? +- `thiserror` +- `uuid` ?? +
+ +## `testing`[^](#toc) + +Testing utils. + +
+ Click me + +### Modules + +- `assert_json` + +### Dependencies + +#### Internal + +- `core` + +#### External + +- `serde` +- `serde_json` +- `thiserror` +- `assert_json_diff` +- `pretty_assertions` +
+ +## `collections`[^](#toc) + +Collection datatypes + +
+ Click me + +### Modules + +- `identified_vec_of` +- `index_set_extensions` +- `index_map_extensions` +- `hash_map_extensions` + +### Dependencies + +#### Internal + +- `core` + +#### External + +- `indexmap` +
+ +## `bytes`[^](#toc) + +Fixed size byte arrays. + +
+ Click me + +### Modules + +- `exactly_60_bytes` (encrypted mnemonic for security questions factor) +- `exactly_12_bytes` (AES encryption) +- `exactly_65_bytes` (Secp256k1Signature) +- `exactly_33_bytes` (Secp256k1PublicKey) +- `exactly_64_bytes` (Ed25519Signature) +- `exactly_32_bytes` (Ed25519PublicKey) +- `exactly_29_bytes` (PublicKeyHash) + +### Dependencies + +#### Internal + +- `core` + +#### External + +- `hex` +
+ +## `hash`[^](#toc) + +Blake hash + +
+ Click me +### Modules +- `hash` +- `blake_hash` +- `public_key_hash` (???) + +### Dependencies + +#### Internal + +#### External + +- [`radix_common` (scrypto)](https://github.com/radixdlt/radixdlt-scrypto/tree/main/radix-common) + +
+ +## `elliptic-curve-cryptography-core`[^](#toc) + +Common traits and models used by `secp256k1`, `curve25519` and `elliptic-curve-cryptography` crates. + +
+ Click me +### Modules +- `is_private_key` +- `is_public_key` +- `curve` + +### Dependencies + +#### Internal + +- `bytes` + +#### External + +
+ +## `secp256k1`[^](#toc) + +Secp256k1 ECC + +
+ Click me +### Modules +- `secp256k1_private_key` +- `secp256k1_public_key` +- `secp256k1_signature` + +### Dependencies + +#### Internal + +- `elliptic-curve-cryptography-core` + +#### External + +- [`radix_common` (scrypto)](https://github.com/radixdlt/radixdlt-scrypto/tree/main/radix-common) + +
+ +## `curve25519`[^](#toc) + +Curve25519 ECC + +
+ Click me +### Modules +- `curve25519_private_key` +- `curve25519_public_key` +- `curve25519_signature` + +### Dependencies + +#### Internal + +- `elliptic-curve-cryptography-core` + +#### External + +- [`radix_common` (scrypto)](https://github.com/radixdlt/radixdlt-scrypto/tree/main/radix-common) + +
+ +## `elliptic-curve-cryptography`[^](#toc) + +ECC models + +
+ Click me +### Modules +- `private_key` +- `public_key` +- `signature` +- `signature_with_public_key` + +### Dependencies + +#### Internal + +- `curve25519` +- `secp256k1` + +#### External + +
+ +## `bip39`[^](#toc) + +
+ Click me + +### Modules + +- `bip39_seed` +- `bip39_word_count` +- `bip39_word` +- `bip39_entropy` +- `mnemonic` +- `bip39_passphrase` +- `mnemonic_with_passphrase` +
+ +## `bip32`[^](#toc) + +
+ Click me +
+ +## `bip44-like-path`[^](#toc) + +
+ Click me + +### Dependencies + +#### Internal + +- `bip32` +
+ +## `cap26-core`[^](#toc) + +
+ Click me + +### Dependencies + +#### Internal + +- `bip32` +
+ +## `account-path`[^](#toc) + +
+ Click me + +### Dependencies + +#### Internal + +- `cap26-core` +
+ +## `identity-path`[^](#toc) + +
+ Click me + +### Dependencies + +#### Internal + +- `cap26-core` +
+ +## `derivation-path`[^](#toc) + +
+ Click me + +### Dependencies + +#### Internal + +- `bip44-like-path` +- `account-path` +- `identity-path` +
+ +## `hd-elliptic-curve-cryptography`[^](#toc) + +Hierarchical Deterministic Elliptic Curve Cryptography, HD ECC models such as `HDPublicKey`, `HDPrivateKey` and `HDSignature` + +
+ Click me +### Modules +- `hd_private_key` +- `hd_public_key` +- `hd_signature` + +### Dependencies + +#### Internal + +- `elliptic-curve-cryptography` +- `derivation-path` + +#### External + +
+ +## `factor-source-kind`[^](#toc) + +Enum with FactorSourceKind + +
+ Click me + +### Modules + +### Dependencies + +#### Internal + +
+ +## `derivation`[^](#toc) + +Hierarchical Deterministic derivation HDPrivateKey and HDPublicKey + +
+ Click me + +### Modules + +### Dependencies + +#### Internal + +- `bip39` +- `hd-elliptic-curve-cryptography` +
+ +## `decimal192`[^](#toc) + +
+ Click me + +### Modules + +- `decimal192` + +### Dependencies + +#### Internal + +- `core` + +#### External + +- [`radix_common`][radix_common] +- `delegate` +- `enum_iterator` + +
+ +## `addresses`[^](#toc) + +All address types. + +
+ Click me + +### Modules + +### Dependencies + +#### Internal + +#### External + +
+ +## `factor-source-id`[^](#toc) + +ID of FactorSources + +
+ Click me + +### Modules + +- `factor_source_id` +- `factor_source_id_from_hash` +- `factor_source_id_from_address` + +### Dependencies + +#### Internal + +- `hash` +- `addresses` +- `factor-source-kind` + +#### External + +
+ +## `factor-sources`[^](#toc) + +All different FactorSource types and the `FactorSource` enum. + +
+ Click me +### Modules +- `factor_source` +- `device_factor_source` +- `ledger_factor_source` +- `arculus_factor_source` +- `password_factor_source` +- `off_device_mnemonic_factor_source` +- `security_questions_factor_source` +- `yubikey_factor_source` +- `trusted_contact_factor_source` + +### Dependencies + +#### Internal + +- `core` +- `factor-source-id` + +#### External + +
+ +## `factor-instance`[^](#toc) + +`FactorInstance` and `HDFactorInstance + +
+ Click me +### Modules +- `factor_instance +- `hd_factor_instance + +### Dependencies + +#### Internal + +- `factor-source-id` +- `hd-elliptic-curve-cryptography` + +#### External + +
+ +## `security-shields`[^](#toc) + +MatrixOfFactors, SecurityStructureOf and builders + +
+ Click me +### Modules + - `primary_role_with_factor_source_ids` + - `recovery_role_with_factor_source_ids` + - `confirmation_role_with_factor_source_ids` + - `primary_role_with_factor_sources` + - `recovery_role_with_factor_sources` + - `confirmation_role_with_factor_sources` + - `primary_role_with_factor_instances` + - `recovery_role_with_factor_instances` + - `confirmation_role_with_factor_instances` + - `matrix_of_factor_source_ids` + - `matrix_of_factor_sources` + - `matrix_of_factor_instances` + - `security_structure_of_factor_instances` + - `security_structure_of_factor_sources` + - `security_structure_of_factor_source_ids` + - `matrix_builder` + - `security_shield_builder` + +### Dependencies + +#### Internal + +- `factor-sources` +- `factor-instances` + +#### External + +
+ +## `entity-security-state`[^](#toc) + +Entity SecurityState models + +
+ Click me +### Modules + - `unsecured_entity_control` + - `securified_entity_control` + - `provisional_security_config` + - `access_controller` + +### Dependencies + +#### Internal + +- `security-shields` + +#### External + +
+ +## `entity-core`[^](#toc) + +Account and Persona shared type `BaseEntity` which we can use `serde(flatten)` with to flat +out into `Account` and `Persona`, something like: + +```rust + +pub trait IsEntity { + fn address(&self) -> &String; + fn display_name(&self) -> &String; + + fn set_display_name(&mut self, new: String); +} + +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] +pub struct BaseEntity { + address: String, + display_name: String, +} + +impl IsEntity for BaseEntity { + fn address(&self) -> &String { + &self.address + } + + fn display_name(&self) -> &String { + &self.display_name + } + + fn set_display_name(&mut self, new: String) { + self.display_name = new; + } +} + +#[macro_export] +macro_rules! forward_is_entity { + ($entity: ty) => { + impl IsEntity for $entity { + delegate::delegate! { + to self.base { + fn address(&self) -> &String; + fn display_name(&self) -> &String; + fn set_display_name(&mut self, new: String); + } + } + } + }; +} + +#[macro_export] +macro_rules! impl_deref_base_entity_for { + ($entity: ty) => { + impl Deref for $entity { + type Target = BaseEntity; + + fn deref(&self) -> &Self::Target { + &self.base + } + } + impl DerefMut for $entity { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.base + } + } + }; +} + +#[macro_export] +macro_rules! as_entity { + ($entity: ty) => { + $crate::forward_is_entity!($entity); + $crate::impl_deref_base_entity_for!($entity); + }; +} + +``` + +Later, In the `account` crate + +```rust +// NOT IN `entity-core` crate! +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] +pub struct Account { + #[serde(flatten)] + base: BaseEntity, // <-- imbue BaseEntity fields + + // === Extra Fields === + pub appearance_id: u8, +} + +// impl `IsEntity` and `Deref`/`DerefMut` (as BaseEntity) for `Account` +as_entity!(Account); +``` + +Later, In the `persona` crate + +```rust +// NOT IN `entity-core` crate! +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] +pub struct Persona { + #[serde(flatten)] + base: BaseEntity, // <-- imbue BaseEntity fields + + // === Extra Fields === + pub persona_data: PersonaData, +} + +// impl `IsEntity` and `Deref`/`DerefMut` (as BaseEntity) for `Persona` +as_entity!(Persona); +``` + +
+ Click me +### Modules + +### Dependencies + +#### Internal + +- `addresses` + +#### External + +- `delegate` + +
+ +## `account`[^](#toc) + +Account entity + +
+ Click me +### Modules +- `account` +- `appearance_id` + +### Dependencies + +#### Internal + +- `entity-core` + +#### External + +
+ +## `persona-data`[^](#toc) + +Persona Data models + +
+ Click me +### Modules +- `persona_data` + +### Dependencies + +#### Internal + +#### External + +
+ +## `persona`[^](#toc) + +Persona entity + +
+ Click me +### Modules +- `persona` + +### Dependencies + +#### Internal + +- `entity-core` +- `persona-data` + +#### External + +
+ +## `keys-collector`[^](#toc) + +Multi-factor-multi-path derivation + +
+ Click me +### Modules +- `keys_collector` +- `key_derivation_interactor` +- `key_derivation_request` +- `key_derivation_response` +- `derivation_purpose` + +### Dependencies + +#### Internal + +- `derivation-path` +- `factor-source` + +#### External + +
+ +- [radix_common]: https://github.com/radixdlt/radixdlt-scrypto/tree/main/radix-common + +## `transaction-manifest-core`[^](#toc) + +TransactionManifests models, this does NOT include the logic of building/declaring Transaction manifests. + +
+ Click me +### Modules + +### Dependencies + +#### Internal + +- `core` + +#### External + +
+ +## `transaction-core`[^](#toc) + +Radix Engine transaction models **except** TransactionManifest which is a lower level crate this crate depends on (split in two for smaller size). And note that **building** TransactionManifests is a third crate/ + +
+ Click me +### Modules +- `transaction_intent` +- `transaction_header` + +### Dependencies + +#### Internal + +- `transaction-manifest-core` + +#### External + +
+ +## `transaction-manifest-building`[^](#toc) + +Building of TransactionManifests. + +
+ Click me +### Modules + +### Dependencies + +#### Internal + +- `transaction-manifest-core` + +#### External + +- [`radix-transactions` (scrypto)](https://github.com/radixdlt/radixdlt-scrypto/tree/main/radix-transactions) + +
+ +## `signatures-collector`[^](#toc) + +Multi-tx-multi-entity-multi-factor signing coordinator. + +
+ Click me +### Modules +- `signatures_collector` +- `sign_request` +- `sign_response` +- `sign_interactor` + +### Dependencies + +#### Internal + +- `transaction` + +#### External + +
+ +## `TEMPLATE`[^](#toc) + +DESCRIPTION + +
+ Click me +### Modules + +### Dependencies + +#### Internal + +- `core` + +#### External + +
diff --git a/crates/sargon-uniffi/Cargo.toml b/crates/sargon-uniffi/Cargo.toml index 1a0e1ea39..13f8e85df 100644 --- a/crates/sargon-uniffi/Cargo.toml +++ b/crates/sargon-uniffi/Cargo.toml @@ -118,13 +118,6 @@ base64 = { git = "https://github.com/marshallpierce/rust-base64.git", rev = "e14 # preinterpret = "0.2.0" preinterpret = { git = "https://github.com/dhedey/preinterpret", rev = "6754b92bdead0ddd6f69fbee7d782180d6351605" } -# Fixes nasty iOS bug "_kSecMatchSubjectWholeString", see https://github.com/kornelski/rust-security-framework/issues/203 -# This is a workaround to fix a bug with version 2.11.0 that added some symbols that are not available on iOS -# The bug is fixed already but the fix is not released yet. https://github.com/kornelski/rust-security-framework/pull/204 -[target.'cfg(target_os = "ios")'.dependencies] -security-framework = { version = "=2.10" } -security-framework-sys = "=2.10.0" - [dev-dependencies] # uniffi = "0.28.3" @@ -141,9 +134,6 @@ uniffi = { git = "https://github.com/mozilla/uniffi-rs/", rev = "9127d4d9cfb8ff8 "build", ] } -# cargo_toml = "0.15.3" -cargo_toml = { git = "https://gitlab.com/lib.rs/cargo_toml", rev = "e498c94fc42a660c1ca1a28999ce1d757cfe77fe" } - [features] build-binary = ["camino", "clap", "regex"] diff --git a/crates/sargon/Cargo.toml b/crates/sargon/Cargo.toml index 6a458775a..aa56b3203 100644 --- a/crates/sargon/Cargo.toml +++ b/crates/sargon/Cargo.toml @@ -138,15 +138,6 @@ url = { version = "2.5.0", features = ["serde"] } # paste = "1.0.14" paste = { git = "https://github.com/dtolnay/paste", rev = "1e0cc1025af5388397c67fa4389ad7ad24814df8" } -# regex = "1.9.3" -regex = { git = "https://github.com/rust-lang/regex/", rev = "72f889ef3cca59ebac6a026f3646e8d92f056d88", optional = true } - -# clap = "4.5.1" -clap = { git = "https://github.com/clap-rs/clap/", rev = "8a7a13a5618cfdc4ff328624a5266e7b4d88649a", default-features = false, features = [ - "std", - "derive", -], optional = true } - # camino = "1.0.8" camino = { git = "https://github.com/camino-rs/camino/", rev = "afa51b1b4c684b7e6698a6717ccda3affd0abd42", optional = true } @@ -175,7 +166,6 @@ reqwest = { git = "https://github.com/seanmonstar/reqwest", rev = "0720159f6369f "native-tls-vendored", ] } -# async-std = "1.13.0" async-std = "1.13.0" futures = "0.3.31" @@ -186,7 +176,6 @@ futures = "0.3.31" security-framework = { version = "=2.10" } security-framework-sys = "=2.10.0" - [dev-dependencies] # actix-rt = "3.3.0" @@ -197,8 +186,5 @@ actix-rt = { git = "https://github.com/actix/actix-net", rev = "57fd6ea8098d1f2d # cargo_toml = "0.15.3" cargo_toml = { git = "https://gitlab.com/lib.rs/cargo_toml", rev = "e498c94fc42a660c1ca1a28999ce1d757cfe77fe" } -[features] -build-binary = ["camino", "clap", "regex"] - [lints.rust] unexpected_cfgs = { level = "forbid", check-cfg = ['cfg(tarpaulin_include)'] } diff --git a/crates/sargon/src/core/utils/vector_samples.rs b/crates/sargon/src/core/utils/vector_samples.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/crates/sargon/src/signing/signatures_outecome_types/petition_transaction_outcome.rs b/crates/sargon/src/signing/signatures_outecome_types/petition_transaction_outcome.rs index f9c6edcc8..55641eff1 100644 --- a/crates/sargon/src/signing/signatures_outecome_types/petition_transaction_outcome.rs +++ b/crates/sargon/src/signing/signatures_outecome_types/petition_transaction_outcome.rs @@ -1,8 +1,8 @@ use crate::prelude::*; /// The outcome of collecting signatures for a specific -/// transasction - either valid or invalid - and a -/// set of collected signatues (might be empty) and +/// transaction - either valid or invalid - and a +/// set of collected signatures (might be empty) and /// a set of neglected factors (might be empty). #[derive(Clone, PartialEq, Eq)] pub(crate) struct PetitionTransactionOutcome { @@ -24,7 +24,7 @@ impl PetitionTransactionOutcome { ) -> Self { assert!( signatures.iter().all(|s| *s.payload_id() == signable_id), - "Discprenacy! Mismatching intent hash found in a signature." + "Discrepancy! Mismatching intent hash found in a signature." ); Self { signable_id, diff --git a/crates/sargon/src/system/sargon_os/sargon_os_accounts.rs b/crates/sargon/src/system/sargon_os/sargon_os_accounts.rs index e6b85d344..8a27e0656 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os_accounts.rs +++ b/crates/sargon/src/system/sargon_os/sargon_os_accounts.rs @@ -976,7 +976,6 @@ impl SargonOS { mod tests { use super::*; use actix_rt::time::timeout; - use futures::future::Shared; use std::{future::join, future::Future, time::Duration}; #[allow(clippy::upper_case_acronyms)] From 1f33e007d03de75c951ba25716a0ae8bcd42333d Mon Sep 17 00:00:00 2001 From: Alexander Cyon <116169792+CyonAlexRDX@users.noreply.github.com> Date: Mon, 30 Dec 2024 09:14:36 +0100 Subject: [PATCH 03/13] Split out module `core` into separate crate (#321) --- Cargo.lock | 64 +++++--- Cargo.toml | 119 ++++++++++++++ README.md | 13 ++ .../CAP26EntityKind+Wrap+Functions.swift | 6 + .../Derivation/AccountPath+Swiftified.swift | 5 +- .../Derivation/IdentityPath+Swiftified.swift | 5 +- .../Profile/CAP26EntityKind+Swiftified.swift | 5 + crates/sargon-core/Cargo.toml | 44 ++++++ .../core => sargon-core/src}/assert_json.rs | 20 +-- .../src}/error/common_error.rs | 149 ++++-------------- .../src}/error/common_error_map.rs | 2 - .../src/core => sargon-core/src}/error/mod.rs | 0 .../src}/has_sample_values.rs | 0 .../src/core => sargon-core/src}/hash.rs | 2 +- crates/sargon-core/src/lib.rs | 92 +++++++++++ .../src}/secure_random_bytes.rs | 0 .../src}/types/appearance_id.rs | 0 .../src}/types/bag_of_bytes.rs | 9 +- .../src}/types/bool_type.rs | 2 + .../src}/types/collections/just.rs | 35 ++-- .../sargon-core/src/types/collections/mod.rs | 3 + .../src}/types/decimal192.rs | 49 +++--- .../src}/types/entity_kind.rs | 0 .../core => sargon-core/src}/types/epoch.rs | 1 - .../src}/types/exactly_n_bytes.rs | 1 - .../core => sargon-core/src}/types/instant.rs | 1 - .../src}/types/intent_discriminator.rs | 0 .../src}/types/keys/ed25519/mod.rs | 0 .../src}/types/keys/ed25519/private_key.rs | 1 - .../src}/types/keys/ed25519/public_key.rs | 4 +- .../src/types/keys/is_private_key.rs | 13 ++ .../src}/types/keys/is_public_key.rs | 0 .../src}/types/keys/key_agreement/mod.rs | 0 .../types/keys/key_agreement/private_key.rs | 2 - .../types/keys/key_agreement/public_key.rs | 0 .../src}/types/keys/mod.rs | 0 .../src}/types/keys/private_key.rs | 24 --- .../src}/types/keys/public_key.rs | 2 - .../src}/types/keys/secp256k1/mod.rs | 0 .../src}/types/keys/secp256k1/private_key.rs | 1 - .../src}/types/keys/secp256k1/public_key.rs | 2 + .../src}/types/keys/slip10_curve.rs | 29 ++-- .../src}/types/locale_config.rs | 0 .../src}/types/logged_result.rs | 0 .../src/core => sargon-core/src}/types/mod.rs | 4 +- .../src}/types/non_empty_max_n_bytes.rs | 7 +- .../core => sargon-core/src}/types/nonce.rs | 0 .../src}/types/requested_number_quantifier.rs | 0 .../src}/types/requested_quantity.rs | 0 .../src}/types/rounding_mode.rs | 1 - .../src}/types/safe_to_log.rs | 3 - .../src}/types/secret_bytes.rs | 7 +- .../types/signatures/ed25519_signature.rs | 0 .../src}/types/signatures/mod.rs | 0 .../types/signatures/secp256k1_signature.rs | 0 .../src}/types/signatures/signature.rs | 62 ++++---- .../signatures/signature_with_public_key.rs | 37 +++-- .../src}/types/vector_image_type.rs | 0 .../src}/types/version_type.rs | 4 +- .../src}/unsafe_id_stepper.rs | 1 - .../src}/utils/constants.rs | 0 .../core => sargon-core/src}/utils/factory.rs | 4 - .../src}/utils/image_url_utils.rs | 0 .../src}/utils/logged_panic.rs | 0 .../src/core => sargon-core/src}/utils/mod.rs | 0 .../src}/utils/serialization.rs | 0 .../src}/utils/string_utils.rs | 0 crates/sargon-uniffi/Cargo.toml | 69 +++----- .../src/core/error/common_error.rs | 81 ++++------ .../sargon-uniffi/src/core/result/result.rs | 32 ++-- .../types/collections/internal_mapping.rs | 33 +--- .../src/core/types/secret_bytes.rs | 1 + .../cap26/cap26_entity_kind.rs | 5 + .../question/security_question.rs | 5 + .../security_shield_builder.rs | 1 + .../supporting_types/decl_vec_samples_for.rs | 11 ++ ...ersona_data_identified_collection_types.rs | 19 +++ .../factors/factor_sources/factor_sources.rs | 4 +- .../resource_preferences.rs | 4 +- .../src/radix_connect/p2p_links/p2p_links.rs | 2 +- .../secure_storage_access_error_kind.rs | 7 + .../system/sargon_os/sargon_os_accounts.rs | 8 +- .../src/system/sargon_os/sargon_os_factors.rs | 6 +- .../sargon_os/sargon_os_security_center.rs | 2 +- .../sargon_os_security_structures.rs | 4 +- crates/sargon/Cargo.toml | 122 ++++---------- crates/sargon/src/core/mod.rs | 21 --- .../sargon/src/core/types/collections/mod.rs | 11 -- .../src/core/types/keys/is_private_key.rs | 49 ------ crates/sargon/src/error_from.rs | 92 +++++++++++ ...entity_index_profile_analyzing_assigner.rs | 24 ++- .../assert_network_request.rs | 3 +- .../src/gateway_api/client/gateway_client.rs | 7 - crates/sargon/src/gateway_api/mod.rs | 2 + .../transaction/preview/request_flags.rs | 2 + .../bip39/bip39_entropy.rs | 3 +- .../bip39/bip39_seed.rs | 3 +- .../cap26/paths/account_path.rs | 12 +- .../cap26/paths/identity_path.rs | 12 +- .../cap26/paths/traits.rs | 4 +- crates/sargon/src/home_cards/home_cards.rs | 8 +- .../decl_identified_vec_of_with_samples.rs | 119 ++++++++++++++ .../identified_vec_of/identifiable.rs | 0 .../identified_vec_of/identified_vec_of.rs | 2 +- .../identified_vec_of_display_debug.rs | 5 +- .../identified_vec_of_iterator.rs | 11 +- .../identified_vec_of_modify.rs | 2 +- .../identified_vec_of_query.rs | 2 +- .../identified_vec_of_serde.rs | 7 +- ...ntified_vec_of_validation_import_export.rs | 11 +- .../collections => }/identified_vec_of/mod.rs | 8 + .../collections => identified_vec_of}/user.rs | 0 .../collector/keys_collector_preprocessor.rs | 2 +- .../collector/keys_collector_state.rs | 4 +- crates/sargon/src/lib.rs | 78 ++++----- .../encrypted/encryption/aes_gcm_256.rs | 16 +- crates/sargon/src/profile/encrypted/mod.rs | 2 + .../encrypted}/pb_hkdf_sha256.rs | 8 +- .../logic/account/accounts_visibility.rs | 11 +- .../profile/logic/gateway/current_gateway.rs | 2 +- .../profile/logic/persona/create_persona.rs | 2 +- .../profile/logic/persona/query_personas.rs | 11 +- .../profile_network_details.rs | 12 +- .../src/profile/logic/query_factor_sources.rs | 14 +- .../keys_by_diffie_hellman_fold.rs | 12 +- ...m_questions_and_answers_lower_trim_utf8.rs | 12 +- .../matrices/builder/matrix_template.rs | 2 +- .../matrices/matrix_of_factor_instances.rs | 2 +- .../security_shield_builder.rs | 1 + .../supporting_types/accounts_or_personas.rs | 11 +- .../decl_identified_vec_of_with_samples.rs | 50 ------ .../supporting_types/is_network_aware.rs | 4 +- .../src/profile/supporting_types/mod.rs | 2 - .../on_same_network_validating.rs | 4 +- .../v100/address/non_fungible_local_id.rs | 6 - .../profile/v100/address/wrap_ret_address.rs | 4 +- .../profile/v100/app_preferences/security.rs | 2 + .../src/profile/v100/entity/entity_flags.rs | 16 +- .../src/profile/v100/factors/factor_source.rs | 94 +++++++---- .../factor_source_crypto_parameters.rs | 9 ++ .../factors/factor_sources/factor_sources.rs | 9 +- .../src/profile/v100/header/profile_id.rs | 4 + .../profile/v100/networks/network/accounts.rs | 14 +- .../v100/networks/network/authorized_dapps.rs | 17 +- .../profile/v100/networks/network/personas.rs | 6 +- .../v100/networks/network/profile_network.rs | 10 +- .../resource_preferences.rs | 20 ++- .../profile/v100/networks/profile_networks.rs | 80 ++++++---- crates/sargon/src/profile/v100/profile.rs | 24 +-- .../sargon/src/radix_connect/mobile/client.rs | 10 +- .../mobile/relay_service/service.rs | 9 +- .../pre_authorization/subintent.rs | 2 + .../transaction/transaction.rs | 1 + .../security_center/support/backup_result.rs | 2 + .../src/signing/authentication/auth_intent.rs | 19 ++- .../petition_transaction_outcome.rs | 2 +- .../clients/client/http_client/http_client.rs | 14 +- .../secure_storage_client.rs | 2 +- .../system/sargon_os/sargon_os_accounts.rs | 23 ++- .../sargon_os/sargon_os_sync_accounts.rs | 2 +- .../sargon_os_transaction_analysis.rs | 6 +- .../sargon_os_transaction_submit.rs | 2 +- .../support/pre_auth_to_review.rs | 1 - .../manifests_access_controller.rs | 4 +- .../manifest_encountered_component_address.rs | 4 +- .../transaction_guarantee.rs | 4 +- .../is_intent_signing.rs | 125 +++++++++++++++ .../manifest_summary/manifest_summary.rs | 14 +- .../low_level/signed_intent.rs | 1 - .../transaction_hashes/intent_hash.rs | 1 - .../transaction_hashes/subintent_hash.rs | 1 - .../plaintext_message/plaintext_message.rs | 1 - .../plaintext_message_contents.rs | 1 - .../transaction_manifest_execution_summary.rs | 88 +++++++---- .../instructions/instructions.rs | 10 +- .../transaction_manifest.rs | 9 +- .../low_level/v2/signed_subintent.rs | 1 - .../child_subintent_specifier.rs | 1 - .../child_subintent_specifiers.rs | 1 - .../instructions_v2/instructions_v2.rs | 10 +- .../subintent_manifest.rs | 9 +- .../transaction_manifest_v2.rs | 9 +- .../src/wrapped_radix_engine_toolkit/mod.rs | 2 + crates/sargon/tests/integration/main.rs | 3 +- .../radixdlt/sargon/extensions/AccountPath.kt | 4 +- .../sargon/extensions/IdentityPath.kt | 7 +- .../AndroidBiometricAuthorizationDriver.kt | 8 +- 187 files changed, 1570 insertions(+), 1091 deletions(-) create mode 100644 apple/Sources/Sargon/Extensions/Methods/Profile/CAP26EntityKind+Wrap+Functions.swift create mode 100644 apple/Sources/Sargon/Extensions/Swiftified/Profile/CAP26EntityKind+Swiftified.swift create mode 100644 crates/sargon-core/Cargo.toml rename crates/{sargon/src/core => sargon-core/src}/assert_json.rs (92%) rename crates/{sargon/src/core => sargon-core/src}/error/common_error.rs (88%) rename crates/{sargon/src/core => sargon-core/src}/error/common_error_map.rs (98%) rename crates/{sargon/src/core => sargon-core/src}/error/mod.rs (100%) rename crates/{sargon/src/core => sargon-core/src}/has_sample_values.rs (100%) rename crates/{sargon/src/core => sargon-core/src}/hash.rs (98%) create mode 100644 crates/sargon-core/src/lib.rs rename crates/{sargon/src/core => sargon-core/src}/secure_random_bytes.rs (100%) rename crates/{sargon/src/core => sargon-core/src}/types/appearance_id.rs (100%) rename crates/{sargon/src/core => sargon-core/src}/types/bag_of_bytes.rs (98%) rename crates/{sargon/src/core => sargon-core/src}/types/bool_type.rs (99%) rename crates/{sargon/src/core => sargon-core/src}/types/collections/just.rs (60%) create mode 100644 crates/sargon-core/src/types/collections/mod.rs rename crates/{sargon/src/core => sargon-core/src}/types/decimal192.rs (98%) rename crates/{sargon/src/core => sargon-core/src}/types/entity_kind.rs (100%) rename crates/{sargon/src/core => sargon-core/src}/types/epoch.rs (98%) rename crates/{sargon/src/core => sargon-core/src}/types/exactly_n_bytes.rs (99%) rename crates/{sargon/src/core => sargon-core/src}/types/instant.rs (99%) rename crates/{sargon/src/core => sargon-core/src}/types/intent_discriminator.rs (100%) rename crates/{sargon/src/core => sargon-core/src}/types/keys/ed25519/mod.rs (100%) rename crates/{sargon/src/core => sargon-core/src}/types/keys/ed25519/private_key.rs (99%) rename crates/{sargon/src/core => sargon-core/src}/types/keys/ed25519/public_key.rs (98%) create mode 100644 crates/sargon-core/src/types/keys/is_private_key.rs rename crates/{sargon/src/core => sargon-core/src}/types/keys/is_public_key.rs (100%) rename crates/{sargon/src/core => sargon-core/src}/types/keys/key_agreement/mod.rs (100%) rename crates/{sargon/src/core => sargon-core/src}/types/keys/key_agreement/private_key.rs (99%) rename crates/{sargon/src/core => sargon-core/src}/types/keys/key_agreement/public_key.rs (100%) rename crates/{sargon/src/core => sargon-core/src}/types/keys/mod.rs (100%) rename crates/{sargon/src/core => sargon-core/src}/types/keys/private_key.rs (85%) rename crates/{sargon/src/core => sargon-core/src}/types/keys/public_key.rs (99%) rename crates/{sargon/src/core => sargon-core/src}/types/keys/secp256k1/mod.rs (100%) rename crates/{sargon/src/core => sargon-core/src}/types/keys/secp256k1/private_key.rs (99%) rename crates/{sargon/src/core => sargon-core/src}/types/keys/secp256k1/public_key.rs (99%) rename crates/{sargon/src/core => sargon-core/src}/types/keys/slip10_curve.rs (86%) rename crates/{sargon/src/core => sargon-core/src}/types/locale_config.rs (100%) rename crates/{sargon/src/core => sargon-core/src}/types/logged_result.rs (100%) rename crates/{sargon/src/core => sargon-core/src}/types/mod.rs (94%) rename crates/{sargon/src/core => sargon-core/src}/types/non_empty_max_n_bytes.rs (97%) rename crates/{sargon/src/core => sargon-core/src}/types/nonce.rs (100%) rename crates/{sargon/src/core => sargon-core/src}/types/requested_number_quantifier.rs (100%) rename crates/{sargon/src/core => sargon-core/src}/types/requested_quantity.rs (100%) rename crates/{sargon/src/core => sargon-core/src}/types/rounding_mode.rs (99%) rename crates/{sargon/src/core => sargon-core/src}/types/safe_to_log.rs (89%) rename crates/{sargon/src/core => sargon-core/src}/types/secret_bytes.rs (94%) rename crates/{sargon/src/core => sargon-core/src}/types/signatures/ed25519_signature.rs (100%) rename crates/{sargon/src/core => sargon-core/src}/types/signatures/mod.rs (100%) rename crates/{sargon/src/core => sargon-core/src}/types/signatures/secp256k1_signature.rs (100%) rename crates/{sargon/src/core => sargon-core/src}/types/signatures/signature.rs (92%) rename crates/{sargon/src/core => sargon-core/src}/types/signatures/signature_with_public_key.rs (96%) rename crates/{sargon/src/core => sargon-core/src}/types/vector_image_type.rs (100%) rename crates/{sargon/src/core => sargon-core/src}/types/version_type.rs (98%) rename crates/{sargon/src/core => sargon-core/src}/unsafe_id_stepper.rs (98%) rename crates/{sargon/src/core => sargon-core/src}/utils/constants.rs (100%) rename crates/{sargon/src/core => sargon-core/src}/utils/factory.rs (96%) rename crates/{sargon/src/core => sargon-core/src}/utils/image_url_utils.rs (100%) rename crates/{sargon/src/core => sargon-core/src}/utils/logged_panic.rs (100%) rename crates/{sargon/src/core => sargon-core/src}/utils/mod.rs (100%) rename crates/{sargon/src/core => sargon-core/src}/utils/serialization.rs (100%) rename crates/{sargon/src/core => sargon-core/src}/utils/string_utils.rs (100%) delete mode 100644 crates/sargon/src/core/mod.rs delete mode 100644 crates/sargon/src/core/types/collections/mod.rs delete mode 100644 crates/sargon/src/core/types/keys/is_private_key.rs create mode 100644 crates/sargon/src/error_from.rs rename crates/sargon/src/{core => gateway_api}/assert_network_request.rs (76%) create mode 100644 crates/sargon/src/identified_vec_of/decl_identified_vec_of_with_samples.rs rename crates/sargon/src/{core/types/collections => }/identified_vec_of/identifiable.rs (100%) rename crates/sargon/src/{core/types/collections => }/identified_vec_of/identified_vec_of.rs (98%) rename crates/sargon/src/{core/types/collections => }/identified_vec_of/identified_vec_of_display_debug.rs (96%) rename crates/sargon/src/{core/types/collections => }/identified_vec_of/identified_vec_of_iterator.rs (94%) rename crates/sargon/src/{core/types/collections => }/identified_vec_of/identified_vec_of_modify.rs (99%) rename crates/sargon/src/{core/types/collections => }/identified_vec_of/identified_vec_of_query.rs (98%) rename crates/sargon/src/{core/types/collections => }/identified_vec_of/identified_vec_of_serde.rs (92%) rename crates/sargon/src/{core/types/collections => }/identified_vec_of/identified_vec_of_validation_import_export.rs (77%) rename crates/sargon/src/{core/types/collections => }/identified_vec_of/mod.rs (79%) rename crates/sargon/src/{core/types/collections => identified_vec_of}/user.rs (100%) rename crates/sargon/src/{core => profile/encrypted}/pb_hkdf_sha256.rs (90%) delete mode 100644 crates/sargon/src/profile/supporting_types/decl_identified_vec_of_with_samples.rs create mode 100644 crates/sargon/src/wrapped_radix_engine_toolkit/is_intent_signing.rs diff --git a/Cargo.lock b/Cargo.lock index ba90e508d..18998bc1f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -894,31 +894,12 @@ dependencies = [ "serde", ] -[[package]] -name = "derive_more" -version = "1.0.0-beta.6" -source = "git+https://github.com/JelteF/derive_more?rev=1196b2dd7a366c06db621093884adbc379fc0f0a#1196b2dd7a366c06db621093884adbc379fc0f0a" -dependencies = [ - "derive_more-impl 1.0.0-beta.6", -] - [[package]] name = "derive_more" version = "1.0.0" source = "git+https://github.com/JelteF/derive_more?rev=d7f5b9e94d024790682f6fc4dcca13941cce64c8#d7f5b9e94d024790682f6fc4dcca13941cce64c8" dependencies = [ - "derive_more-impl 1.0.0", -] - -[[package]] -name = "derive_more-impl" -version = "1.0.0-beta.6" -source = "git+https://github.com/JelteF/derive_more?rev=1196b2dd7a366c06db621093884adbc379fc0f0a#1196b2dd7a366c06db621093884adbc379fc0f0a" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.85", - "unicode-xid", + "derive_more-impl", ] [[package]] @@ -2761,7 +2742,7 @@ dependencies = [ [[package]] name = "sargon" -version = "1.1.98" +version = "1.2.0" dependencies = [ "actix-rt", "aes-gcm", @@ -2773,7 +2754,7 @@ dependencies = [ "camino 1.0.8", "cargo_toml 0.15.3 (git+https://gitlab.com/lib.rs/cargo_toml?rev=e498c94fc42a660c1ca1a28999ce1d757cfe77fe)", "delegate", - "derive_more 1.0.0", + "derive_more", "enum-as-inner", "enum-iterator", "futures", @@ -2798,6 +2779,7 @@ dependencies = [ "radix-transactions", "rand", "reqwest", + "sargon-core", "sbor", "security-framework", "security-framework-sys", @@ -2812,9 +2794,43 @@ dependencies = [ "zeroize 1.7.0", ] +[[package]] +name = "sargon-core" +version = "1.2.0" +dependencies = [ + "assert-json-diff", + "delegate", + "derive_more", + "enum-as-inner", + "enum-iterator", + "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", + "hkdf", + "iota-crypto", + "iso8601-timestamp", + "itertools 0.12.0", + "k256 0.13.3", + "log", + "paste 1.0.14", + "pretty_assertions", + "radix-common", + "radix-engine-interface", + "radix-rust", + "radix-transactions", + "rand", + "serde", + "serde_json 1.0.108", + "serde_repr", + "serde_with 3.4.0", + "strum 0.26.1", + "thiserror 1.0.50", + "url", + "uuid 1.6.1", + "zeroize 1.7.0", +] + [[package]] name = "sargon-uniffi" -version = "1.1.98" +version = "1.2.0" dependencies = [ "actix-rt", "assert-json-diff", @@ -2823,7 +2839,7 @@ dependencies = [ "camino 1.0.8", "clap 4.5.1", "delegate", - "derive_more 1.0.0-beta.6", + "derive_more", "enum-as-inner", "enum-iterator", "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", diff --git a/Cargo.toml b/Cargo.toml index 52918b4bb..3d8c517cd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,6 +4,7 @@ members = [ "crates/sargon", "crates/sargon-uniffi", "crates/sargon-uniffi-conversion-macros", + "crates/sargon-core", ] [profile.release] @@ -14,3 +15,121 @@ codegen-units = 1 [profile.profiling] inherits = "release" debug = true + +[workspace.dependencies] + +# ===== RADIX DEPENDENCIES ======== +radix-common = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0", features = [ + "serde", + "secp256k1_sign_and_validate", +] } +radix-engine-interface = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } +radix-rust = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0", features = [ + "serde", +] } +radix-transactions = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } + + +# ===== EXTERNAL DEPENDENCIES ======== +# hkdf = "0.12.4" +hkdf = { git = "https://github.com/RustCrypto/KDFs/", rev = "1ac16e8b9d4ee7a67613c9396c6cc1327652eaba" } +# thiserror = "1.0.50" +thiserror = { git = "https://github.com/dtolnay/thiserror/", rev = "a7d220d7915fb888413aa7978efd70f7006bda9d" } +# assert-json-diff = "2.0.2" +assert-json-diff = { git = "https://github.com/davidpdrsn/assert-json-diff/", rev = "bca0d2c590808274298d939e0533da79cd09076d" } + +# derive_more = "1.0.0" +derive_more = { git = "https://github.com/JelteF/derive_more", rev = "d7f5b9e94d024790682f6fc4dcca13941cce64c8", features = [ + "add", + "as_ref", + "debug", + "deref", + "deref_mut", + "display", + "from", + "from_str", + "mul", +] } + +# enum-as-inner = "0.6.0" +enum-as-inner = { git = "https://github.com/bluejekyll/enum-as-inner/", rev = "c15f6e5c4f98ec865e181ae1fff9fc13a1a2e4e2" } + +# enum-iterator = "1.4.1" +enum-iterator = { git = "https://github.com/stephaneyfx/enum-iterator/", rev = "9d472a1237cfd03b1c7657fdcba74c8070bfb4ea" } + + +# delegate = "0.12.0" +delegate = { git = "https://github.com/Kobzol/rust-delegate/", rev = "ac852be64f3e4b5f9b58be910d09921488d2845d" } + +# hex = "0.4.3" +hex = { git = "https://github.com/KokaKiwi/rust-hex/", rev = "b2b4370b5bf021b98ee7adc92233e8de3f2de792" } + + +# SLIP10 implementation +# iota_crypto = "0.23.2" +iota-crypto = { git = "https://github.com/iotaledger/crypto.rs", rev = "8c13125541e762206e2dc57b8bfde89c7f6ce8e3", features = [ + "slip10", + "ed25519", + "secp256k1", + "x25519", +] } +# Transitive dependency of iota_crypto - used to construct PubKey from uncompressed bytes. +# k256 = "0.13.3" +k256 = { git = "https://github.com/RustCrypto/elliptic-curves", rev = "e158ce5cf0e9acee2fd76aff2a628334f5c771e5" } + +log = "0.4.20" + + +# rand = "0.8.5" +rand = { git = "https://github.com/rust-random/rand/", rev = "937320cbfeebd4352a23086d9c6e68f067f74644" } + + +# serde_with = "3.4.0" +serde_with = { git = "https://github.com/jonasbb/serde_with/", rev = "1e8e4e75398c6a9de29386473ae7c3157be031c2" } + + +# paste = "1.0.14" +paste = { git = "https://github.com/dtolnay/paste", rev = "1e0cc1025af5388397c67fa4389ad7ad24814df8" } + +# pretty_assertions = "1.4.0" +pretty_assertions = { git = "https://github.com/rust-pretty-assertions/rust-pretty-assertions", rev = "3f1ebc0cac5f88e875f036bf16636e15fa935c8d" } +serde = { version = "1.0.193", features = ["derive", "rc", "std"] } + +# serde_json = "1.0.108" +serde_json = { git = "https://github.com/serde-rs/json/", rev = "4bc1eaa03a6160593575bc9bc60c94dba4cab1e3", features = [ + "preserve_order", +] } + + +# serde_repr = "0.1.17" +serde_repr = { git = "https://github.com/dtolnay/serde-repr/", rev = "94cce18a51bc169869f2cdcea6549b3ed81b3b2e" } + +# iso8601-timestamp = "0.2.16" +iso8601-timestamp = { git = "https://github.com/Lantern-chat/iso8601-timestamp/", rev = "e5a3f2a5911759bc6b0d8100b032a6b4dd6e12c1", features = [ + "serde", + "std", +] } +# itertools = "0.12.0" +itertools = { git = "https://github.com/rust-itertools/itertools/", rev = "98ecabb47d7147dae06fc3fa400ec758947194f3" } + +# once_cell = "1.19.0" +once_cell = { git = "https://github.com/matklad/once_cell/", rev = "c48d3c2c01de926228aea2ac1d03672b4ce160c1" } + + +# strum = "0.26.1" +strum = { git = "https://github.com/Peternator7/strum/", rev = "f746c3699acf150112e26c00e6c8ca666d8d068d", features = [ + "derive", +] } +url = { version = "2.5.0", features = ["serde"] } + +# uuid = "1.6.1" +uuid = { git = "https://github.com/uuid-rs/uuid/", rev = "c8891073248ddc7faa8c53ac9ceb629a341c7b9b", features = [ + "v4", + "serde", +] } + +# zeroize = "1.7.0" +zeroize = { git = "https://github.com/RustCrypto/utils", rev = "df6d2f48a5e8afe8eef04ba32e2af55bacb41375", features = [ + "zeroize_derive", + "derive", +] } diff --git a/README.md b/README.md index 46e436f91..1dcf96cfe 100644 --- a/README.md +++ b/README.md @@ -332,6 +332,19 @@ cd jvm # Release +## Bumping Version +Install [cargo-workspaces](https://crates.io/crates/cargo-workspaces) + +```sh +cargo install cargo-workspaces +``` + +```sh +cargo ws version patch --allow-branch $(git_current_branch) --yes --no-git-tag +``` + +To `patch` bump all crates + ## iOS ### Locally diff --git a/apple/Sources/Sargon/Extensions/Methods/Profile/CAP26EntityKind+Wrap+Functions.swift b/apple/Sources/Sargon/Extensions/Methods/Profile/CAP26EntityKind+Wrap+Functions.swift new file mode 100644 index 000000000..a6fc58593 --- /dev/null +++ b/apple/Sources/Sargon/Extensions/Methods/Profile/CAP26EntityKind+Wrap+Functions.swift @@ -0,0 +1,6 @@ + +extension Cap26EntityKind { + public func toString() -> String { + cap26EntityKindToString(kind: self) + } +} diff --git a/apple/Sources/Sargon/Extensions/Swiftified/Crypto/Derivation/AccountPath+Swiftified.swift b/apple/Sources/Sargon/Extensions/Swiftified/Crypto/Derivation/AccountPath+Swiftified.swift index 60c78064d..5888a1198 100644 --- a/apple/Sources/Sargon/Extensions/Swiftified/Crypto/Derivation/AccountPath+Swiftified.swift +++ b/apple/Sources/Sargon/Extensions/Swiftified/Crypto/Derivation/AccountPath+Swiftified.swift @@ -10,7 +10,10 @@ extension AccountPath { case let .account(value): self = value case .identity, .bip44Like: - throw SargonError.WrongEntityKind(expected: .account, found: .identity) + throw SargonError.WrongEntityKind( + expected: Cap26EntityKind.account.description, + found: Cap26EntityKind.identity.description + ) } } diff --git a/apple/Sources/Sargon/Extensions/Swiftified/Crypto/Derivation/IdentityPath+Swiftified.swift b/apple/Sources/Sargon/Extensions/Swiftified/Crypto/Derivation/IdentityPath+Swiftified.swift index 77d5a71a2..80944f750 100644 --- a/apple/Sources/Sargon/Extensions/Swiftified/Crypto/Derivation/IdentityPath+Swiftified.swift +++ b/apple/Sources/Sargon/Extensions/Swiftified/Crypto/Derivation/IdentityPath+Swiftified.swift @@ -10,7 +10,10 @@ extension IdentityPath { case let .identity(value): self = value case .account, .bip44Like: - throw SargonError.WrongEntityKind(expected: .identity, found: .account) + throw SargonError.WrongEntityKind( + expected: Cap26EntityKind.identity.description, + found: Cap26EntityKind.account.description + ) } } diff --git a/apple/Sources/Sargon/Extensions/Swiftified/Profile/CAP26EntityKind+Swiftified.swift b/apple/Sources/Sargon/Extensions/Swiftified/Profile/CAP26EntityKind+Swiftified.swift new file mode 100644 index 000000000..bf4fa145b --- /dev/null +++ b/apple/Sources/Sargon/Extensions/Swiftified/Profile/CAP26EntityKind+Swiftified.swift @@ -0,0 +1,5 @@ +extension Cap26EntityKind: CustomStringConvertible { + public var description: String { + toString() + } +} diff --git a/crates/sargon-core/Cargo.toml b/crates/sargon-core/Cargo.toml new file mode 100644 index 000000000..0676feca3 --- /dev/null +++ b/crates/sargon-core/Cargo.toml @@ -0,0 +1,44 @@ +[package] +name = "sargon-core" +version = "1.2.0" +edition = "2021" + +[dependencies] +# ==== RADIX DEPENDENCIES ==== +radix-common = { workspace = true } +radix-engine-interface = { workspace = true } +radix-rust = { workspace = true } +radix-transactions = { workspace = true } + + +# ==== EXTERNAL DEPENDENCIES ==== +assert-json-diff = { workspace = true } +delegate = { workspace = true } +enum-as-inner = { workspace = true } +enum-iterator = { workspace = true } +hkdf = { workspace = true } +hex = { workspace = true } +pretty_assertions = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +derive_more = { workspace = true } + + +itertools = { workspace = true } +iota-crypto = { workspace = true } +k256 = { workspace = true } +rand = { workspace = true } +log = { workspace = true } + + +serde_with = { workspace = true } + +paste = { workspace = true } +serde_repr = { workspace = true } +iso8601-timestamp = { workspace = true } +zeroize = { workspace = true } +strum = { workspace = true } +url = { workspace = true } +thiserror = { workspace = true } + +uuid = { workspace = true } diff --git a/crates/sargon/src/core/assert_json.rs b/crates/sargon-core/src/assert_json.rs similarity index 92% rename from crates/sargon/src/core/assert_json.rs rename to crates/sargon-core/src/assert_json.rs index fc49f9dc8..341a72a3c 100644 --- a/crates/sargon/src/core/assert_json.rs +++ b/crates/sargon-core/src/assert_json.rs @@ -1,10 +1,9 @@ -use crate::prelude::*; - use assert_json_diff::assert_json_include; use core::fmt::Debug; -use pretty_assertions::{assert_eq, assert_ne}; +use pretty_assertions::assert_eq; use serde::de::DeserializeOwned; use serde_json::Value; +use std::str::FromStr; use thiserror::Error as ThisError; #[derive(Debug, ThisError)] @@ -16,8 +15,9 @@ pub enum TestingError { FailedToDeserialize(serde_json::Error), } +use serde::Deserialize; +use serde::Serialize; /// `name` is file name without extension, assuming it is json file -#[cfg(not(tarpaulin_include))] pub fn fixture_and_json<'a, T>( vector: &str, ) -> Result<(T, serde_json::Value), TestingError> @@ -34,7 +34,6 @@ where } /// `name` is file name without extension, assuming it is json file -#[cfg(not(tarpaulin_include))] #[allow(unused)] pub fn fixture<'a, T>(vector: &str) -> Result where @@ -43,7 +42,6 @@ where fixture_and_json(vector).map(|t| t.0) } -#[cfg(not(tarpaulin_include))] fn base_assert_equality_after_json_roundtrip( model: &T, json: Value, @@ -66,7 +64,6 @@ fn base_assert_equality_after_json_roundtrip( /// Asserts that (pseudocode) `model.to_json() == json_string` (serialization) /// and also asserts the associative property: /// `Model::from_json(json_string) == model` (deserialization) -#[cfg(not(tarpaulin_include))] pub fn assert_eq_after_json_roundtrip(model: &T, json_string: &str) where T: Serialize + DeserializeOwned + PartialEq + Debug, @@ -75,7 +72,6 @@ where base_assert_equality_after_json_roundtrip(model, json, true) } -#[cfg(not(tarpaulin_include))] pub fn print_json(model: &T) where T: Serialize, @@ -91,7 +87,6 @@ where /// Asserts that (pseudocode) `model.to_json() == json` (serialization) /// and also asserts the associative property: /// `Model::from_json(json) == model` (deserialization) -#[cfg(not(tarpaulin_include))] pub fn assert_json_value_eq_after_roundtrip(model: &T, json: Value) where T: Serialize + DeserializeOwned + PartialEq + Debug, @@ -102,7 +97,6 @@ where /// Asserts that (pseudocode) `model.to_json() != json_string` (serialization) /// and also asserts the associative property: /// `Model::from_json(json_string) != model` (deserialization) -#[cfg(not(tarpaulin_include))] pub fn assert_ne_after_json_roundtrip(model: &T, json_string: &str) where T: Serialize + DeserializeOwned + PartialEq + Debug, @@ -114,7 +108,6 @@ where /// Asserts that (pseudocode) `model.to_json() != json` (serialization) /// and also asserts the associative property: /// `Model::from_json(json) != model` (deserialization) -#[cfg(not(tarpaulin_include))] pub fn assert_json_value_ne_after_roundtrip(model: &T, json: Value) where T: Serialize + DeserializeOwned + PartialEq + Debug, @@ -124,7 +117,6 @@ where /// Asserts that (pseudocode) `Model::from_json(model.to_json()) == model`, /// i.e. that a model after JSON roundtripping remain unchanged. -#[cfg(not(tarpaulin_include))] pub fn assert_json_roundtrip(model: &T) where T: Serialize + DeserializeOwned + PartialEq + Debug, @@ -136,7 +128,6 @@ where /// Creates JSON from `json_str` and tries to decode it, then encode the decoded, /// value and compare it to the JSON value of the json_str. -#[cfg(not(tarpaulin_include))] pub fn assert_json_str_roundtrip(json_str: &str) where T: Serialize + DeserializeOwned + PartialEq + Debug, @@ -147,7 +138,6 @@ where assert_eq!(value, serialized); } -#[cfg(not(tarpaulin_include))] pub fn assert_json_value_fails(json: Value) where T: Serialize + DeserializeOwned + PartialEq + Debug, @@ -164,7 +154,6 @@ where // all good, expected fail. } -#[cfg(not(tarpaulin_include))] pub fn assert_json_fails(json_string: &str) where T: Serialize + DeserializeOwned + PartialEq + Debug, @@ -173,7 +162,6 @@ where assert_json_value_fails::(json) } -#[cfg(not(tarpaulin_include))] pub fn assert_json_eq_ignore_whitespace(json1: &str, json2: &str) { let value1: Value = serde_json::from_str(json1).expect("Invalid JSON in json1"); diff --git a/crates/sargon/src/core/error/common_error.rs b/crates/sargon-core/src/error/common_error.rs similarity index 88% rename from crates/sargon/src/core/error/common_error.rs rename to crates/sargon-core/src/error/common_error.rs index fdf10ec68..637768bac 100644 --- a/crates/sargon/src/core/error/common_error.rs +++ b/crates/sargon-core/src/error/common_error.rs @@ -91,10 +91,7 @@ pub enum CommonError { InvalidEntityKind { bad_value: u32 } = 10023, #[error("Wrong entity kind, (expected {expected}, found {found})")] - WrongEntityKind { - expected: CAP26EntityKind, - found: CAP26EntityKind, - } = 10024, + WrongEntityKind { expected: String, found: String } = 10024, #[error( "InvalidKeyKind, got: '{bad_value}', expected any of: [1460H, 1678H, 1391H]." @@ -191,10 +188,7 @@ pub enum CommonError { #[error( "Accounts on different networks, expected: {expected}, found: {found}" )] - AccountOnWrongNetwork { - expected: NetworkID, - found: NetworkID, - } = 10053, + AccountOnWrongNetwork { expected: String, found: String } = 10053, #[error("FactorSources must not be empty.")] FactorSourcesMustNotBeEmpty = 10054, @@ -203,10 +197,7 @@ pub enum CommonError { UpdateFactorSourceMutateFailed = 10055, #[error("Failed to cast factor source, wrong kind, , expected: {expected}, found: {found}")] - CastFactorSourceWrongKind { - expected: FactorSourceKind, - found: FactorSourceKind, - } = 10056, + CastFactorSourceWrongKind { expected: String, found: String } = 10056, #[error("Length check failed, expected: {expected}, found: {found}, data: {data:?}")] InvalidLength { @@ -230,10 +221,10 @@ pub enum CommonError { #[error("Invalid DisplayName cannot be empty.")] InvalidDisplayNameEmpty = 10062, - #[error("Failed to access secure storage due to \"{error_message}\" for key {} ", key.identifier())] + #[error("Failed to access secure storage due to \"{error_message}\" for key {} ", key)] SecureStorageAccessError { - key: SecureStorageKey, - error_kind: SecureStorageAccessErrorKind, + key: String, + error_kind: String, error_message: String, } = 10063, @@ -269,27 +260,24 @@ pub enum CommonError { FailedToLoadProfileHeadersList = 10072, #[error("FactorSource with ID not found in Profile: {bad_value:?}")] - ProfileDoesNotContainFactorSourceWithID { bad_value: FactorSourceID } = - 10073, + ProfileDoesNotContainFactorSourceWithID { bad_value: String } = 10073, #[error("Account Already Present {bad_value}")] - AccountAlreadyPresent { bad_value: AccountAddress } = 10074, + AccountAlreadyPresent { bad_value: String } = 10074, #[error("Unable to acquire write lock for Profile.")] UnableToAcquireWriteLockForProfile = 10075, #[error("Failed save Mnemonic to SecureStorageDriver with FactorSourceID: {bad_value}")] - UnableToSaveMnemonicToSecureStorage { bad_value: FactorSourceIDFromHash } = - 10076, + UnableToSaveMnemonicToSecureStorage { bad_value: String } = 10076, #[error( "Failed load Mnemonic from SecureStorageDriver with FactorSourceID: {bad_value}" )] - UnableToLoadMnemonicFromSecureStorage { bad_value: FactorSourceIDFromHash } = - 10077, + UnableToLoadMnemonicFromSecureStorage { bad_value: String } = 10077, #[error("Failed save FactorSource to SecureStorageDriver, FactorSourceID: {bad_value}")] - UnableToSaveFactorSourceToProfile { bad_value: FactorSourceID } = 10078, + UnableToSaveFactorSourceToProfile { bad_value: String } = 10078, #[error("Expected IdentityPath but got something else.")] ExpectedIdentityPathButGotSomethingElse = 10079, @@ -315,7 +303,7 @@ pub enum CommonError { #[error("Failed to create Address (via RetAddress) from node_id (hex): {node_id_as_hex}, network_id: {network_id}")] FailedToCreateAddressViaRetAddressFromNodeIdAndNetworkID { node_id_as_hex: String, - network_id: NetworkID, + network_id: String, } = 10086, #[error("Invalid Olympia address string: {bad_value}")] @@ -342,8 +330,8 @@ pub enum CommonError { #[error("Invalid Manifest Instructions String, found network in instructions {found_in_instructions}, but specified to constructor: {specified_to_instructions_ctor}")] InvalidInstructionsWrongNetwork { - found_in_instructions: NetworkID, - specified_to_instructions_ctor: NetworkID, + found_in_instructions: String, + specified_to_instructions_ctor: String, } = 10093, #[error("Failed to decode bytes into Transaction Manifest Instructions")] @@ -462,19 +450,16 @@ pub enum CommonError { RadixMobileInvalidInteractionID { bad_value: String } = 10128, #[error("Network discrepancy, expected : {expected}, actual: {actual}")] - NetworkDiscrepancy { - expected: NetworkID, - actual: NetworkID, - } = 10129, + NetworkDiscrepancy { expected: String, actual: String } = 10129, #[error("Discrepancy, Authorized Dapp references Persona which does not exist {address}")] DiscrepancyAuthorizedDappReferencedPersonaWhichDoesNotExist { - address: IdentityAddress, + address: String, } = 10130, #[error("Discrepancy, Authorized Dapp references Account which does not exist {address}")] DiscrepancyAuthorizedDappReferencedAccountWhichDoesNotExist { - address: AccountAddress, + address: String, } = 10131, #[error("AuthorizedDapp references field id that does not exist")] @@ -508,15 +493,13 @@ pub enum CommonError { InvalidKeyAgreementPrivateKeyFromBytes { bad_value: BagOfBytes } = 10139, #[error("RadixConnectMobileSession not found, session id: {session_id}")] - RadixConnectMobileSessionNotFound { session_id: SessionID } = 10140, + RadixConnectMobileSessionNotFound { session_id: String } = 10140, #[error("RadixConnectMobileDappRequest not found, interaction id: {interaction_id}")] - RadixConnectMobileDappRequestNotFound { - interaction_id: WalletInteractionId, - } = 10141, + RadixConnectMobileDappRequestNotFound { interaction_id: String } = 10141, #[error("RadixConnectMobileDappCallbackPath not found, origin: {origin}")] - RadixConnectMobileDappCallbackPathNotFound { origin: Url } = 10142, + RadixConnectMobileDappCallbackPathNotFound { origin: String } = 10142, #[error("Failed to create Ed25519 Signature from String {bad_value}.")] InvalidEd25519SignatureFromString { bad_value: String } = 10143, @@ -559,7 +542,7 @@ pub enum CommonError { #[error( "Failed to load Profile from secure storage, profile id: {profile_id}" )] - UnableToLoadProfileFromSecureStorage { profile_id: ProfileID } = 10155, + UnableToLoadProfileFromSecureStorage { profile_id: String } = 10155, #[error("Failed to save HostId to secure storage")] UnableToSaveHostIdToSecureStorage = 10156, @@ -584,8 +567,8 @@ pub enum CommonError { #[error("Profile last used on other device {other_device_id} (this device: {this_device_id})")] ProfileUsedOnOtherDevice { - other_device_id: DeviceID, - this_device_id: DeviceID, + other_device_id: String, + this_device_id: String, } = 10163, #[error("Failed To create DeviceID (UUID) from string: {bad_value}")] @@ -644,7 +627,7 @@ pub enum CommonError { #[error("Failed to create Address from global_address (hex): {global_address_as_hex}, network_id: {network_id}")] FailedToCreateAddressFromGlobalAddressAndNetworkID { global_address_as_hex: String, - network_id: NetworkID, + network_id: String, } = 10181, #[error( @@ -653,7 +636,7 @@ pub enum CommonError { EntitiesNotDerivedByFactorSource = 10182, #[error("The network {network_id} does not exist in profile")] - NoNetworkInProfile { network_id: NetworkID } = 10183, + NoNetworkInProfile { network_id: String } = 10183, #[error("Empty FactorSources list")] FactorSourcesOfKindEmptyFactors = 10184, @@ -737,7 +720,7 @@ pub enum CommonError { MaxTransfersPerTransactionReached { amount: u64 } = 10208, #[error("Transaction Manifest class is reserved: {class}")] - ReservedManifestClass { class: DetailedManifestClassKind } = 10209, + ReservedManifestClass { class: String } = 10209, #[error("FactorInstancesProvider did not derive enough factors")] FactorInstancesProviderDidNotDeriveEnoughFactors = 10210, @@ -763,8 +746,8 @@ pub enum CommonError { )] EntityOnWrongNetwork { entity_kind: String, - wrong_network: NetworkID, - expected_network: NetworkID, + wrong_network: String, + expected_network: String, } = 10215, #[error("SecurityState not securified")] @@ -848,8 +831,8 @@ pub enum CommonError { "Entity kind of FactorInstances does not match EntityKind of entity" )] SecurityStructureOfFactorInstancesEntityDiscrepancyInEntityKind { - entity_kind_of_entity: CAP26EntityKind, - entity_kind_of_factor_instances: CAP26EntityKind, + entity_kind_of_entity: String, + entity_kind_of_factor_instances: String, } = 10239, #[error( @@ -878,78 +861,6 @@ impl CommonError { pub fn is_safe_to_show_error_message(&self) -> bool { matches!(self, CommonError::FailedToDeserializeJSONToValue { .. }) } - - pub fn from_address_error( - s: String, - expected_network: NetworkID, - fallback_underlying: String, - ) -> Self { - use radix_engine_toolkit::functions::address::decode as RET_decode_address; - let Some(Some(network_id)) = RET_decode_address(&s) - .map(|t| t.0) - .map(NetworkID::from_repr) - else { - return CommonError::InvalidInstructionsString { - underlying: "Failed to get NetworkID from address".to_owned(), - }; - }; - if network_id != expected_network { - CommonError::InvalidInstructionsWrongNetwork { - found_in_instructions: network_id, - specified_to_instructions_ctor: expected_network, - } - } else { - CommonError::InvalidInstructionsString { - underlying: fallback_underlying, - } - } - } - - pub fn from_scrypto_compile_error( - manifest_string: &str, - err: ScryptoCompileError, - expected_network: NetworkID, - ) -> Self { - use radix_transactions::manifest::parser::ParserError; - use radix_transactions::manifest::parser::ParserErrorKind::*; - use GeneratorError; - use GeneratorErrorKind::*; - let n = expected_network; - - let pretty_diagnostics = scrypto_compile_error_diagnostics( - manifest_string, - err.clone(), - ScryptoCompileErrorDiagnosticsStyle::PlainText, - ); - match err { - ScryptoCompileError::GeneratorError(GeneratorError { - error_kind: gen_err, - .. - }) => match gen_err { - InvalidPackageAddress(a) => { - Self::from_address_error(a, n, pretty_diagnostics) - } - InvalidResourceAddress(a) => { - Self::from_address_error(a, n, pretty_diagnostics) - } - InvalidGlobalAddress(a) => { - Self::from_address_error(a, n, pretty_diagnostics) - } - _ => CommonError::InvalidInstructionsString { - underlying: pretty_diagnostics, - }, - }, - ScryptoCompileError::ParserError(ParserError { - error_kind: MaxDepthExceeded { max, .. }, - .. - }) => CommonError::InvalidTransactionMaxSBORDepthExceeded { - max: max as u16, - }, - _ => CommonError::InvalidInstructionsString { - underlying: pretty_diagnostics, - }, - } - } } impl HasSampleValues for CommonError { diff --git a/crates/sargon/src/core/error/common_error_map.rs b/crates/sargon-core/src/error/common_error_map.rs similarity index 98% rename from crates/sargon/src/core/error/common_error_map.rs rename to crates/sargon-core/src/error/common_error_map.rs index fa0a1d260..750667714 100644 --- a/crates/sargon/src/core/error/common_error_map.rs +++ b/crates/sargon-core/src/error/common_error_map.rs @@ -1,5 +1,3 @@ -use de::StdError; - use crate::prelude::*; pub trait MapToFailedToDeserializeJSONToValue { diff --git a/crates/sargon/src/core/error/mod.rs b/crates/sargon-core/src/error/mod.rs similarity index 100% rename from crates/sargon/src/core/error/mod.rs rename to crates/sargon-core/src/error/mod.rs diff --git a/crates/sargon/src/core/has_sample_values.rs b/crates/sargon-core/src/has_sample_values.rs similarity index 100% rename from crates/sargon/src/core/has_sample_values.rs rename to crates/sargon-core/src/has_sample_values.rs diff --git a/crates/sargon/src/core/hash.rs b/crates/sargon-core/src/hash.rs similarity index 98% rename from crates/sargon/src/core/hash.rs rename to crates/sargon-core/src/hash.rs index e8f982a62..ee3cac28b 100644 --- a/crates/sargon/src/core/hash.rs +++ b/crates/sargon-core/src/hash.rs @@ -11,7 +11,7 @@ use crate::prelude::*; derive_more::Display, derive_more::FromStr, )] -pub struct Hash(pub(crate) ScryptoHash); +pub struct Hash(pub ScryptoHash); impl AsRef for Hash { fn as_ref(&self) -> &ScryptoHash { diff --git a/crates/sargon-core/src/lib.rs b/crates/sargon-core/src/lib.rs new file mode 100644 index 000000000..448ba2f98 --- /dev/null +++ b/crates/sargon-core/src/lib.rs @@ -0,0 +1,92 @@ +#![allow(internal_features)] +#![feature(core_intrinsics)] +#![feature(trivial_bounds)] +#![allow(trivial_bounds)] + +mod assert_json; +mod error; +mod has_sample_values; +mod hash; +mod secure_random_bytes; +mod types; +mod unsafe_id_stepper; +mod utils; + +pub mod prelude { + pub use crate::assert_json::*; + pub use crate::error::*; + pub use crate::has_sample_values::*; + pub use crate::hash::*; + pub use crate::secure_random_bytes::*; + pub use crate::types::*; + pub use crate::unsafe_id_stepper::*; + pub use crate::utils::*; + + pub use radix_rust::prelude::{ + indexmap, BTreeSet, HashMap, HashSet, IndexMap, IndexSet, + }; + pub use std::marker::PhantomData; + + pub use ::hex::decode as hex_decode; + pub use ::hex::encode as hex_encode; + pub use iso8601_timestamp::Timestamp; + pub use itertools::Itertools; + pub use log::{debug, error, info, trace, warn}; + pub use serde::{ + de, ser::SerializeStruct, Deserialize, Deserializer, Serialize, + Serializer, + }; + pub use serde_json::json; + pub use serde_repr::{Deserialize_repr, Serialize_repr}; + pub use serde_with::*; + pub use zeroize::{Zeroize, ZeroizeOnDrop}; + + pub use derive_more::derive::{AsRef, Debug as MoreDebug, Deref, Display}; + + pub use std::cell::RefCell; + pub use std::cmp::Ordering; + pub use std::collections::BTreeMap; + pub use std::fmt::{Debug, Display, Formatter}; + pub use std::fs; + pub use std::hash::Hash as StdHash; + pub use std::ops::{Add, AddAssign, Deref, Div, Mul, Neg, Sub}; + pub use std::str::FromStr; + pub use std::sync::{Arc, RwLock}; + + pub use strum::FromRepr; + pub use strum::IntoEnumIterator; + pub use url::Url; + pub use uuid::Uuid; + + pub use enum_as_inner::EnumAsInner; + pub use paste::*; + + pub(crate) use radix_common::{ + crypto::{ + blake2b_256_hash, verify_ed25519 as scrypto_verify_ed25519, + verify_secp256k1 as scrypto_verify_secp256k1, + Ed25519PrivateKey as ScryptoEd25519PrivateKey, + Ed25519PublicKey as ScryptoEd25519PublicKey, + Ed25519Signature as ScryptoEd25519Signature, Hash as ScryptoHash, + IsHash as ScryptoIsHash, PublicKey as ScryptoPublicKey, + Secp256k1PrivateKey as ScryptoSecp256k1PrivateKey, + Secp256k1PublicKey as ScryptoSecp256k1PublicKey, + Secp256k1Signature as ScryptoSecp256k1Signature, + }, + data::scrypto::model::BytesNonFungibleLocalId as ScryptoBytesNonFungibleLocalId, + math::{ + traits::CheckedMul as ScryptoCheckedMul, + Decimal as ScryptoDecimal192, RoundingMode as ScryptoRoundingMode, + }, + prelude::Instant as ScryptoInstant, + }; + + pub use radix_engine_interface::prelude::Epoch as ScryptoEpoch; + + pub use radix_transactions::model::{ + SignatureV1 as ScryptoSignature, + SignatureWithPublicKeyV1 as ScryptoSignatureWithPublicKey, + }; +} + +pub use prelude::*; diff --git a/crates/sargon/src/core/secure_random_bytes.rs b/crates/sargon-core/src/secure_random_bytes.rs similarity index 100% rename from crates/sargon/src/core/secure_random_bytes.rs rename to crates/sargon-core/src/secure_random_bytes.rs diff --git a/crates/sargon/src/core/types/appearance_id.rs b/crates/sargon-core/src/types/appearance_id.rs similarity index 100% rename from crates/sargon/src/core/types/appearance_id.rs rename to crates/sargon-core/src/types/appearance_id.rs diff --git a/crates/sargon/src/core/types/bag_of_bytes.rs b/crates/sargon-core/src/types/bag_of_bytes.rs similarity index 98% rename from crates/sargon/src/core/types/bag_of_bytes.rs rename to crates/sargon-core/src/types/bag_of_bytes.rs index e00b28a2d..3976b3ec3 100644 --- a/crates/sargon/src/core/types/bag_of_bytes.rs +++ b/crates/sargon-core/src/types/bag_of_bytes.rs @@ -1,4 +1,4 @@ -use std::ops::{Deref, DerefMut, Neg}; +use std::ops::{Deref, DerefMut}; use crate::prelude::*; @@ -24,6 +24,13 @@ pub struct BagOfBytes { pub(crate) bytes: Vec, } +#[cfg(test)] +impl From<()> for BagOfBytes { + fn from(_value: ()) -> Self { + Self::new() + } +} + impl AsRef<[u8]> for BagOfBytes { fn as_ref(&self) -> &[u8] { self.bytes.as_ref() diff --git a/crates/sargon/src/core/types/bool_type.rs b/crates/sargon-core/src/types/bool_type.rs similarity index 99% rename from crates/sargon/src/core/types/bool_type.rs rename to crates/sargon-core/src/types/bool_type.rs index d23c848f5..b8747ab2b 100644 --- a/crates/sargon/src/core/types/bool_type.rs +++ b/crates/sargon-core/src/types/bool_type.rs @@ -1,5 +1,7 @@ use crate::prelude::*; +#[macro_export] + macro_rules! decl_bool_type { ($name:ident, $default_value:expr) => { #[derive( diff --git a/crates/sargon/src/core/types/collections/just.rs b/crates/sargon-core/src/types/collections/just.rs similarity index 60% rename from crates/sargon/src/core/types/collections/just.rs rename to crates/sargon-core/src/types/collections/just.rs index edbc34de6..a4d361051 100644 --- a/crates/sargon/src/core/types/collections/just.rs +++ b/crates/sargon-core/src/types/collections/just.rs @@ -1,3 +1,5 @@ +use radix_rust::prelude::{IndexMap, IndexSet}; + use crate::prelude::*; pub trait Just { @@ -42,47 +44,40 @@ impl JustKV for HashMap { mod tests { use super::*; + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] + enum BlackOrWhite { + Black, + } + #[test] fn test_index_set() { assert_eq!( - IndexSet::just(FactorSourceKind::Device), - IndexSet::::from_iter([FactorSourceKind::Device]) + IndexSet::just(BlackOrWhite::Black), + IndexSet::<_>::from_iter([BlackOrWhite::Black]) ) } #[test] fn test_hash_set() { assert_eq!( - HashSet::just(FactorSourceKind::Device), - HashSet::::from_iter([FactorSourceKind::Device]) + HashSet::just(BlackOrWhite::Black), + HashSet::<_>::from_iter([BlackOrWhite::Black]) ) } #[test] fn test_index_map() { assert_eq!( - IndexMap::just(( - FactorSourceKind::Device, - FactorSource::sample_device() - )), - IndexMap::::from_iter([( - FactorSourceKind::Device, - FactorSource::sample_device() - )]) + IndexMap::just((1u8, BlackOrWhite::Black)), + IndexMap::<_, _>::from_iter([(1u8, BlackOrWhite::Black)]) ) } #[test] fn test_hash_map() { assert_eq!( - HashMap::just(( - FactorSourceKind::Device, - FactorSource::sample_device() - )), - HashMap::::from_iter([( - FactorSourceKind::Device, - FactorSource::sample_device() - )]) + HashMap::just((1u8, BlackOrWhite::Black)), + HashMap::<_, _>::from_iter([(1u8, BlackOrWhite::Black)]) ) } } diff --git a/crates/sargon-core/src/types/collections/mod.rs b/crates/sargon-core/src/types/collections/mod.rs new file mode 100644 index 000000000..f4686b5bd --- /dev/null +++ b/crates/sargon-core/src/types/collections/mod.rs @@ -0,0 +1,3 @@ +mod just; + +pub use just::*; diff --git a/crates/sargon/src/core/types/decimal192.rs b/crates/sargon-core/src/types/decimal192.rs similarity index 98% rename from crates/sargon/src/core/types/decimal192.rs rename to crates/sargon-core/src/types/decimal192.rs index f708c4546..5490e5c1f 100644 --- a/crates/sargon/src/core/types/decimal192.rs +++ b/crates/sargon-core/src/types/decimal192.rs @@ -1,3 +1,5 @@ +use core::panic; + use crate::prelude::*; use delegate::delegate; use enum_iterator::reverse_all; @@ -654,14 +656,6 @@ impl HasSampleValues for Decimal192 { } } -#[cfg(test)] -impl From<&str> for Decimal192 { - /// TEST ONLY - fn from(value: &str) -> Self { - value.parse().unwrap_or_else(|_| panic!("Test failed since the passed in str is not a valid Decimal192: '{}'", value)) - } -} - impl Decimal192 { pub const MACHINE_READABLE_DECIMAL_SEPARATOR: &'static str = "."; @@ -1151,7 +1145,7 @@ mod test_decimal { #[test] fn display() { let s = "3138550867693340381917894711603833208051.177722232017256447"; - let a: Decimal192 = s.into(); + let a: Decimal192 = s.parse().unwrap(); assert_eq!(format!("{}", a), s); } @@ -1159,7 +1153,8 @@ mod test_decimal { fn json_roundtrip() { let a: Decimal192 = "3138550867693340381917894711603833208051.177722232017256447" - .into(); + .parse() + .unwrap(); assert_json_value_eq_after_roundtrip( &a, @@ -1267,7 +1262,7 @@ mod test_decimal { assert_eq!(actual, expected); }; let test = |x: &str, n: u8, expected: &str| { - test_(Decimal192::from(x), n, expected) + test_(x.parse().unwrap(), n, expected) }; test("111222111222111222333.222333", 18, "1.11222111222111222e20"); test("111222111222111222333.222333", 8, "1.1122211e20"); @@ -1336,7 +1331,7 @@ mod test_decimal { #[test] fn round() { let test = |x: SUT, d: u8, y: &str| { - assert_eq!(x.round(d), y.into()); + assert_eq!(x.round(d), y.parse().unwrap()); }; let mut x = SUT::max(); @@ -1393,27 +1388,35 @@ mod test_decimal { test(x, 1, "3138550867693340381917894711603833208051.1"); test(x, 0, "3138550867693340381917894711603833208051"); - x = "3138550867693340381917894711603833208051.14".into(); + x = "3138550867693340381917894711603833208051.14" + .parse() + .unwrap(); test(x, 0, "3138550867693340381917894711603833208051"); test(x, 1, "3138550867693340381917894711603833208051.1"); test(x, 2, "3138550867693340381917894711603833208051.14"); test(x, 3, "3138550867693340381917894711603833208051.14"); - x = "3138550867693340381917894711603833208051.148".into(); + x = "3138550867693340381917894711603833208051.148" + .parse() + .unwrap(); test(x, 0, "3138550867693340381917894711603833208051"); test(x, 1, "3138550867693340381917894711603833208051.1"); test(x, 2, "3138550867693340381917894711603833208051.15"); test(x, 3, "3138550867693340381917894711603833208051.148"); test(x, 4, "3138550867693340381917894711603833208051.148"); - x = "3138550867693340381917894711603833208051.149".into(); + x = "3138550867693340381917894711603833208051.149" + .parse() + .unwrap(); test(x, 0, "3138550867693340381917894711603833208051"); test(x, 1, "3138550867693340381917894711603833208051.1"); test(x, 2, "3138550867693340381917894711603833208051.15"); test(x, 3, "3138550867693340381917894711603833208051.149"); test(x, 4, "3138550867693340381917894711603833208051.149"); - x = "3138550867693340381917894711603833208051.1499".into(); + x = "3138550867693340381917894711603833208051.1499" + .parse() + .unwrap(); test(x, 0, "3138550867693340381917894711603833208051"); test(x, 1, "3138550867693340381917894711603833208051.1"); test(x, 2, "3138550867693340381917894711603833208051.15"); @@ -1421,7 +1424,9 @@ mod test_decimal { test(x, 4, "3138550867693340381917894711603833208051.1499"); test(x, 5, "3138550867693340381917894711603833208051.1499"); - x = "3138550867693340381917894711603833208051.15".into(); + x = "3138550867693340381917894711603833208051.15" + .parse() + .unwrap(); test(x, 0, "3138550867693340381917894711603833208051"); test(x, 1, "3138550867693340381917894711603833208051.1"); test(x, 2, "3138550867693340381917894711603833208051.15"); @@ -1429,7 +1434,9 @@ mod test_decimal { test(x, 4, "3138550867693340381917894711603833208051.15"); test(x, 5, "3138550867693340381917894711603833208051.15"); - x = "3138550867693340381917894711603833208051.15999".into(); + x = "3138550867693340381917894711603833208051.15999" + .parse() + .unwrap(); test(x, 0, "3138550867693340381917894711603833208051"); test(x, 1, "3138550867693340381917894711603833208051.1"); test(x, 2, "3138550867693340381917894711603833208051.16"); @@ -1510,7 +1517,7 @@ mod test_decimal { #[test] fn test_digits() { let test = |s: &str, e: &str| { - let x = Decimal192::from(s); + let x: Decimal192 = s.parse().unwrap(); assert_eq!(x.digits(), e); }; test("1", "1000000000000000000"); @@ -1526,7 +1533,7 @@ mod test_decimal { fn format_grouping_separator() { let test = |x: &str, exp: &str| { let locale = LocaleConfig::english_united_states(); - let decimal: Decimal192 = x.into(); + let decimal: Decimal192 = x.parse().unwrap(); let actual = decimal.formatted(locale, 8, true); assert_eq!(actual, exp); }; @@ -1553,7 +1560,7 @@ mod test_decimal { let actual = decimal.formatted(locale, 8, false); assert_eq!(actual, exp); }; - let test = |x: &str, exp: &str| test_(SUT::from(x), exp); + let test = |x: &str, exp: &str| test_(x.parse().unwrap(), exp); test_(SUT::max(), "3.138e39"); test("0.009999999999999", "0.01"); diff --git a/crates/sargon/src/core/types/entity_kind.rs b/crates/sargon-core/src/types/entity_kind.rs similarity index 100% rename from crates/sargon/src/core/types/entity_kind.rs rename to crates/sargon-core/src/types/entity_kind.rs diff --git a/crates/sargon/src/core/types/epoch.rs b/crates/sargon-core/src/types/epoch.rs similarity index 98% rename from crates/sargon/src/core/types/epoch.rs rename to crates/sargon-core/src/types/epoch.rs index 9f46571d4..b4d9c7cf9 100644 --- a/crates/sargon/src/core/types/epoch.rs +++ b/crates/sargon-core/src/types/epoch.rs @@ -72,7 +72,6 @@ impl HasSampleValues for Epoch { #[cfg(test)] mod tests { use super::*; - use crate::prelude::*; #[test] fn into_from_scrypto() { diff --git a/crates/sargon/src/core/types/exactly_n_bytes.rs b/crates/sargon-core/src/types/exactly_n_bytes.rs similarity index 99% rename from crates/sargon/src/core/types/exactly_n_bytes.rs rename to crates/sargon-core/src/types/exactly_n_bytes.rs index da6a07660..ac0f776ae 100644 --- a/crates/sargon/src/core/types/exactly_n_bytes.rs +++ b/crates/sargon-core/src/types/exactly_n_bytes.rs @@ -1,5 +1,4 @@ use crate::prelude::*; -use delegate::delegate; macro_rules! decl_exactly_n_bytes { ( diff --git a/crates/sargon/src/core/types/instant.rs b/crates/sargon-core/src/types/instant.rs similarity index 99% rename from crates/sargon/src/core/types/instant.rs rename to crates/sargon-core/src/types/instant.rs index c35d5be6d..a155f183c 100644 --- a/crates/sargon/src/core/types/instant.rs +++ b/crates/sargon-core/src/types/instant.rs @@ -68,7 +68,6 @@ impl HasSampleValues for Instant { #[cfg(test)] mod tests { use super::*; - use crate::prelude::*; use std::time::Duration; #[test] diff --git a/crates/sargon/src/core/types/intent_discriminator.rs b/crates/sargon-core/src/types/intent_discriminator.rs similarity index 100% rename from crates/sargon/src/core/types/intent_discriminator.rs rename to crates/sargon-core/src/types/intent_discriminator.rs diff --git a/crates/sargon/src/core/types/keys/ed25519/mod.rs b/crates/sargon-core/src/types/keys/ed25519/mod.rs similarity index 100% rename from crates/sargon/src/core/types/keys/ed25519/mod.rs rename to crates/sargon-core/src/types/keys/ed25519/mod.rs diff --git a/crates/sargon/src/core/types/keys/ed25519/private_key.rs b/crates/sargon-core/src/types/keys/ed25519/private_key.rs similarity index 99% rename from crates/sargon/src/core/types/keys/ed25519/private_key.rs rename to crates/sargon-core/src/types/keys/ed25519/private_key.rs index 0a10c97a9..f1d4bc0c2 100644 --- a/crates/sargon/src/core/types/keys/ed25519/private_key.rs +++ b/crates/sargon-core/src/types/keys/ed25519/private_key.rs @@ -170,7 +170,6 @@ impl Ed25519PrivateKey { #[cfg(test)] mod tests { use super::*; - use crate::prelude::*; #[test] fn equality() { diff --git a/crates/sargon/src/core/types/keys/ed25519/public_key.rs b/crates/sargon-core/src/types/keys/ed25519/public_key.rs similarity index 98% rename from crates/sargon/src/core/types/keys/ed25519/public_key.rs rename to crates/sargon-core/src/types/keys/ed25519/public_key.rs index aaade63ae..61d5549d7 100644 --- a/crates/sargon/src/core/types/keys/ed25519/public_key.rs +++ b/crates/sargon-core/src/types/keys/ed25519/public_key.rs @@ -1,6 +1,6 @@ use crate::prelude::*; - use crypto::signatures::ed25519 as IotaSlip10Ed25519; +use serde_with::{serde_as, DeserializeFromStr, SerializeDisplay}; /// An Ed25519 public key used to verify cryptographic signatures (EdDSA signatures). #[serde_as] @@ -152,7 +152,7 @@ impl Ed25519PublicKey { #[cfg(test)] mod tests { use super::*; - use crate::prelude::*; + use serde_json::json; #[test] fn equality() { diff --git a/crates/sargon-core/src/types/keys/is_private_key.rs b/crates/sargon-core/src/types/keys/is_private_key.rs new file mode 100644 index 000000000..37e74f878 --- /dev/null +++ b/crates/sargon-core/src/types/keys/is_private_key.rs @@ -0,0 +1,13 @@ +use crate::prelude::*; + +pub trait IsPrivateKey>: Sized { + type Signature; + + fn from_bytes(slice: &[u8]) -> Result; + + fn curve() -> SLIP10Curve; + + fn public_key(&self) -> P; + + fn sign(&self, msg_hash: &Hash) -> Self::Signature; +} diff --git a/crates/sargon/src/core/types/keys/is_public_key.rs b/crates/sargon-core/src/types/keys/is_public_key.rs similarity index 100% rename from crates/sargon/src/core/types/keys/is_public_key.rs rename to crates/sargon-core/src/types/keys/is_public_key.rs diff --git a/crates/sargon/src/core/types/keys/key_agreement/mod.rs b/crates/sargon-core/src/types/keys/key_agreement/mod.rs similarity index 100% rename from crates/sargon/src/core/types/keys/key_agreement/mod.rs rename to crates/sargon-core/src/types/keys/key_agreement/mod.rs diff --git a/crates/sargon/src/core/types/keys/key_agreement/private_key.rs b/crates/sargon-core/src/types/keys/key_agreement/private_key.rs similarity index 99% rename from crates/sargon/src/core/types/keys/key_agreement/private_key.rs rename to crates/sargon-core/src/types/keys/key_agreement/private_key.rs index c7afd73a7..88e6bc913 100644 --- a/crates/sargon/src/core/types/keys/key_agreement/private_key.rs +++ b/crates/sargon-core/src/types/keys/key_agreement/private_key.rs @@ -109,8 +109,6 @@ impl HasSampleValues for KeyAgreementPrivateKey { #[cfg(test)] mod tests { - use hex::ToHex; - use super::*; #[allow(clippy::upper_case_acronyms)] diff --git a/crates/sargon/src/core/types/keys/key_agreement/public_key.rs b/crates/sargon-core/src/types/keys/key_agreement/public_key.rs similarity index 100% rename from crates/sargon/src/core/types/keys/key_agreement/public_key.rs rename to crates/sargon-core/src/types/keys/key_agreement/public_key.rs diff --git a/crates/sargon/src/core/types/keys/mod.rs b/crates/sargon-core/src/types/keys/mod.rs similarity index 100% rename from crates/sargon/src/core/types/keys/mod.rs rename to crates/sargon-core/src/types/keys/mod.rs diff --git a/crates/sargon/src/core/types/keys/private_key.rs b/crates/sargon-core/src/types/keys/private_key.rs similarity index 85% rename from crates/sargon/src/core/types/keys/private_key.rs rename to crates/sargon-core/src/types/keys/private_key.rs index 53d8cddbe..c0978a111 100644 --- a/crates/sargon/src/core/types/keys/private_key.rs +++ b/crates/sargon-core/src/types/keys/private_key.rs @@ -58,30 +58,6 @@ impl PrivateKey { } } - pub fn sign_intent_hash( - &self, - transaction: &TransactionIntentHash, - ) -> IntentSignature { - match self { - PrivateKey::Ed25519(key) => SignatureWithPublicKey::Ed25519 { - public_key: key.public_key(), - signature: key.sign(&transaction.hash), - }, - PrivateKey::Secp256k1(key) => SignatureWithPublicKey::Secp256k1 { - public_key: key.public_key(), - signature: key.sign(&transaction.hash), - }, - } - .into() - } - - pub fn notarize_hash( - &self, - signed_transaction_intent_hash: &SignedTransactionIntentHash, - ) -> NotarySignature { - self.sign(&signed_transaction_intent_hash.hash).into() - } - /// Returns the hex representation of the inner private key's bytes as a `Vec`. pub fn to_bytes(&self) -> Vec { match self { diff --git a/crates/sargon/src/core/types/keys/public_key.rs b/crates/sargon-core/src/types/keys/public_key.rs similarity index 99% rename from crates/sargon/src/core/types/keys/public_key.rs rename to crates/sargon-core/src/types/keys/public_key.rs index f8aba0738..db09b9b1b 100644 --- a/crates/sargon/src/core/types/keys/public_key.rs +++ b/crates/sargon-core/src/types/keys/public_key.rs @@ -200,7 +200,6 @@ impl PublicKey { } impl<'de> Deserialize<'de> for PublicKey { - #[cfg(not(tarpaulin_include))] // false negative fn deserialize>( deserializer: D, ) -> Result { @@ -233,7 +232,6 @@ impl<'de> Deserialize<'de> for PublicKey { } impl Serialize for PublicKey { - #[cfg(not(tarpaulin_include))] // false negative fn serialize(&self, serializer: S) -> Result where S: Serializer, diff --git a/crates/sargon/src/core/types/keys/secp256k1/mod.rs b/crates/sargon-core/src/types/keys/secp256k1/mod.rs similarity index 100% rename from crates/sargon/src/core/types/keys/secp256k1/mod.rs rename to crates/sargon-core/src/types/keys/secp256k1/mod.rs diff --git a/crates/sargon/src/core/types/keys/secp256k1/private_key.rs b/crates/sargon-core/src/types/keys/secp256k1/private_key.rs similarity index 99% rename from crates/sargon/src/core/types/keys/secp256k1/private_key.rs rename to crates/sargon-core/src/types/keys/secp256k1/private_key.rs index dd562a77f..e8afd76e5 100644 --- a/crates/sargon/src/core/types/keys/secp256k1/private_key.rs +++ b/crates/sargon-core/src/types/keys/secp256k1/private_key.rs @@ -157,7 +157,6 @@ impl Secp256k1PrivateKey { mod tests { use super::*; - use crate::prelude::*; #[allow(clippy::upper_case_acronyms)] type SUT = Secp256k1PrivateKey; diff --git a/crates/sargon/src/core/types/keys/secp256k1/public_key.rs b/crates/sargon-core/src/types/keys/secp256k1/public_key.rs similarity index 99% rename from crates/sargon/src/core/types/keys/secp256k1/public_key.rs rename to crates/sargon-core/src/types/keys/secp256k1/public_key.rs index 7af235e4e..d135ab1b9 100644 --- a/crates/sargon/src/core/types/keys/secp256k1/public_key.rs +++ b/crates/sargon-core/src/types/keys/secp256k1/public_key.rs @@ -1,6 +1,7 @@ use crate::prelude::*; use k256::ecdsa::VerifyingKey as K256PublicKey; +use serde_with::{serde_as, DeserializeFromStr, SerializeDisplay}; /// A `secp256k1` public key used to verify cryptographic signatures (ECDSA signatures). #[serde_as] @@ -200,6 +201,7 @@ impl FromStr for Secp256k1PublicKey { #[cfg(test)] mod tests { use super::*; + use serde_json::json; #[allow(clippy::upper_case_acronyms)] type SUT = Secp256k1PublicKey; diff --git a/crates/sargon/src/core/types/keys/slip10_curve.rs b/crates/sargon-core/src/types/keys/slip10_curve.rs similarity index 86% rename from crates/sargon/src/core/types/keys/slip10_curve.rs rename to crates/sargon-core/src/types/keys/slip10_curve.rs index 0a2c0db42..cc64258d3 100644 --- a/crates/sargon/src/core/types/keys/slip10_curve.rs +++ b/crates/sargon-core/src/types/keys/slip10_curve.rs @@ -30,10 +30,14 @@ pub enum SLIP10Curve { Secp256k1, } -impl Identifiable for SLIP10Curve { - type ID = String; +impl Display for SLIP10Curve { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.string()) + } +} - fn id(&self) -> Self::ID { +impl SLIP10Curve { + pub fn string(&self) -> String { match self { Self::Curve25519 => "curve25519".to_string(), Self::Secp256k1 => "secp256k1".to_string(), @@ -41,20 +45,13 @@ impl Identifiable for SLIP10Curve { } } -impl Display for SLIP10Curve { - #[cfg(not(tarpaulin_include))] // false negative - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{}", self.id()) - } -} - impl FromStr for SLIP10Curve { type Err = CommonError; fn from_str(s: &str) -> Result { - if s == Self::Curve25519.id() { + if s == Self::Curve25519.string() { Ok(Self::Curve25519) - } else if s == Self::Secp256k1.id() { + } else if s == Self::Secp256k1.string() { Ok(Self::Secp256k1) } else { Err(CommonError::UnknownSLIP10Curve { @@ -109,9 +106,11 @@ mod tests { } #[test] - fn id() { - assert_eq!(SUT::Curve25519.id(), "curve25519"); - assert_eq!(SUT::Secp256k1.id(), "secp256k1"); + fn string() { + assert_eq!(SUT::Curve25519.string(), "curve25519"); + assert_eq!(SUT::Curve25519.to_string(), "curve25519"); + assert_eq!(SUT::Secp256k1.string(), "secp256k1"); + assert_eq!(SUT::Secp256k1.to_string(), "secp256k1"); } #[test] diff --git a/crates/sargon/src/core/types/locale_config.rs b/crates/sargon-core/src/types/locale_config.rs similarity index 100% rename from crates/sargon/src/core/types/locale_config.rs rename to crates/sargon-core/src/types/locale_config.rs diff --git a/crates/sargon/src/core/types/logged_result.rs b/crates/sargon-core/src/types/logged_result.rs similarity index 100% rename from crates/sargon/src/core/types/logged_result.rs rename to crates/sargon-core/src/types/logged_result.rs diff --git a/crates/sargon/src/core/types/mod.rs b/crates/sargon-core/src/types/mod.rs similarity index 94% rename from crates/sargon/src/core/types/mod.rs rename to crates/sargon-core/src/types/mod.rs index f59fd1ab4..fbf844f90 100644 --- a/crates/sargon/src/core/types/mod.rs +++ b/crates/sargon-core/src/types/mod.rs @@ -24,7 +24,7 @@ mod version_type; pub use appearance_id::*; pub use bag_of_bytes::*; -pub use bool_type::*; +pub(crate) use bool_type::*; pub use collections::*; pub use decimal192::*; pub use entity_kind::*; @@ -44,4 +44,4 @@ pub use safe_to_log::*; pub use secret_bytes::*; pub use signatures::*; pub use vector_image_type::*; -pub use version_type::*; +pub(crate) use version_type::*; diff --git a/crates/sargon/src/core/types/non_empty_max_n_bytes.rs b/crates/sargon-core/src/types/non_empty_max_n_bytes.rs similarity index 97% rename from crates/sargon/src/core/types/non_empty_max_n_bytes.rs rename to crates/sargon-core/src/types/non_empty_max_n_bytes.rs index d9f37abf1..df4aa3d31 100644 --- a/crates/sargon/src/core/types/non_empty_max_n_bytes.rs +++ b/crates/sargon-core/src/types/non_empty_max_n_bytes.rs @@ -1,7 +1,6 @@ use crate::prelude::*; use delegate::delegate; use paste::*; -use radix_common::crypto::{Hash, IsHash}; macro_rules! decl_non_empty_max_n_bytes { ( @@ -136,6 +135,12 @@ decl_non_empty_max_n_bytes!( 64 ); +impl From for NonEmptyMax64Bytes { + fn from(value: ScryptoBytesNonFungibleLocalId) -> Self { + Self::try_from(value.value()).expect("Should not be possible, since ScryptoBytesNonFungibleLocalId have validated length") + } +} + decl_non_empty_max_n_bytes!( /// 32 bytes, typically used as entropy for Mnemonics. 32 diff --git a/crates/sargon/src/core/types/nonce.rs b/crates/sargon-core/src/types/nonce.rs similarity index 100% rename from crates/sargon/src/core/types/nonce.rs rename to crates/sargon-core/src/types/nonce.rs diff --git a/crates/sargon/src/core/types/requested_number_quantifier.rs b/crates/sargon-core/src/types/requested_number_quantifier.rs similarity index 100% rename from crates/sargon/src/core/types/requested_number_quantifier.rs rename to crates/sargon-core/src/types/requested_number_quantifier.rs diff --git a/crates/sargon/src/core/types/requested_quantity.rs b/crates/sargon-core/src/types/requested_quantity.rs similarity index 100% rename from crates/sargon/src/core/types/requested_quantity.rs rename to crates/sargon-core/src/types/requested_quantity.rs diff --git a/crates/sargon/src/core/types/rounding_mode.rs b/crates/sargon-core/src/types/rounding_mode.rs similarity index 99% rename from crates/sargon/src/core/types/rounding_mode.rs rename to crates/sargon-core/src/types/rounding_mode.rs index 0a8b2262c..6fae24457 100644 --- a/crates/sargon/src/core/types/rounding_mode.rs +++ b/crates/sargon-core/src/types/rounding_mode.rs @@ -92,7 +92,6 @@ mod tests { use enum_iterator::all; use super::*; - use crate::prelude::*; #[test] fn rounding_mode_conversion() { diff --git a/crates/sargon/src/core/types/safe_to_log.rs b/crates/sargon-core/src/types/safe_to_log.rs similarity index 89% rename from crates/sargon/src/core/types/safe_to_log.rs rename to crates/sargon-core/src/types/safe_to_log.rs index 922d1f807..490a18b76 100644 --- a/crates/sargon/src/core/types/safe_to_log.rs +++ b/crates/sargon-core/src/types/safe_to_log.rs @@ -1,6 +1,3 @@ -use crate::prelude::*; -use log::LevelFilter; - /// A trait used to mark that a values is safe to (debug) log, and /// which debug representation of it to use. /// diff --git a/crates/sargon/src/core/types/secret_bytes.rs b/crates/sargon-core/src/types/secret_bytes.rs similarity index 94% rename from crates/sargon/src/core/types/secret_bytes.rs rename to crates/sargon-core/src/types/secret_bytes.rs index 59d8ff0a8..72c2d8ae4 100644 --- a/crates/sargon/src/core/types/secret_bytes.rs +++ b/crates/sargon-core/src/types/secret_bytes.rs @@ -1,5 +1,6 @@ use crate::prelude::*; +#[macro_export] macro_rules! decl_secret_bytes { ( $( @@ -47,13 +48,13 @@ macro_rules! decl_secret_bytes { impl $struct_name { pub const LENGTH: usize = $byte_count; - pub fn new(bytes: [u8; Self::LENGTH]) -> Self { + pub fn new(bytes: [u8; $byte_count]) -> Self { Self(Box::new(bytes)) } #[allow(unused)] pub(crate) fn is_zeroized(&self) -> bool { - *self.0 == [0; Self::LENGTH] + *self.0 == [0; $byte_count] } } @@ -89,4 +90,4 @@ macro_rules! decl_secret_bytes { }; } -pub(crate) use decl_secret_bytes; +pub use decl_secret_bytes; diff --git a/crates/sargon/src/core/types/signatures/ed25519_signature.rs b/crates/sargon-core/src/types/signatures/ed25519_signature.rs similarity index 100% rename from crates/sargon/src/core/types/signatures/ed25519_signature.rs rename to crates/sargon-core/src/types/signatures/ed25519_signature.rs diff --git a/crates/sargon/src/core/types/signatures/mod.rs b/crates/sargon-core/src/types/signatures/mod.rs similarity index 100% rename from crates/sargon/src/core/types/signatures/mod.rs rename to crates/sargon-core/src/types/signatures/mod.rs diff --git a/crates/sargon/src/core/types/signatures/secp256k1_signature.rs b/crates/sargon-core/src/types/signatures/secp256k1_signature.rs similarity index 100% rename from crates/sargon/src/core/types/signatures/secp256k1_signature.rs rename to crates/sargon-core/src/types/signatures/secp256k1_signature.rs diff --git a/crates/sargon/src/core/types/signatures/signature.rs b/crates/sargon-core/src/types/signatures/signature.rs similarity index 92% rename from crates/sargon/src/core/types/signatures/signature.rs rename to crates/sargon-core/src/types/signatures/signature.rs index 98a873091..ab4912167 100644 --- a/crates/sargon/src/core/types/signatures/signature.rs +++ b/crates/sargon-core/src/types/signatures/signature.rs @@ -18,25 +18,6 @@ pub enum Signature { Ed25519 { value: Ed25519Signature }, } -impl Signature { - /// Returns a `SLIP10Curve`, being the curve of the `Signature`. - pub fn curve(&self) -> SLIP10Curve { - match self { - Self::Ed25519 { .. } => SLIP10Curve::Curve25519, - Self::Secp256k1 { .. } => SLIP10Curve::Secp256k1, - } - } -} - -impl Signature { - pub fn to_bytes(&self) -> Vec { - match self { - Signature::Secp256k1 { value } => value.to_bytes(), - Signature::Ed25519 { value } => value.to_bytes(), - } - } -} - impl From for Signature { fn from(value: ScryptoSignature) -> Self { match value { @@ -56,6 +37,25 @@ impl From for ScryptoSignature { } } +impl Signature { + /// Returns a `SLIP10Curve`, being the curve of the `Signature`. + pub fn curve(&self) -> SLIP10Curve { + match self { + Self::Ed25519 { .. } => SLIP10Curve::Curve25519, + Self::Secp256k1 { .. } => SLIP10Curve::Secp256k1, + } + } +} + +impl Signature { + pub fn to_bytes(&self) -> Vec { + match self { + Signature::Secp256k1 { value } => value.to_bytes(), + Signature::Ed25519 { value } => value.to_bytes(), + } + } +} + impl From for Signature { fn from(signature: Secp256k1Signature) -> Self { Self::Secp256k1 { value: signature } @@ -112,6 +112,8 @@ impl FromStr for Signature { #[cfg(test)] mod tests { + use hex::ToHex; + use super::*; #[allow(clippy::upper_case_acronyms)] @@ -134,6 +136,13 @@ mod tests { assert_eq!(SUT::sample_other().curve(), SLIP10Curve::Secp256k1); } + #[test] + fn to_from_scrypto() { + let roundtrip = |s: SUT| SUT::from(ScryptoSignature::from(s)); + roundtrip(SUT::sample()); + roundtrip(SUT::sample_other()); + } + #[test] fn enum_as_inner() { assert_eq!( @@ -176,13 +185,15 @@ mod tests { #[test] fn ed25519_from_bag_of_bytes() { let bytes: BagOfBytes = "fc6a4a15516b886b10f26777094cb1abdccb213c9ebdea7a4bceb83b6fcba50fea181b0136ee5659c3dfae5f771e5b6e6f9abbaa3f0435df0be1f732be965103".parse().unwrap(); - assert_eq!(SUT::try_from(bytes).unwrap(), SUT::sample()); + assert_eq!(SUT::try_from(bytes.clone()).unwrap(), SUT::sample()); + assert_eq!(SUT::sample().to_bytes(), bytes.to_vec()); } #[test] fn secp256k1_from_str() { - assert_eq!( - "0001598e989470d125dafac276b95bb1ba21e2ee8e0beb0547599335f83b48a0a830cd6a956a54421039cef5fb7e492ebaa315f751a2dd5b74bd9cebbda997ec12".parse::().unwrap(), SUT::sample_other()); + let s = "0001598e989470d125dafac276b95bb1ba21e2ee8e0beb0547599335f83b48a0a830cd6a956a54421039cef5fb7e492ebaa315f751a2dd5b74bd9cebbda997ec12"; + assert_eq!(s.parse::().unwrap(), SUT::sample_other()); + assert_eq!(hex_encode(SUT::sample_other().to_bytes()), s); } #[test] @@ -190,11 +201,4 @@ mod tests { let bytes: BagOfBytes = "0001598e989470d125dafac276b95bb1ba21e2ee8e0beb0547599335f83b48a0a830cd6a956a54421039cef5fb7e492ebaa315f751a2dd5b74bd9cebbda997ec12".parse().unwrap(); assert_eq!(SUT::try_from(bytes).unwrap(), SUT::sample_other()); } - - #[test] - fn to_from_scrypto() { - let roundtrip = |s: SUT| SUT::from(ScryptoSignature::from(s)); - roundtrip(SUT::sample()); - roundtrip(SUT::sample_other()); - } } diff --git a/crates/sargon/src/core/types/signatures/signature_with_public_key.rs b/crates/sargon-core/src/types/signatures/signature_with_public_key.rs similarity index 96% rename from crates/sargon/src/core/types/signatures/signature_with_public_key.rs rename to crates/sargon-core/src/types/signatures/signature_with_public_key.rs index 3b3c62547..7073fd36f 100644 --- a/crates/sargon/src/core/types/signatures/signature_with_public_key.rs +++ b/crates/sargon-core/src/types/signatures/signature_with_public_key.rs @@ -47,19 +47,6 @@ impl From for ScryptoSignatureWithPublicKey { } } -impl From for Signature { - fn from(value: SignatureWithPublicKey) -> Self { - value.signature() - } -} - -impl SignatureWithPublicKey { - pub fn is_valid_for_hash(&self, hash: &impl ScryptoIsHash) -> bool { - self.public_key() - .is_valid_signature_for_hash(self.signature(), hash) - } -} - impl TryFrom<(ScryptoSignatureWithPublicKey, Hash)> for SignatureWithPublicKey { type Error = crate::CommonError; @@ -95,6 +82,19 @@ impl TryFrom<(ScryptoSignatureWithPublicKey, Hash)> for SignatureWithPublicKey { } } +impl From for Signature { + fn from(value: SignatureWithPublicKey) -> Self { + value.signature() + } +} + +impl SignatureWithPublicKey { + pub fn is_valid_for_hash(&self, hash: &impl ScryptoIsHash) -> bool { + self.public_key() + .is_valid_signature_for_hash(self.signature(), hash) + } +} + impl SignatureWithPublicKey { pub fn signature(&self) -> Signature { match &self { @@ -195,6 +195,17 @@ mod tests { assert_ne!(SUT::sample(), SUT::sample_other()); } + #[test] + fn signature_from_sut() { + assert_eq!( + Signature::from(SUT::sample()), + "fc6a4a15516b886b10f26777094cb1abdccb213c9ebdea7a4bceb83b6fcba50fea181b0136ee5659c3dfae5f771e5b6e6f9abbaa3f0435df0be1f732be965103" + .parse::() + .unwrap() + .into() + ); + } + #[test] fn signature() { let pubkey: Ed25519PublicKey = diff --git a/crates/sargon/src/core/types/vector_image_type.rs b/crates/sargon-core/src/types/vector_image_type.rs similarity index 100% rename from crates/sargon/src/core/types/vector_image_type.rs rename to crates/sargon-core/src/types/vector_image_type.rs diff --git a/crates/sargon/src/core/types/version_type.rs b/crates/sargon-core/src/types/version_type.rs similarity index 98% rename from crates/sargon/src/core/types/version_type.rs rename to crates/sargon-core/src/types/version_type.rs index d47d120d7..0928164be 100644 --- a/crates/sargon/src/core/types/version_type.rs +++ b/crates/sargon-core/src/types/version_type.rs @@ -1,10 +1,10 @@ use crate::prelude::*; -use paste::paste; /// A macro that generates a XYZVersion type, which is a typed version of `u64`. +#[macro_export] macro_rules! decl_version_type { ($name:ident) => { - paste! { + paste::paste! { #[derive(Debug, Clone, Deserialize, Serialize, PartialEq)] #[serde(transparent)] pub struct [<$name Version>](pub u64); diff --git a/crates/sargon/src/core/unsafe_id_stepper.rs b/crates/sargon-core/src/unsafe_id_stepper.rs similarity index 98% rename from crates/sargon/src/core/unsafe_id_stepper.rs rename to crates/sargon-core/src/unsafe_id_stepper.rs index ed8ddcc83..b7160124f 100644 --- a/crates/sargon/src/core/unsafe_id_stepper.rs +++ b/crates/sargon-core/src/unsafe_id_stepper.rs @@ -4,7 +4,6 @@ use std::borrow::BorrowMut; use std::marker::PhantomData; use std::ops::AddAssign; use std::sync::Mutex; -use std::sync::MutexGuard; /// An UNSAFE IDStepper, which `next` returns the consecutive next ID, /// should only be used by tests and sample value creation. diff --git a/crates/sargon/src/core/utils/constants.rs b/crates/sargon-core/src/utils/constants.rs similarity index 100% rename from crates/sargon/src/core/utils/constants.rs rename to crates/sargon-core/src/utils/constants.rs diff --git a/crates/sargon/src/core/utils/factory.rs b/crates/sargon-core/src/utils/factory.rs similarity index 96% rename from crates/sargon/src/core/utils/factory.rs rename to crates/sargon-core/src/utils/factory.rs index ffe4d5e13..124865418 100644 --- a/crates/sargon/src/core/utils/factory.rs +++ b/crates/sargon-core/src/utils/factory.rs @@ -15,10 +15,6 @@ pub fn id() -> Uuid { Uuid::new_v4() } -pub fn profile_id() -> ProfileID { - ProfileID(id()) -} - pub fn iso8601(dt: &Timestamp) -> String { let (h, m, s) = dt.as_hms(); format!("{} {:02}:{:02}:{:02}", date(dt), h, m, s) diff --git a/crates/sargon/src/core/utils/image_url_utils.rs b/crates/sargon-core/src/utils/image_url_utils.rs similarity index 100% rename from crates/sargon/src/core/utils/image_url_utils.rs rename to crates/sargon-core/src/utils/image_url_utils.rs diff --git a/crates/sargon/src/core/utils/logged_panic.rs b/crates/sargon-core/src/utils/logged_panic.rs similarity index 100% rename from crates/sargon/src/core/utils/logged_panic.rs rename to crates/sargon-core/src/utils/logged_panic.rs diff --git a/crates/sargon/src/core/utils/mod.rs b/crates/sargon-core/src/utils/mod.rs similarity index 100% rename from crates/sargon/src/core/utils/mod.rs rename to crates/sargon-core/src/utils/mod.rs diff --git a/crates/sargon/src/core/utils/serialization.rs b/crates/sargon-core/src/utils/serialization.rs similarity index 100% rename from crates/sargon/src/core/utils/serialization.rs rename to crates/sargon-core/src/utils/serialization.rs diff --git a/crates/sargon/src/core/utils/string_utils.rs b/crates/sargon-core/src/utils/string_utils.rs similarity index 100% rename from crates/sargon/src/core/utils/string_utils.rs rename to crates/sargon-core/src/utils/string_utils.rs diff --git a/crates/sargon-uniffi/Cargo.toml b/crates/sargon-uniffi/Cargo.toml index f6d168531..94171a941 100644 --- a/crates/sargon-uniffi/Cargo.toml +++ b/crates/sargon-uniffi/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sargon-uniffi" # Don't forget to update version in crates/sargon/Cargo.toml -version = "1.1.98" +version = "1.2.0" edition = "2021" build = "build.rs" @@ -23,77 +23,44 @@ sargon-uniffi-conversion-macros = { path = "../sargon-uniffi-conversion-macros" radix-engine-toolkit = { git = "https://github.com/radixdlt/radix-engine-toolkit", rev = "2ab5b35a6cb96c9faeb98ed8df67b870336e6873" } -# zeroize = "1.7.0" -zeroize = { git = "https://github.com/RustCrypto/utils", rev = "df6d2f48a5e8afe8eef04ba32e2af55bacb41375", features = [ - "zeroize_derive", - "derive", -] } +zeroize = { workspace = true } + -log = "0.4.20" -# log = { git = "https://github.com/rust-lang/log/", rev = "4708f1484c7e6b8d4418b571c05e613b18e57673" } +log = { workspace = true } # pretty_env_logger = "0.5.0" pretty_env_logger = { git = "https://github.com/seanmonstar/pretty-env-logger/", rev = "0e238400e18649415dc710c025e99c009a1bb744" } -# derive_more = "1.0.0-beta.6" -derive_more = { git = "https://github.com/JelteF/derive_more", rev = "1196b2dd7a366c06db621093884adbc379fc0f0a", features = [ - "debug", - "display", - "from_str", -] } - -# thiserror = "1.0.50" -thiserror = { git = "https://github.com/dtolnay/thiserror/", rev = "a7d220d7915fb888413aa7978efd70f7006bda9d" } +derive_more = { workspace = true } -# iso8601-timestamp = "0.2.16" -iso8601-timestamp = { git = "https://github.com/Lantern-chat/iso8601-timestamp/", rev = "e5a3f2a5911759bc6b0d8100b032a6b4dd6e12c1", features = [ - "serde", - "std", -] } +thiserror = { workspace = true } -# uuid = "1.6.1" -uuid = { git = "https://github.com/uuid-rs/uuid/", rev = "c8891073248ddc7faa8c53ac9ceb629a341c7b9b", features = [ - "v4", - "serde", -] } +iso8601-timestamp = { workspace = true } -# strum = "0.26.1" -strum = { git = "https://github.com/Peternator7/strum/", rev = "f746c3699acf150112e26c00e6c8ca666d8d068d", features = [ - "derive", -] } -# enum-iterator = "1.4.1" -enum-iterator = { git = "https://github.com/stephaneyfx/enum-iterator/", rev = "9d472a1237cfd03b1c7657fdcba74c8070bfb4ea" } +uuid = { workspace = true } -# rand = "0.8.5" -rand = { git = "https://github.com/rust-random/rand/", rev = "937320cbfeebd4352a23086d9c6e68f067f74644" } +strum = { workspace = true } +enum-iterator = { workspace = true } -# hex = "0.4.3" -hex = { git = "https://github.com/KokaKiwi/rust-hex/", rev = "b2b4370b5bf021b98ee7adc92233e8de3f2de792" } +rand = { workspace = true } +hex = { workspace = true } -# delegate = "0.12.0" -delegate = { git = "https://github.com/Kobzol/rust-delegate/", rev = "ac852be64f3e4b5f9b58be910d09921488d2845d" } +delegate = { workspace = true } -# itertools = "0.12.0" -itertools = { git = "https://github.com/rust-itertools/itertools/", rev = "98ecabb47d7147dae06fc3fa400ec758947194f3" } +itertools = { workspace = true } -# enum-as-inner = "0.6.0" -enum-as-inner = { git = "https://github.com/bluejekyll/enum-as-inner/", rev = "c15f6e5c4f98ec865e181ae1fff9fc13a1a2e4e2" } +enum-as-inner = { workspace = true } # uniffi = "0.28.3" uniffi = { git = "https://github.com/mozilla/uniffi-rs/", rev = "9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d", features = [ "cli", ] } -# latest: 9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d -# assert-json-diff = "2.0.2" -assert-json-diff = { git = "https://github.com/davidpdrsn/assert-json-diff/", rev = "bca0d2c590808274298d939e0533da79cd09076d" } +assert-json-diff = { workspace = true } -# url = "2.5.0" -# url = { git = "https://github.com/servo/rust-url", rev = "00e9e18ce6504e0e9157816c593afec8e69cb9e3", features = ["serde"] } # BROKEN compat with reqwest: the trait bound `url::Url: IntoUrl` is not satisfied --> tests/integration/network_antenna_reqwest.rs:31:50 -url = { version = "2.5.0", features = ["serde"] } +url = { workspace = true } -# paste = "1.0.14" -paste = { git = "https://github.com/dtolnay/paste", rev = "1e0cc1025af5388397c67fa4389ad7ad24814df8" } +paste = { workspace = true } # regex = "1.9.3" regex = { git = "https://github.com/rust-lang/regex/", rev = "72f889ef3cca59ebac6a026f3646e8d92f056d88", optional = true } diff --git a/crates/sargon-uniffi/src/core/error/common_error.rs b/crates/sargon-uniffi/src/core/error/common_error.rs index 5816cadb0..77892185b 100644 --- a/crates/sargon-uniffi/src/core/error/common_error.rs +++ b/crates/sargon-uniffi/src/core/error/common_error.rs @@ -92,10 +92,7 @@ pub enum CommonError { InvalidEntityKind { bad_value: u32 } = 10023, #[error("Wrong entity kind, (expected {expected}, found {found})")] - WrongEntityKind { - expected: CAP26EntityKind, - found: CAP26EntityKind, - } = 10024, + WrongEntityKind { expected: String, found: String } = 10024, #[error( "InvalidKeyKind, got: '{bad_value}', expected any of: [1460H, 1678H, 1391H]." @@ -192,10 +189,7 @@ pub enum CommonError { #[error( "Accounts on different networks, expected: {expected}, found: {found}" )] - AccountOnWrongNetwork { - expected: NetworkID, - found: NetworkID, - } = 10053, + AccountOnWrongNetwork { expected: String, found: String } = 10053, #[error("FactorSources must not be empty.")] FactorSourcesMustNotBeEmpty = 10054, @@ -204,10 +198,7 @@ pub enum CommonError { UpdateFactorSourceMutateFailed = 10055, #[error("Failed to cast factor source, wrong kind, , expected: {expected}, found: {found}")] - CastFactorSourceWrongKind { - expected: FactorSourceKind, - found: FactorSourceKind, - } = 10056, + CastFactorSourceWrongKind { expected: String, found: String } = 10056, #[error("Length check failed, expected: {expected}, found: {found}, data: {data:?}")] InvalidLength { @@ -231,10 +222,10 @@ pub enum CommonError { #[error("Invalid DisplayName cannot be empty.")] InvalidDisplayNameEmpty = 10062, - #[error("Failed to access secure storage due to \"{error_message}\" for key {} ", secure_storage_key_identifier(key))] + #[error("Failed to access secure storage due to \"{error_message}\" for key {} ", key)] SecureStorageAccessError { - key: SecureStorageKey, - error_kind: SecureStorageAccessErrorKind, + key: String, + error_kind: String, error_message: String, } = 10063, @@ -270,27 +261,24 @@ pub enum CommonError { FailedToLoadProfileHeadersList = 10072, #[error("FactorSource with ID not found in Profile: {bad_value:?}")] - ProfileDoesNotContainFactorSourceWithID { bad_value: FactorSourceID } = - 10073, + ProfileDoesNotContainFactorSourceWithID { bad_value: String } = 10073, #[error("Account Already Present {bad_value}")] - AccountAlreadyPresent { bad_value: AccountAddress } = 10074, + AccountAlreadyPresent { bad_value: String } = 10074, #[error("Unable to acquire write lock for Profile.")] UnableToAcquireWriteLockForProfile = 10075, #[error("Failed save Mnemonic to SecureStorageDriver with FactorSourceID: {bad_value}")] - UnableToSaveMnemonicToSecureStorage { bad_value: FactorSourceIDFromHash } = - 10076, + UnableToSaveMnemonicToSecureStorage { bad_value: String } = 10076, #[error( "Failed load Mnemonic from SecureStorageDriver with FactorSourceID: {bad_value}" )] - UnableToLoadMnemonicFromSecureStorage { bad_value: FactorSourceIDFromHash } = - 10077, + UnableToLoadMnemonicFromSecureStorage { bad_value: String } = 10077, #[error("Failed save FactorSource to SecureStorageDriver, FactorSourceID: {bad_value}")] - UnableToSaveFactorSourceToProfile { bad_value: FactorSourceID } = 10078, + UnableToSaveFactorSourceToProfile { bad_value: String } = 10078, #[error("Expected IdentityPath but got something else.")] ExpectedIdentityPathButGotSomethingElse = 10079, @@ -316,7 +304,7 @@ pub enum CommonError { #[error("Failed to create Address (via RetAddress) from node_id (hex): {node_id_as_hex}, network_id: {network_id}")] FailedToCreateAddressViaRetAddressFromNodeIdAndNetworkID { node_id_as_hex: String, - network_id: NetworkID, + network_id: String, } = 10086, #[error("Invalid Olympia address string: {bad_value}")] @@ -343,13 +331,11 @@ pub enum CommonError { #[error("Invalid Manifest Instructions String, found network in instructions {found_in_instructions}, but specified to constructor: {specified_to_instructions_ctor}")] InvalidInstructionsWrongNetwork { - found_in_instructions: NetworkID, - specified_to_instructions_ctor: NetworkID, + found_in_instructions: String, + specified_to_instructions_ctor: String, } = 10093, - #[error( - "Failed to UniFFI decode bytes into Transaction Manifest Instructions" - )] + #[error("Failed to decode bytes into Transaction Manifest Instructions")] FailedToDecodeBytesToManifestInstructions = 10094, #[error("Failed to decode Transaction Hash, value: {bad_value}")] @@ -465,19 +451,16 @@ pub enum CommonError { RadixMobileInvalidInteractionID { bad_value: String } = 10128, #[error("Network discrepancy, expected : {expected}, actual: {actual}")] - NetworkDiscrepancy { - expected: NetworkID, - actual: NetworkID, - } = 10129, + NetworkDiscrepancy { expected: String, actual: String } = 10129, #[error("Discrepancy, Authorized Dapp references Persona which does not exist {address}")] DiscrepancyAuthorizedDappReferencedPersonaWhichDoesNotExist { - address: IdentityAddress, + address: String, } = 10130, #[error("Discrepancy, Authorized Dapp references Account which does not exist {address}")] DiscrepancyAuthorizedDappReferencedAccountWhichDoesNotExist { - address: AccountAddress, + address: String, } = 10131, #[error("AuthorizedDapp references field id that does not exist")] @@ -511,15 +494,13 @@ pub enum CommonError { InvalidKeyAgreementPrivateKeyFromBytes { bad_value: BagOfBytes } = 10139, #[error("RadixConnectMobileSession not found, session id: {session_id}")] - RadixConnectMobileSessionNotFound { session_id: SessionID } = 10140, + RadixConnectMobileSessionNotFound { session_id: String } = 10140, #[error("RadixConnectMobileDappRequest not found, interaction id: {interaction_id}")] - RadixConnectMobileDappRequestNotFound { - interaction_id: WalletInteractionId, - } = 10141, + RadixConnectMobileDappRequestNotFound { interaction_id: String } = 10141, #[error("RadixConnectMobileDappCallbackPath not found, origin: {origin}")] - RadixConnectMobileDappCallbackPathNotFound { origin: Url } = 10142, + RadixConnectMobileDappCallbackPathNotFound { origin: String } = 10142, #[error("Failed to create Ed25519 Signature from String {bad_value}.")] InvalidEd25519SignatureFromString { bad_value: String } = 10143, @@ -562,7 +543,7 @@ pub enum CommonError { #[error( "Failed to load Profile from secure storage, profile id: {profile_id}" )] - UnableToLoadProfileFromSecureStorage { profile_id: ProfileID } = 10155, + UnableToLoadProfileFromSecureStorage { profile_id: String } = 10155, #[error("Failed to save HostId to secure storage")] UnableToSaveHostIdToSecureStorage = 10156, @@ -587,8 +568,8 @@ pub enum CommonError { #[error("Profile last used on other device {other_device_id} (this device: {this_device_id})")] ProfileUsedOnOtherDevice { - other_device_id: DeviceID, - this_device_id: DeviceID, + other_device_id: String, + this_device_id: String, } = 10163, #[error("Failed To create DeviceID (UUID) from string: {bad_value}")] @@ -647,7 +628,7 @@ pub enum CommonError { #[error("Failed to create Address from global_address (hex): {global_address_as_hex}, network_id: {network_id}")] FailedToCreateAddressFromGlobalAddressAndNetworkID { global_address_as_hex: String, - network_id: NetworkID, + network_id: String, } = 10181, #[error( @@ -656,7 +637,7 @@ pub enum CommonError { EntitiesNotDerivedByFactorSource = 10182, #[error("The network {network_id} does not exist in profile")] - NoNetworkInProfile { network_id: NetworkID } = 10183, + NoNetworkInProfile { network_id: String } = 10183, #[error("Empty FactorSources list")] FactorSourcesOfKindEmptyFactors = 10184, @@ -740,7 +721,7 @@ pub enum CommonError { MaxTransfersPerTransactionReached { amount: u64 } = 10208, #[error("Transaction Manifest class is reserved: {class}")] - ReservedManifestClass { class: DetailedManifestClassKind } = 10209, + ReservedManifestClass { class: String } = 10209, #[error("FactorInstancesProvider did not derive enough factors")] FactorInstancesProviderDidNotDeriveEnoughFactors = 10210, @@ -766,8 +747,8 @@ pub enum CommonError { )] EntityOnWrongNetwork { entity_kind: String, - wrong_network: NetworkID, - expected_network: NetworkID, + wrong_network: String, + expected_network: String, } = 10215, #[error("SecurityState not securified")] @@ -851,8 +832,8 @@ pub enum CommonError { "Entity kind of FactorInstances does not match EntityKind of entity" )] SecurityStructureOfFactorInstancesEntityDiscrepancyInEntityKind { - entity_kind_of_entity: CAP26EntityKind, - entity_kind_of_factor_instances: CAP26EntityKind, + entity_kind_of_entity: String, + entity_kind_of_factor_instances: String, } = 10239, #[error( diff --git a/crates/sargon-uniffi/src/core/result/result.rs b/crates/sargon-uniffi/src/core/result/result.rs index 8061d54b0..bd16907de 100644 --- a/crates/sargon-uniffi/src/core/result/result.rs +++ b/crates/sargon-uniffi/src/core/result/result.rs @@ -33,6 +33,11 @@ pub trait FromInternalResult { fn into_result(self) -> Result; } +/// Utility trait to map `InternalResult` to `Result` +pub trait FromInternalIterResult { + fn into_iter_result(self) -> Result; +} + /// Implementation for InternalResult impl FromInternalResult for InternalResult @@ -45,29 +50,14 @@ where } } -/// Implementation for InternalResult> -impl FromInternalResult> - for InternalResult> -where - Type: From, // Ensures `Type` can be constructed from `InternalType` -{ - fn into_result(self) -> Result> { - self.map(|vec| vec.into_type()) // Converts Ok variant using From trait - .map_err(Into::into) // Converts Err variant using Into - } -} - -/// Implementation for InternalResult> -impl< - InternalType: Debug + PartialEq + Eq + Clone + sargon::Identifiable, - Type, - > FromInternalResult> - for InternalResult> +impl FromInternalIterResult> + for InternalResult where - Type: From, // Ensures `Type` can be constructed from `InternalType` + T: IntoIterator, + Element: From, // Ensures `Type` can be constructed from `InternalType` { - fn into_result(self) -> Result> { - self.map(|vec| vec.into_type()) // Converts Ok variant using From trait + fn into_iter_result(self) -> Result> { + self.map(|xs| xs.into_iter().map(Element::from).collect_vec()) .map_err(Into::into) // Converts Err variant using Into } } diff --git a/crates/sargon-uniffi/src/core/types/collections/internal_mapping.rs b/crates/sargon-uniffi/src/core/types/collections/internal_mapping.rs index e6e0aa4e3..10d54c22f 100644 --- a/crates/sargon-uniffi/src/core/types/collections/internal_mapping.rs +++ b/crates/sargon-uniffi/src/core/types/collections/internal_mapping.rs @@ -9,35 +9,10 @@ pub trait FromInternal { fn into_type(self) -> Type; } -// ===== Vec ====== -impl FromInternal, Vec> - for Vec -where - Element: From, -{ - fn into_type(self) -> Vec { - self.into_iter().map(Element::from).collect() - } -} - -// === IdentifiedVec ==== -impl - FromInternal, Vec> - for IdentifiedVecOf -where - InternalElement: Debug + PartialEq + Eq + Clone + sargon::Identifiable, - Element: From, -{ - fn into_type(self) -> Vec { - self.into_iter().map(Element::from).collect() - } -} - -// ==== IndexSet ====== -impl - FromInternal, Vec> - for IndexSet +// === IntoIterator ==== +impl FromInternal> for T where + T: IntoIterator, Element: From, { fn into_type(self) -> Vec { @@ -76,7 +51,7 @@ where } } -// === IdentifiedVec ==== +// === IdentifiedVecOf ==== impl IntoInternal, IdentifiedVecOf> for Vec diff --git a/crates/sargon-uniffi/src/core/types/secret_bytes.rs b/crates/sargon-uniffi/src/core/types/secret_bytes.rs index a5df86757..8b5b45ed7 100644 --- a/crates/sargon-uniffi/src/core/types/secret_bytes.rs +++ b/crates/sargon-uniffi/src/core/types/secret_bytes.rs @@ -1,5 +1,6 @@ use crate::prelude::*; +#[macro_export] macro_rules! decl_secret_bytes { ( $( diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/cap26/cap26_entity_kind.rs b/crates/sargon-uniffi/src/hierarchical_deterministic/cap26/cap26_entity_kind.rs index d22cb83bb..720437db6 100644 --- a/crates/sargon-uniffi/src/hierarchical_deterministic/cap26/cap26_entity_kind.rs +++ b/crates/sargon-uniffi/src/hierarchical_deterministic/cap26/cap26_entity_kind.rs @@ -13,3 +13,8 @@ pub enum CAP26EntityKind { } delegate_display_debug_into!(CAP26EntityKind, InternalCAP26EntityKind); + +#[uniffi::export] +pub fn cap26_entity_kind_to_string(kind: CAP26EntityKind) -> String { + kind.into_internal().to_string() +} diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/security_question.rs b/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/security_question.rs index c71ceb7ec..acee6dc0f 100644 --- a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/security_question.rs +++ b/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/security_question.rs @@ -2,6 +2,11 @@ use crate::prelude::*; use sargon::SecurityQuestion_NOT_PRODUCTION_READY_ExpectedAnswerFormat as InternalSecurityQuestion_NOT_PRODUCTION_READY_ExpectedAnswerFormat; use sargon::Security_NOT_PRODUCTION_READY_Question as InternalSecurity_NOT_PRODUCTION_READY_Question; +decl_vec_samples_for!( + Security_NOT_PRODUCTION_READY_Questions, + Security_NOT_PRODUCTION_READY_Question +); + /// ❗️ NOT PRODUCTION READY YET ❗️ /// A security question /// ❗️ NOT PRODUCTION READY YET ❗️ diff --git a/crates/sargon-uniffi/src/profile/mfa/security_structures/security_shield_builder.rs b/crates/sargon-uniffi/src/profile/mfa/security_structures/security_shield_builder.rs index 210582d05..290e0f8d3 100644 --- a/crates/sargon-uniffi/src/profile/mfa/security_structures/security_shield_builder.rs +++ b/crates/sargon-uniffi/src/profile/mfa/security_structures/security_shield_builder.rs @@ -9,6 +9,7 @@ use std::{ }; use sargon::{ + FactorSourceWithExtraSampleValues, SecurityShieldBuilder as InternalSecurityShieldBuilder, SelectedFactorSourcesForRoleStatus as InternalSelectedFactorSourcesForRoleStatus, }; diff --git a/crates/sargon-uniffi/src/profile/supporting_types/decl_vec_samples_for.rs b/crates/sargon-uniffi/src/profile/supporting_types/decl_vec_samples_for.rs index 90bb51d06..af2b31f59 100644 --- a/crates/sargon-uniffi/src/profile/supporting_types/decl_vec_samples_for.rs +++ b/crates/sargon-uniffi/src/profile/supporting_types/decl_vec_samples_for.rs @@ -9,7 +9,18 @@ macro_rules! decl_vec_samples_for { $element_type: ident ) => { paste! { + use sargon::$collection_type as [< Internal $collection_type >]; + use sargon::Result as InternalResult; + + impl + IntoInternal, [< Internal $collection_type >]> + for Vec<$element_type> + { + fn into_internal(self) -> [< Internal $collection_type >] { + self.into_iter().map(Into::into).collect() + } + } #[uniffi::export] pub fn [< new_ $collection_type:snake _sample >]() -> Vec<$element_type> { diff --git a/crates/sargon-uniffi/src/profile/v100/entity/persona/persona_data/persona_data_identified_collection_types.rs b/crates/sargon-uniffi/src/profile/v100/entity/persona/persona_data/persona_data_identified_collection_types.rs index 010513363..1bc1aa82c 100644 --- a/crates/sargon-uniffi/src/profile/v100/entity/persona/persona_data/persona_data_identified_collection_types.rs +++ b/crates/sargon-uniffi/src/profile/v100/entity/persona/persona_data/persona_data_identified_collection_types.rs @@ -29,6 +29,25 @@ macro_rules! declare_collection_of_identified_entry { pub collection: Vec<[< PersonaDataIdentified $id_ent_type >]>, } + impl FromInternal<[< InternalCollectionOf $struct_name>], Vec<[< PersonaDataIdentified $id_ent_type >]>> for [< CollectionOf $struct_name>] + { + fn into_type(self) -> Vec<[< PersonaDataIdentified $id_ent_type >]> { + self.collection.into_iter().map([< PersonaDataIdentified $id_ent_type >]::from).collect() + } + } + + impl + IntoInternal]>, [< CollectionOf $struct_name>]> + for Vec<[< PersonaDataIdentified $id_ent_type >]> + { + fn into_internal(self) -> [< CollectionOf $struct_name>] { + [< CollectionOf $struct_name>] { + collection: self + } + } + } + + decl_conversion_tests_for!([< CollectionOf $struct_name>]); } }; diff --git a/crates/sargon-uniffi/src/profile/v100/factors/factor_sources/factor_sources.rs b/crates/sargon-uniffi/src/profile/v100/factors/factor_sources/factor_sources.rs index 68d2e25ff..2e795c7fd 100644 --- a/crates/sargon-uniffi/src/profile/v100/factors/factor_sources/factor_sources.rs +++ b/crates/sargon-uniffi/src/profile/v100/factors/factor_sources/factor_sources.rs @@ -1,5 +1,7 @@ use crate::prelude::*; -use sargon::FactorSource as InternalFactorSource; +use sargon::{ + FactorSource as InternalFactorSource, FactorSourceWithExtraSampleValues, +}; #[uniffi::export] pub fn factor_sources_all_sample_values() -> Vec { diff --git a/crates/sargon-uniffi/src/profile/v100/networks/network/resource_preferences/resource_preferences.rs b/crates/sargon-uniffi/src/profile/v100/networks/network/resource_preferences/resource_preferences.rs index e9d415d0b..e6c8d19e8 100644 --- a/crates/sargon-uniffi/src/profile/v100/networks/network/resource_preferences/resource_preferences.rs +++ b/crates/sargon-uniffi/src/profile/v100/networks/network/resource_preferences/resource_preferences.rs @@ -1,5 +1,7 @@ use crate::prelude::*; -use sargon::ResourcePreferences as InternalResourcePreferences; +use sargon::{ + ResourceHiding, ResourcePreferences as InternalResourcePreferences, +}; #[uniffi::export] pub fn resource_preferences_get_hidden_resources( diff --git a/crates/sargon-uniffi/src/radix_connect/p2p_links/p2p_links.rs b/crates/sargon-uniffi/src/radix_connect/p2p_links/p2p_links.rs index 0121c4ec6..e6f04782d 100644 --- a/crates/sargon-uniffi/src/radix_connect/p2p_links/p2p_links.rs +++ b/crates/sargon-uniffi/src/radix_connect/p2p_links/p2p_links.rs @@ -8,7 +8,7 @@ pub fn new_p2p_links_from_json_bytes( json_bytes .to_vec() .deserialize::() - .into_result() + .into_iter_result() } #[uniffi::export] diff --git a/crates/sargon-uniffi/src/system/drivers/secure_storage_driver/support/secure_storage_access_error_kind.rs b/crates/sargon-uniffi/src/system/drivers/secure_storage_driver/support/secure_storage_access_error_kind.rs index e17d2695a..171b58e4b 100644 --- a/crates/sargon-uniffi/src/system/drivers/secure_storage_driver/support/secure_storage_access_error_kind.rs +++ b/crates/sargon-uniffi/src/system/drivers/secure_storage_driver/support/secure_storage_access_error_kind.rs @@ -76,3 +76,10 @@ pub fn secure_storage_access_error_kind_is_manual_cancellation( ) -> bool { kind.into_internal().is_manual_cancellation() } + +#[uniffi::export] +pub fn secure_storage_access_error_kind_to_string( + kind: SecureStorageAccessErrorKind, +) -> String { + kind.into_internal().to_string() +} diff --git a/crates/sargon-uniffi/src/system/sargon_os/sargon_os_accounts.rs b/crates/sargon-uniffi/src/system/sargon_os/sargon_os_accounts.rs index cd998fa8e..4f1f4e1a7 100644 --- a/crates/sargon-uniffi/src/system/sargon_os/sargon_os_accounts.rs +++ b/crates/sargon-uniffi/src/system/sargon_os/sargon_os_accounts.rs @@ -8,7 +8,9 @@ impl SargonOS { /// Returns the non-hidden accounts on the current network, empty if no accounts /// on the network pub fn accounts_on_current_network(&self) -> Result> { - self.wrapped.accounts_on_current_network().into_result() + self.wrapped + .accounts_on_current_network() + .into_iter_result() } /// Returns the non-hidden accounts on the current network as `AccountForDisplay` @@ -17,7 +19,7 @@ impl SargonOS { ) -> Result> { self.wrapped .accounts_for_display_on_current_network() - .into_result() + .into_iter_result() } /// Looks up the account by account address, returns Err if the account is @@ -172,7 +174,7 @@ impl SargonOS { name_prefix, ) .await - .into_result() + .into_iter_result() } } diff --git a/crates/sargon-uniffi/src/system/sargon_os/sargon_os_factors.rs b/crates/sargon-uniffi/src/system/sargon_os/sargon_os_factors.rs index 09625681d..69fff1806 100644 --- a/crates/sargon-uniffi/src/system/sargon_os/sargon_os_factors.rs +++ b/crates/sargon-uniffi/src/system/sargon_os/sargon_os_factors.rs @@ -50,7 +50,7 @@ impl SargonOS { /// Returns all the factor sources pub fn factor_sources(&self) -> Result> { - self.wrapped.factor_sources().into_result() + self.wrapped.factor_sources().into_iter_result() } pub async fn __debug_factor_instances_in_cache( @@ -132,7 +132,7 @@ impl SargonOS { self.wrapped .add_factor_sources(factor_sources.into_internal()) .await - .into_result() + .into_iter_result() } /// Updates the name of the corresponding `factor_source` in Profile. Throws `UpdateFactorSourceMutateFailed` error if the @@ -157,7 +157,7 @@ impl SargonOS { self.wrapped .debug_add_all_sample_factor_sources() .await - .into_result() + .into_iter_result() } /// Creates a new unsaved DeviceFactorSource from the provided `mnemonic_with_passphrase`, diff --git a/crates/sargon-uniffi/src/system/sargon_os/sargon_os_security_center.rs b/crates/sargon-uniffi/src/system/sargon_os/sargon_os_security_center.rs index 2d24e7e43..d2c03a1c8 100644 --- a/crates/sargon-uniffi/src/system/sargon_os/sargon_os_security_center.rs +++ b/crates/sargon-uniffi/src/system/sargon_os/sargon_os_security_center.rs @@ -12,6 +12,6 @@ impl SargonOS { ) -> Result> { self.wrapped .check_security_problems(input.into_internal()) - .into_result() + .into_iter_result() } } diff --git a/crates/sargon-uniffi/src/system/sargon_os/sargon_os_security_structures.rs b/crates/sargon-uniffi/src/system/sargon_os/sargon_os_security_structures.rs index 156502106..65a9cb6f6 100644 --- a/crates/sargon-uniffi/src/system/sargon_os/sargon_os_security_structures.rs +++ b/crates/sargon-uniffi/src/system/sargon_os/sargon_os_security_structures.rs @@ -9,7 +9,7 @@ impl SargonOS { ) -> Result> { self.wrapped .security_structures_of_factor_sources() - .into_result() + .into_iter_result() } /// Returns all the `SecurityStructuresOfFactorSourceIDs` which are stored @@ -19,7 +19,7 @@ impl SargonOS { ) -> Result> { self.wrapped .security_structures_of_factor_source_ids() - .into_result() + .into_iter_result() } /// Returns all the `SecurityStructuresOfFactorSourceIDs` which are stored diff --git a/crates/sargon/Cargo.toml b/crates/sargon/Cargo.toml index 09bcc7603..ee6377f69 100644 --- a/crates/sargon/Cargo.toml +++ b/crates/sargon/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sargon" # Don't forget to update version in crates/sargon-uniffi/Cargo.toml -version = "1.1.98" +version = "1.2.0" edition = "2021" build = "build.rs" @@ -12,114 +12,61 @@ name = "vectors" crate-type = ["staticlib", "cdylib", "lib"] [dependencies] +sargon-core = { path = "../sargon-core" } -# zeroize = "1.7.0" -zeroize = { git = "https://github.com/RustCrypto/utils", rev = "df6d2f48a5e8afe8eef04ba32e2af55bacb41375", features = [ - "zeroize_derive", - "derive", -] } - -log = "0.4.20" -# log = { git = "https://github.com/rust-lang/log/", rev = "4708f1484c7e6b8d4418b571c05e613b18e57673" } +zeroize = { workspace = true } +log = { workspace = true } # pretty_env_logger = "0.5.0" pretty_env_logger = { git = "https://github.com/seanmonstar/pretty-env-logger/", rev = "0e238400e18649415dc710c025e99c009a1bb744" } -# derive_more = "1.0.0" -derive_more = { git = "https://github.com/JelteF/derive_more", rev = "d7f5b9e94d024790682f6fc4dcca13941cce64c8", features = [ - "add", - "as_ref", - "debug", - "deref", - "deref_mut", - "display", - "from", - "from_str", - "mul", -] } +derive_more = { workspace = true } -serde = { version = "1.0.193", features = ["derive", "rc", "std"] } +serde = { workspace = true } -# serde_json = "1.0.108" -serde_json = { git = "https://github.com/serde-rs/json/", rev = "4bc1eaa03a6160593575bc9bc60c94dba4cab1e3", features = [ - "preserve_order", -] } +serde_json = { workspace = true } -# serde_with = "3.4.0" -serde_with = { git = "https://github.com/jonasbb/serde_with/", rev = "1e8e4e75398c6a9de29386473ae7c3157be031c2" } +serde_with = { workspace = true } -# serde_repr = "0.1.17" -serde_repr = { git = "https://github.com/dtolnay/serde-repr/", rev = "94cce18a51bc169869f2cdcea6549b3ed81b3b2e" } +serde_repr = { workspace = true } -# once_cell = "1.19.0" -once_cell = { git = "https://github.com/matklad/once_cell/", rev = "c48d3c2c01de926228aea2ac1d03672b4ce160c1" } +once_cell = { workspace = true } -# thiserror = "1.0.50" -thiserror = { git = "https://github.com/dtolnay/thiserror/", rev = "a7d220d7915fb888413aa7978efd70f7006bda9d" } +thiserror = { workspace = true } -# iso8601-timestamp = "0.2.16" -iso8601-timestamp = { git = "https://github.com/Lantern-chat/iso8601-timestamp/", rev = "e5a3f2a5911759bc6b0d8100b032a6b4dd6e12c1", features = [ - "serde", - "std", -] } +iso8601-timestamp = { workspace = true } -# uuid = "1.6.1" -uuid = { git = "https://github.com/uuid-rs/uuid/", rev = "c8891073248ddc7faa8c53ac9ceb629a341c7b9b", features = [ - "v4", - "serde", -] } - -# strum = "0.26.1" -strum = { git = "https://github.com/Peternator7/strum/", rev = "f746c3699acf150112e26c00e6c8ca666d8d068d", features = [ - "derive", -] } +uuid = { workspace = true } +strum = { workspace = true } sbor = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } -radix-rust = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0", features = [ - "serde", -] } +radix-rust = { workspace = true } radix-engine = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } -radix-common = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0", features = [ - "serde", - "secp256k1_sign_and_validate", -] } +radix-common = { workspace = true } radix-common-derive = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } -radix-engine-interface = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } +radix-engine-interface = { workspace = true } radix-engine-toolkit-common = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } -radix-transactions = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } +radix-transactions = { workspace = true } radix-engine-toolkit = { git = "https://github.com/radixdlt/radix-engine-toolkit", rev = "2ab5b35a6cb96c9faeb98ed8df67b870336e6873" } -# enum-iterator = "1.4.1" -enum-iterator = { git = "https://github.com/stephaneyfx/enum-iterator/", rev = "9d472a1237cfd03b1c7657fdcba74c8070bfb4ea" } +enum-iterator = { workspace = true } -# rand = "0.8.5" -rand = { git = "https://github.com/rust-random/rand/", rev = "937320cbfeebd4352a23086d9c6e68f067f74644" } +rand = { workspace = true } -# hex = "0.4.3" -hex = { git = "https://github.com/KokaKiwi/rust-hex/", rev = "b2b4370b5bf021b98ee7adc92233e8de3f2de792" } +hex = { workspace = true } -# delegate = "0.12.0" -delegate = { git = "https://github.com/Kobzol/rust-delegate/", rev = "ac852be64f3e4b5f9b58be910d09921488d2845d" } +delegate = { workspace = true } -# itertools = "0.12.0" -itertools = { git = "https://github.com/rust-itertools/itertools/", rev = "98ecabb47d7147dae06fc3fa400ec758947194f3" } +itertools = { workspace = true } -# enum-as-inner = "0.6.0" -enum-as-inner = { git = "https://github.com/bluejekyll/enum-as-inner/", rev = "c15f6e5c4f98ec865e181ae1fff9fc13a1a2e4e2" } +enum-as-inner = { workspace = true } # SLIP10 implementation -# iota_crypto = "0.23.2" -iota-crypto = { git = "https://github.com/iotaledger/crypto.rs", rev = "8c13125541e762206e2dc57b8bfde89c7f6ce8e3", features = [ - "slip10", - "ed25519", - "secp256k1", - "x25519", -] } +iota-crypto = { workspace = true } # Transitive dependency of iota_crypto - used to construct PubKey from uncompressed bytes. -# k256 = "0.13.3" -k256 = { git = "https://github.com/RustCrypto/elliptic-curves", rev = "e158ce5cf0e9acee2fd76aff2a628334f5c771e5" } +k256 = { workspace = true } # bip39 = "2.0.0" bip39 = { git = "https://github.com/rust-bitcoin/rust-bip39", rev = "a30760beac21d595b2bda376df4f4e6bf029bcc5", features = [ @@ -128,15 +75,13 @@ bip39 = { git = "https://github.com/rust-bitcoin/rust-bip39", rev = "a30760beac2 "french", ] } -# assert-json-diff = "2.0.2" -assert-json-diff = { git = "https://github.com/davidpdrsn/assert-json-diff/", rev = "bca0d2c590808274298d939e0533da79cd09076d" } +assert-json-diff = { workspace = true } + +url = { workspace = true } + -# url = "2.5.0" -# url = { git = "https://github.com/servo/rust-url", rev = "00e9e18ce6504e0e9157816c593afec8e69cb9e3", features = ["serde"] } # BROKEN compat with reqwest: the trait bound `url::Url: IntoUrl` is not satisfied --> tests/integration/network_antenna_reqwest.rs:31:50 -url = { version = "2.5.0", features = ["serde"] } +paste = { workspace = true } -# paste = "1.0.14" -paste = { git = "https://github.com/dtolnay/paste", rev = "1e0cc1025af5388397c67fa4389ad7ad24814df8" } # camino = "1.0.8" camino = { git = "https://github.com/camino-rs/camino/", rev = "afa51b1b4c684b7e6698a6717ccda3affd0abd42", optional = true } @@ -144,8 +89,7 @@ camino = { git = "https://github.com/camino-rs/camino/", rev = "afa51b1b4c684b7e # async-trait = "0.1.79" async-trait = { git = "https://github.com/dtolnay/async-trait", rev = "1eb21ed8bd87029bf4dcbea41ff309f2b2220c43" } -# pretty_assertions = "1.4.0" -pretty_assertions = { git = "https://github.com/rust-pretty-assertions/rust-pretty-assertions", rev = "3f1ebc0cac5f88e875f036bf16636e15fa935c8d" } +pretty_assertions = { workspace = true } # AES for Profile Encryption # aes-gcm = "10.3" @@ -157,7 +101,7 @@ aes-gcm = { git = "https://github.com/RustCrypto/AEADs", rev = "7e82b01cd4901f6a ] } # hkdf = "0.12.4" -hkdf = { git = "https://github.com/RustCrypto/KDFs/", rev = "1ac16e8b9d4ee7a67613c9396c6cc1327652eaba" } +hkdf = { workspace = true } base64 = { git = "https://github.com/marshallpierce/rust-base64.git", rev = "e14400697453bcc85997119b874bc03d9601d0af" } diff --git a/crates/sargon/src/core/mod.rs b/crates/sargon/src/core/mod.rs deleted file mode 100644 index 0834c628c..000000000 --- a/crates/sargon/src/core/mod.rs +++ /dev/null @@ -1,21 +0,0 @@ -mod assert_json; -mod assert_network_request; -mod error; -mod has_sample_values; -mod hash; -mod pb_hkdf_sha256; -mod secure_random_bytes; -mod types; -mod unsafe_id_stepper; -mod utils; - -pub use assert_json::*; -pub use assert_network_request::*; -pub use error::*; -pub use has_sample_values::*; -pub use hash::*; -pub use pb_hkdf_sha256::*; -pub use secure_random_bytes::*; -pub use types::*; -pub use unsafe_id_stepper::*; -pub use utils::*; diff --git a/crates/sargon/src/core/types/collections/mod.rs b/crates/sargon/src/core/types/collections/mod.rs deleted file mode 100644 index 1dd0ce650..000000000 --- a/crates/sargon/src/core/types/collections/mod.rs +++ /dev/null @@ -1,11 +0,0 @@ -mod identified_vec_of; -mod just; - -#[cfg(test)] -mod user; - -pub use identified_vec_of::*; -pub use just::*; - -#[cfg(test)] -pub(super) use user::*; diff --git a/crates/sargon/src/core/types/keys/is_private_key.rs b/crates/sargon/src/core/types/keys/is_private_key.rs deleted file mode 100644 index 71bbfbc99..000000000 --- a/crates/sargon/src/core/types/keys/is_private_key.rs +++ /dev/null @@ -1,49 +0,0 @@ -use crate::prelude::*; - -pub trait IsPrivateKey>: Sized { - type Signature; - - fn from_bytes(slice: &[u8]) -> Result; - - fn curve() -> SLIP10Curve; - - fn public_key(&self) -> P; - - fn sign(&self, msg_hash: &Hash) -> Self::Signature; - - fn sign_transaction_intent_hash( - &self, - transaction_intent_hash: &TransactionIntentHash, - ) -> IntentSignature - where - (P, Self::Signature): Into, - { - let public_key: P = self.public_key(); - let signature = self.sign(&transaction_intent_hash.hash); - let tuple: SignatureWithPublicKey = (public_key, signature).into(); - tuple.into() - } - - fn sign_subintent_hash( - &self, - subintent_hash: &SubintentHash, - ) -> IntentSignature - where - (P, Self::Signature): Into, - { - let public_key: P = self.public_key(); - let signature = self.sign(&subintent_hash.hash); - let tuple: SignatureWithPublicKey = (public_key, signature).into(); - tuple.into() - } - - fn notarize_hash( - &self, - signed_transaction_intent_hash: &SignedTransactionIntentHash, - ) -> NotarySignature - where - Self::Signature: Into, - { - self.sign(&signed_transaction_intent_hash.hash).into() - } -} diff --git a/crates/sargon/src/error_from.rs b/crates/sargon/src/error_from.rs new file mode 100644 index 000000000..a85a59d2c --- /dev/null +++ b/crates/sargon/src/error_from.rs @@ -0,0 +1,92 @@ +use crate::prelude::*; +pub trait FromAddressError { + fn from_address_error( + s: String, + expected_network: NetworkID, + fallback_underlying: String, + ) -> Self; +} + +impl FromAddressError for CommonError { + fn from_address_error( + s: String, + expected_network: NetworkID, + fallback_underlying: String, + ) -> Self { + use radix_engine_toolkit::functions::address::decode as RET_decode_address; + let Some(Some(network_id)) = RET_decode_address(&s) + .map(|t| t.0) + .map(NetworkID::from_repr) + else { + return CommonError::InvalidInstructionsString { + underlying: "Failed to get NetworkID from address".to_owned(), + }; + }; + if network_id != expected_network { + CommonError::InvalidInstructionsWrongNetwork { + found_in_instructions: network_id.to_string(), + specified_to_instructions_ctor: expected_network.to_string(), + } + } else { + CommonError::InvalidInstructionsString { + underlying: fallback_underlying, + } + } + } +} + +pub trait FromScryptoCompileError { + fn from_scrypto_compile_error( + manifest_string: &str, + err: ScryptoCompileError, + expected_network: NetworkID, + ) -> Self; +} + +impl FromScryptoCompileError for CommonError { + fn from_scrypto_compile_error( + manifest_string: &str, + err: ScryptoCompileError, + expected_network: NetworkID, + ) -> Self { + use radix_transactions::manifest::parser::ParserError; + use radix_transactions::manifest::parser::ParserErrorKind::*; + use GeneratorError; + use GeneratorErrorKind::*; + let n = expected_network; + + let pretty_diagnostics = scrypto_compile_error_diagnostics( + manifest_string, + err.clone(), + ScryptoCompileErrorDiagnosticsStyle::PlainText, + ); + match err { + ScryptoCompileError::GeneratorError(GeneratorError { + error_kind: gen_err, + .. + }) => match gen_err { + InvalidPackageAddress(a) => { + Self::from_address_error(a, n, pretty_diagnostics) + } + InvalidResourceAddress(a) => { + Self::from_address_error(a, n, pretty_diagnostics) + } + InvalidGlobalAddress(a) => { + Self::from_address_error(a, n, pretty_diagnostics) + } + _ => CommonError::InvalidInstructionsString { + underlying: pretty_diagnostics, + }, + }, + ScryptoCompileError::ParserError(ParserError { + error_kind: MaxDepthExceeded { max, .. }, + .. + }) => CommonError::InvalidTransactionMaxSBORDepthExceeded { + max: max as u16, + }, + _ => CommonError::InvalidInstructionsString { + underlying: pretty_diagnostics, + }, + } + } +} diff --git a/crates/sargon/src/factor_instances_provider/next_index_assigner/next_derivation_entity_index_profile_analyzing_assigner.rs b/crates/sargon/src/factor_instances_provider/next_index_assigner/next_derivation_entity_index_profile_analyzing_assigner.rs index f620daf1a..0b81689c6 100644 --- a/crates/sargon/src/factor_instances_provider/next_index_assigner/next_derivation_entity_index_profile_analyzing_assigner.rs +++ b/crates/sargon/src/factor_instances_provider/next_index_assigner/next_derivation_entity_index_profile_analyzing_assigner.rs @@ -255,8 +255,8 @@ impl NextDerivationEntityIndexProfileAnalyzingAssigner { ) -> Result> { if agnostic_path.network_id != self.network_id { return Err(CommonError::NetworkDiscrepancy { - expected: self.network_id, - actual: agnostic_path.network_id, + expected: self.network_id.to_string(), + actual: agnostic_path.network_id.to_string(), }); } let derivation_preset = DerivationPreset::try_from(agnostic_path)?; @@ -297,17 +297,17 @@ mod tests { #[test] fn test_network_discrepancy() { let sut = SUT::new(NetworkID::Mainnet, None); - assert!(matches!( + assert_eq!( sut.next( FactorSourceIDFromHash::sample_at(0), DerivationPreset::AccountVeci .index_agnostic_path_on_network(NetworkID::Stokenet), ), Err(CommonError::NetworkDiscrepancy { - expected: NetworkID::Mainnet, - actual: NetworkID::Stokenet + expected: NetworkID::Mainnet.to_string(), + actual: NetworkID::Stokenet.to_string() }) - )); + ); } #[test] @@ -608,14 +608,10 @@ mod tests { fn test_next_identity_rola_at_7_is_8() { let preset = DerivationPreset::IdentityRola; let network_id = NetworkID::Mainnet; - let sut = SUT::new( - network_id, - Arc::new(Profile::sample_from( - FactorSource::sample_all(), - [], - [&Persona::sample_at(7)], - )), - ); + let persona = Persona::sample_at(7); + let profile = + Profile::sample_from(FactorSource::sample_all(), [], [&persona]); + let sut = SUT::new(network_id, Arc::new(profile)); type F = FactorSourceIDFromHash; { let fid = F::sample_device(); diff --git a/crates/sargon/src/core/assert_network_request.rs b/crates/sargon/src/gateway_api/assert_network_request.rs similarity index 76% rename from crates/sargon/src/core/assert_network_request.rs rename to crates/sargon/src/gateway_api/assert_network_request.rs index 6dfa84c24..0b19df06b 100644 --- a/crates/sargon/src/core/assert_network_request.rs +++ b/crates/sargon/src/gateway_api/assert_network_request.rs @@ -1,12 +1,11 @@ use crate::prelude::*; /// Verifies that the given `NetworkRequest` has the expected body. -#[cfg(not(tarpaulin_include))] pub fn assert_network_request(result: NetworkRequest, expected: &T) where T: ?Sized + Serialize, { let expected_body = serde_json::to_vec(&expected).unwrap(); - assert_eq!(result.body.bytes, expected_body); + assert_eq!(result.body.to_vec(), expected_body); } diff --git a/crates/sargon/src/gateway_api/client/gateway_client.rs b/crates/sargon/src/gateway_api/client/gateway_client.rs index 11e43a4cf..cdfd9bbaa 100644 --- a/crates/sargon/src/gateway_api/client/gateway_client.rs +++ b/crates/sargon/src/gateway_api/client/gateway_client.rs @@ -44,13 +44,6 @@ impl GatewayClient { } } -#[cfg(test)] -impl From<()> for BagOfBytes { - fn from(_value: ()) -> Self { - Self::new() - } -} - #[cfg(test)] mod tests { use super::*; diff --git a/crates/sargon/src/gateway_api/mod.rs b/crates/sargon/src/gateway_api/mod.rs index 25d1a92f5..ed1795d26 100644 --- a/crates/sargon/src/gateway_api/mod.rs +++ b/crates/sargon/src/gateway_api/mod.rs @@ -1,8 +1,10 @@ +mod assert_network_request; mod client; mod endpoints; mod methods; mod models; +pub use assert_network_request::*; pub use client::*; pub use endpoints::*; pub use methods::*; diff --git a/crates/sargon/src/gateway_api/models/types/request/transaction/preview/request_flags.rs b/crates/sargon/src/gateway_api/models/types/request/transaction/preview/request_flags.rs index 3ed7e76e6..3e9272d11 100644 --- a/crates/sargon/src/gateway_api/models/types/request/transaction/preview/request_flags.rs +++ b/crates/sargon/src/gateway_api/models/types/request/transaction/preview/request_flags.rs @@ -1,3 +1,5 @@ +use sargon_core::decl_bool_type; + use crate::prelude::*; #[derive( diff --git a/crates/sargon/src/hierarchical_deterministic/bip39/bip39_entropy.rs b/crates/sargon/src/hierarchical_deterministic/bip39/bip39_entropy.rs index 8298de05d..3aeaa1e64 100644 --- a/crates/sargon/src/hierarchical_deterministic/bip39/bip39_entropy.rs +++ b/crates/sargon/src/hierarchical_deterministic/bip39/bip39_entropy.rs @@ -1,4 +1,5 @@ -use crate::{decl_secret_bytes, prelude::*}; +use crate::prelude::*; +use sargon_core::decl_secret_bytes; macro_rules! entropy_with_byte_counts { ( diff --git a/crates/sargon/src/hierarchical_deterministic/bip39/bip39_seed.rs b/crates/sargon/src/hierarchical_deterministic/bip39/bip39_seed.rs index 542221cff..2066dcd9f 100644 --- a/crates/sargon/src/hierarchical_deterministic/bip39/bip39_seed.rs +++ b/crates/sargon/src/hierarchical_deterministic/bip39/bip39_seed.rs @@ -1,4 +1,5 @@ -use crate::{decl_secret_bytes, prelude::*}; +use crate::prelude::*; +use sargon_core::decl_secret_bytes; decl_secret_bytes!( /// A BIP39 seed for hierarchal deterministic wallets, as per the [BIP39 standard][doc]. diff --git a/crates/sargon/src/hierarchical_deterministic/cap26/paths/account_path.rs b/crates/sargon/src/hierarchical_deterministic/cap26/paths/account_path.rs index 98b55b9b1..4706f24ba 100644 --- a/crates/sargon/src/hierarchical_deterministic/cap26/paths/account_path.rs +++ b/crates/sargon/src/hierarchical_deterministic/cap26/paths/account_path.rs @@ -218,13 +218,13 @@ mod tests { #[test] fn from_str_persona() { - assert!(matches!( + assert_eq!( SUT::from_str("m/44H/1022H/1H/618H/1460H/0H"), Err(CommonError::WrongEntityKind { - expected: CAP26EntityKind::Account, - found: CAP26EntityKind::Identity + expected: CAP26EntityKind::Account.to_string(), + found: CAP26EntityKind::Identity.to_string() }) - )) + ) } #[test] @@ -365,8 +365,8 @@ mod tests { assert_eq!( AccountPath::from_str("m/44H/1022H/1H/618H/1460H/0H"), Err(CommonError::WrongEntityKind { - expected: CAP26EntityKind::Account, - found: CAP26EntityKind::Identity + expected: CAP26EntityKind::Account.to_string(), + found: CAP26EntityKind::Identity.to_string() }) ) } diff --git a/crates/sargon/src/hierarchical_deterministic/cap26/paths/identity_path.rs b/crates/sargon/src/hierarchical_deterministic/cap26/paths/identity_path.rs index 9cb485029..073044845 100644 --- a/crates/sargon/src/hierarchical_deterministic/cap26/paths/identity_path.rs +++ b/crates/sargon/src/hierarchical_deterministic/cap26/paths/identity_path.rs @@ -219,13 +219,13 @@ mod tests { #[test] fn from_str_account() { - assert!(matches!( + assert_eq!( SUT::from_str("m/44H/1022H/1H/525H/1460H/0H"), Err(CommonError::WrongEntityKind { - expected: CAP26EntityKind::Identity, - found: CAP26EntityKind::Account + expected: CAP26EntityKind::Identity.to_string(), + found: CAP26EntityKind::Account.to_string() }) - )) + ) } #[test] @@ -349,8 +349,8 @@ mod tests { assert_eq!( IdentityPath::from_str("m/44H/1022H/1H/525H/1460H/0H"), Err(CommonError::WrongEntityKind { - expected: CAP26EntityKind::Identity, - found: CAP26EntityKind::Account, + expected: CAP26EntityKind::Identity.to_string(), + found: CAP26EntityKind::Account.to_string(), }) ) } diff --git a/crates/sargon/src/hierarchical_deterministic/cap26/paths/traits.rs b/crates/sargon/src/hierarchical_deterministic/cap26/paths/traits.rs index e4c0a7122..96301ac99 100644 --- a/crates/sargon/src/hierarchical_deterministic/cap26/paths/traits.rs +++ b/crates/sargon/src/hierarchical_deterministic/cap26/paths/traits.rs @@ -35,8 +35,8 @@ impl NewEntityPathCheckingEntityKind for T { let entity_kind = path.entity_kind; if entity_kind != Self::entity_kind() { return Err(CommonError::WrongEntityKind { - expected: Self::entity_kind(), - found: entity_kind, + expected: Self::entity_kind().to_string(), + found: entity_kind.to_string(), }); } Ok(Self::new(path.network_id, path.key_kind, path.index)) diff --git a/crates/sargon/src/home_cards/home_cards.rs b/crates/sargon/src/home_cards/home_cards.rs index 994611952..91cdbca9a 100644 --- a/crates/sargon/src/home_cards/home_cards.rs +++ b/crates/sargon/src/home_cards/home_cards.rs @@ -15,8 +15,12 @@ impl HasSampleValues for HomeCards { } } -impl HomeCards { - pub fn sort(&self) -> Self { +pub trait Sortable { + fn sort(&self) -> Self; +} + +impl Sortable for HomeCards { + fn sort(&self) -> Self { let mut vec = self.into_iter().collect_vec(); vec.sort(); Self::from_iter(vec) diff --git a/crates/sargon/src/identified_vec_of/decl_identified_vec_of_with_samples.rs b/crates/sargon/src/identified_vec_of/decl_identified_vec_of_with_samples.rs new file mode 100644 index 000000000..e35623bf4 --- /dev/null +++ b/crates/sargon/src/identified_vec_of/decl_identified_vec_of_with_samples.rs @@ -0,0 +1,119 @@ +use crate::prelude::*; + +#[macro_export] +macro_rules! decl_identified_vec_of { + ( + $( + #[doc = $expr: expr] + )* + $collection_type: ident, + $element_type: ident + ) => { + paste! { + $( + #[doc = $expr] + )* + #[allow(non_camel_case_types)] + #[derive( + Clone, + PartialEq, + Eq, + Hash, + Serialize, + Deserialize, + Default, + derive_more::Debug, + derive_more::Deref, + derive_more::DerefMut + )] + #[serde(transparent)] + pub struct $collection_type(pub $crate::IdentifiedVecOf<$element_type>); + + impl std::fmt::Display for $collection_type where $element_type: std::fmt::Display { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.0.description()) + } + } + + impl $collection_type { + pub fn new() -> Self { + Self($crate::IdentifiedVecOf::new()) + } + + /// Creates a new collection with one single item. + pub fn just(item: $element_type) -> Self { + Self::from_iter([item]) + } + } + + impl From<$crate::IdentifiedVecOf<$element_type>> for $collection_type { + fn from(value: $crate::IdentifiedVecOf<$element_type>) -> Self { + Self(value) + } + } + + impl FromIterator<$element_type> for $collection_type + { + fn from_iter>(iter: T) -> Self { + $crate::IdentifiedVecOf::<$element_type>::from_iter(iter).into() + } + } + + impl<'a> IntoIterator for &'a $collection_type { + type Item = $element_type; + type IntoIter = IdentifiedVecOfIterator<'a, $element_type>; + + fn into_iter(self) -> Self::IntoIter { + IdentifiedVecOfIterator { + ordered_map: self, + index: 0, + } + } + } + + impl IntoIterator for $collection_type { + type Item = $element_type; + type IntoIter = OwnedIdentifiedVecOfIterator<$element_type>; + + fn into_iter(self) -> Self::IntoIter { + OwnedIdentifiedVecOfIterator { + ordered_map: self.0, + index: 0, + } + } + } + + + #[cfg(test)] + mod [< $collection_type:snake _tests >] { + use super::*; + + #[allow(clippy::upper_case_acronyms)] + type SUT = $collection_type; + + #[test] + fn test_ids() { + assert_eq!(SUT::sample().ids().into_iter().cloned().collect_vec(), SUT::sample().get_all().into_iter().map(|i| i.id()).collect_vec()); + } + } + } + }; + ( + $( + #[doc = $expr: expr] + )* + $element_type: ident + ) => { + paste! { + decl_identified_vec_of!( + $( + #[doc = $expr] + )* + [< $element_type s>], + $element_type + ); + } + }; +} + +pub use decl_identified_vec_of; diff --git a/crates/sargon/src/core/types/collections/identified_vec_of/identifiable.rs b/crates/sargon/src/identified_vec_of/identifiable.rs similarity index 100% rename from crates/sargon/src/core/types/collections/identified_vec_of/identifiable.rs rename to crates/sargon/src/identified_vec_of/identifiable.rs diff --git a/crates/sargon/src/core/types/collections/identified_vec_of/identified_vec_of.rs b/crates/sargon/src/identified_vec_of/identified_vec_of.rs similarity index 98% rename from crates/sargon/src/core/types/collections/identified_vec_of/identified_vec_of.rs rename to crates/sargon/src/identified_vec_of/identified_vec_of.rs index c9dfef4e8..6312ae161 100644 --- a/crates/sargon/src/core/types/collections/identified_vec_of/identified_vec_of.rs +++ b/crates/sargon/src/identified_vec_of/identified_vec_of.rs @@ -80,8 +80,8 @@ impl #[cfg(test)] mod tests { - use super::super::super::User; use super::*; + use crate::identified_vec_of::User; #[allow(clippy::upper_case_acronyms)] type SUT = IdentifiedVecOf; diff --git a/crates/sargon/src/core/types/collections/identified_vec_of/identified_vec_of_display_debug.rs b/crates/sargon/src/identified_vec_of/identified_vec_of_display_debug.rs similarity index 96% rename from crates/sargon/src/core/types/collections/identified_vec_of/identified_vec_of_display_debug.rs rename to crates/sargon/src/identified_vec_of/identified_vec_of_display_debug.rs index 5443dcdaa..c006d1f9b 100644 --- a/crates/sargon/src/core/types/collections/identified_vec_of/identified_vec_of_display_debug.rs +++ b/crates/sargon/src/identified_vec_of/identified_vec_of_display_debug.rs @@ -1,3 +1,5 @@ +use std::fmt::Formatter; + use crate::prelude::*; // =============== @@ -63,7 +65,8 @@ where #[cfg(test)] mod tests { - use super::super::super::User; + use crate::identified_vec_of::User; + use super::*; #[allow(clippy::upper_case_acronyms)] diff --git a/crates/sargon/src/core/types/collections/identified_vec_of/identified_vec_of_iterator.rs b/crates/sargon/src/identified_vec_of/identified_vec_of_iterator.rs similarity index 94% rename from crates/sargon/src/core/types/collections/identified_vec_of/identified_vec_of_iterator.rs rename to crates/sargon/src/identified_vec_of/identified_vec_of_iterator.rs index 637665e95..1cae331e3 100644 --- a/crates/sargon/src/core/types/collections/identified_vec_of/identified_vec_of_iterator.rs +++ b/crates/sargon/src/identified_vec_of/identified_vec_of_iterator.rs @@ -57,8 +57,8 @@ pub struct IdentifiedVecOfIterator< 'a, V: Debug + PartialEq + Eq + Clone + Identifiable, > { - ordered_map: &'a IdentifiedVecOf, - index: usize, + pub ordered_map: &'a IdentifiedVecOf, + pub index: usize, } impl<'a, V: Debug + PartialEq + Eq + Clone + Identifiable> Iterator @@ -81,8 +81,8 @@ impl<'a, V: Debug + PartialEq + Eq + Clone + Identifiable> Iterator pub struct OwnedIdentifiedVecOfIterator< V: Debug + PartialEq + Eq + Clone + Identifiable, > { - ordered_map: IdentifiedVecOf, - index: usize, + pub ordered_map: IdentifiedVecOf, + pub index: usize, } impl Iterator @@ -104,7 +104,8 @@ impl Iterator #[cfg(test)] mod tests { - use super::super::super::User; + use crate::identified_vec_of::User; + use super::*; #[allow(clippy::upper_case_acronyms)] diff --git a/crates/sargon/src/core/types/collections/identified_vec_of/identified_vec_of_modify.rs b/crates/sargon/src/identified_vec_of/identified_vec_of_modify.rs similarity index 99% rename from crates/sargon/src/core/types/collections/identified_vec_of/identified_vec_of_modify.rs rename to crates/sargon/src/identified_vec_of/identified_vec_of_modify.rs index 5d16469e4..db4beb816 100644 --- a/crates/sargon/src/core/types/collections/identified_vec_of/identified_vec_of_modify.rs +++ b/crates/sargon/src/identified_vec_of/identified_vec_of_modify.rs @@ -215,8 +215,8 @@ pub enum IdentifiableVecOfUpdateItemsOutcome { #[cfg(test)] mod tests { - use super::super::super::User; use super::*; + use crate::identified_vec_of::User; #[allow(clippy::upper_case_acronyms)] type SUT = IdentifiedVecOf; diff --git a/crates/sargon/src/core/types/collections/identified_vec_of/identified_vec_of_query.rs b/crates/sargon/src/identified_vec_of/identified_vec_of_query.rs similarity index 98% rename from crates/sargon/src/core/types/collections/identified_vec_of/identified_vec_of_query.rs rename to crates/sargon/src/identified_vec_of/identified_vec_of_query.rs index 005cb8374..38fa9be45 100644 --- a/crates/sargon/src/core/types/collections/identified_vec_of/identified_vec_of_query.rs +++ b/crates/sargon/src/identified_vec_of/identified_vec_of_query.rs @@ -65,8 +65,8 @@ impl IdentifiedVecOf { #[cfg(test)] mod tests { - use super::super::super::User; use super::*; + use crate::identified_vec_of::User; #[allow(clippy::upper_case_acronyms)] type SUT = IdentifiedVecOf; diff --git a/crates/sargon/src/core/types/collections/identified_vec_of/identified_vec_of_serde.rs b/crates/sargon/src/identified_vec_of/identified_vec_of_serde.rs similarity index 92% rename from crates/sargon/src/core/types/collections/identified_vec_of/identified_vec_of_serde.rs rename to crates/sargon/src/identified_vec_of/identified_vec_of_serde.rs index f4f68bacf..3680ad5e1 100644 --- a/crates/sargon/src/core/types/collections/identified_vec_of/identified_vec_of_serde.rs +++ b/crates/sargon/src/identified_vec_of/identified_vec_of_serde.rs @@ -1,6 +1,9 @@ use std::any::TypeId; use crate::prelude::*; +use serde::de::Error; +use serde::de::*; +use serde::ser::*; use super::{export_identified_vec_of, import_identified_vec_of_from}; @@ -30,15 +33,15 @@ where deserializer: D, ) -> Result { let items = Vec::::deserialize(deserializer)?; - import_identified_vec_of_from(items).map_err(de::Error::custom) + import_identified_vec_of_from(items).map_err(Error::custom) } } #[cfg(test)] mod tests { - use super::super::super::User; use super::*; + use crate::identified_vec_of::User; #[allow(clippy::upper_case_acronyms)] type SUT = IdentifiedVecOf; diff --git a/crates/sargon/src/core/types/collections/identified_vec_of/identified_vec_of_validation_import_export.rs b/crates/sargon/src/identified_vec_of/identified_vec_of_validation_import_export.rs similarity index 77% rename from crates/sargon/src/core/types/collections/identified_vec_of/identified_vec_of_validation_import_export.rs rename to crates/sargon/src/identified_vec_of/identified_vec_of_validation_import_export.rs index 195364a5e..8218ae8db 100644 --- a/crates/sargon/src/core/types/collections/identified_vec_of/identified_vec_of_validation_import_export.rs +++ b/crates/sargon/src/identified_vec_of/identified_vec_of_validation_import_export.rs @@ -25,12 +25,17 @@ where V: Debug + Eq + Clone + Identifiable + 'static, { if id_vec.is_empty() { - if TypeId::of::() == TypeId::of::() { - return Err(CommonError::FactorSourcesMustNotBeEmpty); - } if TypeId::of::() == TypeId::of::() { return Err(CommonError::SupportedCurvesMustNotBeEmpty); } + + // `FactorSource` is not declared in this crate, so we + // cannot use `TypeId`, but this should be good enough. + if std::any::type_name::().split("::").last().unwrap() + == "FactorSource" + { + return Err(CommonError::FactorSourcesMustNotBeEmpty); + } } Ok(id_vec) diff --git a/crates/sargon/src/core/types/collections/identified_vec_of/mod.rs b/crates/sargon/src/identified_vec_of/mod.rs similarity index 79% rename from crates/sargon/src/core/types/collections/identified_vec_of/mod.rs rename to crates/sargon/src/identified_vec_of/mod.rs index 810903277..98cea98e3 100644 --- a/crates/sargon/src/core/types/collections/identified_vec_of/mod.rs +++ b/crates/sargon/src/identified_vec_of/mod.rs @@ -1,3 +1,4 @@ +mod decl_identified_vec_of_with_samples; mod identifiable; mod identified_vec_of; mod identified_vec_of_display_debug; @@ -7,6 +8,10 @@ mod identified_vec_of_query; mod identified_vec_of_serde; mod identified_vec_of_validation_import_export; +#[cfg(test)] +mod user; + +pub use decl_identified_vec_of_with_samples::*; pub use identifiable::*; pub use identified_vec_of::*; pub use identified_vec_of_display_debug::*; @@ -15,3 +20,6 @@ pub use identified_vec_of_modify::*; pub use identified_vec_of_query::*; pub use identified_vec_of_serde::*; pub use identified_vec_of_validation_import_export::*; + +#[cfg(test)] +pub use user::*; diff --git a/crates/sargon/src/core/types/collections/user.rs b/crates/sargon/src/identified_vec_of/user.rs similarity index 100% rename from crates/sargon/src/core/types/collections/user.rs rename to crates/sargon/src/identified_vec_of/user.rs diff --git a/crates/sargon/src/keys_collector/collector/keys_collector_preprocessor.rs b/crates/sargon/src/keys_collector/collector/keys_collector_preprocessor.rs index 1e5817441..f2400837a 100644 --- a/crates/sargon/src/keys_collector/collector/keys_collector_preprocessor.rs +++ b/crates/sargon/src/keys_collector/collector/keys_collector_preprocessor.rs @@ -35,7 +35,7 @@ impl KeysCollectorPreprocessor { .map(|id| { all_factor_sources_in_profile.get(id).cloned().ok_or( CommonError::ProfileDoesNotContainFactorSourceWithID { - bad_value: (*id).into(), + bad_value: (*id).to_string(), }, ) }) diff --git a/crates/sargon/src/keys_collector/collector/keys_collector_state.rs b/crates/sargon/src/keys_collector/collector/keys_collector_state.rs index a320c6f66..eb51f914e 100644 --- a/crates/sargon/src/keys_collector/collector/keys_collector_state.rs +++ b/crates/sargon/src/keys_collector/collector/keys_collector_state.rs @@ -50,7 +50,7 @@ impl KeysCollectorState { .map(|x| x.clone_snapshot()) .inspect(|k| assert_eq!(k.factor_source_id, *factor_source_id)) .ok_or(CommonError::ProfileDoesNotContainFactorSourceWithID { - bad_value: (*factor_source_id).into(), + bad_value: (*factor_source_id).to_string(), }) } @@ -64,7 +64,7 @@ impl KeysCollectorState { let mut rings = self.keyrings.try_write().unwrap(); let keyring = rings.get_mut(&factor_source_id).ok_or( CommonError::ProfileDoesNotContainFactorSourceWithID { - bad_value: factor_source_id.into(), + bad_value: factor_source_id.to_string(), }, )?; keyring.process_response(factors) diff --git a/crates/sargon/src/lib.rs b/crates/sargon/src/lib.rs index 0a16014ed..99bae1b3b 100644 --- a/crates/sargon/src/lib.rs +++ b/crates/sargon/src/lib.rs @@ -1,19 +1,22 @@ +#![allow(unused_imports)] +#![allow(internal_features)] +#![allow(incomplete_features)] #![feature(async_closure)] #![feature(let_chains)] #![feature(core_intrinsics)] -#![allow(unused_imports)] -#![allow(internal_features)] #![feature(iter_repeat_n)] #![feature(future_join)] -#![allow(incomplete_features)] #![feature(generic_const_exprs)] #![feature(trait_upcasting)] +#![feature(trivial_bounds)] +#![allow(trivial_bounds)] -mod core; +mod error_from; mod factor_instances_provider; mod gateway_api; mod hierarchical_deterministic; mod home_cards; +mod identified_vec_of; mod keys_collector; mod profile; mod radix_connect; @@ -24,12 +27,14 @@ mod types; mod wrapped_radix_engine_toolkit; pub mod prelude { + pub use sargon_core::prelude::*; - pub use crate::core::*; + pub use crate::error_from::*; pub use crate::factor_instances_provider::*; pub use crate::gateway_api::*; pub use crate::hierarchical_deterministic::*; pub use crate::home_cards::*; + pub use crate::identified_vec_of::*; pub use crate::keys_collector::*; pub use crate::profile::*; pub use crate::radix_connect::*; @@ -38,48 +43,11 @@ pub mod prelude { pub use crate::system::*; pub use crate::types::*; pub use crate::wrapped_radix_engine_toolkit::*; - pub use radix_rust::prelude::{ - indexmap, BTreeSet, HashMap, HashSet, IndexMap, IndexSet, - }; - pub(crate) use std::marker::PhantomData; - pub(crate) use ::hex::decode as hex_decode; - pub(crate) use ::hex::encode as hex_encode; - pub(crate) use iso8601_timestamp::Timestamp; - pub(crate) use itertools::Itertools; - pub(crate) use log::{debug, error, info, trace, warn}; pub(crate) use once_cell::sync::Lazy; - pub(crate) use serde::{ - de, ser::SerializeStruct, Deserialize, Deserializer, Serialize, - Serializer, - }; - pub(crate) use serde_json::json; - pub(crate) use serde_repr::{Deserialize_repr, Serialize_repr}; - pub(crate) use serde_with::*; - pub(crate) use zeroize::{Zeroize, ZeroizeOnDrop}; - pub(crate) use derive_more::derive::{ - AsRef, Debug as MoreDebug, Deref, Display, - }; pub(crate) use futures::future::join_all; - pub use radix_common::math::traits::CheckedMul as ScryptoCheckedMul; - pub(crate) use std::cell::RefCell; - pub(crate) use std::cmp::Ordering; - pub(crate) use std::collections::BTreeMap; - pub(crate) use std::fmt::{Debug, Display, Formatter}; - pub(crate) use std::fs; - pub(crate) use std::hash::Hash as StdHash; - pub use std::ops::{Add, AddAssign, Deref, Div, Mul, Neg, Sub}; - pub(crate) use std::str::FromStr; - pub(crate) use std::sync::{Arc, RwLock}; - pub(crate) use strum::FromRepr; - pub(crate) use strum::IntoEnumIterator; - pub(crate) use url::Url; - pub(crate) use uuid::Uuid; - - pub(crate) use enum_as_inner::EnumAsInner; - pub(crate) use paste::*; pub(crate) use radix_engine::{ blueprints::consensus_manager::UnstakeData as ScryptoUnstakeData, system::system_modules::execution_trace::ResourceSpecifier as ScryptoResourceSpecifier, @@ -175,7 +143,6 @@ pub mod prelude { AccessRule as ScryptoAccessRule, BasicRequirement as ScryptoBasicRequirement, CompositeRequirement as ScryptoCompositeRequirement, - Epoch as ScryptoEpoch, FungibleResourceRoles as ScryptoFungibleResourceRoles, MetadataInit as ScryptoMetadataInit, MetadataValue as ScryptoMetadataValue, @@ -244,8 +211,6 @@ pub mod prelude { NotarySignatureV1 as ScryptoNotarySignature, PartialTransactionV2 as ScryptoPartialTransaction, PlaintextMessageV1 as ScryptoPlaintextMessage, - SignatureV1 as ScryptoSignature, - SignatureWithPublicKeyV1 as ScryptoSignatureWithPublicKey, SignedIntentV1 as ScryptoSignedIntent, SignedPartialTransactionV2 as ScryptoSignedPartialTransaction, SignedTransactionIntentHash as ScryptoSignedTransactionIntentHash, @@ -380,3 +345,26 @@ pub fn android_sign_hash_with_private_key_bytes( Ed25519PrivateKey::try_from(private_key_bytes.as_ref()) .map(|pk| pk.sign(hash)) } + +#[cfg(test)] +mod helper_tests { + use super::*; + + #[test] + fn test_android_notarize_hash_with_private_key_bytes() { + assert!(android_notarize_hash_with_private_key_bytes( + Exactly32Bytes::sample(), + &SignedTransactionIntentHash::sample() + ) + .is_ok()); + } + + #[test] + fn test_android_sign_hash_with_private_key_bytes() { + assert!(android_sign_hash_with_private_key_bytes( + Exactly32Bytes::sample(), + &Hash::sample() + ) + .is_ok()); + } +} diff --git a/crates/sargon/src/profile/encrypted/encryption/aes_gcm_256.rs b/crates/sargon/src/profile/encrypted/encryption/aes_gcm_256.rs index 53ecee4fb..b93253bc6 100644 --- a/crates/sargon/src/profile/encrypted/encryption/aes_gcm_256.rs +++ b/crates/sargon/src/profile/encrypted/encryption/aes_gcm_256.rs @@ -104,14 +104,14 @@ impl VersionedEncryption for AesGcm256 { } } -impl From for Key { - fn from(value: Exactly32Bytes) -> Self { - Self::from(*value.bytes()) - } -} +// impl From for Key { +// fn from(value: Exactly32Bytes) -> Self { +// Self::from(*value.bytes()) +// } +// } impl From for Key { fn from(value: EncryptionKey) -> Self { - Self::from(value.0) + Self::from(*value.0.bytes()) } } @@ -131,7 +131,9 @@ mod tests { nonce: Exactly12Bytes::sample(), cipher_text: hex_decode("deadbeef").unwrap(), }, - Exactly32Bytes::sample_aced().into(), + Key::::from( + *Exactly32Bytes::sample_aced().bytes() + ) ), Err(CommonError::AESDecryptionFailed) ) diff --git a/crates/sargon/src/profile/encrypted/mod.rs b/crates/sargon/src/profile/encrypted/mod.rs index 53de3ecc5..58604b39b 100644 --- a/crates/sargon/src/profile/encrypted/mod.rs +++ b/crates/sargon/src/profile/encrypted/mod.rs @@ -1,9 +1,11 @@ mod encryption; mod key_derivation; +mod pb_hkdf_sha256; mod version_of_algorithm; mod versioned_algorithm; pub use encryption::*; pub use key_derivation::*; +pub use pb_hkdf_sha256::*; pub use version_of_algorithm::*; pub use versioned_algorithm::*; diff --git a/crates/sargon/src/core/pb_hkdf_sha256.rs b/crates/sargon/src/profile/encrypted/pb_hkdf_sha256.rs similarity index 90% rename from crates/sargon/src/core/pb_hkdf_sha256.rs rename to crates/sargon/src/profile/encrypted/pb_hkdf_sha256.rs index 26962af09..4a79fd8d8 100644 --- a/crates/sargon/src/core/pb_hkdf_sha256.rs +++ b/crates/sargon/src/profile/encrypted/pb_hkdf_sha256.rs @@ -1,7 +1,11 @@ -use crate::prelude::*; - use hkdf::Hkdf; use k256::sha2::Sha256; +use sargon_core::Exactly32Bytes; + +use super::{ + PasswordBasedKeyDerivationSchemeVersion, VersionOfAlgorithm, + VersionedPasswordBasedKeyDerivation, +}; /// A simple `HKDF` based scheme using UTF8 encoding of the password as input. #[derive( diff --git a/crates/sargon/src/profile/logic/account/accounts_visibility.rs b/crates/sargon/src/profile/logic/account/accounts_visibility.rs index 156d69e17..a786ffd3f 100644 --- a/crates/sargon/src/profile/logic/account/accounts_visibility.rs +++ b/crates/sargon/src/profile/logic/account/accounts_visibility.rs @@ -1,14 +1,19 @@ use crate::prelude::*; -impl Accounts { - pub fn visible(&self) -> Self { +pub trait VisibleOrHidden { + fn visible(&self) -> Self; + fn hidden(&self) -> Self; +} + +impl VisibleOrHidden for Accounts { + fn visible(&self) -> Self { self.clone() .into_iter() .filter(|p| !p.is_hidden() && !p.is_tombstoned()) .collect() } - pub fn hidden(&self) -> Self { + fn hidden(&self) -> Self { self.clone() .into_iter() .filter(|p| p.is_hidden() && !p.is_tombstoned()) diff --git a/crates/sargon/src/profile/logic/gateway/current_gateway.rs b/crates/sargon/src/profile/logic/gateway/current_gateway.rs index 867c2e84d..6dad37b51 100644 --- a/crates/sargon/src/profile/logic/gateway/current_gateway.rs +++ b/crates/sargon/src/profile/logic/gateway/current_gateway.rs @@ -20,7 +20,7 @@ impl Profile { let current_network_id = self.current_network_id(); self.networks.get_id(current_network_id).ok_or( CommonError::NoNetworkInProfile { - network_id: current_network_id, + network_id: current_network_id.to_string(), }, ) } diff --git a/crates/sargon/src/profile/logic/persona/create_persona.rs b/crates/sargon/src/profile/logic/persona/create_persona.rs index 1192af9a2..666170dbd 100644 --- a/crates/sargon/src/profile/logic/persona/create_persona.rs +++ b/crates/sargon/src/profile/logic/persona/create_persona.rs @@ -65,6 +65,6 @@ impl Profile { key_derivation_interactor, get_name, ) - .await + .await.map(|(a, b, c, d)| (a, b.into_iter().collect(), c, d)) } } diff --git a/crates/sargon/src/profile/logic/persona/query_personas.rs b/crates/sargon/src/profile/logic/persona/query_personas.rs index c76ff1211..209c8d707 100644 --- a/crates/sargon/src/profile/logic/persona/query_personas.rs +++ b/crates/sargon/src/profile/logic/persona/query_personas.rs @@ -1,14 +1,19 @@ use crate::prelude::*; -impl Personas { - pub fn non_hidden(&self) -> Self { +pub trait PersonasVisibility { + fn non_hidden(&self) -> Self; + fn hidden(&self) -> Self; +} + +impl PersonasVisibility for Personas { + fn non_hidden(&self) -> Self { self.clone() .into_iter() .filter(|p| !p.is_hidden()) .collect() } - pub fn hidden(&self) -> Self { + fn hidden(&self) -> Self { self.clone().into_iter().filter(|p| p.is_hidden()).collect() } } diff --git a/crates/sargon/src/profile/logic/profile_network/profile_network_details.rs b/crates/sargon/src/profile/logic/profile_network/profile_network_details.rs index 1b7d3b8fe..1412e0a9d 100644 --- a/crates/sargon/src/profile/logic/profile_network/profile_network_details.rs +++ b/crates/sargon/src/profile/logic/profile_network/profile_network_details.rs @@ -17,7 +17,7 @@ impl AuthorizedPersonaSimple { // This is a sign that Profile is in a bad state somehow... warn!("Discrepancy! AuthorizedDapp references account which does not exist {}", account_address); return Err(CommonError::DiscrepancyAuthorizedDappReferencedAccountWhichDoesNotExist { - address: account_address.to_owned() + address: account_address.to_owned().to_string() }) }; Ok(AccountForDisplay::new( @@ -101,7 +101,7 @@ impl AuthorizedPersonaSimple { // This is a sign that Profile is in a bad state somehow... warn!("Discrepancy! AuthorizedDapp references persona which does not exist {}", self.identity_address); return Err(CommonError::DiscrepancyAuthorizedDappReferencedPersonaWhichDoesNotExist { - address: self.identity_address + address: self.identity_address.to_string() }); }; Ok(persona.clone()) @@ -173,8 +173,8 @@ mod tests { assert_eq!( sut.details_for_authorized_dapp(&AuthorizedDapp::sample_stokenet()), Err(CommonError::NetworkDiscrepancy { - expected: sut.network_id(), - actual: NetworkID::Stokenet + expected: sut.network_id().to_string(), + actual: NetworkID::Stokenet.to_string() }) ) } @@ -190,7 +190,7 @@ mod tests { assert_eq!( sut.details_for_authorized_dapp(&dapp), - Err(CommonError::DiscrepancyAuthorizedDappReferencedPersonaWhichDoesNotExist { address: persona_simple.identity_address }) + Err(CommonError::DiscrepancyAuthorizedDappReferencedPersonaWhichDoesNotExist { address: persona_simple.identity_address.to_string() }) ); } @@ -216,7 +216,7 @@ mod tests { assert_eq!( sut.details_for_authorized_dapp(&dapp), - Err(CommonError::DiscrepancyAuthorizedDappReferencedAccountWhichDoesNotExist { address: address_of_non_existing_account }) + Err(CommonError::DiscrepancyAuthorizedDappReferencedAccountWhichDoesNotExist { address: address_of_non_existing_account.to_string() }) ); } diff --git a/crates/sargon/src/profile/logic/query_factor_sources.rs b/crates/sargon/src/profile/logic/query_factor_sources.rs index 1c3342dc2..3bdf51960 100644 --- a/crates/sargon/src/profile/logic/query_factor_sources.rs +++ b/crates/sargon/src/profile/logic/query_factor_sources.rs @@ -13,13 +13,13 @@ impl Profile { self.factor_sources .get_id(id) .ok_or(CommonError::ProfileDoesNotContainFactorSourceWithID { - bad_value: id, + bad_value: id.to_string(), }) .and_then(|f| { f.clone().try_into().map_err(|_| { CommonError::CastFactorSourceWrongKind { - expected: ::kind(), - found: f.factor_source_kind(), + expected: ::kind().to_string(), + found: f.factor_source_kind().to_string(), } }) }) @@ -153,8 +153,8 @@ mod tests { dfs.factor_source_id() ), Err(CommonError::CastFactorSourceWrongKind { - expected: FactorSourceKind::LedgerHQHardwareWallet, - found: FactorSourceKind::Device, + expected: FactorSourceKind::LedgerHQHardwareWallet.to_string(), + found: FactorSourceKind::Device.to_string(), }) ); } @@ -168,7 +168,7 @@ mod tests { lfs.factor_source_id() ), Err(CommonError::ProfileDoesNotContainFactorSourceWithID { - bad_value: lfs.factor_source_id() + bad_value: lfs.factor_source_id().to_string() }) ); } @@ -194,7 +194,7 @@ mod tests { assert_eq!( profile.device_factor_source_by_id(&id), Err(CommonError::ProfileDoesNotContainFactorSourceWithID { - bad_value: id.into() + bad_value: id.to_string() }) ); } diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/keys_by_diffie_hellman_fold.rs b/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/keys_by_diffie_hellman_fold.rs index 84dd535c9..3367747c3 100644 --- a/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/keys_by_diffie_hellman_fold.rs +++ b/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/keys_by_diffie_hellman_fold.rs @@ -2,14 +2,14 @@ use crate::prelude::*; use crypto::keys::x25519::PublicKey as X25519PublicKey; use crypto::keys::x25519::SecretKey as X25519PrivateKey; -impl From for Exactly32Bytes { - fn from(value: X25519PublicKey) -> Exactly32Bytes { - Exactly32Bytes::from(&value.to_bytes()) - } -} +// impl From for Exactly32Bytes { +// fn from(value: X25519PublicKey) -> Exactly32Bytes { +// Exactly32Bytes::from(&value.to_bytes()) +// } +// } impl From for EncryptionKey { fn from(value: X25519PublicKey) -> EncryptionKey { - EncryptionKey::from(Exactly32Bytes::from(value)) + EncryptionKey(Exactly32Bytes::from(&value.to_bytes())) } } diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/keys_from_questions_and_answers_lower_trim_utf8.rs b/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/keys_from_questions_and_answers_lower_trim_utf8.rs index 2e3158f29..26bbb9d1d 100644 --- a/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/keys_from_questions_and_answers_lower_trim_utf8.rs +++ b/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/keys_from_questions_and_answers_lower_trim_utf8.rs @@ -9,11 +9,11 @@ use crypto::keys::x25519::SecretKey as X25519PrivateKey; use hkdf::Hkdf; use k256::sha2::Sha256; -impl From for X25519PrivateKey { - fn from(value: Exactly32Bytes) -> Self { - Self::from_bytes(*value.bytes()) - } -} +// impl From for X25519PrivateKey { +// fn from(value: Exactly32Bytes) -> Self { +// Self::from_bytes(*value.bytes()) +// } +// } /// ❗️ NOT PRODUCTION READY YET ❗️ /// A Key Derivation Scheme which lowercases, trims and ut8f encodes answers. @@ -106,7 +106,7 @@ impl SecurityQuestions_NOT_PRODUCTION_READY_KeyExchangeKeysFromQandAsLowerTrimUt let hkdf = Hkdf::::new(None, &ikm); let mut okm = [0u8; 32]; hkdf.expand(&info, &mut okm).unwrap(); - Ok(X25519PrivateKey::from(Exactly32Bytes::from(&okm))) + Ok(X25519PrivateKey::from_bytes(okm)) } diff --git a/crates/sargon/src/profile/mfa/security_structures/matrices/builder/matrix_template.rs b/crates/sargon/src/profile/mfa/security_structures/matrices/builder/matrix_template.rs index 8fe804f91..1376d8ca2 100644 --- a/crates/sargon/src/profile/mfa/security_structures/matrices/builder/matrix_template.rs +++ b/crates/sargon/src/profile/mfa/security_structures/matrices/builder/matrix_template.rs @@ -61,7 +61,7 @@ impl FactorSourceIdAssigner { self.map.insert(template.clone(), next); Ok(next) } else { - Err(CommonError::Unknown) + Err(CommonError::TooFewFactorInstancesDerived) } } } diff --git a/crates/sargon/src/profile/mfa/security_structures/matrices/matrix_of_factor_instances.rs b/crates/sargon/src/profile/mfa/security_structures/matrices/matrix_of_factor_instances.rs index dffcb1745..a2bf68d09 100644 --- a/crates/sargon/src/profile/mfa/security_structures/matrices/matrix_of_factor_instances.rs +++ b/crates/sargon/src/profile/mfa/security_structures/matrices/matrix_of_factor_instances.rs @@ -18,7 +18,7 @@ pub trait HasFactorInstances { self.entity_kind_of_all_factors()?; if entity_kind_of_entity != entity_kind_of_factor_instances { - return Err(CommonError::SecurityStructureOfFactorInstancesEntityDiscrepancyInEntityKind { entity_kind_of_entity, entity_kind_of_factor_instances }); + return Err(CommonError::SecurityStructureOfFactorInstancesEntityDiscrepancyInEntityKind { entity_kind_of_entity: entity_kind_of_entity.to_string(), entity_kind_of_factor_instances: entity_kind_of_factor_instances.to_string() }); } Ok(()) diff --git a/crates/sargon/src/profile/mfa/security_structures/security_shield_builder.rs b/crates/sargon/src/profile/mfa/security_structures/security_shield_builder.rs index d715dad69..fc230ae09 100644 --- a/crates/sargon/src/profile/mfa/security_structures/security_shield_builder.rs +++ b/crates/sargon/src/profile/mfa/security_structures/security_shield_builder.rs @@ -819,6 +819,7 @@ mod tests { assert_eq!(SUT::sample_other(), SUT::sample_other().clone()); } + #[test] fn default_is_lenient() { assert_eq!(SUT::default().mode, SecurityShieldBuilderMode::Lenient); } diff --git a/crates/sargon/src/profile/supporting_types/accounts_or_personas.rs b/crates/sargon/src/profile/supporting_types/accounts_or_personas.rs index a91b399a7..310da52ad 100644 --- a/crates/sargon/src/profile/supporting_types/accounts_or_personas.rs +++ b/crates/sargon/src/profile/supporting_types/accounts_or_personas.rs @@ -18,8 +18,13 @@ impl HasSampleValues for AccountsOrPersonas { } } -impl AccountsOrPersonas { - pub(crate) fn sample_mainnet() -> Self { +pub trait HasSampleValuesOnNetworks { + fn sample_mainnet() -> Self; + fn sample_stokenet() -> Self; +} + +impl HasSampleValuesOnNetworks for AccountsOrPersonas { + fn sample_mainnet() -> Self { Self::from_iter([ Account::sample_mainnet().into(), Persona::sample_mainnet().into(), @@ -30,7 +35,7 @@ impl AccountsOrPersonas { ]) } - pub(crate) fn sample_stokenet() -> Self { + fn sample_stokenet() -> Self { Self::from_iter([ Persona::sample_stokenet().into(), Account::sample_stokenet().into(), diff --git a/crates/sargon/src/profile/supporting_types/decl_identified_vec_of_with_samples.rs b/crates/sargon/src/profile/supporting_types/decl_identified_vec_of_with_samples.rs deleted file mode 100644 index bdc4435e1..000000000 --- a/crates/sargon/src/profile/supporting_types/decl_identified_vec_of_with_samples.rs +++ /dev/null @@ -1,50 +0,0 @@ -use crate::prelude::*; - -macro_rules! decl_identified_vec_of { - ( - $( - #[doc = $expr: expr] - )* - $collection_type: ident, - $element_type: ident - ) => { - paste! { - $( - #[doc = $expr] - )* - #[allow(non_camel_case_types)] - pub type $collection_type = IdentifiedVecOf<$element_type>; - - #[cfg(test)] - mod [< $collection_type:snake _tests >] { - use super::*; - - #[allow(clippy::upper_case_acronyms)] - type SUT = $collection_type; - - #[test] - fn test_ids() { - assert_eq!(SUT::sample().ids().into_iter().cloned().collect_vec(), SUT::sample().get_all().into_iter().map(|i| i.id()).collect_vec()); - } - } - } - }; - ( - $( - #[doc = $expr: expr] - )* - $element_type: ident - ) => { - paste! { - decl_identified_vec_of!( - $( - #[doc = $expr] - )* - [< $element_type s>], - $element_type - ); - } - }; -} - -pub(crate) use decl_identified_vec_of; diff --git a/crates/sargon/src/profile/supporting_types/is_network_aware.rs b/crates/sargon/src/profile/supporting_types/is_network_aware.rs index 7e1a9d9b6..aacfb3722 100644 --- a/crates/sargon/src/profile/supporting_types/is_network_aware.rs +++ b/crates/sargon/src/profile/supporting_types/is_network_aware.rs @@ -9,8 +9,8 @@ pub trait IsNetworkAware { let other = other.network_id(); if this != other { Err(CommonError::NetworkDiscrepancy { - expected: this, - actual: other, + expected: this.to_string(), + actual: other.to_string(), }) } else { Ok(()) diff --git a/crates/sargon/src/profile/supporting_types/mod.rs b/crates/sargon/src/profile/supporting_types/mod.rs index 192339c0f..96509e3a9 100644 --- a/crates/sargon/src/profile/supporting_types/mod.rs +++ b/crates/sargon/src/profile/supporting_types/mod.rs @@ -4,7 +4,6 @@ mod accounts_for_display; mod accounts_or_personas; mod authorized_dapp_detailed; mod authorized_persona_detailed; -mod decl_identified_vec_of_with_samples; mod detailed_authorized_personas; mod email_address; mod host_id; @@ -19,7 +18,6 @@ pub use accounts_for_display::*; pub use accounts_or_personas::*; pub use authorized_dapp_detailed::*; pub use authorized_persona_detailed::*; -pub use decl_identified_vec_of_with_samples::*; pub use detailed_authorized_personas::*; pub use email_address::*; pub use host_id::*; diff --git a/crates/sargon/src/profile/supporting_types/on_same_network_validating.rs b/crates/sargon/src/profile/supporting_types/on_same_network_validating.rs index ce68466a0..dc7b70880 100644 --- a/crates/sargon/src/profile/supporting_types/on_same_network_validating.rs +++ b/crates/sargon/src/profile/supporting_types/on_same_network_validating.rs @@ -36,8 +36,8 @@ impl> Ok(()) } else { Err(CommonError::NetworkDiscrepancy { - expected: network_id, - actual: e.network_id(), + expected: network_id.to_string(), + actual: e.network_id().to_string(), }) } })?; diff --git a/crates/sargon/src/profile/v100/address/non_fungible_local_id.rs b/crates/sargon/src/profile/v100/address/non_fungible_local_id.rs index a8b3f0268..c3afcc978 100644 --- a/crates/sargon/src/profile/v100/address/non_fungible_local_id.rs +++ b/crates/sargon/src/profile/v100/address/non_fungible_local_id.rs @@ -124,12 +124,6 @@ impl From for NonFungibleLocalId { } } -impl From for NonEmptyMax64Bytes { - fn from(value: ScryptoBytesNonFungibleLocalId) -> Self { - Self::try_from(value.value()).expect("Should not be possible, since ScryptoBytesNonFungibleLocalId have validated length") - } -} - impl From for NonFungibleLocalId { fn from(value: ScryptoNonFungibleLocalId) -> Self { match value { diff --git a/crates/sargon/src/profile/v100/address/wrap_ret_address.rs b/crates/sargon/src/profile/v100/address/wrap_ret_address.rs index c560973c2..5e30737c9 100644 --- a/crates/sargon/src/profile/v100/address/wrap_ret_address.rs +++ b/crates/sargon/src/profile/v100/address/wrap_ret_address.rs @@ -263,7 +263,7 @@ macro_rules! decl_ret_wrapped_address { [< Ret $address_type:camel Address >]::new(node_id.clone(), network_id.discriminant()) .map_err(|e| { error!("Failed create address, from node and network_id, RET error: {:?}", e); - CommonError::FailedToCreateAddressViaRetAddressFromNodeIdAndNetworkID { node_id_as_hex: node_id.to_hex(), network_id } + CommonError::FailedToCreateAddressViaRetAddressFromNodeIdAndNetworkID { node_id_as_hex: node_id.to_hex(), network_id: network_id.to_string() } }) .map(|i| [< $address_type:camel Address >]::from(i)) } @@ -298,7 +298,7 @@ mod tests { ::new(unknown_node_id, NetworkID::Mainnet), Err(CommonError::FailedToCreateAddressViaRetAddressFromNodeIdAndNetworkID { node_id_as_hex: "deffffffffffffffffffffffffffffffffffffffffffffffffffffffffff".to_owned(), - network_id: NetworkID::Mainnet, + network_id: NetworkID::Mainnet.to_string(), }) ); } diff --git a/crates/sargon/src/profile/v100/app_preferences/security.rs b/crates/sargon/src/profile/v100/app_preferences/security.rs index 7b527c5b3..6453571a2 100644 --- a/crates/sargon/src/profile/v100/app_preferences/security.rs +++ b/crates/sargon/src/profile/v100/app_preferences/security.rs @@ -1,3 +1,5 @@ +use sargon_core::decl_bool_type; + use crate::prelude::*; decl_identified_vec_of!( diff --git a/crates/sargon/src/profile/v100/entity/entity_flags.rs b/crates/sargon/src/profile/v100/entity/entity_flags.rs index d5c6c7fa5..9a9e3c721 100644 --- a/crates/sargon/src/profile/v100/entity/entity_flags.rs +++ b/crates/sargon/src/profile/v100/entity/entity_flags.rs @@ -15,18 +15,26 @@ impl Identifiable for EntityFlag { } } -impl EntityFlags { +pub trait FlagInserting { + fn insert_flag(&mut self, flag: EntityFlag) -> bool; +} +pub trait FlagRemoving { + fn remove_flag(&mut self, flag: &EntityFlag) -> Option; +} + +impl FlagInserting for EntityFlags { /// Adds a flag to the set of flags. /// /// Returns whether the flag was newly inserted. That is: /// /// If the set did not previously contain an equal flag, true is returned. /// If the set already contained an equal flag, false is returned, and the entry is not updated. - pub fn insert_flag(&mut self, flag: EntityFlag) -> bool { + fn insert_flag(&mut self, flag: EntityFlag) -> bool { self.append(flag).0 } - - pub fn remove_flag(&mut self, flag: &EntityFlag) -> Option { +} +impl FlagRemoving for EntityFlags { + fn remove_flag(&mut self, flag: &EntityFlag) -> Option { self.remove_id(&flag.id()) } } diff --git a/crates/sargon/src/profile/v100/factors/factor_source.rs b/crates/sargon/src/profile/v100/factors/factor_source.rs index 01b09a85c..3b25cf137 100644 --- a/crates/sargon/src/profile/v100/factors/factor_source.rs +++ b/crates/sargon/src/profile/v100/factors/factor_source.rs @@ -249,23 +249,54 @@ impl HasSampleValues for FactorSource { Self::sample_ledger() } } -impl FactorSources { - pub fn sample_values_all_with_filter( + +pub trait FactorSourcesWithExtraSampleValues: Sized { + fn sample_values_all_with_filter( + filter: impl Fn(&FactorSource) -> bool, + ) -> Self; + + fn sample_values_all() -> Self { + Self::sample_values_all_with_filter(|_| true) + } + + fn sample_values_all_hd() -> Self { + Self::sample_values_all_with_filter(|f| f.factor_source_id().is_hash()) + } +} + +impl FactorSourcesWithExtraSampleValues for FactorSources { + fn sample_values_all_with_filter( filter: impl Fn(&FactorSource) -> bool, ) -> Self { Self::from_iter( FactorSource::sample_values_all().into_iter().filter(filter), ) } - pub fn sample_values_all() -> Self { - Self::sample_values_all_with_filter(|_| true) - } - pub fn sample_values_all_hd() -> Self { - Self::sample_values_all_with_filter(|f| f.factor_source_id().is_hash()) - } } -impl FactorSource { - pub fn sample_values_all() -> Vec { + +pub trait FactorSourceWithExtraSampleValues: Sized { + fn sample_device() -> Self; + fn sample_device_babylon() -> Self; + fn sample_device_babylon_other() -> Self; + fn sample_device_olympia() -> Self; + fn sample_ledger() -> Self; + fn sample_ledger_other() -> Self; + fn sample_arculus() -> Self; + fn sample_arculus_other() -> Self; + fn sample_off_device() -> Self; + fn sample_off_device_other() -> Self; + fn sample_trusted_contact_frank() -> Self; + fn sample_trusted_contact_grace() -> Self; + fn sample_trusted_contact_judy() -> Self; + fn sample_trusted_contact_oscar() -> Self; + fn sample_trusted_contact_trudy() -> Self; + fn sample_trusted_contact_radix() -> Self; + fn sample_security_questions() -> Self; + fn sample_security_questions_other() -> Self; + fn sample_password() -> Self; + fn sample_password_other() -> Self; + + fn sample_values_all() -> Vec { vec![ Self::sample_device_babylon(), Self::sample_device_babylon_other(), @@ -288,75 +319,78 @@ impl FactorSource { Self::sample_password_other(), ] } - pub fn sample_device() -> Self { +} + +impl FactorSourceWithExtraSampleValues for FactorSource { + fn sample_device() -> Self { Self::sample_device_babylon() } - pub fn sample_device_babylon() -> Self { + fn sample_device_babylon() -> Self { Self::from(DeviceFactorSource::sample_babylon()) } - pub fn sample_device_babylon_other() -> Self { + fn sample_device_babylon_other() -> Self { Self::from(DeviceFactorSource::sample_babylon_other()) } - pub fn sample_device_olympia() -> Self { + fn sample_device_olympia() -> Self { Self::from(DeviceFactorSource::sample_olympia()) } - pub fn sample_ledger() -> Self { + fn sample_ledger() -> Self { Self::from(LedgerHardwareWalletFactorSource::sample()) } - pub fn sample_ledger_other() -> Self { + fn sample_ledger_other() -> Self { Self::from(LedgerHardwareWalletFactorSource::sample_other()) } - pub fn sample_arculus() -> Self { + fn sample_arculus() -> Self { Self::from(ArculusCardFactorSource::sample()) } - pub fn sample_arculus_other() -> Self { + fn sample_arculus_other() -> Self { Self::from(ArculusCardFactorSource::sample_other()) } - pub fn sample_off_device() -> Self { + fn sample_off_device() -> Self { Self::from(OffDeviceMnemonicFactorSource::sample()) } - pub fn sample_off_device_other() -> Self { + fn sample_off_device_other() -> Self { Self::from(OffDeviceMnemonicFactorSource::sample_other()) } - pub fn sample_trusted_contact_frank() -> Self { + fn sample_trusted_contact_frank() -> Self { Self::from(TrustedContactFactorSource::sample_frank()) } - pub fn sample_trusted_contact_grace() -> Self { + fn sample_trusted_contact_grace() -> Self { Self::from(TrustedContactFactorSource::sample_grace()) } - pub fn sample_trusted_contact_judy() -> Self { + fn sample_trusted_contact_judy() -> Self { Self::from(TrustedContactFactorSource::sample_judy()) } - pub fn sample_trusted_contact_oscar() -> Self { + fn sample_trusted_contact_oscar() -> Self { Self::from(TrustedContactFactorSource::sample_oscar()) } - pub fn sample_trusted_contact_trudy() -> Self { + fn sample_trusted_contact_trudy() -> Self { Self::from(TrustedContactFactorSource::sample_trudy()) } - pub fn sample_trusted_contact_radix() -> Self { + fn sample_trusted_contact_radix() -> Self { Self::from(TrustedContactFactorSource::sample_radix()) } - pub fn sample_security_questions() -> Self { + fn sample_security_questions() -> Self { Self::from(SecurityQuestions_NOT_PRODUCTION_READY_FactorSource::sample()) } - pub fn sample_security_questions_other() -> Self { + fn sample_security_questions_other() -> Self { Self::from( SecurityQuestions_NOT_PRODUCTION_READY_FactorSource::sample_other(), ) } - pub fn sample_password() -> Self { + fn sample_password() -> Self { Self::from(PasswordFactorSource::sample()) } - pub fn sample_password_other() -> Self { + fn sample_password_other() -> Self { Self::from(PasswordFactorSource::sample_other()) } } diff --git a/crates/sargon/src/profile/v100/factors/factor_source_crypto_parameters.rs b/crates/sargon/src/profile/v100/factors/factor_source_crypto_parameters.rs index a2ab1cc44..77a2bf6ee 100644 --- a/crates/sargon/src/profile/v100/factors/factor_source_crypto_parameters.rs +++ b/crates/sargon/src/profile/v100/factors/factor_source_crypto_parameters.rs @@ -7,6 +7,14 @@ decl_identified_vec_of!( SLIP10Curve ); +impl Identifiable for SLIP10Curve { + type ID = String; + + fn id(&self) -> Self::ID { + self.string() + } +} + /// Cryptographic parameters a certain FactorSource supports, e.g. which Elliptic Curves /// it supports and which Hierarchical Deterministic (HD) derivations schemes it supports, /// if any. @@ -120,6 +128,7 @@ impl HasSampleValues for SupportedCurves { ]) } } + #[cfg(test)] mod tests { use super::*; diff --git a/crates/sargon/src/profile/v100/factors/factor_sources/factor_sources.rs b/crates/sargon/src/profile/v100/factors/factor_sources/factor_sources.rs index 48bd5a700..2fad5edcc 100644 --- a/crates/sargon/src/profile/v100/factors/factor_sources/factor_sources.rs +++ b/crates/sargon/src/profile/v100/factors/factor_sources/factor_sources.rs @@ -6,10 +6,14 @@ decl_identified_vec_of!( FactorSource ); -impl FactorSources { +pub trait FactorSourcesWithBDFS { + fn with_bdfs(device_factor_source: DeviceFactorSource) -> Self; +} + +impl FactorSourcesWithBDFS for FactorSources { /// Panics if `device_factor_source` is not using Babylon crypto parameters /// AND marked "main". - pub fn with_bdfs(device_factor_source: DeviceFactorSource) -> Self { + fn with_bdfs(device_factor_source: DeviceFactorSource) -> Self { assert!(device_factor_source.is_main_bdfs()); Self::just(device_factor_source.into()) } @@ -30,6 +34,7 @@ impl HasSampleValues for FactorSources { ]) } } + #[cfg(test)] mod tests { diff --git a/crates/sargon/src/profile/v100/header/profile_id.rs b/crates/sargon/src/profile/v100/header/profile_id.rs index f5b890529..c67f7509d 100644 --- a/crates/sargon/src/profile/v100/header/profile_id.rs +++ b/crates/sargon/src/profile/v100/header/profile_id.rs @@ -1,5 +1,9 @@ use crate::prelude::*; +pub fn profile_id() -> ProfileID { + ProfileID(id()) +} + /// A stable and globally unique identifier of a Profile. #[derive( Serialize, diff --git a/crates/sargon/src/profile/v100/networks/network/accounts.rs b/crates/sargon/src/profile/v100/networks/network/accounts.rs index fa8c8e357..06f667e91 100644 --- a/crates/sargon/src/profile/v100/networks/network/accounts.rs +++ b/crates/sargon/src/profile/v100/networks/network/accounts.rs @@ -19,9 +19,9 @@ impl HasSampleValues for Accounts { } } -impl Accounts { +impl HasSampleValuesOnNetworks for Accounts { /// A sample used to facilitate unit tests. - pub fn sample_mainnet() -> Self { + fn sample_mainnet() -> Self { Self::from_iter([ Account::sample_mainnet(), Account::sample_mainnet_other(), @@ -29,7 +29,7 @@ impl Accounts { } /// A sample used to facilitate unit tests. - pub fn sample_stokenet() -> Self { + fn sample_stokenet() -> Self { Self::from_iter([ Account::sample_stokenet_nadia(), Account::sample_stokenet_olivia(), @@ -101,8 +101,8 @@ mod tests { ]) .assert_elements_not_empty_and_on_same_network(), Err(CommonError::NetworkDiscrepancy { - expected: NetworkID::Mainnet, - actual: NetworkID::Stokenet + expected: NetworkID::Mainnet.to_string(), + actual: NetworkID::Stokenet.to_string() }) ) } @@ -116,8 +116,8 @@ mod tests { ]) .assert_elements_not_empty_and_on_same_network(), Err(CommonError::NetworkDiscrepancy { - expected: NetworkID::Stokenet, - actual: NetworkID::Mainnet + expected: NetworkID::Stokenet.to_string(), + actual: NetworkID::Mainnet.to_string() }) ) } diff --git a/crates/sargon/src/profile/v100/networks/network/authorized_dapps.rs b/crates/sargon/src/profile/v100/networks/network/authorized_dapps.rs index af1ae8dd1..407423ec3 100644 --- a/crates/sargon/src/profile/v100/networks/network/authorized_dapps.rs +++ b/crates/sargon/src/profile/v100/networks/network/authorized_dapps.rs @@ -5,12 +5,13 @@ decl_identified_vec_of!( AuthorizedDapp ); -impl AuthorizedDapps { +pub(crate) trait ReferencedAccountRemoving { + fn remove_referenced_account(&mut self, account_address: &AccountAddress); +} + +impl ReferencedAccountRemoving for AuthorizedDapps { /// Remove referenced account from all the dApps - pub(crate) fn remove_referenced_account( - &mut self, - account_address: &AccountAddress, - ) { + fn remove_referenced_account(&mut self, account_address: &AccountAddress) { self.update_all_with(|dapp| { dapp.remove_referenced_account(account_address); }) @@ -29,9 +30,9 @@ impl HasSampleValues for AuthorizedDapps { } } -impl AuthorizedDapps { +impl HasSampleValuesOnNetworks for AuthorizedDapps { /// A sample used to facilitate unit tests. - pub fn sample_mainnet() -> Self { + fn sample_mainnet() -> Self { Self::from_iter([ AuthorizedDapp::sample_mainnet_dashboard(), AuthorizedDapp::sample_mainnet_gumballclub(), @@ -39,7 +40,7 @@ impl AuthorizedDapps { } /// A sample used to facilitate unit tests. - pub fn sample_stokenet() -> Self { + fn sample_stokenet() -> Self { Self::from_iter([ AuthorizedDapp::sample_stokenet_devconsole(), AuthorizedDapp::sample_stokenet_sandbox(), diff --git a/crates/sargon/src/profile/v100/networks/network/personas.rs b/crates/sargon/src/profile/v100/networks/network/personas.rs index 6db3eb890..1dc861cef 100644 --- a/crates/sargon/src/profile/v100/networks/network/personas.rs +++ b/crates/sargon/src/profile/v100/networks/network/personas.rs @@ -17,9 +17,9 @@ impl HasSampleValues for Personas { } } -impl Personas { +impl HasSampleValuesOnNetworks for Personas { /// A sample used to facilitate unit tests. - pub fn sample_mainnet() -> Self { + fn sample_mainnet() -> Self { Self::from_iter([ Persona::sample_mainnet_satoshi(), Persona::sample_mainnet_batman(), @@ -27,7 +27,7 @@ impl Personas { } /// A sample used to facilitate unit tests. - pub fn sample_stokenet() -> Self { + fn sample_stokenet() -> Self { Self::from_iter([ Persona::sample_stokenet_leia_skywalker(), Persona::sample_stokenet_hermione(), diff --git a/crates/sargon/src/profile/v100/networks/network/profile_network.rs b/crates/sargon/src/profile/v100/networks/network/profile_network.rs index d74b78523..dc0551206 100644 --- a/crates/sargon/src/profile/v100/networks/network/profile_network.rs +++ b/crates/sargon/src/profile/v100/networks/network/profile_network.rs @@ -81,14 +81,14 @@ impl ProfileNetwork { /// and same for `personas` and `authorized_dapps`. pub fn new( network_id: impl Into, - accounts: impl Into, - personas: impl Into, + accounts: impl IntoIterator, + personas: impl IntoIterator, authorized_dapps: impl Into, resource_preferences: impl Into, ) -> Self { let network_id = network_id.into(); - let accounts = accounts.into(); - let personas = personas.into(); + let accounts = accounts.into_iter().collect::(); + let personas = personas.into_iter().collect::(); let authorized_dapps = authorized_dapps.into(); let resource_preferences = resource_preferences.into(); assert!( @@ -146,7 +146,7 @@ impl ProfileNetwork { /// the rest i.e. Personas, AuthorizedDapps all being empty. pub fn new_with_accounts( network_id: impl Into, - accounts: impl Into, + accounts: impl IntoIterator, ) -> Self { Self::new( network_id, diff --git a/crates/sargon/src/profile/v100/networks/network/resource_preferences/resource_preferences.rs b/crates/sargon/src/profile/v100/networks/network/resource_preferences/resource_preferences.rs index a84440734..c1335d5f5 100644 --- a/crates/sargon/src/profile/v100/networks/network/resource_preferences/resource_preferences.rs +++ b/crates/sargon/src/profile/v100/networks/network/resource_preferences/resource_preferences.rs @@ -18,28 +18,34 @@ impl HasSampleValues for ResourcePreferences { } } -impl ResourcePreferences { - pub(crate) fn sample_mainnet() -> Self { +impl HasSampleValuesOnNetworks for ResourcePreferences { + fn sample_mainnet() -> Self { Self::from_iter([ ResourceAppPreference::sample_fungible_mainnet(), ResourceAppPreference::sample_non_fungible_mainnet(), ]) } - pub(crate) fn sample_stokenet() -> Self { + fn sample_stokenet() -> Self { Self::from_iter([ResourceAppPreference::sample_non_fungible_stokenet()]) } } -impl ResourcePreferences { - pub fn get_hidden_resources(&self) -> HiddenResources { +pub trait ResourceHiding { + fn get_hidden_resources(&self) -> HiddenResources; + fn hide_resource(&mut self, resource: ResourceIdentifier); + fn unhide_resource(&mut self, resource: ResourceIdentifier); +} + +impl ResourceHiding for ResourcePreferences { + fn get_hidden_resources(&self) -> HiddenResources { self.iter() .filter(|x| x.visibility == ResourceVisibility::Hidden) .map(|x| x.resource) .collect() } - pub fn hide_resource(&mut self, resource: ResourceIdentifier) { + fn hide_resource(&mut self, resource: ResourceIdentifier) { if !self.update_with(resource.id(), |x| { x.visibility = ResourceVisibility::Hidden }) { @@ -51,7 +57,7 @@ impl ResourcePreferences { } } - pub fn unhide_resource(&mut self, resource: ResourceIdentifier) { + fn unhide_resource(&mut self, resource: ResourceIdentifier) { if !self.update_with(resource.id(), |x| { x.visibility = ResourceVisibility::Visible }) { diff --git a/crates/sargon/src/profile/v100/networks/profile_networks.rs b/crates/sargon/src/profile/v100/networks/profile_networks.rs index 299ed5a8f..4faf846e1 100644 --- a/crates/sargon/src/profile/v100/networks/profile_networks.rs +++ b/crates/sargon/src/profile/v100/networks/profile_networks.rs @@ -7,20 +7,62 @@ decl_identified_vec_of!( ProfileNetwork ); -impl ProfileNetworks { - pub fn get_account(&self, address: &AccountAddress) -> Option { +pub trait EntityOnNetworkHandling { + fn get_account(&self, address: &AccountAddress) -> Option; + fn get_persona(&self, address: &IdentityAddress) -> Option; + fn update_entities( + &mut self, + updated_entities: IdentifiedVecOf, + ) -> Result<()>; + fn update_entities_erased( + &mut self, + updated_entities: IdentifiedVecOf, + ) -> Result<()>; + + fn update_account( + &mut self, + address: &AccountAddress, + mutate: F, + ) -> Option + where + F: FnMut(&mut Account); + + fn hide_account(&mut self, account_address: &AccountAddress) -> bool; + + fn tombstone_account(&mut self, account_address: &AccountAddress) -> bool; + + /// Tombstones the accounts + fn tombstone_accounts(&mut self, account_addresses: &Vec) { + for account_address in account_addresses { + self.tombstone_account(account_address); + } + } + + fn update_persona( + &mut self, + address: &IdentityAddress, + mutate: F, + ) -> Option + where + F: FnMut(&mut Persona); + + fn content_hint(&self) -> ContentHint; +} + +impl EntityOnNetworkHandling for ProfileNetworks { + fn get_account(&self, address: &AccountAddress) -> Option { self.get_id(address.network_id()) .and_then(|n| n.accounts.get_id(address)) .cloned() } - pub fn get_persona(&self, address: &IdentityAddress) -> Option { + fn get_persona(&self, address: &IdentityAddress) -> Option { self.get_id(address.network_id()) .and_then(|n| n.personas.get_id(address)) .cloned() } - pub fn update_entities( + fn update_entities( &mut self, updated_entities: IdentifiedVecOf, ) -> Result<()> { @@ -29,7 +71,7 @@ impl ProfileNetworks { ) } - pub fn update_entities_erased( + fn update_entities_erased( &mut self, updated_entities: IdentifiedVecOf, ) -> Result<()> { @@ -41,7 +83,7 @@ impl ProfileNetworks { } /// Returns a clone of the updated account if found, else None. - pub fn update_account( + fn update_account( &mut self, address: &AccountAddress, mut mutate: F, @@ -56,37 +98,21 @@ impl ProfileNetworks { } /// Hides the account associated with the `account_address` - pub(crate) fn hide_account( - &mut self, - account_address: &AccountAddress, - ) -> bool { + fn hide_account(&mut self, account_address: &AccountAddress) -> bool { self.update_with(account_address.network_id(), |n| { n.hide_account(account_address); }) } /// Tombstones the account associated with the `account_address` - pub(crate) fn tombstone_account( - &mut self, - account_address: &AccountAddress, - ) -> bool { + fn tombstone_account(&mut self, account_address: &AccountAddress) -> bool { self.update_with(account_address.network_id(), |n| { n.tombstone_account(account_address); }) } - /// Tombstones the accounts - pub(crate) fn tombstone_accounts( - &mut self, - account_addresses: &Vec, - ) { - for account_address in account_addresses { - self.tombstone_account(account_address); - } - } - /// Returns a clone of the updated persona if found, else None. - pub fn update_persona( + fn update_persona( &mut self, address: &IdentityAddress, mut mutate: F, @@ -99,10 +125,8 @@ impl ProfileNetworks { }); self.get_persona(address) } -} -impl ProfileNetworks { - pub fn content_hint(&self) -> ContentHint { + fn content_hint(&self) -> ContentHint { let number_of_accounts = self.iter().fold(0, |acc, x| acc + x.accounts.len()); let number_of_personas = diff --git a/crates/sargon/src/profile/v100/profile.rs b/crates/sargon/src/profile/v100/profile.rs index ff649081f..d241eba0e 100644 --- a/crates/sargon/src/profile/v100/profile.rs +++ b/crates/sargon/src/profile/v100/profile.rs @@ -225,8 +225,12 @@ impl Profile { } } -impl IdentifiedVecOf { - pub fn erased(&self) -> IdentifiedVecOf { +pub trait EntitiesErased { + fn erased(&self) -> IdentifiedVecOf; +} + +impl EntitiesErased for IdentifiedVecOf { + fn erased(&self) -> IdentifiedVecOf { self.items() .into_iter() .map(Into::::into) @@ -288,10 +292,9 @@ impl Profile { + Identifiable, >( &self, - entities: IdentifiedVecOf, + entities: impl IntoIterator, ) -> Result<()> { let entities = entities - .items() .into_iter() .map(Into::::into) .collect::>(); @@ -301,10 +304,9 @@ impl Profile { pub fn assert_new_factor_instances_not_already_used_erased( &self, - entities: IdentifiedVecOf, + entities: impl IntoIterator, ) -> Result<()> { let instances_of_new_entities = entities - .items() .into_iter() .map(|e| (e.clone(), e.unique_all_factor_instances())) .collect::>>(); @@ -486,8 +488,8 @@ impl Profile { .maybe_update_with(factor_source_id, |f| { S::try_from(f.clone()) .map_err(|_| CommonError::CastFactorSourceWrongKind { - expected: S::kind(), - found: f.factor_source_kind(), + expected: S::kind().to_string(), + found: f.factor_source_kind().to_string(), }) .and_then(|element| { mutate(element).map(|modified| modified.into()) @@ -609,7 +611,7 @@ mod tests { fn not_allowed_to_create_profile_with_empty_factor_source() { let _ = SUT::with( Header::sample(), - IdentifiedVecOf::new(), + FactorSources::new(), AppPreferences::sample(), ProfileNetworks::sample(), ); @@ -784,8 +786,8 @@ mod tests { } ), Err(CommonError::CastFactorSourceWrongKind { - expected: FactorSourceKind::LedgerHQHardwareWallet, - found: FactorSourceKind::Device + expected: FactorSourceKind::LedgerHQHardwareWallet.to_string(), + found: FactorSourceKind::Device.to_string() }) ); diff --git a/crates/sargon/src/radix_connect/mobile/client.rs b/crates/sargon/src/radix_connect/mobile/client.rs index 1780ac3f5..2ecc3241f 100644 --- a/crates/sargon/src/radix_connect/mobile/client.rs +++ b/crates/sargon/src/radix_connect/mobile/client.rs @@ -115,7 +115,9 @@ impl RadixConnectMobile { let is_in_flight_session = in_flight_session.is_some(); let session = existing_session.or(in_flight_session).ok_or( - CommonError::RadixConnectMobileSessionNotFound { session_id }, + CommonError::RadixConnectMobileSessionNotFound { + session_id: session_id.to_string(), + }, )?; let is_success_response = wallet_response.response.is_success(); @@ -205,7 +207,9 @@ impl RadixConnectMobile { async fn load_session(&self, session_id: SessionID) -> Result { let session_bytes = self.session_storage.load_session(session_id).await?.ok_or( - CommonError::RadixConnectMobileSessionNotFound { session_id }, + CommonError::RadixConnectMobileSessionNotFound { + session_id: session_id.to_string(), + }, )?; session_bytes.deserialize() } @@ -292,7 +296,7 @@ mod tests { Some(encoded_session.into()) }) .ok_or(CommonError::RadixConnectMobileSessionNotFound { - session_id, + session_id: session_id.to_string(), }) } } diff --git a/crates/sargon/src/radix_connect/mobile/relay_service/service.rs b/crates/sargon/src/radix_connect/mobile/relay_service/service.rs index 302a09541..00817560a 100644 --- a/crates/sargon/src/radix_connect/mobile/relay_service/service.rs +++ b/crates/sargon/src/radix_connect/mobile/relay_service/service.rs @@ -125,8 +125,10 @@ mod tests { #[actix_rt::test] async fn test_send_wallet_interaction_response() { - let mock_antenna = - MockNetworkingDriver::with_spy(200, (), |request, _| { + let mock_antenna = MockNetworkingDriver::with_spy( + 200, + BagOfBytes::new(), + |request, _| { // Prepare encryption keys let mut encryption_key = Session::sample().encryption_key; let mut decryption_key = encryption_key; @@ -188,7 +190,8 @@ mod tests { decoded_payload, wallet_to_dapp_interaction_response ) - }); + }, + ); let service = Service::new_with_networking_driver(Arc::new(mock_antenna)); diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/subintent.rs b/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/subintent.rs index b93e7bd08..b3b2e2c94 100644 --- a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/subintent.rs +++ b/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/subintent.rs @@ -1,3 +1,5 @@ +use sargon_core::decl_version_type; + use crate::prelude::*; decl_version_type!(Subintent); diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/transaction.rs b/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/transaction.rs index ad1134095..b090c0847 100644 --- a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/transaction.rs +++ b/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/transaction.rs @@ -1,4 +1,5 @@ use crate::prelude::*; +use sargon_core::decl_version_type; #[derive(Debug, Clone, Deserialize, Serialize, PartialEq)] pub struct DappToWalletInteractionTransactionItems { diff --git a/crates/sargon/src/security_center/support/backup_result.rs b/crates/sargon/src/security_center/support/backup_result.rs index 1ce0f3d72..856cf902c 100644 --- a/crates/sargon/src/security_center/support/backup_result.rs +++ b/crates/sargon/src/security_center/support/backup_result.rs @@ -1,3 +1,5 @@ +use sargon_core::decl_bool_type; + use crate::prelude::*; /// A struct that represents the result of a given backup. diff --git a/crates/sargon/src/signing/authentication/auth_intent.rs b/crates/sargon/src/signing/authentication/auth_intent.rs index eb112257b..626c4a943 100644 --- a/crates/sargon/src/signing/authentication/auth_intent.rs +++ b/crates/sargon/src/signing/authentication/auth_intent.rs @@ -35,8 +35,11 @@ impl AuthIntent { if metadata.network_id != metadata.dapp_definition_address.network_id() { return Err(CommonError::NetworkDiscrepancy { - expected: metadata.network_id, - actual: metadata.dapp_definition_address.network_id(), + expected: metadata.network_id.to_string(), + actual: metadata + .dapp_definition_address + .network_id() + .to_string(), }); } @@ -44,8 +47,8 @@ impl AuthIntent { for entity in &entities { if entity.network_id() != metadata.network_id { return Err(CommonError::NetworkDiscrepancy { - expected: metadata.network_id, - actual: entity.network_id(), + expected: metadata.network_id.to_string(), + actual: entity.network_id().to_string(), }); } } @@ -169,8 +172,8 @@ mod tests { vec![AddressOfAccountOrPersona::sample()] ), Err(CommonError::NetworkDiscrepancy { - expected: NetworkID::Mainnet, - actual: NetworkID::Stokenet, + expected: NetworkID::Mainnet.to_string(), + actual: NetworkID::Stokenet.to_string(), }) ) } @@ -188,8 +191,8 @@ mod tests { vec![AddressOfAccountOrPersona::sample_stokenet()] ), Err(CommonError::NetworkDiscrepancy { - expected: NetworkID::Mainnet, - actual: NetworkID::Stokenet, + expected: NetworkID::Mainnet.to_string(), + actual: NetworkID::Stokenet.to_string(), }) ) } diff --git a/crates/sargon/src/signing/signatures_outecome_types/petition_transaction_outcome.rs b/crates/sargon/src/signing/signatures_outecome_types/petition_transaction_outcome.rs index 55641eff1..7b81694ea 100644 --- a/crates/sargon/src/signing/signatures_outecome_types/petition_transaction_outcome.rs +++ b/crates/sargon/src/signing/signatures_outecome_types/petition_transaction_outcome.rs @@ -44,7 +44,7 @@ mod tests { #[test] #[should_panic( - expected = "Discprenacy! Mismatching intent hash found in a signature." + expected = "Discrepancy! Mismatching intent hash found in a signature." )] fn panic() { SUT::new( diff --git a/crates/sargon/src/system/clients/client/http_client/http_client.rs b/crates/sargon/src/system/clients/client/http_client/http_client.rs index 2bef6b05d..213284da0 100644 --- a/crates/sargon/src/system/clients/client/http_client/http_client.rs +++ b/crates/sargon/src/system/clients/client/http_client/http_client.rs @@ -89,7 +89,8 @@ mod tests { #[actix_rt::test] async fn execute_network_request_invalid_url() { - let mock_networking_driver = MockNetworkingDriver::new(200, ()); + let mock_networking_driver = + MockNetworkingDriver::new(200, BagOfBytes::new()); let base = "http://example.com"; let sut = SUT::with_gateway( Arc::new(mock_networking_driver), @@ -109,7 +110,7 @@ mod tests { async fn execute_network_request_bad_status_code() { let mock_networking_driver = MockNetworkingDriver::new( 404, // bad code - (), + BagOfBytes::new(), ); let sut = SUT::new(Arc::new(mock_networking_driver), NetworkID::Stokenet); @@ -141,8 +142,10 @@ mod tests { #[actix_rt::test] async fn spy_headers() { - let mock_networking_driver = - MockNetworkingDriver::with_spy(200, (), |request, _| { + let mock_networking_driver = MockNetworkingDriver::with_spy( + 200, + BagOfBytes::new(), + |request, _| { assert_eq!( request .headers @@ -160,7 +163,8 @@ mod tests { .map(|s| s.to_owned()) .collect::>() ) - }); + }, + ); let sut = SUT::new(Arc::new(mock_networking_driver), NetworkID::Stokenet); let req = sut.current_epoch(); diff --git a/crates/sargon/src/system/clients/client/secure_storage_client/secure_storage_client.rs b/crates/sargon/src/system/clients/client/secure_storage_client/secure_storage_client.rs index a1f01c550..52c423c73 100644 --- a/crates/sargon/src/system/clients/client/secure_storage_client/secure_storage_client.rs +++ b/crates/sargon/src/system/clients/client/secure_storage_client/secure_storage_client.rs @@ -187,7 +187,7 @@ impl SecureStorageClient { factor_source_id: *id, }, CommonError::UnableToLoadMnemonicFromSecureStorage { - bad_value: *id, + bad_value: id.to_string(), }, ) .await diff --git a/crates/sargon/src/system/sargon_os/sargon_os_accounts.rs b/crates/sargon/src/system/sargon_os/sargon_os_accounts.rs index 8a27e0656..4933161f7 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os_accounts.rs +++ b/crates/sargon/src/system/sargon_os/sargon_os_accounts.rs @@ -483,7 +483,9 @@ impl SargonOS { InstancesInCacheConsumer, FactorInstancesProviderOutcomeForFactor, )> { - self.batch_create_unsaved_entities_with_factor_source_with_derivation_outcome(factor_source, network_id, count, name_prefix).await + self.batch_create_unsaved_entities_with_factor_source_with_derivation_outcome(factor_source, network_id, count, name_prefix) + .await + .map(|(a, b, c)| (a.into_iter().collect(), b, c)) } pub async fn batch_create_unsaved_entities_with_factor_source_with_derivation_outcome< @@ -609,7 +611,7 @@ impl SargonOS { pub async fn update_entities( &self, - updated: IdentifiedVecOf, + updated: impl IntoIterator, ) -> Result<()> { self.update_entities_erased( updated.into_iter().map(Into::into).collect(), @@ -702,8 +704,16 @@ impl SargonOS { } } -impl IdentifiedVecOf { - pub fn to_accounts(self) -> Result { +pub trait ToEntityConverting { + fn to_accounts(self) -> Result; + fn to_personas(self) -> Result; +} + +impl ToEntityConverting for T +where + T: IntoIterator, +{ + fn to_accounts(self) -> Result { self.into_iter() .map(|e| { Account::try_from(Into::::into(e.clone())) @@ -714,7 +724,7 @@ impl IdentifiedVecOf { .collect::>() } - pub fn to_personas(self) -> Result { + fn to_personas(self) -> Result { self.into_iter() .map(|e| { Persona::try_from(Into::::into(e.clone())) @@ -740,8 +750,9 @@ impl SargonOS { /// of the active profile to secure storage. pub async fn add_entities( &self, - entities: IdentifiedVecOf, + entities: impl IntoIterator, ) -> Result<()> { + let entities = entities.into_iter().collect_vec(); if entities.is_empty() { warn!("Tried to add empty entities..."); return Ok(()); diff --git a/crates/sargon/src/system/sargon_os/sargon_os_sync_accounts.rs b/crates/sargon/src/system/sargon_os/sargon_os_sync_accounts.rs index 843a19cbc..b23fdc66c 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os_sync_accounts.rs +++ b/crates/sargon/src/system/sargon_os/sargon_os_sync_accounts.rs @@ -108,7 +108,7 @@ mod tests { // Assert first that accounts in profile are active assert_eq!( os.accounts_on_current_network().unwrap(), - Accounts::from_iter(all_initial_accounts) + Accounts::from_iter(all_initial_accounts.clone()) ); let result = os.sync_accounts_deleted_on_ledger().await.unwrap(); diff --git a/crates/sargon/src/system/sargon_os/transactions/sargon_os_transaction_analysis.rs b/crates/sargon/src/system/sargon_os/transactions/sargon_os_transaction_analysis.rs index 4dc91df0b..1aa110f97 100644 --- a/crates/sargon/src/system/sargon_os/transactions/sargon_os_transaction_analysis.rs +++ b/crates/sargon/src/system/sargon_os/transactions/sargon_os_transaction_analysis.rs @@ -196,7 +196,7 @@ impl SargonOS { && !are_instructions_originating_from_host { return Err(CommonError::ReservedManifestClass { - class: reserved_manifest_class.kind().clone(), + class: reserved_manifest_class.kind().to_string(), }); } @@ -683,7 +683,7 @@ mod transaction_preview_analysis_tests { [], [], FeeLocks::default(), - FeeSummary::new("0", "0", "0", 0,), + FeeSummary::new(0, 0, 0, 0,), NewEntities::default() ) }) @@ -855,7 +855,7 @@ mod transaction_preview_analysis_tests { [], [DetailedManifestClass::General], FeeLocks::default(), - FeeSummary::new("0", "0", "0", 0,), + FeeSummary::new(0, 0, 0, 0,), NewEntities::default() ) }) diff --git a/crates/sargon/src/system/sargon_os/transactions/sargon_os_transaction_submit.rs b/crates/sargon/src/system/sargon_os/transactions/sargon_os_transaction_submit.rs index b762d4407..a4bca82da 100644 --- a/crates/sargon/src/system/sargon_os/transactions/sargon_os_transaction_submit.rs +++ b/crates/sargon/src/system/sargon_os/transactions/sargon_os_transaction_submit.rs @@ -43,7 +43,7 @@ mod tests { ); let sent_body = serde_json::to_vec(&sent_request).unwrap(); - assert_eq!(request.body.bytes, sent_body); + assert_eq!(request.body.to_vec(), sent_body); }); let req = SUT::boot_test_with_networking_driver(Arc::new(mock_driver)); diff --git a/crates/sargon/src/system/sargon_os/transactions/support/pre_auth_to_review.rs b/crates/sargon/src/system/sargon_os/transactions/support/pre_auth_to_review.rs index 2b11a352f..2ddc80e6a 100644 --- a/crates/sargon/src/system/sargon_os/transactions/support/pre_auth_to_review.rs +++ b/crates/sargon/src/system/sargon_os/transactions/support/pre_auth_to_review.rs @@ -74,7 +74,6 @@ impl HasSampleValues for PreAuthEnclosedManifest { #[cfg(test)] mod tests { use super::*; - use crate::prelude::*; #[allow(clippy::upper_case_acronyms)] type SUT = PreAuthToReview; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/manifests_access_controller.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/manifests_access_controller.rs index ce39dcf24..54a0dee25 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/manifests_access_controller.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/manifests_access_controller.rs @@ -211,7 +211,7 @@ mod tests { Account::sample_other(), SecurityStructureOfFactorInstances::sample_other(), ); - assert_eq!(manifest, Err(CommonError::SecurityStructureOfFactorInstancesEntityDiscrepancyInEntityKind { entity_kind_of_entity: CAP26EntityKind::Account, entity_kind_of_factor_instances: CAP26EntityKind::Identity })); + assert_eq!(manifest, Err(CommonError::SecurityStructureOfFactorInstancesEntityDiscrepancyInEntityKind { entity_kind_of_entity: CAP26EntityKind::Account.to_string(), entity_kind_of_factor_instances: CAP26EntityKind::Identity.to_string() })); } #[test] @@ -220,6 +220,6 @@ mod tests { Persona::sample_other(), SecurityStructureOfFactorInstances::sample(), ); - assert_eq!(manifest, Err(CommonError::SecurityStructureOfFactorInstancesEntityDiscrepancyInEntityKind { entity_kind_of_entity: CAP26EntityKind::Identity, entity_kind_of_factor_instances: CAP26EntityKind::Account })); + assert_eq!(manifest, Err(CommonError::SecurityStructureOfFactorInstancesEntityDiscrepancyInEntityKind { entity_kind_of_entity: CAP26EntityKind::Identity.to_string(), entity_kind_of_factor_instances: CAP26EntityKind::Account.to_string() })); } } diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/manifest_encountered_component_address.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/manifest_encountered_component_address.rs index 019393ea6..558ac059d 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/manifest_encountered_component_address.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/manifest_encountered_component_address.rs @@ -22,7 +22,7 @@ macro_rules! impl_try_from_for_manifest_encountered_address { Err(CommonError::FailedToCreateAddressFromGlobalAddressAndNetworkID { global_address_as_hex: global_address.to_hex(), - network_id, + network_id: network_id.to_string(), }) } } @@ -66,7 +66,7 @@ mod tests { result.unwrap_err(), CommonError::FailedToCreateAddressFromGlobalAddressAndNetworkID { global_address_as_hex: global_address.to_hex(), - network_id, + network_id: network_id.to_string(), } ); } diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction_guarantee.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction_guarantee.rs index 7a56b720d..32397acae 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction_guarantee.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction_guarantee.rs @@ -79,13 +79,13 @@ mod tests { #[test] fn rounding() { let sut = SUT::new( - "0.12344", + "0.12344".parse::().unwrap(), 90, 2, ResourceAddress::sample_mainnet_candy(), 4, ); - assert_eq!(sut.rounded_amount(), "0.1234".into()); + assert_eq!(sut.rounded_amount(), "0.1234".parse().unwrap()); } } diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/is_intent_signing.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/is_intent_signing.rs new file mode 100644 index 000000000..e6e91ae36 --- /dev/null +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/is_intent_signing.rs @@ -0,0 +1,125 @@ +use crate::prelude::*; + +pub trait BaseIsTransactionIntentHashSigning { + fn sign_transaction_intent_hash( + &self, + transaction_intent_hash: &TransactionIntentHash, + ) -> IntentSignature; +} + +pub trait BaseHashNotarizing { + fn notarize_hash( + &self, + signed_transaction_intent_hash: &SignedTransactionIntentHash, + ) -> NotarySignature; +} + +pub trait IsTransactionIntentHashSigning +where + (P, S): Into, +{ + fn sign_transaction_intent_hash( + &self, + transaction_intent_hash: &TransactionIntentHash, + ) -> IntentSignature; +} + +impl BaseHashNotarizing for PrivateKey { + fn notarize_hash( + &self, + signed_transaction_intent_hash: &SignedTransactionIntentHash, + ) -> NotarySignature { + self.sign(&signed_transaction_intent_hash.hash).into() + } +} + +impl BaseIsTransactionIntentHashSigning for PrivateKey { + fn sign_transaction_intent_hash( + &self, + transaction_intent_hash: &TransactionIntentHash, + ) -> IntentSignature { + match self { + PrivateKey::Ed25519(key) => SignatureWithPublicKey::Ed25519 { + public_key: key.public_key(), + signature: key.sign(&transaction_intent_hash.hash), + }, + PrivateKey::Secp256k1(key) => SignatureWithPublicKey::Secp256k1 { + public_key: key.public_key(), + signature: key.sign(&transaction_intent_hash.hash), + }, + } + .into() + } +} + +impl IsTransactionIntentHashSigning for T +where + T: IsPrivateKey

, + P: IsPublicKey, + (P, T::Signature): Into, +{ + fn sign_transaction_intent_hash( + &self, + transaction_intent_hash: &TransactionIntentHash, + ) -> IntentSignature { + let public_key: P = self.public_key(); + let signature = self.sign(&transaction_intent_hash.hash); + let tuple: SignatureWithPublicKey = (public_key, signature).into(); + tuple.into() + } +} + +pub trait IsSubIntentHashSigning>: + IsPrivateKey

+{ + fn sign_subintent_hash( + &self, + subintent_hash: &SubintentHash, + ) -> IntentSignature + where + (P, Self::Signature): Into; +} +impl IsSubIntentHashSigning

for T +where + T: IsPrivateKey

, + P: IsPublicKey, +{ + fn sign_subintent_hash( + &self, + subintent_hash: &SubintentHash, + ) -> IntentSignature + where + (P, Self::Signature): Into, + { + let public_key: P = self.public_key(); + let signature = self.sign(&subintent_hash.hash); + let tuple: SignatureWithPublicKey = (public_key, signature).into(); + tuple.into() + } +} + +pub trait IsNotaryHashSigning>: + IsPrivateKey

+{ + fn notarize_hash( + &self, + signed_transaction_intent_hash: &SignedTransactionIntentHash, + ) -> NotarySignature + where + Self::Signature: Into; +} +impl IsNotaryHashSigning

for T +where + T: IsPrivateKey

, + P: IsPublicKey, +{ + fn notarize_hash( + &self, + signed_transaction_intent_hash: &SignedTransactionIntentHash, + ) -> NotarySignature + where + Self::Signature: Into, + { + self.sign(&signed_transaction_intent_hash.hash).into() + } +} diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/manifest_summary.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/manifest_summary.rs index d0302a055..310b0660d 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/manifest_summary.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/manifest_summary.rs @@ -187,16 +187,6 @@ impl From<(RetStaticAnalysisWithResourceMovements, NetworkID)> } } -impl HasSampleValues for RetManifestClass { - fn sample() -> Self { - RetManifestClass::GeneralSubintent - } - - fn sample_other() -> Self { - RetManifestClass::Transfer - } -} - impl HasSampleValues for ManifestSummary { fn sample() -> Self { Self { @@ -209,7 +199,7 @@ impl HasSampleValues for ManifestSummary { addresses_of_accounts_requiring_auth: Vec::<_>::sample(), addresses_of_personas_requiring_auth: Vec::<_>::sample(), reserved_instructions: Vec::<_>::sample(), - classification: IndexSet::<_>::sample(), + classification: IndexSet::just(RetManifestClass::GeneralSubintent), } } @@ -224,7 +214,7 @@ impl HasSampleValues for ManifestSummary { addresses_of_accounts_requiring_auth: Vec::<_>::sample_other(), addresses_of_personas_requiring_auth: Vec::<_>::sample_other(), reserved_instructions: Vec::<_>::sample_other(), - classification: IndexSet::<_>::sample_other(), + classification: IndexSet::just(RetManifestClass::Transfer), } } } diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/signed_intent.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/signed_intent.rs index 246ce20d5..5989cfb56 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/signed_intent.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/signed_intent.rs @@ -176,7 +176,6 @@ impl SignedIntent { mod tests { use super::*; - use crate::prelude::*; #[allow(clippy::upper_case_acronyms)] type SUT = SignedIntent; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/intent_hash.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/intent_hash.rs index baf54d50f..e5b8cafed 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/intent_hash.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/intent_hash.rs @@ -15,7 +15,6 @@ impl HasSampleValues for TransactionIntentHash { mod tests { use super::*; - use crate::prelude::*; #[allow(clippy::upper_case_acronyms)] type SUT = TransactionIntentHash; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/subintent_hash.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/subintent_hash.rs index bcf81dcb6..6938aee9d 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/subintent_hash.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/subintent_hash.rs @@ -14,7 +14,6 @@ impl HasSampleValues for SubintentHash { mod tests { use super::*; - use crate::prelude::*; #[allow(clippy::upper_case_acronyms)] type SUT = SubintentHash; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/message/plaintext_message/plaintext_message.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/message/plaintext_message/plaintext_message.rs index d7c198afa..159e2c2b1 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/message/plaintext_message/plaintext_message.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/message/plaintext_message/plaintext_message.rs @@ -67,7 +67,6 @@ impl PlaintextMessage { mod tests { use super::*; - use crate::prelude::*; #[allow(clippy::upper_case_acronyms)] type SUT = PlaintextMessage; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/message/plaintext_message/plaintext_message_contents.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/message/plaintext_message/plaintext_message_contents.rs index d2e2ca710..abdb1c681 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/message/plaintext_message/plaintext_message_contents.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/message/plaintext_message/plaintext_message_contents.rs @@ -64,7 +64,6 @@ impl HasSampleValues for MessageContents { mod tests { use super::*; - use crate::prelude::*; #[allow(clippy::upper_case_acronyms)] type SUT = MessageContents; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/execution_summary/transaction_manifest_execution_summary.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/execution_summary/transaction_manifest_execution_summary.rs index 16bc6e734..8bdbf8236 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/execution_summary/transaction_manifest_execution_summary.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/execution_summary/transaction_manifest_execution_summary.rs @@ -90,11 +90,11 @@ mod tests { vec![ ResourceIndicator::fungible( "resource_tdx_2_1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxtfd2jc", - FungibleResourceIndicator::guaranteed("10") + FungibleResourceIndicator::guaranteed(10) ), ResourceIndicator::fungible( "resource_tdx_2_1t4nnqzrdympy0n74yhvkp7vnver90j5yurlhqu3083z8mt2gdvu7sq", - FungibleResourceIndicator::guaranteed("5") + FungibleResourceIndicator::guaranteed(5) ), ResourceIndicator::non_fungible( "resource_tdx_2_1n2uml563pnl0yjmd57xnj80mzdwyh4ca4w29zt2ljwpwq2p837c4a7", @@ -117,7 +117,7 @@ mod tests { vec![ ResourceIndicator::fungible( "resource_tdx_2_1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxtfd2jc", - FungibleResourceIndicator::guaranteed("10") + FungibleResourceIndicator::guaranteed(10) ), ResourceIndicator::non_fungible( "resource_tdx_2_1n2uml563pnl0yjmd57xnj80mzdwyh4ca4w29zt2ljwpwq2p837c4a7", @@ -157,9 +157,9 @@ mod tests { ], FeeLocks::default(), FeeSummary::new( - "0.37765305", - "0.10476895", - "0.3614425597", + "0.37765305".parse::().unwrap(), + "0.10476895".parse::().unwrap(), + "0.3614425597".parse::().unwrap(), 0, ), NewEntities::default() @@ -223,9 +223,9 @@ mod tests { ], FeeLocks::default(), FeeSummary::new( - "0.07638415", - "0.0105008", - "0.03871917658", + "0.07638415".parse::().unwrap(), + "0.0105008".parse::().unwrap(), + "0.03871917658".parse::().unwrap(), 0 ), NewEntities::default() @@ -275,7 +275,12 @@ mod tests { [], // encountered_component_addresses [DetailedManifestClass::General], FeeLocks::default(), - FeeSummary::new("0.1585925", "0.1210119", "0.26540755769", 0,), + FeeSummary::new( + "0.1585925".parse::().unwrap(), + "0.1210119".parse::().unwrap(), + "0.26540755769".parse::().unwrap(), + 0, + ), NewEntities::new([( token_address, NewlyCreatedResource::empty() @@ -359,9 +364,9 @@ mod tests { ], FeeLocks::default(), FeeSummary::new( - "0.18451315", - "0.40604035", - "0.96845625165", + "0.18451315".parse::().unwrap(), + "0.40604035".parse::().unwrap(), + "0.96845625165".parse::().unwrap(), 0, ), NewEntities::new([ @@ -434,9 +439,9 @@ mod tests { ], FeeLocks::default(), FeeSummary::new( - "0.3737913", - "0.0467599", - "0.14677047477", + "0.3737913".parse::().unwrap(), + "0.0467599".parse::().unwrap(), + "0.14677047477".parse::().unwrap(), 0, ), NewEntities::default() @@ -492,9 +497,9 @@ mod tests { ], FeeLocks::default(), FeeSummary::new( - "0.4943021", - "0.0467589", - "0.13551711803", + "0.4943021".parse::().unwrap(), + "0.0467589".parse::().unwrap(), + "0.13551711803".parse::().unwrap(), 0, ), NewEntities::default() @@ -534,7 +539,7 @@ mod tests { [], // encountered_component_addresses [DetailedManifestClass::General], FeeLocks::default(), - FeeSummary::new("0.15184175", "0.1607719", "0.33388137243", 0,), + FeeSummary::new("0.15184175".parse::().unwrap(), "0.1607719".parse::().unwrap(), "0.33388137243".parse::().unwrap(), 0,), NewEntities::new([ (ResourceAddress::try_from_bech32("resource_tdx_2_1tkrg7uwrc9sw3tkckuxwu65euwppxa00f7aqtx5ujd0aa22gej6nm7").unwrap(), NewlyCreatedResource::default()) ]) @@ -593,7 +598,12 @@ mod tests { pool_contributions: vec![] }], FeeLocks::new(0.36962, 0), - FeeSummary::new("0.1493972", "0.01125345", "0.0782012926", 0,), + FeeSummary::new( + "0.1493972".parse::().unwrap(), + "0.01125345".parse::().unwrap(), + "0.0782012926".parse::().unwrap(), + 0, + ), NewEntities::default() ) ); @@ -622,13 +632,13 @@ mod tests { let acc_gk: AccountAddress = "account_tdx_2_129uv9r46an4hwng8wc97qwpraspvnrc7v2farne4lr6ff7yaevaz2a".parse().unwrap(); let validator_0: ValidatorAddress = "validator_tdx_2_1sdtnujyn3720ymg8lakydkvc5tw4q3zecdj95akdwt9de362mvtd94".parse().unwrap(); - let validator_0_resource_address_of_stake: ResourceAddress = "resource_tdx_2_1t45l9ku3r5mwxazht2qutmhhk3660hqqvxkkyl8rxs20n9k2zv0w7t".parse().unwrap(); + let validator_0_resource_address_of_stake: ResourceAddress = "resource_tdx_2_1t45l9ku3r5mwxazht2qutmhhk3660hqqvxkkyl8rxs20n9k2zv0w7t".parse::<_>().unwrap(); let validator_1: ValidatorAddress = "validator_tdx_2_1sdlkptcwjpajqawnuya8r2mgl3eqt89hw27ww6du8kxmx3thmyu8l4".parse().unwrap(); - let validator_1_resource_address_of_stake: ResourceAddress = "resource_tdx_2_1t5hpjckz9tm63gqvxsl60ejhzvnlguly77tltvywnj06s2x9wjdxjn".parse().unwrap(); + let validator_1_resource_address_of_stake: ResourceAddress = "resource_tdx_2_1t5hpjckz9tm63gqvxsl60ejhzvnlguly77tltvywnj06s2x9wjdxjn".parse::<_>().unwrap(); let validator_2: ValidatorAddress = "validator_tdx_2_1svr6rmtd9ts5zx8d3euwmmp6mmjdtcj2q7zlmd8xjrn4qx7q5snkas".parse().unwrap(); - let validator_2_resource_address_of_stake: ResourceAddress = "resource_tdx_2_1t48zl3qmcv3pf24r0765q4zc6rrk83cfjv6wza2xksej80pcfd7p5g".parse().unwrap(); + let validator_2_resource_address_of_stake: ResourceAddress = "resource_tdx_2_1t48zl3qmcv3pf24r0765q4zc6rrk83cfjv6wza2xksej80pcfd7p5g".parse::<_>().unwrap(); pretty_assertions::assert_eq!( sut, @@ -672,7 +682,12 @@ mod tests { validator_stakes: vec![] }], FeeLocks::default(), - FeeSummary::new("0.3527215", "0.1150347", "0.32796859177", 0,), + FeeSummary::new( + "0.3527215".parse::().unwrap(), + "0.1150347".parse::().unwrap(), + "0.32796859177".parse::().unwrap(), + 0, + ), NewEntities::default() ) ); @@ -729,7 +744,7 @@ mod tests { )] }], FeeLocks::default(), - FeeSummary::new("0.26154965", "0.0325088", "0.12760162134", 0,), + FeeSummary::new("0.26154965".parse::().unwrap(), "0.0325088".parse::().unwrap(), "0.12760162134".parse::().unwrap(), 0,), NewEntities::default() ) ); @@ -806,9 +821,9 @@ mod tests { ], FeeLocks::default(), FeeSummary::new( - "0.2848875", - "0.06251535", - "0.16927718825", + "0.2848875".parse::().unwrap(), + "0.06251535".parse::().unwrap(), + "0.16927718825".parse::().unwrap(), 0, ), NewEntities::default() @@ -882,9 +897,9 @@ mod tests { ], FeeLocks::default(), FeeSummary::new( - "0.2383276", - "0.041757", - "0.11224746511", + "0.2383276".parse::().unwrap(), + "0.041757".parse::().unwrap(), + "0.11224746511".parse::().unwrap(), 0, ), NewEntities::default() @@ -946,7 +961,7 @@ mod tests { ["locker_tdx_2_1dr6v4fwufgacxqwxsm44ysglhdv7yyxgvq6xazcwzvu35937wzsjnx".parse::().unwrap()], [DetailedManifestClass::General], FeeLocks::default(), - FeeSummary::new("0.2516311", "0.03200635", "0.12903213279", 0,), + FeeSummary::new("0.2516311".parse::().unwrap(), "0.03200635".parse::().unwrap(), "0.12903213279".parse::().unwrap(), 0,), NewEntities::default() ) ); @@ -1007,7 +1022,12 @@ mod tests { account_addresses: vec![acc], }], FeeLocks::default(), - FeeSummary::new("0.21017315", "0.04175875", "0.1564025852", 0), + FeeSummary::new( + "0.21017315".parse::().unwrap(), + "0.04175875".parse::().unwrap(), + "0.1564025852".parse::().unwrap(), + 0, + ), NewEntities::default(), ); diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/instructions/instructions.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/instructions/instructions.rs index 231ba1d59..94dd64fe3 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/instructions/instructions.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/instructions/instructions.rs @@ -250,8 +250,8 @@ mod tests { NetworkID::Stokenet ), Err(CommonError::InvalidInstructionsWrongNetwork { - found_in_instructions: NetworkID::Mainnet, - specified_to_instructions_ctor: NetworkID::Stokenet + found_in_instructions: NetworkID::Mainnet.to_string(), + specified_to_instructions_ctor: NetworkID::Stokenet.to_string() }) ); } @@ -379,8 +379,9 @@ mod tests { NetworkID::Simulator ), CommonError::InvalidInstructionsWrongNetwork { - found_in_instructions: NetworkID::Mainnet, + found_in_instructions: NetworkID::Mainnet.to_string(), specified_to_instructions_ctor: NetworkID::Simulator + .to_string() } ); } @@ -410,8 +411,9 @@ mod tests { NetworkID::Simulator ), CommonError::InvalidInstructionsWrongNetwork { - found_in_instructions: NetworkID::Mainnet, + found_in_instructions: NetworkID::Mainnet.to_string(), specified_to_instructions_ctor: NetworkID::Simulator + .to_string() } ); } diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/transaction_manifest.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/transaction_manifest.rs index a84ab8dec..cdd11424c 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/transaction_manifest.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/transaction_manifest.rs @@ -209,7 +209,6 @@ impl TransactionManifest { #[cfg(test)] mod tests { use super::*; - use crate::prelude::*; use radix_common::prelude::ManifestBucket; use radix_rust::hashmap; use radix_transactions::manifest::{ @@ -425,8 +424,8 @@ BURN_RESOURCE assert_eq!( SUT::new(instructions_str, NetworkID::Mainnet, Blobs::default(),), Err(CommonError::InvalidInstructionsWrongNetwork { - found_in_instructions: NetworkID::Simulator, - specified_to_instructions_ctor: NetworkID::Mainnet + found_in_instructions: NetworkID::Simulator.to_string(), + specified_to_instructions_ctor: NetworkID::Mainnet.to_string() }) ); } @@ -442,8 +441,8 @@ BURN_RESOURCE assert_eq!( SUT::new(instructions_str, NetworkID::Stokenet, Blobs::default(),), Err(CommonError::InvalidInstructionsWrongNetwork { - found_in_instructions: NetworkID::Mainnet, - specified_to_instructions_ctor: NetworkID::Stokenet + found_in_instructions: NetworkID::Mainnet.to_string(), + specified_to_instructions_ctor: NetworkID::Stokenet.to_string() }) ); } diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/signed_subintent.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/signed_subintent.rs index e6a84cf22..2bc6c57ea 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/signed_subintent.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/signed_subintent.rs @@ -161,7 +161,6 @@ impl HasSampleValues for SignedSubintent { mod tests { use super::*; - use crate::prelude::*; #[allow(clippy::upper_case_acronyms)] type SUT = SignedSubintent; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/child_subintent_specifier.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/child_subintent_specifier.rs index 06a2e9b5f..0914c0fbd 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/child_subintent_specifier.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/child_subintent_specifier.rs @@ -56,7 +56,6 @@ impl HasSampleValues for ChildSubintentSpecifier { #[cfg(test)] mod tests { use super::*; - use crate::prelude::*; #[allow(clippy::upper_case_acronyms)] type SUT = ChildSubintentSpecifier; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/child_subintent_specifiers.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/child_subintent_specifiers.rs index 15f54c461..766777c09 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/child_subintent_specifiers.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/child_subintent_specifiers.rs @@ -83,7 +83,6 @@ impl HasSampleValues for ChildSubintentSpecifiers { #[cfg(test)] mod tests { use super::*; - use crate::prelude::*; #[allow(clippy::upper_case_acronyms)] type SUT = ChildSubintentSpecifiers; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/instructions_v2/instructions_v2.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/instructions_v2/instructions_v2.rs index b55dc3047..512bff84c 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/instructions_v2/instructions_v2.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/instructions_v2/instructions_v2.rs @@ -255,8 +255,8 @@ mod tests { NetworkID::Stokenet ), Err(CommonError::InvalidInstructionsWrongNetwork { - found_in_instructions: NetworkID::Mainnet, - specified_to_instructions_ctor: NetworkID::Stokenet + found_in_instructions: NetworkID::Mainnet.to_string(), + specified_to_instructions_ctor: NetworkID::Stokenet.to_string() }) ); } @@ -393,8 +393,9 @@ mod tests { NetworkID::Simulator ), CommonError::InvalidInstructionsWrongNetwork { - found_in_instructions: NetworkID::Mainnet, + found_in_instructions: NetworkID::Mainnet.to_string(), specified_to_instructions_ctor: NetworkID::Simulator + .to_string() } ); } @@ -424,8 +425,9 @@ mod tests { NetworkID::Simulator ), CommonError::InvalidInstructionsWrongNetwork { - found_in_instructions: NetworkID::Mainnet, + found_in_instructions: NetworkID::Mainnet.to_string(), specified_to_instructions_ctor: NetworkID::Simulator + .to_string() } ); } diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/subintent_manifest.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/subintent_manifest.rs index cd2677a60..dfac6e327 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/subintent_manifest.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/subintent_manifest.rs @@ -247,7 +247,6 @@ impl HasSampleValues for SubintentManifest { #[cfg(test)] mod tests { use super::*; - use crate::prelude::*; use radix_rust::hashmap; use radix_transactions::manifest::{ BlobProvider, CallMethod, DropAllProofs, DropAuthZoneProofs, @@ -463,8 +462,8 @@ DROP_AUTH_ZONE_PROOFS; ChildSubintentSpecifiers::empty() ), Err(CommonError::InvalidInstructionsWrongNetwork { - found_in_instructions: NetworkID::Simulator, - specified_to_instructions_ctor: NetworkID::Mainnet + found_in_instructions: NetworkID::Simulator.to_string(), + specified_to_instructions_ctor: NetworkID::Mainnet.to_string() }) ); } @@ -485,8 +484,8 @@ DROP_AUTH_ZONE_PROOFS; ChildSubintentSpecifiers::empty() ), Err(CommonError::InvalidInstructionsWrongNetwork { - found_in_instructions: NetworkID::Mainnet, - specified_to_instructions_ctor: NetworkID::Stokenet + found_in_instructions: NetworkID::Mainnet.to_string(), + specified_to_instructions_ctor: NetworkID::Stokenet.to_string() }) ); } diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/transaction_manifest_v2.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/transaction_manifest_v2.rs index 738ae1f74..ce1d36a10 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/transaction_manifest_v2.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/transaction_manifest_v2.rs @@ -202,7 +202,6 @@ impl HasSampleValues for TransactionManifestV2 { #[cfg(test)] mod tests { use super::*; - use crate::prelude::*; use radix_rust::hashmap; use radix_transactions::manifest::{ CallMethod, DropAllProofs, DropAuthZoneProofs, @@ -416,8 +415,8 @@ DROP_AUTH_ZONE_PROOFS; ChildSubintentSpecifiers::empty() ), Err(CommonError::InvalidInstructionsWrongNetwork { - found_in_instructions: NetworkID::Simulator, - specified_to_instructions_ctor: NetworkID::Mainnet + found_in_instructions: NetworkID::Simulator.to_string(), + specified_to_instructions_ctor: NetworkID::Mainnet.to_string() }) ); } @@ -438,8 +437,8 @@ DROP_AUTH_ZONE_PROOFS; ChildSubintentSpecifiers::empty() ), Err(CommonError::InvalidInstructionsWrongNetwork { - found_in_instructions: NetworkID::Mainnet, - specified_to_instructions_ctor: NetworkID::Stokenet + found_in_instructions: NetworkID::Mainnet.to_string(), + specified_to_instructions_ctor: NetworkID::Stokenet.to_string() }) ); } diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/mod.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/mod.rs index 36b4bf536..cebce8201 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/mod.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/mod.rs @@ -1,4 +1,6 @@ mod high_level; +mod is_intent_signing; mod low_level; pub use high_level::*; +pub use is_intent_signing::*; pub use low_level::*; diff --git a/crates/sargon/tests/integration/main.rs b/crates/sargon/tests/integration/main.rs index 208c780c8..9e6e47925 100644 --- a/crates/sargon/tests/integration/main.rs +++ b/crates/sargon/tests/integration/main.rs @@ -186,7 +186,8 @@ mod integration_tests { let intent_hash = intent.transaction_intent_hash(); println!("✨ intent hash: {}", &intent_hash); - let intent_signature = private_key.sign_intent_hash(&intent_hash); + let intent_signature = + private_key.sign_transaction_intent_hash(&intent_hash); let signed_intent = SignedIntent::new( intent, diff --git a/jvm/sargon-android/src/main/java/com/radixdlt/sargon/extensions/AccountPath.kt b/jvm/sargon-android/src/main/java/com/radixdlt/sargon/extensions/AccountPath.kt index 3796c3684..82b97abf4 100644 --- a/jvm/sargon-android/src/main/java/com/radixdlt/sargon/extensions/AccountPath.kt +++ b/jvm/sargon-android/src/main/java/com/radixdlt/sargon/extensions/AccountPath.kt @@ -24,8 +24,8 @@ fun AccountPath.Companion.init(path: String): AccountPath = when (val derivationPath = DerivationPath.init(path)) { is DerivationPath.Account -> derivationPath.value is DerivationPath.Bip44Like, is DerivationPath.Identity -> throw CommonException.WrongEntityKind( - expected = Cap26EntityKind.ACCOUNT, - found = Cap26EntityKind.IDENTITY + expected = Cap26EntityKind.ACCOUNT.discriminant(), + found = Cap26EntityKind.IDENTITY.discriminant() ) } diff --git a/jvm/sargon-android/src/main/java/com/radixdlt/sargon/extensions/IdentityPath.kt b/jvm/sargon-android/src/main/java/com/radixdlt/sargon/extensions/IdentityPath.kt index d15508ad3..a40e0a959 100644 --- a/jvm/sargon-android/src/main/java/com/radixdlt/sargon/extensions/IdentityPath.kt +++ b/jvm/sargon-android/src/main/java/com/radixdlt/sargon/extensions/IdentityPath.kt @@ -7,6 +7,7 @@ import com.radixdlt.sargon.DerivationPath import com.radixdlt.sargon.Hardened import com.radixdlt.sargon.IdentityPath import com.radixdlt.sargon.NetworkId +import com.radixdlt.sargon.cap26EntityKindToString import com.radixdlt.sargon.newIdentityPath fun IdentityPath.Companion.init( @@ -19,13 +20,15 @@ fun IdentityPath.Companion.init( index = index ) +public fun Cap26EntityKind.discriminant(): String = cap26EntityKindToString(kind = this) + @Throws(SargonException::class) fun IdentityPath.Companion.init(path: String): IdentityPath = when (val derivationPath = DerivationPath.init(path)) { is DerivationPath.Identity -> derivationPath.value is DerivationPath.Bip44Like, is DerivationPath.Account -> throw CommonException.WrongEntityKind( - expected = Cap26EntityKind.IDENTITY, - found = Cap26EntityKind.ACCOUNT + expected = Cap26EntityKind.IDENTITY.discriminant(), + found = Cap26EntityKind.ACCOUNT.discriminant() ) } diff --git a/jvm/sargon-android/src/main/java/com/radixdlt/sargon/os/driver/AndroidBiometricAuthorizationDriver.kt b/jvm/sargon-android/src/main/java/com/radixdlt/sargon/os/driver/AndroidBiometricAuthorizationDriver.kt index da0375bc3..493ca7930 100644 --- a/jvm/sargon-android/src/main/java/com/radixdlt/sargon/os/driver/AndroidBiometricAuthorizationDriver.kt +++ b/jvm/sargon-android/src/main/java/com/radixdlt/sargon/os/driver/AndroidBiometricAuthorizationDriver.kt @@ -12,6 +12,8 @@ import androidx.lifecycle.lifecycleScope import com.radixdlt.sargon.CommonException import com.radixdlt.sargon.SecureStorageAccessErrorKind import com.radixdlt.sargon.SecureStorageKey +import com.radixdlt.sargon.secureStorageKeyIdentifier +import com.radixdlt.sargon.secureStorageAccessErrorKindToString import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.launchIn @@ -37,8 +39,8 @@ class BiometricsFailure( fun toCommonException( key: SecureStorageKey ): CommonException = CommonException.SecureStorageAccessException( - key = key, - errorKind = when (errorCode) { + key = secureStorageKeyIdentifier(key), + errorKind = secureStorageAccessErrorKindToString(kind = when (errorCode) { BiometricPrompt.ERROR_CANCELED -> SecureStorageAccessErrorKind.CANCELLED BiometricPrompt.ERROR_HW_NOT_PRESENT -> SecureStorageAccessErrorKind.HARDWARE_NOT_PRESENT BiometricPrompt.ERROR_HW_UNAVAILABLE -> SecureStorageAccessErrorKind.HARDWARE_UNAVAILABLE @@ -53,7 +55,7 @@ class BiometricsFailure( BiometricPrompt.ERROR_USER_CANCELED -> SecureStorageAccessErrorKind.USER_CANCELLED BiometricPrompt.ERROR_VENDOR -> SecureStorageAccessErrorKind.VENDOR else -> throw CommonException.Unknown() - }, + }), errorMessage = errorMessage.orEmpty() ) From 42f3b013d2b1ff360cd789b21fd7e04d3055c225 Mon Sep 17 00:00:00 2001 From: Alexander Cyon <116169792+CyonAlexRDX@users.noreply.github.com> Date: Mon, 30 Dec 2024 09:25:28 +0100 Subject: [PATCH 04/13] Split out Hierarchical Deterministic module into separate crate (#323) Split out HD crate --- Cargo.lock | 44 ++++++++++- Cargo.toml | 3 +- crates/sargon-core/Cargo.toml | 2 +- .../src}/identifiable.rs | 0 .../src}/is_network_aware.rs | 0 crates/sargon-core/src/lib.rs | 9 +++ .../network => sargon-core/src}/network_id.rs | 10 +-- .../src/types/keys/slip10_curve.rs | 8 ++ .../src/types/signatures/signature.rs | 1 - .../src/unsigned_ints}/add_via_deref.rs | 0 .../unsigned_ints/global_index_constants.rs | 0 .../src}/unsigned_ints/mod.rs | 2 + .../src}/unsigned_ints/u30.rs | 2 +- .../src}/unsigned_ints/u31.rs | 28 +++---- .../Cargo.toml | 54 ++++++++++++++ .../src}/bip32/hd_path.rs | 0 .../src}/bip32/hd_path_component.rs | 17 ++++- .../bip32/key_space/components/hardened.rs | 48 ++++++++---- .../src}/bip32/key_space/components/mod.rs | 0 .../bip32/key_space/components/securified.rs | 34 +++++---- .../bip32/key_space/components/unhardened.rs | 5 +- .../key_space/components/unsecurified.rs | 0 .../components/unsecurified_hardened.rs | 36 +++++---- .../src}/bip32/key_space/key_space.rs | 0 .../src}/bip32/key_space/mod.rs | 0 .../bip32/key_space/traits/add_via_global.rs | 0 .../key_space/traits/from_global_key_space.rs | 0 .../key_space/traits/from_local_key_space.rs | 0 .../has_offset_from_global_key_space.rs | 0 .../key_space/traits/is_in_local_key_space.rs | 0 .../traits/is_mappable_to_global_key_space.rs | 0 .../src}/bip32/key_space/traits/mod.rs | 2 - .../src}/bip32/mod.rs | 2 - .../src}/bip32/traits/from_bip32_str.rs | 0 .../is_path_component_string_convertible.rs | 0 .../bip32/traits/is_security_state_aware.rs | 0 .../src}/bip32/traits/mod.rs | 0 .../src}/bip32/traits/to_bip32_str.rs | 0 .../src}/bip39/bip39_entropy.rs | 0 .../src}/bip39/bip39_passphrase.rs | 0 .../src}/bip39/bip39_seed.rs | 0 .../src}/bip39/bip39_word/bip39_language.rs | 0 .../src}/bip39/bip39_word/bip39_word.rs | 2 +- .../src}/bip39/bip39_word/mod.rs | 0 .../src}/bip39/bip39_word/u11.rs | 0 .../src}/bip39/bip39_word_count.rs | 2 +- .../src}/bip39/mnemonic.rs | 2 - .../src}/bip39/mod.rs | 0 .../src}/bip44/bip44_like_path.rs | 1 + .../src}/bip44/mod.rs | 0 .../src}/cap26/cap26_entity_kind.rs | 0 .../src}/cap26/cap26_key_kind.rs | 0 .../src}/cap26/mod.rs | 0 .../src}/cap26/paths/account_path.rs | 0 .../src}/cap26/paths/get_id_path.rs | 0 .../src}/cap26/paths/identity_path.rs | 0 .../src}/cap26/paths/mod.rs | 0 .../src}/cap26/paths/traits.rs | 0 .../cap26/paths/unvalidated_cap26_path.rs | 10 +++ .../src}/derivation/derivation_path.rs | 0 .../src}/derivation/derivation_path_scheme.rs | 0 .../derivation/has_derivation_path_scheme.rs | 0 .../hierarchical_deterministic_private_key.rs | 0 .../hierarchical_deterministic_public_key.rs | 0 .../derivation/mnemonic_with_passphrase.rs | 32 ++++---- .../src}/derivation/mod.rs | 0 .../src}/has_key_kind.rs | 0 .../src/lib.rs | 24 ++++++ crates/sargon-uniffi/Cargo.toml | 2 +- .../src/system/sargon_os/sargon_os_factors.rs | 1 + crates/sargon/Cargo.toml | 10 +-- .../agnostic_paths/index_agnostic_path.rs | 30 ++++++-- .../provider/factor_instances_provider.rs | 4 +- .../src/hierarchical_deterministic/.DS_Store | Bin 6148 -> 0 bytes .../src/hierarchical_deterministic/mod.rs | 11 --- crates/sargon/src/identified_vec_of/mod.rs | 2 - .../collector/keys_collector.rs | 1 + .../stateless_dummy_indices.rs | 1 + crates/sargon/src/keys_collector/mod.rs | 5 ++ .../keys_collector/tests/derivation_tests.rs | 69 ++++++++++-------- crates/sargon/src/keys_collector/tests/mod.rs | 4 + crates/sargon/src/lib.rs | 5 +- .../matrices/matrix_of_factor_instances.rs | 15 +++- .../supporting_types/account_or_persona.rs | 6 ++ .../src/profile/supporting_types/mod.rs | 2 - .../profile/v100/address/wrap_ret_address.rs | 5 +- .../profile/v100/entity/account/account.rs | 7 ++ .../src/profile/v100/entity/is_entity.rs | 10 +-- .../profile/v100/entity/persona/persona.rs | 6 ++ .../factor_source_crypto_parameters.rs | 8 -- ...ierarchical_deterministic_factor_source.rs | 12 ++- .../hd_transaction_signing_factor_instance.rs | 5 +- crates/sargon/src/profile/v100/factors/mod.rs | 2 - .../src/profile/v100/networks/network/mod.rs | 2 - .../signing/collector/signatures_collector.rs | 24 +++--- .../petition_types/petition_for_entity.rs | 6 +- .../petition_for_factors_state.rs | 4 +- .../maybe_signed_transactions.rs | 2 +- .../src/types/samples/persona_samples.rs | 6 +- 99 files changed, 436 insertions(+), 211 deletions(-) rename crates/{sargon/src/identified_vec_of => sargon-core/src}/identifiable.rs (100%) rename crates/{sargon/src/profile/supporting_types => sargon-core/src}/is_network_aware.rs (100%) rename crates/{sargon/src/profile/v100/networks/network => sargon-core/src}/network_id.rs (96%) rename crates/{sargon/src/hierarchical_deterministic/bip32/key_space/traits => sargon-core/src/unsigned_ints}/add_via_deref.rs (100%) rename crates/{sargon/src/hierarchical_deterministic/bip32 => sargon-core/src}/unsigned_ints/global_index_constants.rs (100%) rename crates/{sargon/src/hierarchical_deterministic/bip32 => sargon-core/src}/unsigned_ints/mod.rs (71%) rename crates/{sargon/src/hierarchical_deterministic/bip32 => sargon-core/src}/unsigned_ints/u30.rs (98%) rename crates/{sargon/src/hierarchical_deterministic/bip32 => sargon-core/src}/unsigned_ints/u31.rs (91%) create mode 100644 crates/sargon-hierarchical-deterministic/Cargo.toml rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip32/hd_path.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip32/hd_path_component.rs (97%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip32/key_space/components/hardened.rs (91%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip32/key_space/components/mod.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip32/key_space/components/securified.rs (90%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip32/key_space/components/unhardened.rs (98%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip32/key_space/components/unsecurified.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip32/key_space/components/unsecurified_hardened.rs (90%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip32/key_space/key_space.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip32/key_space/mod.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip32/key_space/traits/add_via_global.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip32/key_space/traits/from_global_key_space.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip32/key_space/traits/from_local_key_space.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip32/key_space/traits/has_offset_from_global_key_space.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip32/key_space/traits/is_in_local_key_space.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip32/key_space/traits/is_mappable_to_global_key_space.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip32/key_space/traits/mod.rs (89%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip32/mod.rs (77%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip32/traits/from_bip32_str.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip32/traits/is_path_component_string_convertible.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip32/traits/is_security_state_aware.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip32/traits/mod.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip32/traits/to_bip32_str.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip39/bip39_entropy.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip39/bip39_passphrase.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip39/bip39_seed.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip39/bip39_word/bip39_language.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip39/bip39_word/bip39_word.rs (98%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip39/bip39_word/mod.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip39/bip39_word/u11.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip39/bip39_word_count.rs (98%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip39/mnemonic.rs (99%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip39/mod.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip44/bip44_like_path.rs (99%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/bip44/mod.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/cap26/cap26_entity_kind.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/cap26/cap26_key_kind.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/cap26/mod.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/cap26/paths/account_path.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/cap26/paths/get_id_path.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/cap26/paths/identity_path.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/cap26/paths/mod.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/cap26/paths/traits.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/cap26/paths/unvalidated_cap26_path.rs (96%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/derivation/derivation_path.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/derivation/derivation_path_scheme.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/derivation/has_derivation_path_scheme.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/derivation/hierarchical_deterministic_private_key.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/derivation/hierarchical_deterministic_public_key.rs (100%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/derivation/mnemonic_with_passphrase.rs (94%) rename crates/{sargon/src/hierarchical_deterministic => sargon-hierarchical-deterministic/src}/derivation/mod.rs (100%) rename crates/{sargon/src/profile/v100/factors => sargon-hierarchical-deterministic/src}/has_key_kind.rs (100%) create mode 100644 crates/sargon-hierarchical-deterministic/src/lib.rs delete mode 100644 crates/sargon/src/hierarchical_deterministic/.DS_Store delete mode 100644 crates/sargon/src/hierarchical_deterministic/mod.rs diff --git a/Cargo.lock b/Cargo.lock index 18998bc1f..038124308 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2742,7 +2742,7 @@ dependencies = [ [[package]] name = "sargon" -version = "1.2.0" +version = "1.2.1" dependencies = [ "actix-rt", "aes-gcm", @@ -2750,7 +2750,6 @@ dependencies = [ "async-std", "async-trait", "base64 0.22.1 (git+https://github.com/marshallpierce/rust-base64.git?rev=e14400697453bcc85997119b874bc03d9601d0af)", - "bip39", "camino 1.0.8", "cargo_toml 0.15.3 (git+https://gitlab.com/lib.rs/cargo_toml?rev=e498c94fc42a660c1ca1a28999ce1d757cfe77fe)", "delegate", @@ -2780,6 +2779,7 @@ dependencies = [ "rand", "reqwest", "sargon-core", + "sargon-hierarchical-deterministic", "sbor", "security-framework", "security-framework-sys", @@ -2796,9 +2796,44 @@ dependencies = [ [[package]] name = "sargon-core" -version = "1.2.0" +version = "1.2.1" +dependencies = [ + "assert-json-diff", + "delegate", + "derive_more", + "enum-as-inner", + "enum-iterator", + "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", + "hkdf", + "iota-crypto", + "iso8601-timestamp", + "itertools 0.12.0", + "k256 0.13.3", + "log", + "paste 1.0.14", + "pretty_assertions", + "radix-common", + "radix-engine-interface", + "radix-rust", + "radix-transactions", + "rand", + "serde", + "serde_json 1.0.108", + "serde_repr", + "serde_with 3.4.0", + "strum 0.26.1", + "thiserror 1.0.50", + "url", + "uuid 1.6.1", + "zeroize 1.7.0", +] + +[[package]] +name = "sargon-hierarchical-deterministic" +version = "1.2.1" dependencies = [ "assert-json-diff", + "bip39", "delegate", "derive_more", "enum-as-inner", @@ -2817,6 +2852,7 @@ dependencies = [ "radix-rust", "radix-transactions", "rand", + "sargon-core", "serde", "serde_json 1.0.108", "serde_repr", @@ -2830,7 +2866,7 @@ dependencies = [ [[package]] name = "sargon-uniffi" -version = "1.2.0" +version = "1.2.1" dependencies = [ "actix-rt", "assert-json-diff", diff --git a/Cargo.toml b/Cargo.toml index 3d8c517cd..f7fd284ea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,9 +2,10 @@ resolver = "2" members = [ "crates/sargon", + "crates/sargon-core", + "crates/sargon-hierarchical-deterministic", "crates/sargon-uniffi", "crates/sargon-uniffi-conversion-macros", - "crates/sargon-core", ] [profile.release] diff --git a/crates/sargon-core/Cargo.toml b/crates/sargon-core/Cargo.toml index 0676feca3..61b17be71 100644 --- a/crates/sargon-core/Cargo.toml +++ b/crates/sargon-core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sargon-core" -version = "1.2.0" +version = "1.2.1" edition = "2021" [dependencies] diff --git a/crates/sargon/src/identified_vec_of/identifiable.rs b/crates/sargon-core/src/identifiable.rs similarity index 100% rename from crates/sargon/src/identified_vec_of/identifiable.rs rename to crates/sargon-core/src/identifiable.rs diff --git a/crates/sargon/src/profile/supporting_types/is_network_aware.rs b/crates/sargon-core/src/is_network_aware.rs similarity index 100% rename from crates/sargon/src/profile/supporting_types/is_network_aware.rs rename to crates/sargon-core/src/is_network_aware.rs diff --git a/crates/sargon-core/src/lib.rs b/crates/sargon-core/src/lib.rs index 448ba2f98..d5dd5ec07 100644 --- a/crates/sargon-core/src/lib.rs +++ b/crates/sargon-core/src/lib.rs @@ -7,9 +7,13 @@ mod assert_json; mod error; mod has_sample_values; mod hash; +mod identifiable; +mod is_network_aware; +mod network_id; mod secure_random_bytes; mod types; mod unsafe_id_stepper; +mod unsigned_ints; mod utils; pub mod prelude { @@ -17,9 +21,13 @@ pub mod prelude { pub use crate::error::*; pub use crate::has_sample_values::*; pub use crate::hash::*; + pub use crate::identifiable::*; + pub use crate::is_network_aware::*; + pub use crate::network_id::*; pub use crate::secure_random_bytes::*; pub use crate::types::*; pub use crate::unsafe_id_stepper::*; + pub use crate::unsigned_ints::*; pub use crate::utils::*; pub use radix_rust::prelude::{ @@ -78,6 +86,7 @@ pub mod prelude { traits::CheckedMul as ScryptoCheckedMul, Decimal as ScryptoDecimal192, RoundingMode as ScryptoRoundingMode, }, + network::NetworkDefinition as ScryptoNetworkDefinition, prelude::Instant as ScryptoInstant, }; diff --git a/crates/sargon/src/profile/v100/networks/network/network_id.rs b/crates/sargon-core/src/network_id.rs similarity index 96% rename from crates/sargon/src/profile/v100/networks/network/network_id.rs rename to crates/sargon-core/src/network_id.rs index 7fadc9659..f80d66291 100644 --- a/crates/sargon/src/profile/v100/networks/network/network_id.rs +++ b/crates/sargon-core/src/network_id.rs @@ -114,7 +114,7 @@ impl NetworkID { /// Returns collection of all by Sargon known network ids. pub fn all() -> Vec { - all::().collect() + enum_iterator::all::().collect() } } @@ -127,13 +127,7 @@ impl TryFrom for NetworkID { .ok_or(Self::Error::UnknownNetworkID { bad_value: value }) } } -impl TryFrom for NetworkID { - type Error = CommonError; - fn try_from(value: HDPathComponent) -> Result { - Self::try_from(value.index_in_local_key_space()) - } -} impl TryFrom for NetworkID { type Error = CommonError; fn try_from(value: U31) -> Result { @@ -157,7 +151,7 @@ impl NetworkID { /// Looks up a `ScryptoNetworkDefinition` in lookup table, /// this is used internally for radix_common::address::AddressBech32Decoder, /// and to read out the canonical name (logical name) for a network. - pub(crate) fn network_definition(&self) -> ScryptoNetworkDefinition { + pub fn network_definition(&self) -> ScryptoNetworkDefinition { use NetworkID::*; match self { Mainnet => ScryptoNetworkDefinition::mainnet(), diff --git a/crates/sargon-core/src/types/keys/slip10_curve.rs b/crates/sargon-core/src/types/keys/slip10_curve.rs index cc64258d3..5241bf08c 100644 --- a/crates/sargon-core/src/types/keys/slip10_curve.rs +++ b/crates/sargon-core/src/types/keys/slip10_curve.rs @@ -30,6 +30,14 @@ pub enum SLIP10Curve { Secp256k1, } +impl Identifiable for SLIP10Curve { + type ID = String; + + fn id(&self) -> Self::ID { + self.string() + } +} + impl Display for SLIP10Curve { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{}", self.string()) diff --git a/crates/sargon-core/src/types/signatures/signature.rs b/crates/sargon-core/src/types/signatures/signature.rs index ab4912167..70c581219 100644 --- a/crates/sargon-core/src/types/signatures/signature.rs +++ b/crates/sargon-core/src/types/signatures/signature.rs @@ -112,7 +112,6 @@ impl FromStr for Signature { #[cfg(test)] mod tests { - use hex::ToHex; use super::*; diff --git a/crates/sargon/src/hierarchical_deterministic/bip32/key_space/traits/add_via_deref.rs b/crates/sargon-core/src/unsigned_ints/add_via_deref.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/bip32/key_space/traits/add_via_deref.rs rename to crates/sargon-core/src/unsigned_ints/add_via_deref.rs diff --git a/crates/sargon/src/hierarchical_deterministic/bip32/unsigned_ints/global_index_constants.rs b/crates/sargon-core/src/unsigned_ints/global_index_constants.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/bip32/unsigned_ints/global_index_constants.rs rename to crates/sargon-core/src/unsigned_ints/global_index_constants.rs diff --git a/crates/sargon/src/hierarchical_deterministic/bip32/unsigned_ints/mod.rs b/crates/sargon-core/src/unsigned_ints/mod.rs similarity index 71% rename from crates/sargon/src/hierarchical_deterministic/bip32/unsigned_ints/mod.rs rename to crates/sargon-core/src/unsigned_ints/mod.rs index 6e6b95526..471b07ddd 100644 --- a/crates/sargon/src/hierarchical_deterministic/bip32/unsigned_ints/mod.rs +++ b/crates/sargon-core/src/unsigned_ints/mod.rs @@ -1,7 +1,9 @@ +mod add_via_deref; mod global_index_constants; mod u30; mod u31; +pub use add_via_deref::*; pub use global_index_constants::*; pub use u30::*; pub use u31::*; diff --git a/crates/sargon/src/hierarchical_deterministic/bip32/unsigned_ints/u30.rs b/crates/sargon-core/src/unsigned_ints/u30.rs similarity index 98% rename from crates/sargon/src/hierarchical_deterministic/bip32/unsigned_ints/u30.rs rename to crates/sargon-core/src/unsigned_ints/u30.rs index 577810fe6..e7112383d 100644 --- a/crates/sargon/src/hierarchical_deterministic/bip32/unsigned_ints/u30.rs +++ b/crates/sargon-core/src/unsigned_ints/u30.rs @@ -8,7 +8,7 @@ pub struct U30(pub u32); impl U30 { pub const MAX: u32 = U30_MAX; - pub(crate) const fn new(value: u16) -> Self { + pub const fn new(value: u16) -> Self { Self(value as u32) } diff --git a/crates/sargon/src/hierarchical_deterministic/bip32/unsigned_ints/u31.rs b/crates/sargon-core/src/unsigned_ints/u31.rs similarity index 91% rename from crates/sargon/src/hierarchical_deterministic/bip32/unsigned_ints/u31.rs rename to crates/sargon-core/src/unsigned_ints/u31.rs index a5c7633cb..11de5dcc3 100644 --- a/crates/sargon/src/hierarchical_deterministic/bip32/unsigned_ints/u31.rs +++ b/crates/sargon-core/src/unsigned_ints/u31.rs @@ -39,20 +39,6 @@ impl From for u32 { } } -// Convenient so that we do not need to add `u32` suffix to literals in tests. -#[cfg(test)] -impl TryFrom for U31 { - type Error = CommonError; - - fn try_from(value: i32) -> Result { - if value >= 0 { - Self::try_from(value as u32) - } else { - panic!("Negative") - } - } -} - impl TryFrom for U31 { type Error = CommonError; @@ -102,6 +88,20 @@ mod tests { ) } + // Convenient so that we do not need to add `u32` suffix to literals in tests. + #[cfg(test)] + impl TryFrom for U31 { + type Error = CommonError; + + fn try_from(value: i32) -> Result { + if value >= 0 { + Self::try_from(value as u32) + } else { + panic!("Negative") + } + } + } + #[test] fn try_from_valid() { assert_eq!(*SUT::try_from(0).unwrap(), 0); diff --git a/crates/sargon-hierarchical-deterministic/Cargo.toml b/crates/sargon-hierarchical-deterministic/Cargo.toml new file mode 100644 index 000000000..ab076faec --- /dev/null +++ b/crates/sargon-hierarchical-deterministic/Cargo.toml @@ -0,0 +1,54 @@ +[package] +name = "sargon-hierarchical-deterministic" +version = "1.2.1" +edition = "2021" + +[dependencies] +# ==== INTERNAL DEPENDENCIES ==== +sargon-core = { path = "../sargon-core" } + +# ==== RADIX DEPENDENCIES ==== +radix-common = { workspace = true } +radix-engine-interface = { workspace = true } +radix-rust = { workspace = true } +radix-transactions = { workspace = true } + + +# ==== EXTERNAL DEPENDENCIES ==== +assert-json-diff = { workspace = true } +delegate = { workspace = true } +enum-as-inner = { workspace = true } +enum-iterator = { workspace = true } +hkdf = { workspace = true } +hex = { workspace = true } +pretty_assertions = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +derive_more = { workspace = true } + + +itertools = { workspace = true } +iota-crypto = { workspace = true } +k256 = { workspace = true } +rand = { workspace = true } +log = { workspace = true } + + +serde_with = { workspace = true } + +paste = { workspace = true } +serde_repr = { workspace = true } +iso8601-timestamp = { workspace = true } +zeroize = { workspace = true } +strum = { workspace = true } +url = { workspace = true } +thiserror = { workspace = true } + +uuid = { workspace = true } + +# bip39 = "2.0.0" +bip39 = { git = "https://github.com/rust-bitcoin/rust-bip39", rev = "a30760beac21d595b2bda376df4f4e6bf029bcc5", features = [ + "serde", + "zeroize", + "french", +] } diff --git a/crates/sargon/src/hierarchical_deterministic/bip32/hd_path.rs b/crates/sargon-hierarchical-deterministic/src/bip32/hd_path.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/bip32/hd_path.rs rename to crates/sargon-hierarchical-deterministic/src/bip32/hd_path.rs diff --git a/crates/sargon/src/hierarchical_deterministic/bip32/hd_path_component.rs b/crates/sargon-hierarchical-deterministic/src/bip32/hd_path_component.rs similarity index 97% rename from crates/sargon/src/hierarchical_deterministic/bip32/hd_path_component.rs rename to crates/sargon-hierarchical-deterministic/src/bip32/hd_path_component.rs index 932fcf390..137092b5f 100644 --- a/crates/sargon/src/hierarchical_deterministic/bip32/hd_path_component.rs +++ b/crates/sargon-hierarchical-deterministic/src/bip32/hd_path_component.rs @@ -536,21 +536,32 @@ mod tests { assert_eq!( SUT::from_global_key_space(1337).unwrap(), SUT::Unsecurified(Unsecurified::Unhardened( - Unhardened::from_local_key_space(1337).unwrap() + Unhardened::from_local_key_space( + U31::try_from(1337u32).unwrap() + ) + .unwrap() )) ); assert_eq!( SUT::from_global_key_space(42 + GLOBAL_OFFSET_HARDENED).unwrap(), SUT::Unsecurified(Unsecurified::Hardened( - UnsecurifiedHardened::from_local_key_space(42).unwrap() + UnsecurifiedHardened::from_local_key_space( + U31::try_from(42u32).unwrap() + ) + .unwrap() )) ); assert_eq!( SUT::from_global_key_space(237 + GLOBAL_OFFSET_HARDENED_SECURIFIED) .unwrap(), - SUT::Securified(SecurifiedU30::from_local_key_space(237).unwrap()) + SUT::Securified( + SecurifiedU30::from_local_key_space( + U31::try_from(237u32).unwrap() + ) + .unwrap() + ) ); } diff --git a/crates/sargon/src/hierarchical_deterministic/bip32/key_space/components/hardened.rs b/crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/hardened.rs similarity index 91% rename from crates/sargon/src/hierarchical_deterministic/bip32/key_space/components/hardened.rs rename to crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/hardened.rs index c178808eb..c789d0525 100644 --- a/crates/sargon/src/hierarchical_deterministic/bip32/key_space/components/hardened.rs +++ b/crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/hardened.rs @@ -241,12 +241,12 @@ mod tests { #[test] fn unsecurified_from_local() { assert_eq!( - SUT::from_local_key_space(1, IsSecurified(false)).unwrap(), + SUT::from_local_key_space(U31::ONE, IsSecurified(false)).unwrap(), SUT::from_global_key_space(GLOBAL_OFFSET_HARDENED + 1).unwrap() ); assert_eq!( - SUT::from_local_key_space(3, IsSecurified(false)).unwrap(), + SUT::from_local_key_space(U31::THREE, IsSecurified(false)).unwrap(), SUT::from_global_key_space(GLOBAL_OFFSET_HARDENED + 3).unwrap() ); } @@ -254,13 +254,13 @@ mod tests { #[test] fn securified_from_local() { assert_eq!( - SUT::from_local_key_space(0, IsSecurified(true)).unwrap(), + SUT::from_local_key_space(U31::ZERO, IsSecurified(true)).unwrap(), SUT::from_global_key_space(GLOBAL_OFFSET_HARDENED_SECURIFIED) .unwrap() ); assert_eq!( - SUT::from_local_key_space(3, IsSecurified(true)).unwrap(), + SUT::from_local_key_space(U31::THREE, IsSecurified(true)).unwrap(), SUT::from_global_key_space(3 + GLOBAL_OFFSET_HARDENED_SECURIFIED) .unwrap() ); @@ -270,7 +270,7 @@ mod tests { fn from_str_valid_0_unsecurified() { assert_eq!( "0H".parse::().unwrap(), - SUT::from_local_key_space(0, IsSecurified(false)).unwrap() + SUT::from_local_key_space(U31::ZERO, IsSecurified(false)).unwrap() ); } @@ -278,7 +278,7 @@ mod tests { fn from_str_valid_0_securified() { assert_eq!( "0S".parse::().unwrap(), - SUT::from_local_key_space(0, IsSecurified(true)).unwrap() + SUT::from_local_key_space(U31::ZERO, IsSecurified(true)).unwrap() ); } @@ -384,7 +384,8 @@ mod tests { assert_eq!( format!( "{:?}", - SUT::from_local_key_space(0, IsSecurified(false)).unwrap() + SUT::from_local_key_space(U31::ZERO, IsSecurified(false)) + .unwrap() ), "0'" ); @@ -395,7 +396,8 @@ mod tests { assert_eq!( format!( "{:?}", - SUT::from_local_key_space(0, IsSecurified(true)).unwrap() + SUT::from_local_key_space(U31::ZERO, IsSecurified(true)) + .unwrap() ), "0^" ); @@ -406,7 +408,8 @@ mod tests { assert_eq!( format!( "{}", - SUT::from_local_key_space(0, IsSecurified(false)).unwrap() + SUT::from_local_key_space(U31::ZERO, IsSecurified(false)) + .unwrap() ), "0H" ); @@ -417,7 +420,8 @@ mod tests { assert_eq!( format!( "{}", - SUT::from_local_key_space(0, IsSecurified(true)).unwrap() + SUT::from_local_key_space(U31::ZERO, IsSecurified(true)) + .unwrap() ), "0S" ); @@ -438,7 +442,12 @@ mod tests { 1337 + GLOBAL_OFFSET_HARDENED_SECURIFIED ) .unwrap(), - SUT::Securified(SecurifiedU30::from_local_key_space(1337).unwrap()) + SUT::Securified( + SecurifiedU30::from_local_key_space( + U31::try_from(1337u32).unwrap() + ) + .unwrap() + ) ); } @@ -447,7 +456,10 @@ mod tests { assert_eq!( SUT::from_global_key_space(1337 + GLOBAL_OFFSET_HARDENED).unwrap(), SUT::Unsecurified( - UnsecurifiedHardened::from_local_key_space(1337).unwrap() + UnsecurifiedHardened::from_local_key_space( + U31::try_from(1337u32).unwrap() + ) + .unwrap() ) ); } @@ -533,7 +545,11 @@ mod tests { #[test] fn json_roundtrip_securified() { - let sut = SUT::from_local_key_space(1337, IsSecurified(true)).unwrap(); + let sut = SUT::from_local_key_space( + U31::try_from(1337u32).unwrap(), + IsSecurified(true), + ) + .unwrap(); assert_json_value_eq_after_roundtrip(&sut, json!("1337S")); assert_json_roundtrip(&sut); @@ -542,7 +558,11 @@ mod tests { #[test] fn json_roundtrip_unsecurified() { - let sut = SUT::from_local_key_space(1337, IsSecurified(false)).unwrap(); + let sut = SUT::from_local_key_space( + U31::try_from(1337u32).unwrap(), + IsSecurified(false), + ) + .unwrap(); assert_json_value_eq_after_roundtrip(&sut, json!("1337H")); assert_json_roundtrip(&sut); diff --git a/crates/sargon/src/hierarchical_deterministic/bip32/key_space/components/mod.rs b/crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/mod.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/bip32/key_space/components/mod.rs rename to crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/mod.rs diff --git a/crates/sargon/src/hierarchical_deterministic/bip32/key_space/components/securified.rs b/crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/securified.rs similarity index 90% rename from crates/sargon/src/hierarchical_deterministic/bip32/key_space/components/securified.rs rename to crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/securified.rs index 3438a5e93..93e4716ef 100644 --- a/crates/sargon/src/hierarchical_deterministic/bip32/key_space/components/securified.rs +++ b/crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/securified.rs @@ -186,7 +186,7 @@ mod tests { fn try_from_u32() { assert_eq!( SUT::try_from(0u32).unwrap(), - SUT::from_local_key_space(0).unwrap() + SUT::from_local_key_space(U31::ZERO).unwrap() ); } @@ -199,7 +199,7 @@ mod tests { fn from_str_valid_canonical_0() { assert_eq!( "0S".parse::().unwrap(), - SUT::from_local_key_space(0).unwrap() + SUT::from_local_key_space(U31::ZERO).unwrap() ); } @@ -207,7 +207,7 @@ mod tests { fn from_str_valid_canonical_1() { assert_eq!( "1S".parse::().unwrap(), - SUT::from_local_key_space(1).unwrap() + SUT::from_local_key_space(U31::ONE).unwrap() ); } @@ -223,7 +223,7 @@ mod tests { fn from_str_valid_uncanonical_0() { assert_eq!( "0^".parse::().unwrap(), - SUT::from_local_key_space(0).unwrap() + SUT::from_local_key_space(U31::ZERO).unwrap() ); } @@ -231,7 +231,7 @@ mod tests { fn from_str_valid_uncanonical_1() { assert_eq!( "1^".parse::().unwrap(), - SUT::from_local_key_space(1).unwrap() + SUT::from_local_key_space(U31::ONE).unwrap() ); } @@ -245,13 +245,16 @@ mod tests { #[test] fn display_0() { - assert_eq!(format!("{}", SUT::from_local_key_space(0).unwrap()), "0S"); + assert_eq!( + format!("{}", SUT::from_local_key_space(U31::ZERO).unwrap()), + "0S" + ); } #[test] fn debug_0() { assert_eq!( - format!("{:?}", SUT::from_local_key_space(0).unwrap()), + format!("{:?}", SUT::from_local_key_space(U31::ZERO).unwrap()), "0^" ); } @@ -303,7 +306,7 @@ mod tests { GLOBAL_OFFSET_HARDENED_SECURIFIED + 1337 ) .unwrap(), - SUT::from_local_key_space(1337).unwrap() + SUT::from_local_key_space(U31::try_from(1337u32).unwrap()).unwrap() ); } @@ -351,7 +354,7 @@ mod tests { #[test] fn into_global() { assert_eq!( - SUT::from_local_key_space(1337) + SUT::from_local_key_space(U31::try_from(1337u32).unwrap()) .unwrap() .map_to_global_key_space(), GLOBAL_OFFSET_HARDENED_SECURIFIED + 1337 @@ -360,7 +363,8 @@ mod tests { #[test] fn json_roundtrip() { - let sut = SUT::from_local_key_space(1337).unwrap(); + let sut = + SUT::from_local_key_space(U31::try_from(1337u32).unwrap()).unwrap(); assert_json_value_eq_after_roundtrip(&sut, json!("1337S")); assert_json_roundtrip(&sut); @@ -380,7 +384,8 @@ mod tests { #[test] fn add_zero() { - let sut = SUT::from_local_key_space(42).unwrap(); + let sut = + SUT::from_local_key_space(U31::try_from(42u32).unwrap()).unwrap(); assert_eq!(sut.checked_add(&SUT::ZERO).unwrap(), sut); } @@ -401,10 +406,11 @@ mod tests { #[test] fn add_one() { - let sut = SUT::from_local_key_space(42).unwrap(); + let sut = + SUT::from_local_key_space(U31::try_from(42u32).unwrap()).unwrap(); assert_eq!( sut.checked_add_one().unwrap(), - SUT::from_local_key_space(43).unwrap() + SUT::from_local_key_space(U31::try_from(43u32).unwrap()).unwrap() ); } @@ -434,7 +440,7 @@ mod tests { #[test] fn addition_overflow_add_max() { - let sut = SUT::from_local_key_space(1).unwrap(); + let sut = SUT::from_local_key_space(U31::ONE).unwrap(); assert!(matches!( sut.checked_add( &SUT::from_local_key_space(SUT::MAX_LOCAL).unwrap() diff --git a/crates/sargon/src/hierarchical_deterministic/bip32/key_space/components/unhardened.rs b/crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/unhardened.rs similarity index 98% rename from crates/sargon/src/hierarchical_deterministic/bip32/key_space/components/unhardened.rs rename to crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/unhardened.rs index c430a2969..6ed5e394c 100644 --- a/crates/sargon/src/hierarchical_deterministic/bip32/key_space/components/unhardened.rs +++ b/crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/unhardened.rs @@ -332,10 +332,11 @@ mod tests { #[test] fn add_one() { - let sut = SUT::from_local_key_space(42).unwrap(); + let sut = + SUT::from_local_key_space(U31::try_from(42u32).unwrap()).unwrap(); assert_eq!( sut.checked_add_one().unwrap(), - SUT::from_local_key_space(43).unwrap() + SUT::from_local_key_space(U31::try_from(43u32).unwrap()).unwrap() ); } diff --git a/crates/sargon/src/hierarchical_deterministic/bip32/key_space/components/unsecurified.rs b/crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/unsecurified.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/bip32/key_space/components/unsecurified.rs rename to crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/unsecurified.rs diff --git a/crates/sargon/src/hierarchical_deterministic/bip32/key_space/components/unsecurified_hardened.rs b/crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/unsecurified_hardened.rs similarity index 90% rename from crates/sargon/src/hierarchical_deterministic/bip32/key_space/components/unsecurified_hardened.rs rename to crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/unsecurified_hardened.rs index fe762405d..83acfb011 100644 --- a/crates/sargon/src/hierarchical_deterministic/bip32/key_space/components/unsecurified_hardened.rs +++ b/crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/unsecurified_hardened.rs @@ -192,7 +192,7 @@ mod tests { fn from_str_valid_canonical_0() { assert_eq!( "0H".parse::().unwrap(), - SUT::from_local_key_space(0).unwrap() + SUT::from_local_key_space(U31::ZERO).unwrap() ); } @@ -200,7 +200,7 @@ mod tests { fn from_str_valid_canonical_1() { assert_eq!( "1H".parse::().unwrap(), - SUT::from_local_key_space(1).unwrap() + SUT::from_local_key_space(U31::ONE).unwrap() ); } @@ -216,7 +216,7 @@ mod tests { fn from_str_valid_uncanonical_0() { assert_eq!( "0'".parse::().unwrap(), - SUT::from_local_key_space(0).unwrap() + SUT::from_local_key_space(U31::ZERO).unwrap() ); } @@ -224,7 +224,7 @@ mod tests { fn from_str_valid_uncanonical_1() { assert_eq!( "1'".parse::().unwrap(), - SUT::from_local_key_space(1).unwrap() + SUT::from_local_key_space(U31::ONE).unwrap() ); } @@ -238,13 +238,16 @@ mod tests { #[test] fn display_0() { - assert_eq!(format!("{}", SUT::from_local_key_space(0).unwrap()), "0H"); + assert_eq!( + format!("{}", SUT::from_local_key_space(U31::ZERO).unwrap()), + "0H" + ); } #[test] fn debug_0() { assert_eq!( - format!("{:?}", SUT::from_local_key_space(0).unwrap()), + format!("{:?}", SUT::from_local_key_space(U31::ZERO).unwrap()), "0'" ); } @@ -277,12 +280,12 @@ mod tests { fn from_global_valid() { assert_eq!( SUT::from_global_key_space(GLOBAL_OFFSET_HARDENED).unwrap(), - SUT::from_local_key_space(0).unwrap() + SUT::from_local_key_space(U31::ZERO).unwrap() ); assert_eq!( SUT::from_global_key_space(GLOBAL_OFFSET_HARDENED + 1337).unwrap(), - SUT::from_local_key_space(1337).unwrap() + SUT::from_local_key_space(U31::try_from(1337u32).unwrap()).unwrap() ); } @@ -318,7 +321,7 @@ mod tests { #[test] fn into_global() { assert_eq!( - SUT::from_local_key_space(1337) + SUT::from_local_key_space(U31::try_from(1337u32).unwrap()) .unwrap() .map_to_global_key_space(), GLOBAL_OFFSET_HARDENED + 1337 @@ -336,7 +339,8 @@ mod tests { #[test] fn json_roundtrip() { - let sut = SUT::from_local_key_space(1337).unwrap(); + let sut = + SUT::from_local_key_space(U31::try_from(1337u32).unwrap()).unwrap(); assert_json_value_eq_after_roundtrip(&sut, json!("1337H")); assert_json_roundtrip(&sut); @@ -358,7 +362,7 @@ mod tests { fn try_from_u32() { assert_eq!( SUT::try_from(0u32).unwrap(), - SUT::from_local_key_space(0).unwrap() + SUT::from_local_key_space(U31::ZERO).unwrap() ); } @@ -369,7 +373,8 @@ mod tests { #[test] fn add_zero() { - let sut = SUT::from_local_key_space(42).unwrap(); + let sut = + SUT::from_local_key_space(U31::try_from(42u32).unwrap()).unwrap(); assert_eq!( sut.checked_add(&SUT::from_local_key_space(0u32).unwrap()) .unwrap(), @@ -398,10 +403,11 @@ mod tests { #[test] fn add_one() { - let sut = SUT::from_local_key_space(42).unwrap(); + let sut = + SUT::from_local_key_space(U31::try_from(42u32).unwrap()).unwrap(); assert_eq!( sut.checked_add_one().unwrap(), - SUT::from_local_key_space(43).unwrap() + SUT::from_local_key_space(U31::try_from(43u32).unwrap()).unwrap() ); } @@ -430,7 +436,7 @@ mod tests { #[test] fn addition_overflow_add_max() { - let sut = SUT::from_local_key_space(1).unwrap(); + let sut = SUT::from_local_key_space(U31::ONE).unwrap(); assert!(matches!( sut.checked_add( &SUT::from_local_key_space(SUT::MAX_LOCAL).unwrap() diff --git a/crates/sargon/src/hierarchical_deterministic/bip32/key_space/key_space.rs b/crates/sargon-hierarchical-deterministic/src/bip32/key_space/key_space.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/bip32/key_space/key_space.rs rename to crates/sargon-hierarchical-deterministic/src/bip32/key_space/key_space.rs diff --git a/crates/sargon/src/hierarchical_deterministic/bip32/key_space/mod.rs b/crates/sargon-hierarchical-deterministic/src/bip32/key_space/mod.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/bip32/key_space/mod.rs rename to crates/sargon-hierarchical-deterministic/src/bip32/key_space/mod.rs diff --git a/crates/sargon/src/hierarchical_deterministic/bip32/key_space/traits/add_via_global.rs b/crates/sargon-hierarchical-deterministic/src/bip32/key_space/traits/add_via_global.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/bip32/key_space/traits/add_via_global.rs rename to crates/sargon-hierarchical-deterministic/src/bip32/key_space/traits/add_via_global.rs diff --git a/crates/sargon/src/hierarchical_deterministic/bip32/key_space/traits/from_global_key_space.rs b/crates/sargon-hierarchical-deterministic/src/bip32/key_space/traits/from_global_key_space.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/bip32/key_space/traits/from_global_key_space.rs rename to crates/sargon-hierarchical-deterministic/src/bip32/key_space/traits/from_global_key_space.rs diff --git a/crates/sargon/src/hierarchical_deterministic/bip32/key_space/traits/from_local_key_space.rs b/crates/sargon-hierarchical-deterministic/src/bip32/key_space/traits/from_local_key_space.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/bip32/key_space/traits/from_local_key_space.rs rename to crates/sargon-hierarchical-deterministic/src/bip32/key_space/traits/from_local_key_space.rs diff --git a/crates/sargon/src/hierarchical_deterministic/bip32/key_space/traits/has_offset_from_global_key_space.rs b/crates/sargon-hierarchical-deterministic/src/bip32/key_space/traits/has_offset_from_global_key_space.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/bip32/key_space/traits/has_offset_from_global_key_space.rs rename to crates/sargon-hierarchical-deterministic/src/bip32/key_space/traits/has_offset_from_global_key_space.rs diff --git a/crates/sargon/src/hierarchical_deterministic/bip32/key_space/traits/is_in_local_key_space.rs b/crates/sargon-hierarchical-deterministic/src/bip32/key_space/traits/is_in_local_key_space.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/bip32/key_space/traits/is_in_local_key_space.rs rename to crates/sargon-hierarchical-deterministic/src/bip32/key_space/traits/is_in_local_key_space.rs diff --git a/crates/sargon/src/hierarchical_deterministic/bip32/key_space/traits/is_mappable_to_global_key_space.rs b/crates/sargon-hierarchical-deterministic/src/bip32/key_space/traits/is_mappable_to_global_key_space.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/bip32/key_space/traits/is_mappable_to_global_key_space.rs rename to crates/sargon-hierarchical-deterministic/src/bip32/key_space/traits/is_mappable_to_global_key_space.rs diff --git a/crates/sargon/src/hierarchical_deterministic/bip32/key_space/traits/mod.rs b/crates/sargon-hierarchical-deterministic/src/bip32/key_space/traits/mod.rs similarity index 89% rename from crates/sargon/src/hierarchical_deterministic/bip32/key_space/traits/mod.rs rename to crates/sargon-hierarchical-deterministic/src/bip32/key_space/traits/mod.rs index f7ddf7837..f4b30f311 100644 --- a/crates/sargon/src/hierarchical_deterministic/bip32/key_space/traits/mod.rs +++ b/crates/sargon-hierarchical-deterministic/src/bip32/key_space/traits/mod.rs @@ -1,4 +1,3 @@ -mod add_via_deref; mod add_via_global; mod from_global_key_space; mod from_local_key_space; @@ -6,7 +5,6 @@ mod has_offset_from_global_key_space; mod is_in_local_key_space; mod is_mappable_to_global_key_space; -pub use add_via_deref::*; pub use add_via_global::*; pub use from_global_key_space::*; pub use from_local_key_space::*; diff --git a/crates/sargon/src/hierarchical_deterministic/bip32/mod.rs b/crates/sargon-hierarchical-deterministic/src/bip32/mod.rs similarity index 77% rename from crates/sargon/src/hierarchical_deterministic/bip32/mod.rs rename to crates/sargon-hierarchical-deterministic/src/bip32/mod.rs index e9184bbe0..e30357057 100644 --- a/crates/sargon/src/hierarchical_deterministic/bip32/mod.rs +++ b/crates/sargon-hierarchical-deterministic/src/bip32/mod.rs @@ -2,10 +2,8 @@ mod hd_path; mod hd_path_component; mod key_space; mod traits; -mod unsigned_ints; pub use hd_path::*; pub use hd_path_component::*; pub use key_space::*; pub use traits::*; -pub use unsigned_ints::*; diff --git a/crates/sargon/src/hierarchical_deterministic/bip32/traits/from_bip32_str.rs b/crates/sargon-hierarchical-deterministic/src/bip32/traits/from_bip32_str.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/bip32/traits/from_bip32_str.rs rename to crates/sargon-hierarchical-deterministic/src/bip32/traits/from_bip32_str.rs diff --git a/crates/sargon/src/hierarchical_deterministic/bip32/traits/is_path_component_string_convertible.rs b/crates/sargon-hierarchical-deterministic/src/bip32/traits/is_path_component_string_convertible.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/bip32/traits/is_path_component_string_convertible.rs rename to crates/sargon-hierarchical-deterministic/src/bip32/traits/is_path_component_string_convertible.rs diff --git a/crates/sargon/src/hierarchical_deterministic/bip32/traits/is_security_state_aware.rs b/crates/sargon-hierarchical-deterministic/src/bip32/traits/is_security_state_aware.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/bip32/traits/is_security_state_aware.rs rename to crates/sargon-hierarchical-deterministic/src/bip32/traits/is_security_state_aware.rs diff --git a/crates/sargon/src/hierarchical_deterministic/bip32/traits/mod.rs b/crates/sargon-hierarchical-deterministic/src/bip32/traits/mod.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/bip32/traits/mod.rs rename to crates/sargon-hierarchical-deterministic/src/bip32/traits/mod.rs diff --git a/crates/sargon/src/hierarchical_deterministic/bip32/traits/to_bip32_str.rs b/crates/sargon-hierarchical-deterministic/src/bip32/traits/to_bip32_str.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/bip32/traits/to_bip32_str.rs rename to crates/sargon-hierarchical-deterministic/src/bip32/traits/to_bip32_str.rs diff --git a/crates/sargon/src/hierarchical_deterministic/bip39/bip39_entropy.rs b/crates/sargon-hierarchical-deterministic/src/bip39/bip39_entropy.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/bip39/bip39_entropy.rs rename to crates/sargon-hierarchical-deterministic/src/bip39/bip39_entropy.rs diff --git a/crates/sargon/src/hierarchical_deterministic/bip39/bip39_passphrase.rs b/crates/sargon-hierarchical-deterministic/src/bip39/bip39_passphrase.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/bip39/bip39_passphrase.rs rename to crates/sargon-hierarchical-deterministic/src/bip39/bip39_passphrase.rs diff --git a/crates/sargon/src/hierarchical_deterministic/bip39/bip39_seed.rs b/crates/sargon-hierarchical-deterministic/src/bip39/bip39_seed.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/bip39/bip39_seed.rs rename to crates/sargon-hierarchical-deterministic/src/bip39/bip39_seed.rs diff --git a/crates/sargon/src/hierarchical_deterministic/bip39/bip39_word/bip39_language.rs b/crates/sargon-hierarchical-deterministic/src/bip39/bip39_word/bip39_language.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/bip39/bip39_word/bip39_language.rs rename to crates/sargon-hierarchical-deterministic/src/bip39/bip39_word/bip39_language.rs diff --git a/crates/sargon/src/hierarchical_deterministic/bip39/bip39_word/bip39_word.rs b/crates/sargon-hierarchical-deterministic/src/bip39/bip39_word/bip39_word.rs similarity index 98% rename from crates/sargon/src/hierarchical_deterministic/bip39/bip39_word/bip39_word.rs rename to crates/sargon-hierarchical-deterministic/src/bip39/bip39_word/bip39_word.rs index 33d6d4473..8376665a6 100644 --- a/crates/sargon/src/hierarchical_deterministic/bip39/bip39_word/bip39_word.rs +++ b/crates/sargon-hierarchical-deterministic/src/bip39/bip39_word/bip39_word.rs @@ -68,7 +68,7 @@ fn word_by_index(u11: U11, language: bip39::Language) -> BIP39Word { } } -pub(crate) fn bip39_word_by_index(u11: U11) -> BIP39Word { +pub fn bip39_word_by_index(u11: U11) -> BIP39Word { word_by_index(u11, bip39::Language::English) } diff --git a/crates/sargon/src/hierarchical_deterministic/bip39/bip39_word/mod.rs b/crates/sargon-hierarchical-deterministic/src/bip39/bip39_word/mod.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/bip39/bip39_word/mod.rs rename to crates/sargon-hierarchical-deterministic/src/bip39/bip39_word/mod.rs diff --git a/crates/sargon/src/hierarchical_deterministic/bip39/bip39_word/u11.rs b/crates/sargon-hierarchical-deterministic/src/bip39/bip39_word/u11.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/bip39/bip39_word/u11.rs rename to crates/sargon-hierarchical-deterministic/src/bip39/bip39_word/u11.rs diff --git a/crates/sargon/src/hierarchical_deterministic/bip39/bip39_word_count.rs b/crates/sargon-hierarchical-deterministic/src/bip39/bip39_word_count.rs similarity index 98% rename from crates/sargon/src/hierarchical_deterministic/bip39/bip39_word_count.rs rename to crates/sargon-hierarchical-deterministic/src/bip39/bip39_word_count.rs index 85d2b4c27..b16cb2281 100644 --- a/crates/sargon/src/hierarchical_deterministic/bip39/bip39_word_count.rs +++ b/crates/sargon-hierarchical-deterministic/src/bip39/bip39_word_count.rs @@ -44,7 +44,7 @@ impl std::fmt::Display for BIP39WordCount { impl BIP39WordCount { /// Returns collection of all word counts pub fn all() -> Vec { - all::().collect() + enum_iterator::all::().collect() } /// The raw representation of the word count as a number. diff --git a/crates/sargon/src/hierarchical_deterministic/bip39/mnemonic.rs b/crates/sargon-hierarchical-deterministic/src/bip39/mnemonic.rs similarity index 99% rename from crates/sargon/src/hierarchical_deterministic/bip39/mnemonic.rs rename to crates/sargon-hierarchical-deterministic/src/bip39/mnemonic.rs index fea725831..39b5f6078 100644 --- a/crates/sargon/src/hierarchical_deterministic/bip39/mnemonic.rs +++ b/crates/sargon-hierarchical-deterministic/src/bip39/mnemonic.rs @@ -54,8 +54,6 @@ impl Mnemonic { } pub(crate) fn from_internal(internal: bip39::Mnemonic) -> Self { - use k256::elliptic_curve::zeroize::Zeroize; - let language = internal.language(); let words = internal diff --git a/crates/sargon/src/hierarchical_deterministic/bip39/mod.rs b/crates/sargon-hierarchical-deterministic/src/bip39/mod.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/bip39/mod.rs rename to crates/sargon-hierarchical-deterministic/src/bip39/mod.rs diff --git a/crates/sargon/src/hierarchical_deterministic/bip44/bip44_like_path.rs b/crates/sargon-hierarchical-deterministic/src/bip44/bip44_like_path.rs similarity index 99% rename from crates/sargon/src/hierarchical_deterministic/bip44/bip44_like_path.rs rename to crates/sargon-hierarchical-deterministic/src/bip44/bip44_like_path.rs index a400581b5..2c43b23a6 100644 --- a/crates/sargon/src/hierarchical_deterministic/bip44/bip44_like_path.rs +++ b/crates/sargon-hierarchical-deterministic/src/bip44/bip44_like_path.rs @@ -1,4 +1,5 @@ use crate::prelude::*; +use sargon_core::prelude::*; /// Either a canonical BIP44 derivation path like so: /// diff --git a/crates/sargon/src/hierarchical_deterministic/bip44/mod.rs b/crates/sargon-hierarchical-deterministic/src/bip44/mod.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/bip44/mod.rs rename to crates/sargon-hierarchical-deterministic/src/bip44/mod.rs diff --git a/crates/sargon/src/hierarchical_deterministic/cap26/cap26_entity_kind.rs b/crates/sargon-hierarchical-deterministic/src/cap26/cap26_entity_kind.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/cap26/cap26_entity_kind.rs rename to crates/sargon-hierarchical-deterministic/src/cap26/cap26_entity_kind.rs diff --git a/crates/sargon/src/hierarchical_deterministic/cap26/cap26_key_kind.rs b/crates/sargon-hierarchical-deterministic/src/cap26/cap26_key_kind.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/cap26/cap26_key_kind.rs rename to crates/sargon-hierarchical-deterministic/src/cap26/cap26_key_kind.rs diff --git a/crates/sargon/src/hierarchical_deterministic/cap26/mod.rs b/crates/sargon-hierarchical-deterministic/src/cap26/mod.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/cap26/mod.rs rename to crates/sargon-hierarchical-deterministic/src/cap26/mod.rs diff --git a/crates/sargon/src/hierarchical_deterministic/cap26/paths/account_path.rs b/crates/sargon-hierarchical-deterministic/src/cap26/paths/account_path.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/cap26/paths/account_path.rs rename to crates/sargon-hierarchical-deterministic/src/cap26/paths/account_path.rs diff --git a/crates/sargon/src/hierarchical_deterministic/cap26/paths/get_id_path.rs b/crates/sargon-hierarchical-deterministic/src/cap26/paths/get_id_path.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/cap26/paths/get_id_path.rs rename to crates/sargon-hierarchical-deterministic/src/cap26/paths/get_id_path.rs diff --git a/crates/sargon/src/hierarchical_deterministic/cap26/paths/identity_path.rs b/crates/sargon-hierarchical-deterministic/src/cap26/paths/identity_path.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/cap26/paths/identity_path.rs rename to crates/sargon-hierarchical-deterministic/src/cap26/paths/identity_path.rs diff --git a/crates/sargon/src/hierarchical_deterministic/cap26/paths/mod.rs b/crates/sargon-hierarchical-deterministic/src/cap26/paths/mod.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/cap26/paths/mod.rs rename to crates/sargon-hierarchical-deterministic/src/cap26/paths/mod.rs diff --git a/crates/sargon/src/hierarchical_deterministic/cap26/paths/traits.rs b/crates/sargon-hierarchical-deterministic/src/cap26/paths/traits.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/cap26/paths/traits.rs rename to crates/sargon-hierarchical-deterministic/src/cap26/paths/traits.rs diff --git a/crates/sargon/src/hierarchical_deterministic/cap26/paths/unvalidated_cap26_path.rs b/crates/sargon-hierarchical-deterministic/src/cap26/paths/unvalidated_cap26_path.rs similarity index 96% rename from crates/sargon/src/hierarchical_deterministic/cap26/paths/unvalidated_cap26_path.rs rename to crates/sargon-hierarchical-deterministic/src/cap26/paths/unvalidated_cap26_path.rs index 968b2ceef..6a57704bd 100644 --- a/crates/sargon/src/hierarchical_deterministic/cap26/paths/unvalidated_cap26_path.rs +++ b/crates/sargon-hierarchical-deterministic/src/cap26/paths/unvalidated_cap26_path.rs @@ -9,9 +9,19 @@ pub struct UnvalidatedCAP26Path { pub key_kind: CAP26KeyKind, pub index: Hardened, } + impl UnvalidatedCAP26Path { pub const DEPTH: usize = 6; } + +impl TryFrom for NetworkID { + type Error = CommonError; + + fn try_from(value: HDPathComponent) -> Result { + Self::try_from(value.index_in_local_key_space()) + } +} + impl TryFrom for UnvalidatedCAP26Path { type Error = CommonError; diff --git a/crates/sargon/src/hierarchical_deterministic/derivation/derivation_path.rs b/crates/sargon-hierarchical-deterministic/src/derivation/derivation_path.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/derivation/derivation_path.rs rename to crates/sargon-hierarchical-deterministic/src/derivation/derivation_path.rs diff --git a/crates/sargon/src/hierarchical_deterministic/derivation/derivation_path_scheme.rs b/crates/sargon-hierarchical-deterministic/src/derivation/derivation_path_scheme.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/derivation/derivation_path_scheme.rs rename to crates/sargon-hierarchical-deterministic/src/derivation/derivation_path_scheme.rs diff --git a/crates/sargon/src/hierarchical_deterministic/derivation/has_derivation_path_scheme.rs b/crates/sargon-hierarchical-deterministic/src/derivation/has_derivation_path_scheme.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/derivation/has_derivation_path_scheme.rs rename to crates/sargon-hierarchical-deterministic/src/derivation/has_derivation_path_scheme.rs diff --git a/crates/sargon/src/hierarchical_deterministic/derivation/hierarchical_deterministic_private_key.rs b/crates/sargon-hierarchical-deterministic/src/derivation/hierarchical_deterministic_private_key.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/derivation/hierarchical_deterministic_private_key.rs rename to crates/sargon-hierarchical-deterministic/src/derivation/hierarchical_deterministic_private_key.rs diff --git a/crates/sargon/src/hierarchical_deterministic/derivation/hierarchical_deterministic_public_key.rs b/crates/sargon-hierarchical-deterministic/src/derivation/hierarchical_deterministic_public_key.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/derivation/hierarchical_deterministic_public_key.rs rename to crates/sargon-hierarchical-deterministic/src/derivation/hierarchical_deterministic_public_key.rs diff --git a/crates/sargon/src/hierarchical_deterministic/derivation/mnemonic_with_passphrase.rs b/crates/sargon-hierarchical-deterministic/src/derivation/mnemonic_with_passphrase.rs similarity index 94% rename from crates/sargon/src/hierarchical_deterministic/derivation/mnemonic_with_passphrase.rs rename to crates/sargon-hierarchical-deterministic/src/derivation/mnemonic_with_passphrase.rs index 5ec07f262..fcc77d4d8 100644 --- a/crates/sargon/src/hierarchical_deterministic/derivation/mnemonic_with_passphrase.rs +++ b/crates/sargon-hierarchical-deterministic/src/derivation/mnemonic_with_passphrase.rs @@ -22,7 +22,6 @@ pub struct MnemonicWithPassphrase { } impl MnemonicWithPassphrase { - #[cfg(not(tarpaulin_include))] // false negative pub fn partially_obfuscated_string(&self) -> String { format!( "{} + {}", @@ -133,98 +132,98 @@ impl MnemonicWithPassphrase { } impl MnemonicWithPassphrase { - pub(crate) fn sample_device() -> Self { + pub fn sample_device() -> Self { Self::with_passphrase( Mnemonic::sample_device(), BIP39Passphrase::default(), ) } - pub(crate) fn sample_device_other() -> Self { + pub fn sample_device_other() -> Self { Self::with_passphrase( Mnemonic::sample_device_other(), BIP39Passphrase::default(), ) } - pub(crate) fn sample_device_12_words() -> Self { + pub fn sample_device_12_words() -> Self { Self::with_passphrase( Mnemonic::sample_device_12_words(), BIP39Passphrase::default(), ) } - pub(crate) fn sample_device_12_words_other() -> Self { + pub fn sample_device_12_words_other() -> Self { Self::with_passphrase( Mnemonic::sample_device_12_words_other(), BIP39Passphrase::new("Olympia rules!"), ) } - pub(crate) fn sample_ledger() -> Self { + pub fn sample_ledger() -> Self { Self::with_passphrase( Mnemonic::sample_ledger(), BIP39Passphrase::default(), ) } - pub(crate) fn sample_ledger_other() -> Self { + pub fn sample_ledger_other() -> Self { Self::with_passphrase( Mnemonic::sample_ledger_other(), BIP39Passphrase::new("Mellon"), ) } - pub(crate) fn sample_off_device() -> Self { + pub fn sample_off_device() -> Self { Self::with_passphrase( Mnemonic::sample_off_device(), BIP39Passphrase::default(), ) } - pub(crate) fn sample_off_device_other() -> Self { + pub fn sample_off_device_other() -> Self { Self::with_passphrase( Mnemonic::sample_off_device_other(), BIP39Passphrase::new("open sesame"), ) } - pub(crate) fn sample_arculus() -> Self { + pub fn sample_arculus() -> Self { Self::with_passphrase( Mnemonic::sample_arculus(), BIP39Passphrase::default(), ) } - pub(crate) fn sample_arculus_other() -> Self { + pub fn sample_arculus_other() -> Self { Self::with_passphrase( Mnemonic::sample_arculus_other(), BIP39Passphrase::new("Leonidas"), ) } - pub(crate) fn sample_security_questions() -> Self { + pub fn sample_security_questions() -> Self { Self::with_passphrase( Mnemonic::sample_security_questions(), BIP39Passphrase::default(), ) } - pub(crate) fn sample_security_questions_other() -> Self { + pub fn sample_security_questions_other() -> Self { Self::with_passphrase( Mnemonic::sample_security_questions_other(), BIP39Passphrase::default(), ) } - pub(crate) fn sample_password() -> Self { + pub fn sample_password() -> Self { Self::with_passphrase( Mnemonic::sample_password(), BIP39Passphrase::default(), ) } - pub(crate) fn sample_password_other() -> Self { + pub fn sample_password_other() -> Self { Self::with_passphrase( Mnemonic::sample_password_other(), BIP39Passphrase::new("Pass phrase"), @@ -482,7 +481,8 @@ mod tests { let path = AccountPath::new( NetworkID::Mainnet, CAP26KeyKind::TransactionSigning, - Hardened::from_local_key_space(0, IsSecurified(false)).unwrap(), + Hardened::from_local_key_space(U31::ZERO, IsSecurified(false)) + .unwrap(), ); let seed = mwp.to_seed(); let private_key = seed.derive_private_key(&path); diff --git a/crates/sargon/src/hierarchical_deterministic/derivation/mod.rs b/crates/sargon-hierarchical-deterministic/src/derivation/mod.rs similarity index 100% rename from crates/sargon/src/hierarchical_deterministic/derivation/mod.rs rename to crates/sargon-hierarchical-deterministic/src/derivation/mod.rs diff --git a/crates/sargon/src/profile/v100/factors/has_key_kind.rs b/crates/sargon-hierarchical-deterministic/src/has_key_kind.rs similarity index 100% rename from crates/sargon/src/profile/v100/factors/has_key_kind.rs rename to crates/sargon-hierarchical-deterministic/src/has_key_kind.rs diff --git a/crates/sargon-hierarchical-deterministic/src/lib.rs b/crates/sargon-hierarchical-deterministic/src/lib.rs new file mode 100644 index 000000000..2c179dc52 --- /dev/null +++ b/crates/sargon-hierarchical-deterministic/src/lib.rs @@ -0,0 +1,24 @@ +#![feature(let_chains)] + +mod bip32; +mod bip39; +mod bip44; +mod cap26; +mod derivation; + +mod has_key_kind; + +pub mod prelude { + pub(crate) use sargon_core::prelude::*; + + pub use crate::bip32::*; + pub use crate::bip39::*; + pub use crate::bip44::*; + pub use crate::cap26::*; + pub use crate::derivation::*; + pub use crate::has_key_kind::*; + + pub use radix_common::crypto::IsHash as ScryptoIsHash; +} + +pub use prelude::*; diff --git a/crates/sargon-uniffi/Cargo.toml b/crates/sargon-uniffi/Cargo.toml index 94171a941..928085e20 100644 --- a/crates/sargon-uniffi/Cargo.toml +++ b/crates/sargon-uniffi/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sargon-uniffi" # Don't forget to update version in crates/sargon/Cargo.toml -version = "1.2.0" +version = "1.2.1" edition = "2021" build = "build.rs" diff --git a/crates/sargon-uniffi/src/system/sargon_os/sargon_os_factors.rs b/crates/sargon-uniffi/src/system/sargon_os/sargon_os_factors.rs index 69fff1806..7bda96926 100644 --- a/crates/sargon-uniffi/src/system/sargon_os/sargon_os_factors.rs +++ b/crates/sargon-uniffi/src/system/sargon_os/sargon_os_factors.rs @@ -2,6 +2,7 @@ use crate::prelude::*; use sargon::DeviceFactorSourceType as InternalDeviceFactorSourceType; use sargon::HasIndexInLocalKeySpace; use sargon::HierarchicalDeterministicFactorInstance as InternalHierarchicalDeterministicFactorInstance; +use sargon::ToAgnosticPath; /// If we wanna create an Olympia DeviceFactorSource or /// a Babylon one, either main or not. diff --git a/crates/sargon/Cargo.toml b/crates/sargon/Cargo.toml index ee6377f69..ff345e6f0 100644 --- a/crates/sargon/Cargo.toml +++ b/crates/sargon/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sargon" # Don't forget to update version in crates/sargon-uniffi/Cargo.toml -version = "1.2.0" +version = "1.2.1" edition = "2021" build = "build.rs" @@ -13,6 +13,7 @@ crate-type = ["staticlib", "cdylib", "lib"] [dependencies] sargon-core = { path = "../sargon-core" } +sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } zeroize = { workspace = true } @@ -68,12 +69,7 @@ iota-crypto = { workspace = true } # Transitive dependency of iota_crypto - used to construct PubKey from uncompressed bytes. k256 = { workspace = true } -# bip39 = "2.0.0" -bip39 = { git = "https://github.com/rust-bitcoin/rust-bip39", rev = "a30760beac21d595b2bda376df4f4e6bf029bcc5", features = [ - "serde", - "zeroize", - "french", -] } + assert-json-diff = { workspace = true } diff --git a/crates/sargon/src/factor_instances_provider/agnostic_paths/index_agnostic_path.rs b/crates/sargon/src/factor_instances_provider/agnostic_paths/index_agnostic_path.rs index e735b7928..c928d80d5 100644 --- a/crates/sargon/src/factor_instances_provider/agnostic_paths/index_agnostic_path.rs +++ b/crates/sargon/src/factor_instances_provider/agnostic_paths/index_agnostic_path.rs @@ -138,8 +138,18 @@ impl TryFrom for DerivationPreset { } } -impl From<(IndexAgnosticPath, HDPathComponent)> for DerivationPath { - fn from((path, index): (IndexAgnosticPath, HDPathComponent)) -> Self { +pub trait FromIndexAgnosticPathAndComponent { + fn from_index_agnostic_path_and_component( + path: IndexAgnosticPath, + index: HDPathComponent, + ) -> Self; +} + +impl FromIndexAgnosticPathAndComponent for DerivationPath { + fn from_index_agnostic_path_and_component( + path: IndexAgnosticPath, + index: HDPathComponent, + ) -> Self { assert_eq!(index.key_space(), path.key_space); let hardened = Hardened::try_from(index).expect("Expected only hardened indices."); @@ -158,8 +168,12 @@ impl From<(IndexAgnosticPath, HDPathComponent)> for DerivationPath { } } -impl AccountPath { - pub fn agnostic(&self) -> IndexAgnosticPath { +pub trait ToAgnosticPath { + fn agnostic(&self) -> IndexAgnosticPath; +} + +impl ToAgnosticPath for AccountPath { + fn agnostic(&self) -> IndexAgnosticPath { IndexAgnosticPath { network_id: self.network_id, entity_kind: self.get_entity_kind(), @@ -169,8 +183,8 @@ impl AccountPath { } } -impl IdentityPath { - pub fn agnostic(&self) -> IndexAgnosticPath { +impl ToAgnosticPath for IdentityPath { + fn agnostic(&self) -> IndexAgnosticPath { IndexAgnosticPath { network_id: self.network_id, entity_kind: self.get_entity_kind(), @@ -180,8 +194,8 @@ impl IdentityPath { } } -impl DerivationPath { - pub fn agnostic(&self) -> IndexAgnosticPath { +impl ToAgnosticPath for DerivationPath { + fn agnostic(&self) -> IndexAgnosticPath { match self { DerivationPath::Account { value } => value.agnostic(), DerivationPath::Identity { value } => value.agnostic(), diff --git a/crates/sargon/src/factor_instances_provider/provider/factor_instances_provider.rs b/crates/sargon/src/factor_instances_provider/provider/factor_instances_provider.rs index 511041830..47e6f9195 100644 --- a/crates/sargon/src/factor_instances_provider/provider/factor_instances_provider.rs +++ b/crates/sargon/src/factor_instances_provider/provider/factor_instances_provider.rs @@ -394,10 +394,10 @@ impl FactorInstancesProvider { let path = next_index_assigner .next(factor_source_id, index_agnostic_path) .map(|index| { - DerivationPath::from(( + DerivationPath::from_index_agnostic_path_and_component( index_agnostic_path, index, - )) + ) })?; Ok(path) }) diff --git a/crates/sargon/src/hierarchical_deterministic/.DS_Store b/crates/sargon/src/hierarchical_deterministic/.DS_Store deleted file mode 100644 index c0b35c89d0681b1f3ace6d65f7544039ccdb11b5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKI|>3Z5S{S@f{mqRt{`}TAbJ8XAR>q$DuUKqc`lFUn@_VWc3LQJVDgg5yo9`B zXGcVIaof#ACL%I|8_L6muGzkM$9fr2ARK4R@9XR7cs}hrx$gqT9m-Y?a*=t9Z#y(9 zKn17(6`%rC;L{3Zg&mDQeK60X0#xAV6|nC^fg9GuCeS|}7`z1l4iI+3+i0p zHi3x1G^oI!YPJ{}bi_;M)x;(+=%U$tXx^;Zp{U=E^NXj8)5qCO}KLe% Self { - match entity_kind { - CAP26EntityKind::Account => DerivationPath::account( - AccountPath::new(network_id, key_kind, hardened), - ), - CAP26EntityKind::Identity => DerivationPath::identity( - IdentityPath::new(network_id, key_kind, hardened), - ), - } - } + ) -> DerivationPath; - pub fn hardening_global_index( + fn hardening_global_index( network_id: NetworkID, entity_kind: CAP26EntityKind, key_kind: CAP26KeyKind, global_key_space: u32, - ) -> Self { + ) -> DerivationPath { let index = Hardened::from_global_key_space(global_key_space).unwrap(); Self::for_entity(network_id, entity_kind, key_kind, index) } - pub fn unsecurified_hardening_base_index( + fn unsecurified_hardening_base_index( network_id: NetworkID, entity_kind: CAP26EntityKind, key_kind: CAP26KeyKind, index: u32, - ) -> Self { + ) -> DerivationPath { let index = U30::try_from(index).unwrap(); let index = Hardened::Unsecurified(UnsecurifiedHardened::from(index)); match entity_kind { @@ -46,10 +36,10 @@ impl DerivationPath { } } - pub fn hardening_global_index_account_tx( + fn hardening_global_index_account_tx( network_id: NetworkID, global_key_space: u32, - ) -> Self { + ) -> DerivationPath { Self::hardening_global_index( network_id, CAP26EntityKind::Account, @@ -58,10 +48,10 @@ impl DerivationPath { ) } - pub fn hardening_global_index_account_rola( + fn hardening_global_index_account_rola( network_id: NetworkID, global_key_space: u32, - ) -> Self { + ) -> DerivationPath { Self::hardening_global_index( network_id, CAP26EntityKind::Account, @@ -70,10 +60,10 @@ impl DerivationPath { ) } - pub fn hardening_global_index_identity_tx( + fn hardening_global_index_identity_tx( network_id: NetworkID, global_key_space: u32, - ) -> Self { + ) -> DerivationPath { Self::hardening_global_index( network_id, CAP26EntityKind::Identity, @@ -82,10 +72,10 @@ impl DerivationPath { ) } - pub fn hardening_global_index_identity_rola( + fn hardening_global_index_identity_rola( network_id: NetworkID, global_key_space: u32, - ) -> Self { + ) -> DerivationPath { Self::hardening_global_index( network_id, CAP26EntityKind::Identity, @@ -94,10 +84,10 @@ impl DerivationPath { ) } - pub fn account_tx_unsecurified_hardening_base_index( + fn account_tx_unsecurified_hardening_base_index( network_id: NetworkID, index: u32, - ) -> Self { + ) -> DerivationPath { Self::unsecurified_hardening_base_index( network_id, CAP26EntityKind::Account, @@ -107,12 +97,29 @@ impl DerivationPath { } } -mod key_derivation_tests { +impl DerivationPathConstructors for DerivationPath { + fn for_entity( + network_id: NetworkID, + entity_kind: CAP26EntityKind, + key_kind: CAP26KeyKind, + hardened: Hardened, + ) -> DerivationPath { + match entity_kind { + CAP26EntityKind::Account => DerivationPath::account( + AccountPath::new(network_id, key_kind, hardened), + ), + CAP26EntityKind::Identity => DerivationPath::identity( + IdentityPath::new(network_id, key_kind, hardened), + ), + } + } +} - use super::CAP26EntityKind::*; - use super::CAP26KeyKind::*; - use super::NetworkID::*; +mod key_derivation_tests { use super::*; + use sargon_hierarchical_deterministic::CAP26EntityKind::*; + use sargon_hierarchical_deterministic::CAP26KeyKind::*; + use NetworkID::*; #[actix_rt::test] async fn failure_unknown_factor() { diff --git a/crates/sargon/src/keys_collector/tests/mod.rs b/crates/sargon/src/keys_collector/tests/mod.rs index 4141518a8..5f9b87202 100644 --- a/crates/sargon/src/keys_collector/tests/mod.rs +++ b/crates/sargon/src/keys_collector/tests/mod.rs @@ -1 +1,5 @@ +#[cfg(test)] mod derivation_tests; + +#[cfg(test)] +pub(crate) use derivation_tests::*; diff --git a/crates/sargon/src/lib.rs b/crates/sargon/src/lib.rs index 99bae1b3b..e09909299 100644 --- a/crates/sargon/src/lib.rs +++ b/crates/sargon/src/lib.rs @@ -14,7 +14,6 @@ mod error_from; mod factor_instances_provider; mod gateway_api; -mod hierarchical_deterministic; mod home_cards; mod identified_vec_of; mod keys_collector; @@ -28,11 +27,11 @@ mod wrapped_radix_engine_toolkit; pub mod prelude { pub use sargon_core::prelude::*; + pub use sargon_hierarchical_deterministic::prelude::*; pub use crate::error_from::*; pub use crate::factor_instances_provider::*; pub use crate::gateway_api::*; - pub use crate::hierarchical_deterministic::*; pub use crate::home_cards::*; pub use crate::identified_vec_of::*; pub use crate::keys_collector::*; @@ -72,7 +71,7 @@ pub mod prelude { Ed25519PublicKey as ScryptoEd25519PublicKey, Ed25519PublicKeyHash as ScryptoEd25519PublicKeyHash, Ed25519Signature as ScryptoEd25519Signature, Hash as ScryptoHash, - IsHash as ScryptoIsHash, PublicKey as ScryptoPublicKey, + PublicKey as ScryptoPublicKey, PublicKeyHash as ScryptoPublicKeyHash, Secp256k1PrivateKey as ScryptoSecp256k1PrivateKey, Secp256k1PublicKey as ScryptoSecp256k1PublicKey, diff --git a/crates/sargon/src/profile/mfa/security_structures/matrices/matrix_of_factor_instances.rs b/crates/sargon/src/profile/mfa/security_structures/matrices/matrix_of_factor_instances.rs index a2bf68d09..3b1516c55 100644 --- a/crates/sargon/src/profile/mfa/security_structures/matrices/matrix_of_factor_instances.rs +++ b/crates/sargon/src/profile/mfa/security_structures/matrices/matrix_of_factor_instances.rs @@ -103,7 +103,16 @@ impl HasFactorInstances for MatrixOfFactorInstances { } } -impl MnemonicWithPassphrase { +trait InstancesDerivingWithFactorSources { + fn derive_instances_for_factor_sources( + network_id: NetworkID, + quantity_per_factor: usize, + derivation_presets: impl IntoIterator, + sources: impl IntoIterator, + ) -> IndexMap; +} + +impl InstancesDerivingWithFactorSources for MnemonicWithPassphrase { fn derive_instances_for_factor_sources( network_id: NetworkID, quantity_per_factor: usize, @@ -143,10 +152,10 @@ impl MnemonicWithPassphrase { next_index_assigner .next(fsid, index_agnostic_path) .map(|index| { - DerivationPath::from(( + DerivationPath::from_index_agnostic_path_and_component( index_agnostic_path, index, - )) + ) }) .unwrap() }) diff --git a/crates/sargon/src/profile/supporting_types/account_or_persona.rs b/crates/sargon/src/profile/supporting_types/account_or_persona.rs index d2513cabd..ecadf2e5d 100644 --- a/crates/sargon/src/profile/supporting_types/account_or_persona.rs +++ b/crates/sargon/src/profile/supporting_types/account_or_persona.rs @@ -73,6 +73,12 @@ impl AccountOrPersona { } } +impl IsNetworkAware for AccountOrPersona { + fn network_id(&self) -> NetworkID { + self.address().network_id() + } +} + impl IsBaseEntity for AccountOrPersona { type Address = AddressOfAccountOrPersona; diff --git a/crates/sargon/src/profile/supporting_types/mod.rs b/crates/sargon/src/profile/supporting_types/mod.rs index 96509e3a9..644adb5e2 100644 --- a/crates/sargon/src/profile/supporting_types/mod.rs +++ b/crates/sargon/src/profile/supporting_types/mod.rs @@ -9,7 +9,6 @@ mod email_address; mod host_id; mod host_info; mod host_os; -mod is_network_aware; mod on_same_network_validating; pub use account_for_display::*; @@ -23,5 +22,4 @@ pub use email_address::*; pub use host_id::*; pub use host_info::*; pub use host_os::*; -pub use is_network_aware::*; pub use on_same_network_validating::*; diff --git a/crates/sargon/src/profile/v100/address/wrap_ret_address.rs b/crates/sargon/src/profile/v100/address/wrap_ret_address.rs index 5e30737c9..0c16e0825 100644 --- a/crates/sargon/src/profile/v100/address/wrap_ret_address.rs +++ b/crates/sargon/src/profile/v100/address/wrap_ret_address.rs @@ -60,6 +60,7 @@ macro_rules! decl_ret_wrapped_address { $address_type: ident ) => { paste! { + use std::str::FromStr; $( #[doc = $expr] )* @@ -95,7 +96,7 @@ macro_rules! decl_ret_wrapped_address { impl From<&str> for [< $address_type:camel Address >] { /// TEST ONLY fn from(value: &str) -> Self { - value.parse().expect(&format!("Test failed since the passed in str is not a valid address: '{}'", value)) + value.parse::().expect(&format!("Test failed since the passed in str is not a valid address: '{}'", value)) } } @@ -182,8 +183,8 @@ macro_rules! decl_ret_wrapped_address { pub fn entity_type(&self) -> ScryptoEntityType { self.0.entity_type() } - pub fn try_from_bech32(bech32: impl AsRef) -> Result { + bech32.as_ref().parse::<[< Ret $address_type:camel Address >]>() .map_err(|e| { error!("Failed Bech32 decode String, RET error: {:?}", e); diff --git a/crates/sargon/src/profile/v100/entity/account/account.rs b/crates/sargon/src/profile/v100/entity/account/account.rs index 68b4a1a9d..7e2867325 100644 --- a/crates/sargon/src/profile/v100/entity/account/account.rs +++ b/crates/sargon/src/profile/v100/entity/account/account.rs @@ -92,6 +92,13 @@ impl IsSecurityStateAware for Account { self.security_state().is_securified() } } + +impl IsNetworkAware for Account { + fn network_id(&self) -> NetworkID { + self.address().network_id() + } +} + impl IsBaseEntity for Account { type Address = AccountAddress; diff --git a/crates/sargon/src/profile/v100/entity/is_entity.rs b/crates/sargon/src/profile/v100/entity/is_entity.rs index 921790f0d..01ca22433 100644 --- a/crates/sargon/src/profile/v100/entity/is_entity.rs +++ b/crates/sargon/src/profile/v100/entity/is_entity.rs @@ -30,11 +30,11 @@ pub trait IsBaseEntity: } } -impl IsNetworkAware for T { - fn network_id(&self) -> NetworkID { - self.address().network_id() - } -} +// impl IsNetworkAware for T { +// fn network_id(&self) -> NetworkID { +// self.address().network_id() +// } +// } /// A trait bridging Account and Persona. pub trait IsEntity: diff --git a/crates/sargon/src/profile/v100/entity/persona/persona.rs b/crates/sargon/src/profile/v100/entity/persona/persona.rs index 9671040f3..0e2ef4e6e 100644 --- a/crates/sargon/src/profile/v100/entity/persona/persona.rs +++ b/crates/sargon/src/profile/v100/entity/persona/persona.rs @@ -105,6 +105,12 @@ impl TryFrom for Persona { } } +impl IsNetworkAware for Persona { + fn network_id(&self) -> NetworkID { + self.address().network_id() + } +} + impl IsEntity for Persona { type Path = IdentityPath; diff --git a/crates/sargon/src/profile/v100/factors/factor_source_crypto_parameters.rs b/crates/sargon/src/profile/v100/factors/factor_source_crypto_parameters.rs index 77a2bf6ee..a37cb542f 100644 --- a/crates/sargon/src/profile/v100/factors/factor_source_crypto_parameters.rs +++ b/crates/sargon/src/profile/v100/factors/factor_source_crypto_parameters.rs @@ -7,14 +7,6 @@ decl_identified_vec_of!( SLIP10Curve ); -impl Identifiable for SLIP10Curve { - type ID = String; - - fn id(&self) -> Self::ID { - self.string() - } -} - /// Cryptographic parameters a certain FactorSource supports, e.g. which Elliptic Curves /// it supports and which Hierarchical Deterministic (HD) derivations schemes it supports, /// if any. diff --git a/crates/sargon/src/profile/v100/factors/factor_sources/private_hierarchical_deterministic_factor_source.rs b/crates/sargon/src/profile/v100/factors/factor_sources/private_hierarchical_deterministic_factor_source.rs index f4a1e2122..892234b8d 100644 --- a/crates/sargon/src/profile/v100/factors/factor_sources/private_hierarchical_deterministic_factor_source.rs +++ b/crates/sargon/src/profile/v100/factors/factor_sources/private_hierarchical_deterministic_factor_source.rs @@ -132,10 +132,18 @@ impl PrivateHierarchicalDeterministicFactorSource { } } -impl MnemonicWithPassphrase { +pub trait EntityCreatingFactorInstanceDeriving { + fn _derive_entity_creation_factor_instances( + &self, + factor_source_id: FactorSourceIDFromHash, + derivation_paths: impl IntoIterator, + ) -> IndexSet; +} + +impl EntityCreatingFactorInstanceDeriving for MnemonicWithPassphrase { /// Should only be used for testing and sample values, for production code use /// `VirtualEntityCreatingInstanceProvider` powered by the `FactorInstancesProvider` - pub(crate) fn _derive_entity_creation_factor_instances( + fn _derive_entity_creation_factor_instances( &self, factor_source_id: FactorSourceIDFromHash, derivation_paths: impl IntoIterator, diff --git a/crates/sargon/src/profile/v100/factors/hd_transaction_signing_factor_instance.rs b/crates/sargon/src/profile/v100/factors/hd_transaction_signing_factor_instance.rs index 670d54649..5745099bc 100644 --- a/crates/sargon/src/profile/v100/factors/hd_transaction_signing_factor_instance.rs +++ b/crates/sargon/src/profile/v100/factors/hd_transaction_signing_factor_instance.rs @@ -115,7 +115,7 @@ mod tests { AccountPath::new( NetworkID::Mainnet, CAP26KeyKind::AuthenticationSigning, - UnsecurifiedHardened::from_local_key_space(0).unwrap(), + UnsecurifiedHardened::from_local_key_space(U31::ZERO).unwrap(), ) .into(), ); @@ -168,7 +168,8 @@ mod tests { IdentityPath::new( NetworkID::Mainnet, CAP26KeyKind::AuthenticationSigning, - Hardened::from_local_key_space(0, IsSecurified(false)).unwrap(), + Hardened::from_local_key_space(U31::ZERO, IsSecurified(false)) + .unwrap(), ) .into(), ); diff --git a/crates/sargon/src/profile/v100/factors/mod.rs b/crates/sargon/src/profile/v100/factors/mod.rs index f70c985bd..9f85b8187 100644 --- a/crates/sargon/src/profile/v100/factors/mod.rs +++ b/crates/sargon/src/profile/v100/factors/mod.rs @@ -9,7 +9,6 @@ mod factor_source_id_from_address; mod factor_source_id_from_hash; mod factor_source_kind; mod factor_sources; -mod has_key_kind; mod hd_factor_instance_account_creation; mod hd_factor_instance_identity_creation; mod hd_transaction_signing_factor_instance; @@ -28,7 +27,6 @@ pub use factor_source_id_from_address::*; pub use factor_source_id_from_hash::*; pub use factor_source_kind::*; pub use factor_sources::*; -pub use has_key_kind::*; pub use hd_factor_instance_account_creation::*; pub use hd_factor_instance_identity_creation::*; pub use hd_transaction_signing_factor_instance::*; diff --git a/crates/sargon/src/profile/v100/networks/network/mod.rs b/crates/sargon/src/profile/v100/networks/network/mod.rs index 1d79e7e03..0f62b163d 100644 --- a/crates/sargon/src/profile/v100/networks/network/mod.rs +++ b/crates/sargon/src/profile/v100/networks/network/mod.rs @@ -1,7 +1,6 @@ mod accounts; mod authorized_dapp; mod authorized_dapps; -mod network_id; mod personas; mod profile_network; mod resource_preferences; @@ -9,7 +8,6 @@ mod resource_preferences; pub use accounts::*; pub use authorized_dapp::*; pub use authorized_dapps::*; -pub use network_id::*; pub use personas::*; pub use profile_network::*; pub use resource_preferences::*; diff --git a/crates/sargon/src/signing/collector/signatures_collector.rs b/crates/sargon/src/signing/collector/signatures_collector.rs index 101f2ceae..579babec6 100644 --- a/crates/sargon/src/signing/collector/signatures_collector.rs +++ b/crates/sargon/src/signing/collector/signatures_collector.rs @@ -751,8 +751,11 @@ mod tests { DerivationPath::from(AccountPath::new( NetworkID::Mainnet, CAP26KeyKind::TransactionSigning, - Hardened::from_local_key_space(6, IsSecurified(true)) - .unwrap() + Hardened::from_local_key_space( + U31::try_from(6u32).unwrap(), + IsSecurified(true) + ) + .unwrap() )), 5 ) @@ -1368,8 +1371,11 @@ mod tests { vec![DerivationPath::from(AccountPath::new( NetworkID::Mainnet, CAP26KeyKind::TransactionSigning, - Hardened::from_local_key_space(0, IsSecurified(false)) // unsecurified account at `0`. - .unwrap() + Hardened::from_local_key_space( + U31::ZERO, + IsSecurified(false) + ) // unsecurified account at `0`. + .unwrap() ))] ) } @@ -1448,7 +1454,7 @@ mod tests { HierarchicalDeterministicFactorInstance::new_for_entity( FactorSourceIDFromHash::sample_at(0), CAP26EntityKind::Account, - Hardened::from_local_key_space(0, IsSecurified(false)).unwrap(), + Hardened::from_local_key_space(U31::ZERO, IsSecurified(false)).unwrap(), ), ), Account::sample_unsecurified_mainnet( @@ -1456,7 +1462,7 @@ mod tests { HierarchicalDeterministicFactorInstance::new_for_entity( FactorSourceIDFromHash::sample_at(0), CAP26EntityKind::Account, - Hardened::from_local_key_space(1, IsSecurified(false)).unwrap(), + Hardened::from_local_key_space(U31::ONE, IsSecurified(false)).unwrap(), ), ), ]) @@ -1476,7 +1482,7 @@ mod tests { NetworkID::Mainnet, CAP26KeyKind::TransactionSigning, Hardened::from_local_key_space( - 0, + U31::ZERO, IsSecurified(false) ) .unwrap() @@ -1485,7 +1491,7 @@ mod tests { NetworkID::Mainnet, CAP26KeyKind::TransactionSigning, Hardened::from_local_key_space( - 1, + U31::ONE, IsSecurified(false) ) .unwrap() @@ -1921,7 +1927,7 @@ mod tests { HierarchicalDeterministicFactorInstance::new_for_entity( *f.factor_source_id().as_hash().unwrap(), E::entity_kind(), - Hardened::from_local_key_space(0, IsSecurified(true)).unwrap(), + Hardened::from_local_key_space(U31::ZERO, IsSecurified(true)).unwrap(), ) }), ).unwrap() diff --git a/crates/sargon/src/signing/petition_types/petition_for_entity.rs b/crates/sargon/src/signing/petition_types/petition_for_entity.rs index db2ecac2a..211b0b2b3 100644 --- a/crates/sargon/src/signing/petition_types/petition_for_entity.rs +++ b/crates/sargon/src/signing/petition_types/petition_for_entity.rs @@ -654,7 +654,7 @@ mod tests { || { let fi = HierarchicalDeterministicFactorInstance::sample_id_to_instance( CAP26EntityKind::Account, - Hardened::from_local_key_space(0, IsSecurified(true)).unwrap(), + Hardened::from_local_key_space(U31::ZERO, IsSecurified(true)).unwrap(), ); GeneralRoleWithHierarchicalDeterministicFactorInstances::with_factors_and_role( RoleKind::Primary, @@ -676,7 +676,7 @@ mod tests { OwnedFactorInstance::new( AddressOfAccountOrPersona::from(entity.address), HierarchicalDeterministicFactorInstance::sample_mainnet_tx_account( - Hardened::from_local_key_space(0, IsSecurified(true)).unwrap(), + Hardened::from_local_key_space(U31::ZERO, IsSecurified(true)).unwrap(), FactorSourceIDFromHash::sample_at(0), ), ), @@ -696,7 +696,7 @@ mod tests { OwnedFactorInstance::new( sut.entity, HierarchicalDeterministicFactorInstance::sample_mainnet_tx_account( - Hardened::from_local_key_space(6, IsSecurified(true)).unwrap(), + Hardened::from_local_key_space(U31::try_from(6u32).unwrap(), IsSecurified(true)).unwrap(), FactorSourceIDFromHash::sample_at(1), ), ), diff --git a/crates/sargon/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state.rs b/crates/sargon/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state.rs index 5ed3efab8..178723115 100644 --- a/crates/sargon/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state.rs +++ b/crates/sargon/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state.rs @@ -186,7 +186,7 @@ mod tests { let factor_instance = HierarchicalDeterministicFactorInstance::sample_mainnet_tx_account( - Hardened::from_local_key_space_unsecurified(0).unwrap(), + Hardened::from_local_key_space_unsecurified(U31::ZERO).unwrap(), FactorSourceIDFromHash::sample_at(0), ); let sign_input = HDSignatureInput::new( @@ -211,7 +211,7 @@ mod tests { let intent_hash = TransactionIntentHash::sample(); let factor_instance = HierarchicalDeterministicFactorInstance::sample_mainnet_tx_account( - Hardened::from_local_key_space_unsecurified(0).unwrap(), + Hardened::from_local_key_space_unsecurified(U31::ZERO).unwrap(), FactorSourceIDFromHash::sample_at(0), ); diff --git a/crates/sargon/src/signing/signatures_outecome_types/maybe_signed_transactions.rs b/crates/sargon/src/signing/signatures_outecome_types/maybe_signed_transactions.rs index 5660e7cc1..69cabbdd9 100644 --- a/crates/sargon/src/signing/signatures_outecome_types/maybe_signed_transactions.rs +++ b/crates/sargon/src/signing/signatures_outecome_types/maybe_signed_transactions.rs @@ -282,7 +282,7 @@ mod tests { OwnedFactorInstance::new( AddressOfAccountOrPersona::sample(), HierarchicalDeterministicFactorInstance::sample_mainnet_tx_account( - Hardened::from_local_key_space_unsecurified(0).unwrap(), + Hardened::from_local_key_space_unsecurified(U31::ZERO).unwrap(), FactorSourceIDFromHash::sample(), ), ), diff --git a/crates/sargon/src/types/samples/persona_samples.rs b/crates/sargon/src/types/samples/persona_samples.rs index 9ddcbb2be..e04e30543 100644 --- a/crates/sargon/src/types/samples/persona_samples.rs +++ b/crates/sargon/src/types/samples/persona_samples.rs @@ -99,7 +99,11 @@ static ALL_PERSONA_SAMPLES: Lazy<[Persona; 8]> = Lazy::new(|| { ] }); -impl DerivationPath { +trait UnsafeAsPersona { + unsafe fn as_persona(&self) -> Self; +} + +impl UnsafeAsPersona for DerivationPath { /// # Safety /// Crashes for Bip44LikePath, this is only meant to be used for tests /// to map between IdentityPath -> IdentityPath From 81aef4b080c8647121090f3d65d30b3ef5527a35 Mon Sep 17 00:00:00 2001 From: Alexander Cyon <116169792+CyonAlexRDX@users.noreply.github.com> Date: Mon, 30 Dec 2024 09:55:25 +0100 Subject: [PATCH 05/13] Split Factors module into separate crate (and some more) (#324) Split out module `Factors` and others into separate crates Split out module `Addresses` & `KeysCollector` into new crates --- Cargo.lock | 147 ++++++++++++++++++ Cargo.toml | 40 ++++- ...icalDeterministicFactorInstanceTests.swift | 2 +- crates/identified-vec-of/Cargo.toml | 17 ++ .../decl_identified_vec_of_with_samples.rs | 2 +- .../src/identifiable.rs | 0 .../src}/identified_vec_of.rs | 13 +- .../src}/identified_vec_of_display_debug.rs | 2 +- .../src}/identified_vec_of_iterator.rs | 2 +- .../src}/identified_vec_of_modify.rs | 7 +- .../src}/identified_vec_of_query.rs | 2 +- .../src}/identified_vec_of_serde.rs | 6 +- ...ntified_vec_of_validation_import_export.rs | 8 +- crates/identified-vec-of/src/lib.rs | 37 +++++ .../src}/user.rs | 6 +- crates/sargon-addresses/Cargo.toml | 27 ++++ .../src}/address/access_controller_address.rs | 0 .../src}/address/account_address.rs | 6 + .../src}/address/address.rs | 0 .../src}/address/address_format.rs | 0 .../address}/address_of_account_or_persona.rs | 2 +- .../src/address}/address_union.rs | 2 - .../src}/address/component_address.rs | 0 .../src}/address/entity_address.rs | 2 - .../src}/address/identity_address.rs | 0 .../address/legacy_olympia_account_address.rs | 0 .../src}/address/locker_address.rs | 0 .../src}/address/mod.rs | 8 + .../src}/address/non_fungible_global_id.rs | 0 .../src}/address/non_fungible_local_id.rs | 2 +- .../address/non_fungible_local_id_string.rs | 0 .../address/non_fungible_resource_address.rs | 0 .../src}/address/package_address.rs | 0 .../src}/address/pool_address.rs | 0 .../src/address}/public_key_hash.rs | 0 .../src}/address/resource_address.rs | 3 +- .../src}/address/validator_address.rs | 0 .../src}/address/vault_address.rs | 0 .../src}/address/wrap_ret_address.rs | 19 +-- .../addresses_manifest_builder_support.rs | 45 ------ .../src/address_conversion/mod.rs | 2 + .../resource_address_from.rs | 0 crates/sargon-addresses/src/lib.rs | 85 ++++++++++ crates/sargon-addresses/src/resource/mod.rs | 3 + .../src/resource}/resource_or_non_fungible.rs | 37 +++++ crates/sargon-core-assert-json/Cargo.toml | 14 ++ .../src/assert_json.rs | 0 crates/sargon-core-assert-json/src/lib.rs | 6 + crates/sargon-core-error/Cargo.toml | 10 ++ .../src}/common_error.rs | 26 +--- crates/sargon-core-error/src/lib.rs | 8 + crates/sargon-core-utils/Cargo.toml | 15 ++ .../src}/common_error_map.rs | 1 + .../src}/constants.rs | 0 .../src}/factory.rs | 21 +-- crates/sargon-core-utils/src/lib.rs | 20 +++ .../src}/logged_panic.rs | 0 .../src}/serialization.rs | 3 +- .../src}/string_utils.rs | 39 ++--- crates/sargon-core/Cargo.toml | 7 + .../src}/encryption/aes_gcm_256.rs | 4 +- .../src}/encryption/aes_gcm_sealed_box.rs | 0 .../src}/encryption/encryption_key.rs | 8 + .../src}/encryption/encryption_scheme.rs | 2 - .../encryption/encryption_scheme_version.rs | 0 .../src}/encryption/mod.rs | 4 +- .../src/encryption}/version_of_algorithm.rs | 2 - .../src}/encryption/versioned_encryption.rs | 0 crates/sargon-core/src/error/mod.rs | 5 - crates/sargon-core/src/has_sample_values.rs | 29 ++++ .../src/{utils => }/image_url_utils.rs | 2 +- crates/sargon-core/src/lib.rs | 37 +++-- .../src/types}/display_name.rs | 26 ++-- .../src/types}/email_address.rs | 23 +-- .../src}/types/hidden_constructor.rs | 2 - .../src/types/host_info}/device_id.rs | 0 .../host_info}/device_info_description.rs | 0 .../src/types/host_info}/host_id.rs | 0 .../src/types/host_info}/host_info.rs | 0 .../src/types/host_info}/host_os.rs | 4 +- crates/sargon-core/src/types/host_info/mod.rs | 11 ++ .../src/types/keys/ed25519/private_key.rs | 4 +- .../src/types/keys/ed25519/public_key.rs | 4 +- .../types/keys/key_agreement/private_key.rs | 4 +- .../types/keys/key_agreement/public_key.rs | 4 +- .../src/types/keys/secp256k1/private_key.rs | 8 +- .../src/types/keys/secp256k1/public_key.rs | 6 +- .../src/types/keys/slip10_curve.rs | 2 + crates/sargon-core/src/types/mod.rs | 10 ++ crates/sargon-core/src/types/short_string.rs | 98 ++++++++++++ crates/sargon-core/src/utils/mod.rs | 31 ---- crates/sargon-factors/Cargo.toml | 64 ++++++++ crates/sargon-factors/build.rs | 14 ++ ...curity_questions_factor_source_sample.json | 0 ..._questions_factor_source_sample_other.json | 0 .../factor_instance/badge_virtual_source.rs | 2 - .../src}/factor_instance/factor_instance.rs | 4 +- .../factor_instance/factor_instance_badge.rs | 102 ++++++------ .../src/factor_instance}/factor_instances.rs | 0 .../src}/factor_instance/mod.rs | 2 + ...rarchical_deterministic_factor_instance.rs | 0 .../src}/factor_source.rs | 3 +- .../src}/factor_source_category.rs | 10 ++ .../src}/factor_source_common.rs | 0 .../src}/factor_source_crypto_parameters.rs | 1 - .../src}/factor_source_flag.rs | 0 .../src}/factor_source_id.rs | 16 +- .../src}/factor_source_id_from_address.rs | 21 +-- .../src}/factor_source_id_from_hash.rs | 2 - .../src}/factor_source_kind.rs | 1 - .../device_factor_source.rs | 0 .../device_factor_source_hint.rs | 0 .../device_factor_source/mod.rs | 0 .../src}/factor_sources/factor_sources.rs | 0 .../ledger_hardware_wallet_factor_source.rs | 0 .../ledger_hardware_wallet_hint.rs | 0 .../ledger_hardware_wallet_model.rs | 0 .../mod.rs | 0 .../src}/factor_sources/mod.rs | 0 ...ierarchical_deterministic_factor_source.rs | 6 +- .../src}/factor_sources_of_kind.rs | 31 +++- .../hd_factor_instance_account_creation.rs | 0 .../hd_factor_instance_identity_creation.rs | 0 .../hd_transaction_signing_factor_instance.rs | 0 ...rarchical_deterministic_factor_instance.rs | 13 +- .../src}/is_entity_path.rs | 0 .../src}/is_factor_source.rs | 0 crates/sargon-factors/src/lib.rs | 62 ++++++++ .../arculus_card_factor_source.rs | 1 - .../arculus_card_hint.rs | 0 .../arculus_card_model.rs | 0 .../arculus_card_factor_source/mod.rs | 0 .../src}/mfa_factor_sources/mod.rs | 0 .../off_device_mnemonic_factor_source/mod.rs | 0 .../off_device_factor_source_hint.rs | 0 .../off_device_mnemonic_factor_source.rs | 4 +- .../password_factor_source/mod.rs | 0 .../password_factor_source.rs | 0 .../password_factor_source_hint.rs | 0 .../answer/mod.rs | 0 .../answer/security_question_and_answer.rs | 0 .../answer/security_questions_and_answers.rs | 0 .../kdf/is_security_questions_kdf_scheme.rs | 0 .../kdf/mod.rs | 0 ...s_keys_from_questions_and_answer_scheme.rs | 0 .../keys_by_diffie_hellman_fold.rs | 11 -- .../mod.rs | 0 ...m_questions_and_answers_lower_trim_utf8.rs | 5 - .../mod.rs | 0 .../security_question_and_answer_as_bytes.rs | 0 .../security_question_answer_as_bytes.rs | 0 .../kdf/sub_kdf/mod.rs | 0 .../security_questions_factor_source/mod.rs | 0 .../question/mod.rs | 0 .../question/security_question.rs | 0 .../question/security_question_kind.rs | 0 .../question/security_questions.rs | 0 .../security_questions_factor_source.rs | 11 -- .../security_questions_sealed_mnemonic.rs | 0 .../trusted_contact_factor_source/mod.rs | 0 .../trusted_contact_factor_source.rs | 24 +-- .../trusted_contact_factor_source_contact.rs | 0 .../src/samples}/factor_source_id_samples.rs | 0 .../samples/factor_source_ids_with_samples.rs | 0 .../src}/samples/factor_source_samples.rs | 7 +- ...l_deterministic_factor_instance_samples.rs | 2 +- crates/sargon-factors/src/samples/mod.rs | 7 + .../Cargo.toml | 2 +- crates/sargon-keys-collector/Cargo.toml | 15 ++ .../src}/collector/derivation_purpose.rs | 0 .../src}/collector/key_derivation_outcome.rs | 0 .../src}/collector/key_ring.rs | 0 .../src}/collector/keys_collector.rs | 91 ----------- .../collector/keys_collector_dependencies.rs | 0 .../collector/keys_collector_preprocessor.rs | 0 .../src}/collector/keys_collector_state.rs | 0 .../src}/collector/mod.rs | 0 .../src}/derivation_testing/mod.rs | 5 +- .../stateless_dummy_indices.rs | 0 .../test_keys_collector/mod.rs | 3 - .../test_derivation_interactor.rs | 80 ++++++++-- .../test_keys_collector.rs | 0 .../key_derivation_interactor.rs | 0 .../key_derivation_request.rs | 0 .../key_derivation_response.rs | 0 .../src}/host_interaction/mod.rs | 0 crates/sargon-keys-collector/src/lib.rs | 26 ++++ .../src}/tests/derivation_tests.rs | 91 +++++++++++ .../src}/tests/mod.rs | 0 crates/sargon-uniffi/Cargo.toml | 14 +- .../src/core/error/common_error.rs | 14 +- .../trusted_contact_factor_source.rs | 2 +- .../profile/supporting_types/email_address.rs | 20 ++- .../src/profile/v100/entity/display_name.rs | 20 ++- .../factor_instance/factor_instance_badge.rs | 6 +- .../factors/factor_source_id_from_address.rs | 25 ++- crates/sargon-uniffi/src/types/ffi_url.rs | 4 +- crates/sargon/Cargo.toml | 27 ++-- .../agnostic_paths/index_agnostic_path.rs | 4 +- .../factor_instances_cache/keyed_instances.rs | 2 +- .../factor_instances_provider/types/mod.rs | 4 - crates/sargon/src/identified_vec_of/mod.rs | 23 --- crates/sargon/src/keys_collector/mod.rs | 15 -- crates/sargon/src/lib.rs | 56 +------ .../encrypted_profile_snapshot.rs | 0 .../encrypted/encrypted_profile/mod.rs | 3 + crates/sargon/src/profile/encrypted/mod.rs | 6 +- .../src/profile/encrypted/pb_hkdf_sha256.rs | 4 +- .../profile/logic/account/create_account.rs | 2 +- .../profile/logic/persona/create_persona.rs | 2 +- .../profile_network_details.rs | 9 +- crates/sargon/src/profile/mfa/mod.rs | 2 - .../automatic_shield_builder.rs | 9 -- .../matrices/matrix_of_factor_instances.rs | 12 -- .../mfa/security_structures/matrices/mod.rs | 2 - .../confirmation_roles_builder_unit_tests.rs | 2 + ...archical_deterministic_factor_instances.rs | 26 ++-- .../security_shield_builder.rs | 5 +- .../supporting_types/account_for_display.rs | 2 +- .../src/profile/supporting_types/mod.rs | 8 - .../v100/app_preferences/gateways/gateway.rs | 2 + .../profile/v100/entity/account/account.rs | 6 +- .../third_party_deposits/mod.rs | 2 - crates/sargon/src/profile/v100/entity/mod.rs | 2 - crates/sargon/src/profile/v100/factors/mod.rs | 35 ----- crates/sargon/src/profile/v100/header/mod.rs | 4 - crates/sargon/src/profile/v100/mod.rs | 4 - .../authorized_dapp/authorized_dapp.rs | 8 - .../profile/v100/networks/profile_networks.rs | 4 +- crates/sargon/src/profile/v100/profile.rs | 8 +- .../mobile/deep_link_parsing/parser.rs | 2 + .../signatures_collector_preprocessor.rs | 25 --- .../secure_storage_client.rs | 31 ++++ .../system/sargon_os/profile_state_holder.rs | 8 +- .../system/sargon_os/sargon_os_accounts.rs | 2 +- .../system/sargon_os/sargon_os_personas.rs | 2 +- crates/sargon/src/types/mod.rs | 2 - .../access_controller_address_samples.rs | 20 ++- .../types/samples/account_address_samples.rs | 9 +- .../src/types/samples/account_samples.rs | 4 +- .../types/samples/identity_address_samples.rs | 18 ++- crates/sargon/src/types/samples/mod.rs | 6 - .../src/types/samples/persona_samples.rs | 8 +- .../delete_account/manifest_delete_account.rs | 4 +- .../manifest_account_locker.rs | 32 ++-- .../high_level/manifest_building/mod.rs | 2 - .../manifest_third_party_deposit_update.rs | 2 +- .../third_party_deposits_delta.rs | 31 ---- .../per_recipient_asset_transfers.rs | 10 +- .../manifest_encountered_component_address.rs | 2 + .../high_level/sargon_specific_types/mod.rs | 7 - .../low_level/address_conversion/mod.rs | 2 - .../execution_summary/execution_summary.rs | 43 +++++ .../low_level/mod.rs | 4 - .../transaction_manifest_execution_summary.rs | 82 +++++----- .../transaction_manifest.rs | 16 +- .../subintent_manifest.rs | 105 ++++++------- .../transaction_manifest_v2.rs | 16 +- .../com/radixdlt/sargon/FactorSourceIdTest.kt | 5 +- .../com/radixdlt/sargon/FactorSourceTest.kt | 3 +- 260 files changed, 1671 insertions(+), 1010 deletions(-) create mode 100644 crates/identified-vec-of/Cargo.toml rename crates/{sargon/src/identified_vec_of => identified-vec-of/src}/decl_identified_vec_of_with_samples.rs (97%) rename crates/{sargon-core => identified-vec-of}/src/identifiable.rs (100%) rename crates/{sargon/src/identified_vec_of => identified-vec-of/src}/identified_vec_of.rs (90%) rename crates/{sargon/src/identified_vec_of => identified-vec-of/src}/identified_vec_of_display_debug.rs (97%) rename crates/{sargon/src/identified_vec_of => identified-vec-of/src}/identified_vec_of_iterator.rs (98%) rename crates/{sargon/src/identified_vec_of => identified-vec-of/src}/identified_vec_of_modify.rs (97%) rename crates/{sargon/src/identified_vec_of => identified-vec-of/src}/identified_vec_of_query.rs (98%) rename crates/{sargon/src/identified_vec_of => identified-vec-of/src}/identified_vec_of_serde.rs (94%) rename crates/{sargon/src/identified_vec_of => identified-vec-of/src}/identified_vec_of_validation_import_export.rs (79%) create mode 100644 crates/identified-vec-of/src/lib.rs rename crates/{sargon/src/identified_vec_of => identified-vec-of/src}/user.rs (93%) create mode 100644 crates/sargon-addresses/Cargo.toml rename crates/{sargon/src/profile/v100 => sargon-addresses/src}/address/access_controller_address.rs (100%) rename crates/{sargon/src/profile/v100 => sargon-addresses/src}/address/account_address.rs (98%) rename crates/{sargon/src/profile/v100 => sargon-addresses/src}/address/address.rs (100%) rename crates/{sargon/src/profile/v100 => sargon-addresses/src}/address/address_format.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types => sargon-addresses/src/address}/address_of_account_or_persona.rs (96%) rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types => sargon-addresses/src/address}/address_union.rs (99%) rename crates/{sargon/src/profile/v100 => sargon-addresses/src}/address/component_address.rs (100%) rename crates/{sargon/src/profile/v100 => sargon-addresses/src}/address/entity_address.rs (94%) rename crates/{sargon/src/profile/v100 => sargon-addresses/src}/address/identity_address.rs (100%) rename crates/{sargon/src/profile/v100 => sargon-addresses/src}/address/legacy_olympia_account_address.rs (100%) rename crates/{sargon/src/profile/v100 => sargon-addresses/src}/address/locker_address.rs (100%) rename crates/{sargon/src/profile/v100 => sargon-addresses/src}/address/mod.rs (86%) rename crates/{sargon/src/profile/v100 => sargon-addresses/src}/address/non_fungible_global_id.rs (100%) rename crates/{sargon/src/profile/v100 => sargon-addresses/src}/address/non_fungible_local_id.rs (99%) rename crates/{sargon/src/profile/v100 => sargon-addresses/src}/address/non_fungible_local_id_string.rs (100%) rename crates/{sargon/src/profile/v100 => sargon-addresses/src}/address/non_fungible_resource_address.rs (100%) rename crates/{sargon/src/profile/v100 => sargon-addresses/src}/address/package_address.rs (100%) rename crates/{sargon/src/profile/v100 => sargon-addresses/src}/address/pool_address.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit/low_level => sargon-addresses/src/address}/public_key_hash.rs (100%) rename crates/{sargon/src/profile/v100 => sargon-addresses/src}/address/resource_address.rs (99%) rename crates/{sargon/src/profile/v100 => sargon-addresses/src}/address/validator_address.rs (100%) rename crates/{sargon/src/profile/v100 => sargon-addresses/src}/address/vault_address.rs (100%) rename crates/{sargon/src/profile/v100 => sargon-addresses/src}/address/wrap_ret_address.rs (97%) rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building => sargon-addresses/src/address_conversion}/addresses_manifest_builder_support.rs (87%) create mode 100644 crates/sargon-addresses/src/address_conversion/mod.rs rename crates/{sargon/src/wrapped_radix_engine_toolkit/low_level => sargon-addresses/src}/address_conversion/resource_address_from.rs (100%) create mode 100644 crates/sargon-addresses/src/lib.rs create mode 100644 crates/sargon-addresses/src/resource/mod.rs rename crates/{sargon/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits => sargon-addresses/src/resource}/resource_or_non_fungible.rs (79%) create mode 100644 crates/sargon-core-assert-json/Cargo.toml rename crates/{sargon-core => sargon-core-assert-json}/src/assert_json.rs (100%) create mode 100644 crates/sargon-core-assert-json/src/lib.rs create mode 100644 crates/sargon-core-error/Cargo.toml rename crates/{sargon-core/src/error => sargon-core-error/src}/common_error.rs (98%) create mode 100644 crates/sargon-core-error/src/lib.rs create mode 100644 crates/sargon-core-utils/Cargo.toml rename crates/{sargon-core/src/error => sargon-core-utils/src}/common_error_map.rs (97%) rename crates/{sargon-core/src/utils => sargon-core-utils/src}/constants.rs (100%) rename crates/{sargon-core/src/utils => sargon-core-utils/src}/factory.rs (74%) create mode 100644 crates/sargon-core-utils/src/lib.rs rename crates/{sargon-core/src/utils => sargon-core-utils/src}/logged_panic.rs (100%) rename crates/{sargon-core/src/utils => sargon-core-utils/src}/serialization.rs (97%) rename crates/{sargon-core/src/utils => sargon-core-utils/src}/string_utils.rs (90%) rename crates/{sargon/src/profile/encrypted => sargon-core/src}/encryption/aes_gcm_256.rs (97%) rename crates/{sargon/src/profile/encrypted => sargon-core/src}/encryption/aes_gcm_sealed_box.rs (100%) rename crates/{sargon/src/profile/encrypted => sargon-core/src}/encryption/encryption_key.rs (82%) rename crates/{sargon/src/profile/encrypted => sargon-core/src}/encryption/encryption_scheme.rs (98%) rename crates/{sargon/src/profile/encrypted => sargon-core/src}/encryption/encryption_scheme_version.rs (100%) rename crates/{sargon/src/profile/encrypted => sargon-core/src}/encryption/mod.rs (82%) rename crates/{sargon/src/profile/encrypted => sargon-core/src/encryption}/version_of_algorithm.rs (96%) rename crates/{sargon/src/profile/encrypted => sargon-core/src}/encryption/versioned_encryption.rs (100%) delete mode 100644 crates/sargon-core/src/error/mod.rs rename crates/sargon-core/src/{utils => }/image_url_utils.rs (99%) rename crates/{sargon/src/profile/v100/entity => sargon-core/src/types}/display_name.rs (87%) rename crates/{sargon/src/profile/supporting_types => sargon-core/src/types}/email_address.rs (86%) rename crates/{sargon/src/factor_instances_provider => sargon-core/src}/types/hidden_constructor.rs (95%) rename crates/{sargon/src/profile/v100/header => sargon-core/src/types/host_info}/device_id.rs (100%) rename crates/{sargon/src/profile/v100/header => sargon-core/src/types/host_info}/device_info_description.rs (100%) rename crates/{sargon/src/profile/supporting_types => sargon-core/src/types/host_info}/host_id.rs (100%) rename crates/{sargon/src/profile/supporting_types => sargon-core/src/types/host_info}/host_info.rs (100%) rename crates/{sargon/src/profile/supporting_types => sargon-core/src/types/host_info}/host_os.rs (97%) create mode 100644 crates/sargon-core/src/types/host_info/mod.rs create mode 100644 crates/sargon-core/src/types/short_string.rs delete mode 100644 crates/sargon-core/src/utils/mod.rs create mode 100644 crates/sargon-factors/Cargo.toml create mode 100644 crates/sargon-factors/build.rs rename crates/{sargon => sargon-factors}/fixtures/vector/security_questions_factor_source_sample.json (100%) rename crates/{sargon => sargon-factors}/fixtures/vector/security_questions_factor_source_sample_other.json (100%) rename crates/{sargon/src/profile/v100/factors => sargon-factors/src}/factor_instance/badge_virtual_source.rs (97%) rename crates/{sargon/src/profile/v100/factors => sargon-factors/src}/factor_instance/factor_instance.rs (98%) rename crates/{sargon/src/profile/v100/factors => sargon-factors/src}/factor_instance/factor_instance_badge.rs (72%) rename crates/{sargon/src/factor_instances_provider/types => sargon-factors/src/factor_instance}/factor_instances.rs (100%) rename crates/{sargon/src/profile/v100/factors => sargon-factors/src}/factor_instance/mod.rs (85%) rename crates/{sargon/src/profile/v100/factors => sargon-factors/src}/factor_instance/private_hierarchical_deterministic_factor_instance.rs (100%) rename crates/{sargon/src/profile/v100/factors => sargon-factors/src}/factor_source.rs (99%) rename crates/{sargon/src/profile/v100/factors => sargon-factors/src}/factor_source_category.rs (62%) rename crates/{sargon/src/profile/v100/factors => sargon-factors/src}/factor_source_common.rs (100%) rename crates/{sargon/src/profile/v100/factors => sargon-factors/src}/factor_source_crypto_parameters.rs (99%) rename crates/{sargon/src/profile/v100/factors => sargon-factors/src}/factor_source_flag.rs (100%) rename crates/{sargon/src/profile/v100/factors => sargon-factors/src}/factor_source_id.rs (93%) rename crates/{sargon/src/profile/v100/factors => sargon-factors/src}/factor_source_id_from_address.rs (78%) rename crates/{sargon/src/profile/v100/factors => sargon-factors/src}/factor_source_id_from_hash.rs (99%) rename crates/{sargon/src/profile/v100/factors => sargon-factors/src}/factor_source_kind.rs (99%) rename crates/{sargon/src/profile/v100/factors => sargon-factors/src}/factor_sources/device_factor_source/device_factor_source.rs (100%) rename crates/{sargon/src/profile/v100/factors => sargon-factors/src}/factor_sources/device_factor_source/device_factor_source_hint.rs (100%) rename crates/{sargon/src/profile/v100/factors => sargon-factors/src}/factor_sources/device_factor_source/mod.rs (100%) rename crates/{sargon/src/profile/v100/factors => sargon-factors/src}/factor_sources/factor_sources.rs (100%) rename crates/{sargon/src/profile/v100/factors => sargon-factors/src}/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_factor_source.rs (100%) rename crates/{sargon/src/profile/v100/factors => sargon-factors/src}/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_hint.rs (100%) rename crates/{sargon/src/profile/v100/factors => sargon-factors/src}/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_model.rs (100%) rename crates/{sargon/src/profile/v100/factors => sargon-factors/src}/factor_sources/ledger_hardware_wallet_factor_source/mod.rs (100%) rename crates/{sargon/src/profile/v100/factors => sargon-factors/src}/factor_sources/mod.rs (100%) rename crates/{sargon/src/profile/v100/factors => sargon-factors/src}/factor_sources/private_hierarchical_deterministic_factor_source.rs (98%) rename crates/{sargon/src/types => sargon-factors/src}/factor_sources_of_kind.rs (76%) rename crates/{sargon/src/profile/v100/factors => sargon-factors/src}/hd_factor_instance_account_creation.rs (100%) rename crates/{sargon/src/profile/v100/factors => sargon-factors/src}/hd_factor_instance_identity_creation.rs (100%) rename crates/{sargon/src/profile/v100/factors => sargon-factors/src}/hd_transaction_signing_factor_instance.rs (100%) rename crates/{sargon/src/profile/v100/factors => sargon-factors/src}/hierarchical_deterministic_factor_instance.rs (96%) rename crates/{sargon/src/profile/v100/factors => sargon-factors/src}/is_entity_path.rs (100%) rename crates/{sargon/src/profile/v100/factors => sargon-factors/src}/is_factor_source.rs (100%) create mode 100644 crates/sargon-factors/src/lib.rs rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/arculus_card_factor_source/arculus_card_factor_source.rs (99%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/arculus_card_factor_source/arculus_card_hint.rs (100%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/arculus_card_factor_source/arculus_card_model.rs (100%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/arculus_card_factor_source/mod.rs (100%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/mod.rs (100%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/off_device_mnemonic_factor_source/mod.rs (100%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_factor_source_hint.rs (100%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_mnemonic_factor_source.rs (98%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/password_factor_source/mod.rs (100%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/password_factor_source/password_factor_source.rs (100%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/password_factor_source/password_factor_source_hint.rs (100%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/security_questions_factor_source/answer/mod.rs (100%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/security_questions_factor_source/answer/security_question_and_answer.rs (100%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/security_questions_factor_source/answer/security_questions_and_answers.rs (100%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/security_questions_factor_source/kdf/is_security_questions_kdf_scheme.rs (100%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/security_questions_factor_source/kdf/mod.rs (100%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/security_questions_factor_source/kdf/security_questions_keys_from_questions_and_answer_scheme.rs (100%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/keys_by_diffie_hellman_fold.rs (89%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/mod.rs (100%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/keys_from_questions_and_answers_lower_trim_utf8.rs (96%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/mod.rs (100%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/security_question_and_answer_as_bytes.rs (100%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/security_question_answer_as_bytes.rs (100%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/mod.rs (100%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/security_questions_factor_source/mod.rs (100%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/security_questions_factor_source/question/mod.rs (100%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/security_questions_factor_source/question/security_question.rs (100%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/security_questions_factor_source/question/security_question_kind.rs (100%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/security_questions_factor_source/question/security_questions.rs (100%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/security_questions_factor_source/security_questions_factor_source.rs (98%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/security_questions_factor_source/security_questions_sealed_mnemonic.rs (100%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/trusted_contact_factor_source/mod.rs (100%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source.rs (86%) rename crates/{sargon/src/profile/mfa => sargon-factors/src}/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source_contact.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures/matrices => sargon-factors/src/samples}/factor_source_id_samples.rs (100%) rename crates/{sargon/src/types => sargon-factors/src}/samples/factor_source_ids_with_samples.rs (100%) rename crates/{sargon/src/types => sargon-factors/src}/samples/factor_source_samples.rs (94%) rename crates/{sargon/src/types => sargon-factors/src}/samples/hierarchical_deterministic_factor_instance_samples.rs (99%) create mode 100644 crates/sargon-factors/src/samples/mod.rs create mode 100644 crates/sargon-keys-collector/Cargo.toml rename crates/{sargon/src/keys_collector => sargon-keys-collector/src}/collector/derivation_purpose.rs (100%) rename crates/{sargon/src/keys_collector => sargon-keys-collector/src}/collector/key_derivation_outcome.rs (100%) rename crates/{sargon/src/keys_collector => sargon-keys-collector/src}/collector/key_ring.rs (100%) rename crates/{sargon/src/keys_collector => sargon-keys-collector/src}/collector/keys_collector.rs (66%) rename crates/{sargon/src/keys_collector => sargon-keys-collector/src}/collector/keys_collector_dependencies.rs (100%) rename crates/{sargon/src/keys_collector => sargon-keys-collector/src}/collector/keys_collector_preprocessor.rs (100%) rename crates/{sargon/src/keys_collector => sargon-keys-collector/src}/collector/keys_collector_state.rs (100%) rename crates/{sargon/src/keys_collector => sargon-keys-collector/src}/collector/mod.rs (100%) rename crates/{sargon/src/keys_collector => sargon-keys-collector/src}/derivation_testing/mod.rs (53%) rename crates/{sargon/src/keys_collector => sargon-keys-collector/src}/derivation_testing/stateless_dummy_indices.rs (100%) rename crates/{sargon/src/keys_collector => sargon-keys-collector/src}/derivation_testing/test_keys_collector/mod.rs (69%) rename crates/{sargon/src/keys_collector => sargon-keys-collector/src}/derivation_testing/test_keys_collector/test_derivation_interactor.rs (62%) rename crates/{sargon/src/keys_collector => sargon-keys-collector/src}/derivation_testing/test_keys_collector/test_keys_collector.rs (100%) rename crates/{sargon/src/keys_collector => sargon-keys-collector/src}/host_interaction/key_derivation_interactor.rs (100%) rename crates/{sargon/src/keys_collector => sargon-keys-collector/src}/host_interaction/key_derivation_request.rs (100%) rename crates/{sargon/src/keys_collector => sargon-keys-collector/src}/host_interaction/key_derivation_response.rs (100%) rename crates/{sargon/src/keys_collector => sargon-keys-collector/src}/host_interaction/mod.rs (100%) create mode 100644 crates/sargon-keys-collector/src/lib.rs rename crates/{sargon/src/keys_collector => sargon-keys-collector/src}/tests/derivation_tests.rs (88%) rename crates/{sargon/src/keys_collector => sargon-keys-collector/src}/tests/mod.rs (100%) delete mode 100644 crates/sargon/src/identified_vec_of/mod.rs delete mode 100644 crates/sargon/src/keys_collector/mod.rs rename crates/sargon/src/profile/encrypted/{encryption => encrypted_profile}/encrypted_profile_snapshot.rs (100%) create mode 100644 crates/sargon/src/profile/encrypted/encrypted_profile/mod.rs delete mode 100644 crates/sargon/src/profile/v100/factors/mod.rs delete mode 100644 crates/sargon/src/wrapped_radix_engine_toolkit/low_level/address_conversion/mod.rs diff --git a/Cargo.lock b/Cargo.lock index 038124308..d547a7f1b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -179,6 +179,14 @@ version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" +[[package]] +name = "arraystring" +version = "0.3.0" +source = "git+https://github.com/paulocsanz/arraystring?rev=ebd7d8ba94fa0d5068fe048d5445f6b1af56035d#ebd7d8ba94fa0d5068fe048d5445f6b1af56035d" +dependencies = [ + "serde", +] + [[package]] name = "arrayvec" version = "0.7.6" @@ -1582,6 +1590,20 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +[[package]] +name = "identified-vec-of" +version = "1.2.1" +dependencies = [ + "derive_more", + "itertools 0.12.0", + "paste 1.0.14", + "radix-rust", + "sargon-core-assert-json", + "sargon-core-error", + "serde", + "serde_json 1.0.108", +] + [[package]] name = "idna" version = "0.5.0" @@ -2759,6 +2781,7 @@ dependencies = [ "futures", "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", "hkdf", + "identified-vec-of", "iota-crypto", "iso8601-timestamp", "itertools 0.12.0", @@ -2778,8 +2801,11 @@ dependencies = [ "radix-transactions", "rand", "reqwest", + "sargon-addresses", "sargon-core", + "sargon-factors", "sargon-hierarchical-deterministic", + "sargon-keys-collector", "sbor", "security-framework", "security-framework-sys", @@ -2794,10 +2820,34 @@ dependencies = [ "zeroize 1.7.0", ] +[[package]] +name = "sargon-addresses" +version = "1.2.1" +dependencies = [ + "derive_more", + "enum-iterator", + "log", + "pretty_assertions", + "radix-common", + "radix-engine", + "radix-engine-interface", + "radix-engine-toolkit", + "radix-rust", + "radix-transactions", + "sargon-core", + "sargon-factors", + "sargon-hierarchical-deterministic", + "serde", + "serde_json 1.0.108", + "serde_with 3.4.0", +] + [[package]] name = "sargon-core" version = "1.2.1" dependencies = [ + "aes-gcm", + "arraystring", "assert-json-diff", "delegate", "derive_more", @@ -2805,6 +2855,7 @@ dependencies = [ "enum-iterator", "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", "hkdf", + "identified-vec-of", "iota-crypto", "iso8601-timestamp", "itertools 0.12.0", @@ -2817,6 +2868,86 @@ dependencies = [ "radix-rust", "radix-transactions", "rand", + "sargon-core-assert-json", + "sargon-core-error", + "sargon-core-utils", + "serde", + "serde_json 1.0.108", + "serde_repr", + "serde_with 3.4.0", + "strum 0.26.1", + "thiserror 1.0.50", + "url", + "uuid 1.6.1", + "zeroize 1.7.0", +] + +[[package]] +name = "sargon-core-assert-json" +version = "1.2.1" +dependencies = [ + "assert-json-diff", + "log", + "pretty_assertions", + "sargon-core-error", + "serde", + "serde_json 1.0.108", + "thiserror 1.0.50", +] + +[[package]] +name = "sargon-core-error" +version = "1.2.1" +dependencies = [ + "log", + "serde_json 1.0.108", + "thiserror 1.0.50", +] + +[[package]] +name = "sargon-core-utils" +version = "1.2.1" +dependencies = [ + "iso8601-timestamp", + "log", + "pretty_assertions", + "sargon-core-error", + "serde", + "serde_json 1.0.108", + "url", + "uuid 1.6.1", +] + +[[package]] +name = "sargon-factors" +version = "1.2.1" +dependencies = [ + "arraystring", + "assert-json-diff", + "bip39", + "cargo_toml 0.15.3 (git+https://gitlab.com/lib.rs/cargo_toml?rev=e498c94fc42a660c1ca1a28999ce1d757cfe77fe)", + "delegate", + "derive_more", + "enum-as-inner", + "enum-iterator", + "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", + "hkdf", + "identified-vec-of", + "iota-crypto", + "iso8601-timestamp", + "itertools 0.12.0", + "k256 0.13.3", + "log", + "once_cell 1.19.0", + "paste 1.0.14", + "pretty_assertions", + "radix-common", + "radix-engine-interface", + "radix-rust", + "radix-transactions", + "rand", + "sargon-core", + "sargon-hierarchical-deterministic", "serde", "serde_json 1.0.108", "serde_repr", @@ -2840,6 +2971,7 @@ dependencies = [ "enum-iterator", "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", "hkdf", + "identified-vec-of", "iota-crypto", "iso8601-timestamp", "itertools 0.12.0", @@ -2864,6 +2996,20 @@ dependencies = [ "zeroize 1.7.0", ] +[[package]] +name = "sargon-keys-collector" +version = "1.2.1" +dependencies = [ + "actix-rt", + "async-trait", + "derive_more", + "log", + "sargon-addresses", + "sargon-core", + "sargon-factors", + "sargon-hierarchical-deterministic", +] + [[package]] name = "sargon-uniffi" version = "1.2.1" @@ -2890,6 +3036,7 @@ dependencies = [ "rand", "regex 1.9.3 (git+https://github.com/rust-lang/regex/?rev=72f889ef3cca59ebac6a026f3646e8d92f056d88)", "sargon", + "sargon-core", "sargon-uniffi-conversion-macros", "strum 0.26.1", "thiserror 1.0.50", diff --git a/Cargo.toml b/Cargo.toml index f7fd284ea..2e20d5bb7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,23 @@ [workspace] resolver = "2" members = [ - "crates/sargon", + # sorted according to dependency, not alphabetically + "crates/sargon-core-utils", + "crates/sargon-core-error", + "crates/sargon-core-assert-json", + + "crates/identified-vec-of", + "crates/sargon-core", "crates/sargon-hierarchical-deterministic", - "crates/sargon-uniffi", + "crates/sargon-factors", + "crates/sargon-addresses", + "crates/sargon-keys-collector", + + "crates/sargon", # to be split + "crates/sargon-uniffi-conversion-macros", + "crates/sargon-uniffi", ] [profile.release] @@ -24,14 +36,24 @@ radix-common = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1 "serde", "secp256k1_sign_and_validate", ] } +radix-engine = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } radix-engine-interface = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } radix-rust = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0", features = [ "serde", ] } radix-transactions = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } - +radix-engine-toolkit = { git = "https://github.com/radixdlt/radix-engine-toolkit", rev = "2ab5b35a6cb96c9faeb98ed8df67b870336e6873" } # ===== EXTERNAL DEPENDENCIES ======== +arraystring = { git = "https://github.com/paulocsanz/arraystring", rev = "ebd7d8ba94fa0d5068fe048d5445f6b1af56035d", features = [ + "serde-traits", +] } + +# actix-rt = "3.3.0" +actix-rt = { git = "https://github.com/actix/actix-net", rev = "57fd6ea8098d1f2d281c305fc331216c4fe1992e" } + +async-trait = { git = "https://github.com/dtolnay/async-trait", rev = "1eb21ed8bd87029bf4dcbea41ff309f2b2220c43" } + # hkdf = "0.12.4" hkdf = { git = "https://github.com/RustCrypto/KDFs/", rev = "1ac16e8b9d4ee7a67613c9396c6cc1327652eaba" } # thiserror = "1.0.50" @@ -59,6 +81,14 @@ enum-as-inner = { git = "https://github.com/bluejekyll/enum-as-inner/", rev = "c enum-iterator = { git = "https://github.com/stephaneyfx/enum-iterator/", rev = "9d472a1237cfd03b1c7657fdcba74c8070bfb4ea" } +# aes-gcm = "10.3" +aes-gcm = { git = "https://github.com/RustCrypto/AEADs", rev = "7e82b01cd4901f6a35b5153536f11b87f5e4e622", default-features = false, features = [ + "aes", + "alloc", + "getrandom", + "zeroize", +] } + # delegate = "0.12.0" delegate = { git = "https://github.com/Kobzol/rust-delegate/", rev = "ac852be64f3e4b5f9b58be910d09921488d2845d" } @@ -94,6 +124,7 @@ paste = { git = "https://github.com/dtolnay/paste", rev = "1e0cc1025af5388397c67 # pretty_assertions = "1.4.0" pretty_assertions = { git = "https://github.com/rust-pretty-assertions/rust-pretty-assertions", rev = "3f1ebc0cac5f88e875f036bf16636e15fa935c8d" } + serde = { version = "1.0.193", features = ["derive", "rc", "std"] } # serde_json = "1.0.108" @@ -134,3 +165,6 @@ zeroize = { git = "https://github.com/RustCrypto/utils", rev = "df6d2f48a5e8afe8 "zeroize_derive", "derive", ] } + +# cargo_toml = "0.15.3" +cargo_toml = { git = "https://gitlab.com/lib.rs/cargo_toml", rev = "e498c94fc42a660c1ca1a28999ce1d757cfe77fe" } diff --git a/apple/Tests/TestCases/Profile/Factor/HierarchicalDeterministicFactorInstanceTests.swift b/apple/Tests/TestCases/Profile/Factor/HierarchicalDeterministicFactorInstanceTests.swift index 58d960350..b1917b399 100644 --- a/apple/Tests/TestCases/Profile/Factor/HierarchicalDeterministicFactorInstanceTests.swift +++ b/apple/Tests/TestCases/Profile/Factor/HierarchicalDeterministicFactorInstanceTests.swift @@ -25,7 +25,7 @@ final class HierarchicalDeterministicFactorInstanceTests: Test); + pub struct $collection_type(pub identified_vec_of::IdentifiedVecOf<$element_type>); impl std::fmt::Display for $collection_type where $element_type: std::fmt::Display { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { diff --git a/crates/sargon-core/src/identifiable.rs b/crates/identified-vec-of/src/identifiable.rs similarity index 100% rename from crates/sargon-core/src/identifiable.rs rename to crates/identified-vec-of/src/identifiable.rs diff --git a/crates/sargon/src/identified_vec_of/identified_vec_of.rs b/crates/identified-vec-of/src/identified_vec_of.rs similarity index 90% rename from crates/sargon/src/identified_vec_of/identified_vec_of.rs rename to crates/identified-vec-of/src/identified_vec_of.rs index 6312ae161..d759923cd 100644 --- a/crates/sargon/src/identified_vec_of/identified_vec_of.rs +++ b/crates/identified-vec-of/src/identified_vec_of.rs @@ -1,14 +1,9 @@ -use radix_rust::prelude::{IndexMap, IndexSet}; +use radix_rust::prelude::IndexMap; use crate::prelude::*; -use std::{ - any::TypeId, - fmt::{Debug, Display, Formatter}, - hash::Hasher, - ops::Index, -}; -use std::{hash::Hash, ops::DerefMut}; +use std::hash::Hash; +use std::{fmt::Debug, hash::Hasher, ops::Index}; /// A collection which **retains the insertion order** of its **unique** [`Identifiable`] /// items, with **constant time** look up of an item by its `id` - a stable key @@ -81,7 +76,7 @@ impl mod tests { use super::*; - use crate::identified_vec_of::User; + use crate::User; #[allow(clippy::upper_case_acronyms)] type SUT = IdentifiedVecOf; diff --git a/crates/sargon/src/identified_vec_of/identified_vec_of_display_debug.rs b/crates/identified-vec-of/src/identified_vec_of_display_debug.rs similarity index 97% rename from crates/sargon/src/identified_vec_of/identified_vec_of_display_debug.rs rename to crates/identified-vec-of/src/identified_vec_of_display_debug.rs index c006d1f9b..0a1fa2214 100644 --- a/crates/sargon/src/identified_vec_of/identified_vec_of_display_debug.rs +++ b/crates/identified-vec-of/src/identified_vec_of_display_debug.rs @@ -65,7 +65,7 @@ where #[cfg(test)] mod tests { - use crate::identified_vec_of::User; + use crate::User; use super::*; diff --git a/crates/sargon/src/identified_vec_of/identified_vec_of_iterator.rs b/crates/identified-vec-of/src/identified_vec_of_iterator.rs similarity index 98% rename from crates/sargon/src/identified_vec_of/identified_vec_of_iterator.rs rename to crates/identified-vec-of/src/identified_vec_of_iterator.rs index 1cae331e3..8dde59e1f 100644 --- a/crates/sargon/src/identified_vec_of/identified_vec_of_iterator.rs +++ b/crates/identified-vec-of/src/identified_vec_of_iterator.rs @@ -104,7 +104,7 @@ impl Iterator #[cfg(test)] mod tests { - use crate::identified_vec_of::User; + use crate::User; use super::*; diff --git a/crates/sargon/src/identified_vec_of/identified_vec_of_modify.rs b/crates/identified-vec-of/src/identified_vec_of_modify.rs similarity index 97% rename from crates/sargon/src/identified_vec_of/identified_vec_of_modify.rs rename to crates/identified-vec-of/src/identified_vec_of_modify.rs index db4beb816..16ca7cd42 100644 --- a/crates/sargon/src/identified_vec_of/identified_vec_of_modify.rs +++ b/crates/identified-vec-of/src/identified_vec_of_modify.rs @@ -53,7 +53,6 @@ impl IdentifiedVecOf { /// `IdentifiedVecOf`. /// - Complexity: The operation is expected to perform O(1) copy, hash, and compare operations on /// the `ID` type, if it implements high-quality hashing. - #[cfg(not(tarpaulin_include))] // false negative pub fn append(&mut self, item: V) -> (bool, usize) { if let Some(existing) = self.0.get_full(&item.id()) { return (false, existing.0); @@ -82,7 +81,6 @@ impl IdentifiedVecOf { /// Returns `false` if no element of `id` was found, otherwise if found, this /// existing element gets updated by `mutate` closure and this function returns /// `true`. - #[cfg(not(tarpaulin_include))] // false negative #[inline] pub fn update_with( &mut self, @@ -100,7 +98,6 @@ impl IdentifiedVecOf { } /// Updates in place each item by `mutate`. - #[cfg(not(tarpaulin_include))] // false negative #[inline] pub fn update_all_with(&mut self, mut mutate: F) where @@ -114,7 +111,6 @@ impl IdentifiedVecOf { /// Tries to mutate the value identified by `id`, if no such value exists /// an error is returned, the mutation is failable, if your return an `Err` /// in `mutate`, this method propagates that error. - #[cfg(not(tarpaulin_include))] // false negative #[inline] pub fn try_try_update_with( &mut self, @@ -136,7 +132,6 @@ impl IdentifiedVecOf { /// Tries to mutate the value identified by `id`, if no such value exists /// an error is returned, the mutation is failable, if your return an `Err` /// in `mutate`, this method propagates that error. - #[cfg(not(tarpaulin_include))] // false negative #[inline] pub fn try_update_with( &mut self, @@ -216,7 +211,7 @@ pub enum IdentifiableVecOfUpdateItemsOutcome { mod tests { use super::*; - use crate::identified_vec_of::User; + use crate::User; #[allow(clippy::upper_case_acronyms)] type SUT = IdentifiedVecOf; diff --git a/crates/sargon/src/identified_vec_of/identified_vec_of_query.rs b/crates/identified-vec-of/src/identified_vec_of_query.rs similarity index 98% rename from crates/sargon/src/identified_vec_of/identified_vec_of_query.rs rename to crates/identified-vec-of/src/identified_vec_of_query.rs index 38fa9be45..e79067b7c 100644 --- a/crates/sargon/src/identified_vec_of/identified_vec_of_query.rs +++ b/crates/identified-vec-of/src/identified_vec_of_query.rs @@ -66,7 +66,7 @@ impl IdentifiedVecOf { mod tests { use super::*; - use crate::identified_vec_of::User; + use crate::User; #[allow(clippy::upper_case_acronyms)] type SUT = IdentifiedVecOf; diff --git a/crates/sargon/src/identified_vec_of/identified_vec_of_serde.rs b/crates/identified-vec-of/src/identified_vec_of_serde.rs similarity index 94% rename from crates/sargon/src/identified_vec_of/identified_vec_of_serde.rs rename to crates/identified-vec-of/src/identified_vec_of_serde.rs index 3680ad5e1..e465dfc51 100644 --- a/crates/sargon/src/identified_vec_of/identified_vec_of_serde.rs +++ b/crates/identified-vec-of/src/identified_vec_of_serde.rs @@ -1,12 +1,8 @@ -use std::any::TypeId; - use crate::prelude::*; use serde::de::Error; use serde::de::*; use serde::ser::*; -use super::{export_identified_vec_of, import_identified_vec_of_from}; - impl Serialize for IdentifiedVecOf where @@ -41,7 +37,7 @@ where mod tests { use super::*; - use crate::identified_vec_of::User; + use crate::User; #[allow(clippy::upper_case_acronyms)] type SUT = IdentifiedVecOf; diff --git a/crates/sargon/src/identified_vec_of/identified_vec_of_validation_import_export.rs b/crates/identified-vec-of/src/identified_vec_of_validation_import_export.rs similarity index 79% rename from crates/sargon/src/identified_vec_of/identified_vec_of_validation_import_export.rs rename to crates/identified-vec-of/src/identified_vec_of_validation_import_export.rs index 8218ae8db..878c26b3b 100644 --- a/crates/sargon/src/identified_vec_of/identified_vec_of_validation_import_export.rs +++ b/crates/identified-vec-of/src/identified_vec_of_validation_import_export.rs @@ -1,5 +1,3 @@ -use std::any::TypeId; - use crate::prelude::*; pub fn import_identified_vec_of_from( @@ -25,12 +23,12 @@ where V: Debug + Eq + Clone + Identifiable + 'static, { if id_vec.is_empty() { - if TypeId::of::() == TypeId::of::() { + if std::any::type_name::().split("::").last().unwrap() + == "SLIP10Curve" + { return Err(CommonError::SupportedCurvesMustNotBeEmpty); } - // `FactorSource` is not declared in this crate, so we - // cannot use `TypeId`, but this should be good enough. if std::any::type_name::().split("::").last().unwrap() == "FactorSource" { diff --git a/crates/identified-vec-of/src/lib.rs b/crates/identified-vec-of/src/lib.rs new file mode 100644 index 000000000..3874ec35f --- /dev/null +++ b/crates/identified-vec-of/src/lib.rs @@ -0,0 +1,37 @@ +#![feature(trivial_bounds)] +#![allow(trivial_bounds)] + +mod decl_identified_vec_of_with_samples; +mod identifiable; +mod identified_vec_of; +mod identified_vec_of_display_debug; +mod identified_vec_of_iterator; +mod identified_vec_of_modify; +mod identified_vec_of_query; +mod identified_vec_of_serde; +mod identified_vec_of_validation_import_export; + +#[cfg(test)] +mod user; + +pub mod prelude { + + pub use sargon_core_assert_json::prelude::*; + pub use sargon_core_error::prelude::*; + + pub use crate::decl_identified_vec_of_with_samples::*; + pub use crate::identifiable::*; + pub use crate::identified_vec_of::*; + pub use crate::identified_vec_of_iterator::*; + pub use crate::identified_vec_of_modify::*; + pub use crate::identified_vec_of_validation_import_export::*; + + pub use itertools::Itertools; + pub use std::fmt::{Debug, Display}; + pub use std::hash::Hash as StdHash; +} + +#[cfg(test)] +pub(crate) use user::*; + +pub use prelude::*; diff --git a/crates/sargon/src/identified_vec_of/user.rs b/crates/identified-vec-of/src/user.rs similarity index 93% rename from crates/sargon/src/identified_vec_of/user.rs rename to crates/identified-vec-of/src/user.rs index a479bbc31..0193cd624 100644 --- a/crates/sargon/src/identified_vec_of/user.rs +++ b/crates/identified-vec-of/src/user.rs @@ -87,14 +87,14 @@ fn sample_vec_other() -> Vec { } #[cfg(test)] -impl crate::HasSampleValues for IdentifiedVecOf { +impl IdentifiedVecOf { /// Alice(0), Carol(2), Erin(4), Grace(6) - fn sample() -> Self { + pub fn sample() -> Self { Self::from_iter(sample_vec()) } /// Bob(1), David(3), Frank(5) - fn sample_other() -> Self { + pub fn sample_other() -> Self { Self::from_iter(sample_vec_other()) } } diff --git a/crates/sargon-addresses/Cargo.toml b/crates/sargon-addresses/Cargo.toml new file mode 100644 index 000000000..4722d7b2b --- /dev/null +++ b/crates/sargon-addresses/Cargo.toml @@ -0,0 +1,27 @@ +[package] +name = "sargon-addresses" +version = "1.2.1" +edition = "2021" + +[dependencies] +sargon-core = { path = "../sargon-core" } +sargon-factors = { path = "../sargon-factors" } +sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } + +# ==== RADIX DEPENDENCIES ==== +radix-common = { workspace = true } +radix-engine-interface = { workspace = true } +radix-engine = { workspace = true } +radix-rust = { workspace = true } +radix-transactions = { workspace = true } + +radix-engine-toolkit = { workspace = true } + +# ==== EXTERNAL DEPENDENCIES ==== +derive_more = { workspace = true } +enum-iterator = { workspace = true } +log = { workspace = true } +pretty_assertions = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +serde_with = { workspace = true } diff --git a/crates/sargon/src/profile/v100/address/access_controller_address.rs b/crates/sargon-addresses/src/address/access_controller_address.rs similarity index 100% rename from crates/sargon/src/profile/v100/address/access_controller_address.rs rename to crates/sargon-addresses/src/address/access_controller_address.rs diff --git a/crates/sargon/src/profile/v100/address/account_address.rs b/crates/sargon-addresses/src/address/account_address.rs similarity index 98% rename from crates/sargon/src/profile/v100/address/account_address.rs rename to crates/sargon-addresses/src/address/account_address.rs index bbe45eaf1..a57665862 100644 --- a/crates/sargon/src/profile/v100/address/account_address.rs +++ b/crates/sargon-addresses/src/address/account_address.rs @@ -65,6 +65,12 @@ impl HasSampleValues for AccountAddress { } } +impl From for ScryptoComponentAddress { + fn from(value: AccountAddress) -> ScryptoComponentAddress { + ScryptoComponentAddress::new_or_panic(value.node_id().0) + } +} + impl AccountAddress { /// A sample used to facilitate unit tests. pub fn sample_mainnet() -> Self { diff --git a/crates/sargon/src/profile/v100/address/address.rs b/crates/sargon-addresses/src/address/address.rs similarity index 100% rename from crates/sargon/src/profile/v100/address/address.rs rename to crates/sargon-addresses/src/address/address.rs diff --git a/crates/sargon/src/profile/v100/address/address_format.rs b/crates/sargon-addresses/src/address/address_format.rs similarity index 100% rename from crates/sargon/src/profile/v100/address/address_format.rs rename to crates/sargon-addresses/src/address/address_format.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/address_of_account_or_persona.rs b/crates/sargon-addresses/src/address/address_of_account_or_persona.rs similarity index 96% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/address_of_account_or_persona.rs rename to crates/sargon-addresses/src/address/address_of_account_or_persona.rs index 19b3c798d..ed0c957ce 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/address_of_account_or_persona.rs +++ b/crates/sargon-addresses/src/address/address_of_account_or_persona.rs @@ -1,4 +1,4 @@ -use crate::prelude::*; +use crate::{address_union, prelude::*}; address_union!( /// A tagged union of addresses of either an Account or a Persona (IdentityAddress) diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/address_union.rs b/crates/sargon-addresses/src/address/address_union.rs similarity index 99% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/address_union.rs rename to crates/sargon-addresses/src/address/address_union.rs index 6a71ef698..80e08dfe4 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/address_union.rs +++ b/crates/sargon-addresses/src/address/address_union.rs @@ -1,5 +1,3 @@ -use crate::prelude::*; - #[macro_export] macro_rules! address_union { ( diff --git a/crates/sargon/src/profile/v100/address/component_address.rs b/crates/sargon-addresses/src/address/component_address.rs similarity index 100% rename from crates/sargon/src/profile/v100/address/component_address.rs rename to crates/sargon-addresses/src/address/component_address.rs diff --git a/crates/sargon/src/profile/v100/address/entity_address.rs b/crates/sargon-addresses/src/address/entity_address.rs similarity index 94% rename from crates/sargon/src/profile/v100/address/entity_address.rs rename to crates/sargon-addresses/src/address/entity_address.rs index 2d914d5f9..66d89070c 100644 --- a/crates/sargon/src/profile/v100/address/entity_address.rs +++ b/crates/sargon-addresses/src/address/entity_address.rs @@ -24,7 +24,6 @@ pub trait IsEntityAddress: { /// Creates a new address from `public_key` and `network_id` by bech32 encoding /// it. - #[cfg(not(tarpaulin_include))] // false negative fn from_public_key

(public_key: P, network_id: NetworkID) -> Self where P: Into + Clone, @@ -39,7 +38,6 @@ pub trait IsEntityAddress: Self::new(node_id, network_id).expect("To always be able to create a address from public key and network id.") } - #[cfg(not(tarpaulin_include))] // false negative fn from_hd_factor_instance_virtual_entity_creation( hd_factor_instance_virtual_entity_creation: HDFactorInstanceTransactionSigning, ) -> Self { diff --git a/crates/sargon/src/profile/v100/address/identity_address.rs b/crates/sargon-addresses/src/address/identity_address.rs similarity index 100% rename from crates/sargon/src/profile/v100/address/identity_address.rs rename to crates/sargon-addresses/src/address/identity_address.rs diff --git a/crates/sargon/src/profile/v100/address/legacy_olympia_account_address.rs b/crates/sargon-addresses/src/address/legacy_olympia_account_address.rs similarity index 100% rename from crates/sargon/src/profile/v100/address/legacy_olympia_account_address.rs rename to crates/sargon-addresses/src/address/legacy_olympia_account_address.rs diff --git a/crates/sargon/src/profile/v100/address/locker_address.rs b/crates/sargon-addresses/src/address/locker_address.rs similarity index 100% rename from crates/sargon/src/profile/v100/address/locker_address.rs rename to crates/sargon-addresses/src/address/locker_address.rs diff --git a/crates/sargon/src/profile/v100/address/mod.rs b/crates/sargon-addresses/src/address/mod.rs similarity index 86% rename from crates/sargon/src/profile/v100/address/mod.rs rename to crates/sargon-addresses/src/address/mod.rs index d19c0f1e3..7e643e202 100644 --- a/crates/sargon/src/profile/v100/address/mod.rs +++ b/crates/sargon-addresses/src/address/mod.rs @@ -2,6 +2,11 @@ mod access_controller_address; mod account_address; mod address; mod address_format; +mod address_of_account_or_persona; + +#[macro_use] +mod address_union; + mod component_address; mod entity_address; mod identity_address; @@ -13,6 +18,7 @@ mod non_fungible_local_id_string; mod non_fungible_resource_address; mod package_address; mod pool_address; +mod public_key_hash; mod resource_address; mod validator_address; mod vault_address; @@ -22,6 +28,7 @@ pub use access_controller_address::*; pub use account_address::*; pub use address::*; pub use address_format::*; +pub use address_of_account_or_persona::*; pub use component_address::*; pub use entity_address::*; pub use identity_address::*; @@ -33,6 +40,7 @@ pub use non_fungible_local_id_string::*; pub use non_fungible_resource_address::*; pub use package_address::*; pub use pool_address::*; +pub use public_key_hash::*; pub use resource_address::*; pub use validator_address::*; pub use vault_address::*; diff --git a/crates/sargon/src/profile/v100/address/non_fungible_global_id.rs b/crates/sargon-addresses/src/address/non_fungible_global_id.rs similarity index 100% rename from crates/sargon/src/profile/v100/address/non_fungible_global_id.rs rename to crates/sargon-addresses/src/address/non_fungible_global_id.rs diff --git a/crates/sargon/src/profile/v100/address/non_fungible_local_id.rs b/crates/sargon-addresses/src/address/non_fungible_local_id.rs similarity index 99% rename from crates/sargon/src/profile/v100/address/non_fungible_local_id.rs rename to crates/sargon-addresses/src/address/non_fungible_local_id.rs index c3afcc978..9afb97f66 100644 --- a/crates/sargon/src/profile/v100/address/non_fungible_local_id.rs +++ b/crates/sargon-addresses/src/address/non_fungible_local_id.rs @@ -65,7 +65,7 @@ impl NonFungibleLocalId { } impl NonFungibleLocalId { - pub(crate) fn derives_account_address( + pub fn derives_account_address( &self, account_address: AccountAddress, ) -> bool { diff --git a/crates/sargon/src/profile/v100/address/non_fungible_local_id_string.rs b/crates/sargon-addresses/src/address/non_fungible_local_id_string.rs similarity index 100% rename from crates/sargon/src/profile/v100/address/non_fungible_local_id_string.rs rename to crates/sargon-addresses/src/address/non_fungible_local_id_string.rs diff --git a/crates/sargon/src/profile/v100/address/non_fungible_resource_address.rs b/crates/sargon-addresses/src/address/non_fungible_resource_address.rs similarity index 100% rename from crates/sargon/src/profile/v100/address/non_fungible_resource_address.rs rename to crates/sargon-addresses/src/address/non_fungible_resource_address.rs diff --git a/crates/sargon/src/profile/v100/address/package_address.rs b/crates/sargon-addresses/src/address/package_address.rs similarity index 100% rename from crates/sargon/src/profile/v100/address/package_address.rs rename to crates/sargon-addresses/src/address/package_address.rs diff --git a/crates/sargon/src/profile/v100/address/pool_address.rs b/crates/sargon-addresses/src/address/pool_address.rs similarity index 100% rename from crates/sargon/src/profile/v100/address/pool_address.rs rename to crates/sargon-addresses/src/address/pool_address.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/public_key_hash.rs b/crates/sargon-addresses/src/address/public_key_hash.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/public_key_hash.rs rename to crates/sargon-addresses/src/address/public_key_hash.rs diff --git a/crates/sargon/src/profile/v100/address/resource_address.rs b/crates/sargon-addresses/src/address/resource_address.rs similarity index 99% rename from crates/sargon/src/profile/v100/address/resource_address.rs rename to crates/sargon-addresses/src/address/resource_address.rs index 48c4f5668..5294c1ad2 100644 --- a/crates/sargon/src/profile/v100/address/resource_address.rs +++ b/crates/sargon-addresses/src/address/resource_address.rs @@ -134,8 +134,7 @@ impl ResourceAddress { .expect("valid sample value") } - #[allow(unused)] - pub(crate) fn sample_sim_xrd() -> Self { + pub fn sample_sim_xrd() -> Self { "resource_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3" .parse() .expect("valid sample value") diff --git a/crates/sargon/src/profile/v100/address/validator_address.rs b/crates/sargon-addresses/src/address/validator_address.rs similarity index 100% rename from crates/sargon/src/profile/v100/address/validator_address.rs rename to crates/sargon-addresses/src/address/validator_address.rs diff --git a/crates/sargon/src/profile/v100/address/vault_address.rs b/crates/sargon-addresses/src/address/vault_address.rs similarity index 100% rename from crates/sargon/src/profile/v100/address/vault_address.rs rename to crates/sargon-addresses/src/address/vault_address.rs diff --git a/crates/sargon/src/profile/v100/address/wrap_ret_address.rs b/crates/sargon-addresses/src/address/wrap_ret_address.rs similarity index 97% rename from crates/sargon/src/profile/v100/address/wrap_ret_address.rs rename to crates/sargon-addresses/src/address/wrap_ret_address.rs index 0c16e0825..e0a6334ba 100644 --- a/crates/sargon/src/profile/v100/address/wrap_ret_address.rs +++ b/crates/sargon-addresses/src/address/wrap_ret_address.rs @@ -37,17 +37,6 @@ pub(crate) trait FromRetAddress { type RetAddress; } -pub(crate) fn format_string( - s: impl AsRef, - start: usize, - end: usize, -) -> String { - let s = s.as_ref(); - let prefix = &s[0..start]; - let suffix = suffix_str(end, s); - format!("{}...{}", prefix, suffix) -} - pub trait IntoScryptoAddress: IsNetworkAware { fn scrypto(&self) -> ScryptoGlobalAddress; } @@ -92,6 +81,14 @@ macro_rules! decl_ret_wrapped_address { } } + impl Identifiable for [< $address_type:camel Address >] { + type ID = Self; + + fn id(&self) -> Self::ID { + *self + } + } + #[cfg(test)] impl From<&str> for [< $address_type:camel Address >] { /// TEST ONLY diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/addresses_manifest_builder_support.rs b/crates/sargon-addresses/src/address_conversion/addresses_manifest_builder_support.rs similarity index 87% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/addresses_manifest_builder_support.rs rename to crates/sargon-addresses/src/address_conversion/addresses_manifest_builder_support.rs index 4e8874b0a..5fcac9780 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/addresses_manifest_builder_support.rs +++ b/crates/sargon-addresses/src/address_conversion/addresses_manifest_builder_support.rs @@ -140,51 +140,6 @@ impl From for ScryptoResourceOrNonFungible { } } -#[cfg(not(tarpaulin_include))] // false negative, tested. -pub(crate) fn to_vec_network_aware( - values: impl IntoIterator, - network_id: NetworkID, -) -> Vec -where - U: From<(T, NetworkID)>, -{ - values - .into_iter() - .map(|x| (x, network_id)) - .map(U::from) - .collect_vec() -} - -pub(crate) fn to_hashmap_network_aware_key( - values: impl IntoIterator, - network_id: NetworkID, -) -> HashMap -where - L: Eq + std::hash::Hash + From<(K, NetworkID)>, - U: From, -{ - values - .into_iter() - .map(|(k, v)| (L::from((k, network_id)), U::from(v))) - .collect::>() -} - -#[cfg(not(tarpaulin_include))] // false negative, tested. -pub(crate) fn filter_try_to_vec_network_aware( - values: impl IntoIterator, - network_id: NetworkID, -) -> Vec -where - U: TryFrom<(T, NetworkID)>, -{ - values - .into_iter() - .map(|x| (x, network_id)) - .map(U::try_from) - .filter_map(Result::ok) - .collect_vec() -} - #[cfg(test)] mod tests { use super::*; diff --git a/crates/sargon-addresses/src/address_conversion/mod.rs b/crates/sargon-addresses/src/address_conversion/mod.rs new file mode 100644 index 000000000..0ce2b5183 --- /dev/null +++ b/crates/sargon-addresses/src/address_conversion/mod.rs @@ -0,0 +1,2 @@ +mod addresses_manifest_builder_support; +mod resource_address_from; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/address_conversion/resource_address_from.rs b/crates/sargon-addresses/src/address_conversion/resource_address_from.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/address_conversion/resource_address_from.rs rename to crates/sargon-addresses/src/address_conversion/resource_address_from.rs diff --git a/crates/sargon-addresses/src/lib.rs b/crates/sargon-addresses/src/lib.rs new file mode 100644 index 000000000..4a544b6c2 --- /dev/null +++ b/crates/sargon-addresses/src/lib.rs @@ -0,0 +1,85 @@ +mod address; +mod address_conversion; +mod resource; + +pub mod prelude { + pub(crate) use sargon_core::prelude::*; + pub(crate) use sargon_factors::prelude::*; + pub(crate) use sargon_hierarchical_deterministic::prelude::*; + + pub use crate::address::*; + pub use crate::resource::*; + + pub(crate) use radix_engine_interface::blueprints::resource::ResourceOrNonFungible as ScryptoResourceOrNonFungible; + + pub use radix_common::{ + address::{ + AddressBech32Decoder as ScryptoAddressBech32Decoder, + AddressBech32Encoder as ScryptoAddressBech32Encoder, + }, + crypto::{ + Ed25519PublicKey as ScryptoEd25519PublicKey, + Ed25519PublicKeyHash as ScryptoEd25519PublicKeyHash, + Hash as ScryptoHash, PublicKey as ScryptoPublicKey, + PublicKeyHash as ScryptoPublicKeyHash, + Secp256k1PublicKeyHash as ScryptoSecp256k1PublicKeyHash, + }, + data::scrypto::{ + model::{ + BytesNonFungibleLocalId as ScryptoBytesNonFungibleLocalId, + IntegerNonFungibleLocalId as ScryptoIntegerNonFungibleLocalId, + NonFungibleLocalId as ScryptoNonFungibleLocalId, + RUIDNonFungibleLocalId as ScryptoRUIDNonFungibleLocalId, + StringNonFungibleLocalId as ScryptoStringNonFungibleLocalId, + }, + scrypto_decode as Scrypto_scrypto_decode, + scrypto_encode as Scrypto_scrypto_encode, + }, + prelude::{ + AllowedIds as ScryptoAllowedIds, + DynamicComponentAddress as ScryptoDynamicComponentAddress, + DynamicGlobalAddress as ScryptoDynamicGlobalAddress, + DynamicResourceAddress as ScryptoDynamicResourceAddress, + FromPublicKey as ScryptoFromPublicKey, Instant as ScryptoInstant, + LowerBound as ScryptoLowerBound, + ManifestAddress as ScryptoManifestAddress, + ManifestAddressReservation as ScryptoManifestAddressReservation, + ManifestBucket as ScryptoManifestBucket, + ManifestCustomValue as ScryptoManifestCustomValue, + ManifestCustomValueKind as ScryptoManifestCustomValueKind, + ManifestEncode as ScryptoManifestEncode, + ManifestNamedAddress as ScryptoManifestNamedAddress, + ManifestProof as ScryptoManifestProof, + ManifestValue as ScryptoManifestValue, + NonFungibleData as ScryptoNonFungibleData, + NonFungibleGlobalId as ScryptoNonFungibleGlobalId, + NonFungibleIdType as ScryptoNonFungibleIdType, XRD, + }, + types::{ + ComponentAddress as ScryptoComponentAddress, + EntityType as ScryptoEntityType, + GlobalAddress as ScryptoGlobalAddress, NodeId as ScryptoNodeId, + ResourceAddress as ScryptoResourceAddress, + }, + }; + pub(crate) use radix_engine::system::system_modules::execution_trace::ResourceSpecifier as ScryptoResourceSpecifier; + + pub use radix_engine_toolkit::models::{ + canonical_address_types::{ + CanonicalAccessControllerAddress as RetAccessControllerAddress, + CanonicalAccountAddress as RetAccountAddress, + CanonicalAddress as RetIsAddressTrait, + CanonicalComponentAddress as RetComponentAddress, + CanonicalIdentityAddress as RetIdentityAddress, + CanonicalLockerAddress as RetLockerAddress, + CanonicalPackageAddress as RetPackageAddress, + CanonicalPoolAddress as RetPoolAddress, + CanonicalResourceAddress as RetResourceAddress, + CanonicalValidatorAddress as RetValidatorAddress, + CanonicalVaultAddress as RetVaultAddress, + }, + node_id::TypedNodeId as RetTypedNodeId, + }; +} + +pub use prelude::*; diff --git a/crates/sargon-addresses/src/resource/mod.rs b/crates/sargon-addresses/src/resource/mod.rs new file mode 100644 index 000000000..ae1eb6ea0 --- /dev/null +++ b/crates/sargon-addresses/src/resource/mod.rs @@ -0,0 +1,3 @@ +mod resource_or_non_fungible; + +pub use resource_or_non_fungible::*; diff --git a/crates/sargon/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/resource_or_non_fungible.rs b/crates/sargon-addresses/src/resource/resource_or_non_fungible.rs similarity index 79% rename from crates/sargon/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/resource_or_non_fungible.rs rename to crates/sargon-addresses/src/resource/resource_or_non_fungible.rs index 709186b2a..0840290f7 100644 --- a/crates/sargon/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/resource_or_non_fungible.rs +++ b/crates/sargon-addresses/src/resource/resource_or_non_fungible.rs @@ -1,5 +1,11 @@ use crate::prelude::*; +use radix_engine_interface::blueprints::account::{ + AccountAddAuthorizedDepositorInput as ScryptoAccountAddAuthorizedDepositorInput, + AccountRemoveAuthorizedDepositorInput as ScryptoAccountRemoveAuthorizedDepositorInput, + AccountRemoveResourcePreferenceInput as ScryptoAccountRemoveResourcePreferenceInput, +}; + /// The addresses that can be added as exception to the `DepositRule` #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, Hash)] #[serde(tag = "discriminator")] @@ -11,6 +17,37 @@ pub enum ResourceOrNonFungible { NonFungible { value: NonFungibleGlobalId }, } +impl From + for ScryptoAccountRemoveAuthorizedDepositorInput +{ + fn from(value: ResourceOrNonFungible) -> Self { + Self { + badge: value.into(), + } + } +} +impl From for ScryptoAccountAddAuthorizedDepositorInput { + fn from(value: ResourceOrNonFungible) -> Self { + Self { + badge: value.into(), + } + } +} +impl From + for ScryptoAccountRemoveResourcePreferenceInput +{ + fn from(value: ResourceOrNonFungible) -> Self { + match value { + ResourceOrNonFungible::Resource { value } => Self { + resource_address: value.into(), + }, + ResourceOrNonFungible::NonFungible { value } => Self { + resource_address: value.resource_address.into(), + }, + } + } +} + impl std::fmt::Display for ResourceOrNonFungible { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { diff --git a/crates/sargon-core-assert-json/Cargo.toml b/crates/sargon-core-assert-json/Cargo.toml new file mode 100644 index 000000000..522554d38 --- /dev/null +++ b/crates/sargon-core-assert-json/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "sargon-core-assert-json" +version = "1.2.1" +edition = "2021" + +[dependencies] +sargon-core-error = { path = "../sargon-core-error" } + +log = { workspace = true } +pretty_assertions = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +thiserror = { workspace = true } +assert-json-diff = { workspace = true } diff --git a/crates/sargon-core/src/assert_json.rs b/crates/sargon-core-assert-json/src/assert_json.rs similarity index 100% rename from crates/sargon-core/src/assert_json.rs rename to crates/sargon-core-assert-json/src/assert_json.rs diff --git a/crates/sargon-core-assert-json/src/lib.rs b/crates/sargon-core-assert-json/src/lib.rs new file mode 100644 index 000000000..75a35baf1 --- /dev/null +++ b/crates/sargon-core-assert-json/src/lib.rs @@ -0,0 +1,6 @@ +mod assert_json; + +pub mod prelude { + + pub use crate::assert_json::*; +} diff --git a/crates/sargon-core-error/Cargo.toml b/crates/sargon-core-error/Cargo.toml new file mode 100644 index 000000000..2a14a2069 --- /dev/null +++ b/crates/sargon-core-error/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "sargon-core-error" +version = "1.2.1" +edition = "2021" + +[dependencies] + +thiserror = { workspace = true } +serde_json = { workspace = true } +log = { workspace = true } diff --git a/crates/sargon-core/src/error/common_error.rs b/crates/sargon-core-error/src/common_error.rs similarity index 98% rename from crates/sargon-core/src/error/common_error.rs rename to crates/sargon-core-error/src/common_error.rs index 637768bac..4acbdf2f1 100644 --- a/crates/sargon-core/src/error/common_error.rs +++ b/crates/sargon-core-error/src/common_error.rs @@ -1,5 +1,3 @@ -use crate::prelude::*; - use thiserror::Error as ThisError; pub type Result = std::result::Result; @@ -11,7 +9,7 @@ pub enum CommonError { Unknown = 10000, #[error("Failed to create Ed25519 Private key from bytes {bad_value:?}")] - InvalidEd25519PrivateKeyFromBytes { bad_value: BagOfBytes } = 10001, + InvalidEd25519PrivateKeyFromBytes { bad_value: String } = 10001, #[error("Failed to create Ed25519 Private key from String {bad_value}.")] InvalidEd25519PrivateKeyFromString { bad_value: String } = 10002, @@ -19,7 +17,7 @@ pub enum CommonError { #[error( "Failed to create Secp256k1 Private key from bytes {bad_value:?}." )] - InvalidSecp256k1PrivateKeyFromBytes { bad_value: BagOfBytes } = 10003, + InvalidSecp256k1PrivateKeyFromBytes { bad_value: String } = 10003, #[error( "Failed to create Secp256k1 Private key from String {bad_value:?}." @@ -27,13 +25,13 @@ pub enum CommonError { InvalidSecp256k1PrivateKeyFromString { bad_value: String } = 10004, #[error("Failed to create Ed25519 Public key from bytes {bad_value:?}.")] - InvalidEd25519PublicKeyFromBytes { bad_value: BagOfBytes } = 10005, + InvalidEd25519PublicKeyFromBytes { bad_value: String } = 10005, #[error("Failed to create Ed25519 Public key from String {bad_value}.")] InvalidEd25519PublicKeyFromString { bad_value: String } = 10006, #[error("Failed to create Secp256k1 Public key from bytes {bad_value:?}.")] - InvalidSecp256k1PublicKeyFromBytes { bad_value: BagOfBytes } = 10007, + InvalidSecp256k1PublicKeyFromBytes { bad_value: String } = 10007, #[error("Failed to create Secp256k1 Public key from String {bad_value}.")] InvalidSecp256k1PublicKeyFromString { bad_value: String } = 10008, @@ -203,7 +201,7 @@ pub enum CommonError { InvalidLength { expected: u64, found: u64, - data: BagOfBytes, + data: String, } = 10057, #[error("Invalid NonFungibleLocalID::String")] @@ -485,12 +483,12 @@ pub enum CommonError { #[error( "Failed to create KeyAgreementPublicKey from bytes: {bad_value:?}" )] - InvalidKeyAgreementPublicKeyFromBytes { bad_value: BagOfBytes } = 10138, + InvalidKeyAgreementPublicKeyFromBytes { bad_value: String } = 10138, #[error( "Failed to create KeyAgreementPrivateKey from bytes: {bad_value:?}" )] - InvalidKeyAgreementPrivateKeyFromBytes { bad_value: BagOfBytes } = 10139, + InvalidKeyAgreementPrivateKeyFromBytes { bad_value: String } = 10139, #[error("RadixConnectMobileSession not found, session id: {session_id}")] RadixConnectMobileSessionNotFound { session_id: String } = 10140, @@ -863,16 +861,6 @@ impl CommonError { } } -impl HasSampleValues for CommonError { - fn sample() -> Self { - CommonError::Unknown - } - - fn sample_other() -> Self { - CommonError::Unknown - } -} - #[cfg(test)] mod tests { use crate::prelude::*; diff --git a/crates/sargon-core-error/src/lib.rs b/crates/sargon-core-error/src/lib.rs new file mode 100644 index 000000000..95fbf3394 --- /dev/null +++ b/crates/sargon-core-error/src/lib.rs @@ -0,0 +1,8 @@ +#![allow(internal_features)] +#![feature(core_intrinsics)] + +mod common_error; + +pub mod prelude { + pub use crate::common_error::*; +} diff --git a/crates/sargon-core-utils/Cargo.toml b/crates/sargon-core-utils/Cargo.toml new file mode 100644 index 000000000..c2a9b2943 --- /dev/null +++ b/crates/sargon-core-utils/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "sargon-core-utils" +version = "1.2.1" +edition = "2021" + +[dependencies] +sargon-core-error = { path = "../sargon-core-error" } + +iso8601-timestamp = { workspace = true } +log = { workspace = true } +pretty_assertions = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +url = { workspace = true } +uuid = { workspace = true } diff --git a/crates/sargon-core/src/error/common_error_map.rs b/crates/sargon-core-utils/src/common_error_map.rs similarity index 97% rename from crates/sargon-core/src/error/common_error_map.rs rename to crates/sargon-core-utils/src/common_error_map.rs index 750667714..e90801b14 100644 --- a/crates/sargon-core/src/error/common_error_map.rs +++ b/crates/sargon-core-utils/src/common_error_map.rs @@ -1,4 +1,5 @@ use crate::prelude::*; +use sargon_core_error::prelude::CommonError; pub trait MapToFailedToDeserializeJSONToValue { fn map_failed_to_deserialize_string( diff --git a/crates/sargon-core/src/utils/constants.rs b/crates/sargon-core-utils/src/constants.rs similarity index 100% rename from crates/sargon-core/src/utils/constants.rs rename to crates/sargon-core-utils/src/constants.rs diff --git a/crates/sargon-core/src/utils/factory.rs b/crates/sargon-core-utils/src/factory.rs similarity index 74% rename from crates/sargon-core/src/utils/factory.rs rename to crates/sargon-core-utils/src/factory.rs index 124865418..2ec7c50af 100644 --- a/crates/sargon-core/src/utils/factory.rs +++ b/crates/sargon-core-utils/src/factory.rs @@ -24,27 +24,10 @@ pub fn date(dt: &Timestamp) -> String { dt.date().to_string() } -impl HasSampleValues for Uuid { - fn sample() -> Self { - Self::from_bytes([0xff; 16]) - } - - fn sample_other() -> Self { - Self::from_bytes([0xde; 16]) - } -} -impl HasSampleValues for Timestamp { - fn sample() -> Self { - Self::parse("2023-09-11T16:05:56Z").unwrap() - } - - fn sample_other() -> Self { - Self::parse("2023-12-24T17:13:56.123Z").unwrap() - } -} - #[cfg(test)] mod tests { + use std::collections::BTreeSet; + use crate::prelude::*; #[test] diff --git a/crates/sargon-core-utils/src/lib.rs b/crates/sargon-core-utils/src/lib.rs new file mode 100644 index 000000000..d719fe56e --- /dev/null +++ b/crates/sargon-core-utils/src/lib.rs @@ -0,0 +1,20 @@ +mod common_error_map; +mod constants; +mod factory; +mod logged_panic; +mod serialization; +mod string_utils; + +pub mod prelude { + pub use crate::common_error_map::*; + pub use crate::constants::*; + pub use crate::factory::*; + pub use crate::logged_panic::*; + pub use crate::serialization::*; + pub use crate::string_utils::*; + + pub use iso8601_timestamp::Timestamp; + pub use log::*; + pub use std::collections::HashMap; + pub use uuid::Uuid; +} diff --git a/crates/sargon-core/src/utils/logged_panic.rs b/crates/sargon-core-utils/src/logged_panic.rs similarity index 100% rename from crates/sargon-core/src/utils/logged_panic.rs rename to crates/sargon-core-utils/src/logged_panic.rs diff --git a/crates/sargon-core/src/utils/serialization.rs b/crates/sargon-core-utils/src/serialization.rs similarity index 97% rename from crates/sargon-core/src/utils/serialization.rs rename to crates/sargon-core-utils/src/serialization.rs index bd15b7aed..710abdce8 100644 --- a/crates/sargon-core/src/utils/serialization.rs +++ b/crates/sargon-core-utils/src/serialization.rs @@ -1,5 +1,6 @@ use crate::prelude::*; -use serde::de::DeserializeOwned; +use sargon_core_error::prelude::*; +use serde::{de::DeserializeOwned, Serialize}; pub trait SerializeToBytes { fn serialize_to_bytes(&self) -> Result>; diff --git a/crates/sargon-core/src/utils/string_utils.rs b/crates/sargon-core-utils/src/string_utils.rs similarity index 90% rename from crates/sargon-core/src/utils/string_utils.rs rename to crates/sargon-core-utils/src/string_utils.rs index 2b351e260..29c6b5452 100644 --- a/crates/sargon-core/src/utils/string_utils.rs +++ b/crates/sargon-core-utils/src/string_utils.rs @@ -1,6 +1,4 @@ -use crate::prelude::*; use url::form_urlencoded; -use url::Url; /// Returns the last `n` chars of the &str `s`. If `s` is shorter than `n` /// we panic. @@ -9,6 +7,21 @@ pub fn suffix_str(n: usize, s: impl AsRef) -> String { s.as_ref()[split_pos..].to_string() } +pub fn type_name() -> String { + std::any::type_name::() + .split("::") + .last() + .unwrap() + .to_owned() +} + +pub fn format_string(s: impl AsRef, start: usize, end: usize) -> String { + let s = s.as_ref(); + let prefix = &s[0..start]; + let suffix = suffix_str(end, s); + format!("{}...{}", prefix, suffix) +} + /// Returns the first `n` chars of the &str `s`. If `n` is bigger than `s` then /// the whole `s` is returned. pub fn prefix_str(n: usize, s: impl AsRef) -> String { @@ -37,12 +50,6 @@ impl StrExt for str { } } -pub fn parse_url(s: impl AsRef) -> Result { - Url::try_from(s.as_ref()).map_err(|_| CommonError::InvalidURL { - bad_value: s.as_ref().to_owned(), - }) -} - pub fn url_encode(s: impl AsRef) -> String { form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() } @@ -100,16 +107,6 @@ mod tests { assert_eq!("Foobar".remove_last(), "Fooba"); } - #[test] - fn test_parse_url() { - assert!(parse_url("https://radixdlt.com").is_ok()); - } - - #[test] - fn test_parse_url_invalid() { - assert!(parse_url("https/radixdlt").is_err()); - } - #[test] fn test_url_encode() { let url = "https://svgshare.com/i/U7z.svg"; @@ -124,4 +121,10 @@ mod tests { "data%3Aimage%2Fsvg%2Bxml%2C%253Csvg%2520viewBox%253D%25220%25200%25201000%25201000%2522%2520xmlns%253D%2522http%253A%252F%252Fwww.w3.org%252F2000%252Fsvg%2522%253E%250A%253Cpolygon%2520fill%253D%2522hsla%252890%252C99%2525%252C52%2525%252C1%2529%2522%2520points%253D%25220%252C%25200%252C%25201000%252C%25201000%252C%25200%252C%25201000%2522%2520transform%253D%2522scale%2528-1%252C1%2529%2520translate%2528-1000%2529%2522%252F%253E%250A%253Cpolygon%2520fill%253D%2522hsla%2528199%252C90%2525%252C64%2525%252C1%2529%2522%2520points%253D%25221000%252C%25201000%252C%25201000%252C%25200%252C%25200%252C%25200%2522%2520transform%253D%2522scale%2528-1%252C1%2529%2520translate%2528-1000%2529%2522%252F%253E%250A%253Cpath%2520d%253D%2522M1000%252C229%2520A1000%252C1000%252C0%252C0%252C0%252C229%252C1000%2520L1000%252C1000%2520z%2522%2520fill%253D%2522hsla%2528140%252C98%2525%252C61%2525%252C1%2529%2522%252F%253E%250A%253Cpath%2520d%253D%2522M392%252C500%2520L608%252C500%2520M500%252C392%2520L500%252C608%2522%2520stroke%253D%2522hsla%252847%252C92%2525%252C61%2525%252C1%2529%2522%2520stroke-width%253D%252272%2522%252F%253E%250A%253C%252Fsvg%253E" ); } + + #[test] + fn test_typename() { + struct GreatStruct {} + assert_eq!(type_name::(), "GreatStruct"); + } } diff --git a/crates/sargon-core/Cargo.toml b/crates/sargon-core/Cargo.toml index 61b17be71..5fc6d69ae 100644 --- a/crates/sargon-core/Cargo.toml +++ b/crates/sargon-core/Cargo.toml @@ -4,6 +4,11 @@ version = "1.2.1" edition = "2021" [dependencies] +identified-vec-of = { path = "../identified-vec-of" } +sargon-core-utils = { path = "../sargon-core-utils" } +sargon-core-error = { path = "../sargon-core-error" } +sargon-core-assert-json = { path = "../sargon-core-assert-json" } + # ==== RADIX DEPENDENCIES ==== radix-common = { workspace = true } radix-engine-interface = { workspace = true } @@ -12,6 +17,8 @@ radix-transactions = { workspace = true } # ==== EXTERNAL DEPENDENCIES ==== +aes-gcm = { workspace = true } +arraystring = { workspace = true } assert-json-diff = { workspace = true } delegate = { workspace = true } enum-as-inner = { workspace = true } diff --git a/crates/sargon/src/profile/encrypted/encryption/aes_gcm_256.rs b/crates/sargon-core/src/encryption/aes_gcm_256.rs similarity index 97% rename from crates/sargon/src/profile/encrypted/encryption/aes_gcm_256.rs rename to crates/sargon-core/src/encryption/aes_gcm_256.rs index b93253bc6..7a8578d41 100644 --- a/crates/sargon/src/profile/encrypted/encryption/aes_gcm_256.rs +++ b/crates/sargon-core/src/encryption/aes_gcm_256.rs @@ -1,8 +1,8 @@ use crate::prelude::*; use aes_gcm::{ - aead::{generic_array::sequence::Concat, Aead, AeadCore, KeyInit, OsRng}, - Aes256Gcm, Key, Nonce, + aead::{Aead, AeadCore, KeyInit, OsRng}, + Key, }; /// AES GCM 256 encryption diff --git a/crates/sargon/src/profile/encrypted/encryption/aes_gcm_sealed_box.rs b/crates/sargon-core/src/encryption/aes_gcm_sealed_box.rs similarity index 100% rename from crates/sargon/src/profile/encrypted/encryption/aes_gcm_sealed_box.rs rename to crates/sargon-core/src/encryption/aes_gcm_sealed_box.rs diff --git a/crates/sargon/src/profile/encrypted/encryption/encryption_key.rs b/crates/sargon-core/src/encryption/encryption_key.rs similarity index 82% rename from crates/sargon/src/profile/encrypted/encryption/encryption_key.rs rename to crates/sargon-core/src/encryption/encryption_key.rs index 03976f334..5e34c57c6 100644 --- a/crates/sargon/src/profile/encrypted/encryption/encryption_key.rs +++ b/crates/sargon-core/src/encryption/encryption_key.rs @@ -16,6 +16,14 @@ use crate::prelude::*; #[serde(transparent)] pub struct EncryptionKey(pub Exactly32Bytes); +use crypto::keys::x25519::PublicKey as X25519PublicKey; + +impl From for EncryptionKey { + fn from(value: X25519PublicKey) -> EncryptionKey { + EncryptionKey(Exactly32Bytes::from(&value.to_bytes())) + } +} + impl EncryptionKey { pub fn generate() -> Self { Self::from(Exactly32Bytes::generate()) diff --git a/crates/sargon/src/profile/encrypted/encryption/encryption_scheme.rs b/crates/sargon-core/src/encryption/encryption_scheme.rs similarity index 98% rename from crates/sargon/src/profile/encrypted/encryption/encryption_scheme.rs rename to crates/sargon-core/src/encryption/encryption_scheme.rs index 5bfa3cf05..2eb3e605f 100644 --- a/crates/sargon/src/profile/encrypted/encryption/encryption_scheme.rs +++ b/crates/sargon-core/src/encryption/encryption_scheme.rs @@ -27,7 +27,6 @@ impl std::fmt::Display for EncryptionScheme { } } -#[cfg(not(tarpaulin_include))] // false negative impl Serialize for EncryptionScheme { fn serialize(&self, serializer: S) -> Result where @@ -40,7 +39,6 @@ impl Serialize for EncryptionScheme { } } -#[cfg(not(tarpaulin_include))] // false negative impl<'de> Deserialize<'de> for EncryptionScheme { fn deserialize>( deserializer: D, diff --git a/crates/sargon/src/profile/encrypted/encryption/encryption_scheme_version.rs b/crates/sargon-core/src/encryption/encryption_scheme_version.rs similarity index 100% rename from crates/sargon/src/profile/encrypted/encryption/encryption_scheme_version.rs rename to crates/sargon-core/src/encryption/encryption_scheme_version.rs diff --git a/crates/sargon/src/profile/encrypted/encryption/mod.rs b/crates/sargon-core/src/encryption/mod.rs similarity index 82% rename from crates/sargon/src/profile/encrypted/encryption/mod.rs rename to crates/sargon-core/src/encryption/mod.rs index 232ef49e8..e5bbb8e39 100644 --- a/crates/sargon/src/profile/encrypted/encryption/mod.rs +++ b/crates/sargon-core/src/encryption/mod.rs @@ -1,15 +1,15 @@ mod aes_gcm_256; mod aes_gcm_sealed_box; -mod encrypted_profile_snapshot; mod encryption_key; mod encryption_scheme; mod encryption_scheme_version; +mod version_of_algorithm; mod versioned_encryption; pub use aes_gcm_256::*; pub use aes_gcm_sealed_box::*; -pub use encrypted_profile_snapshot::*; pub use encryption_key::*; pub use encryption_scheme::*; pub use encryption_scheme_version::*; +pub use version_of_algorithm::*; pub use versioned_encryption::*; diff --git a/crates/sargon/src/profile/encrypted/version_of_algorithm.rs b/crates/sargon-core/src/encryption/version_of_algorithm.rs similarity index 96% rename from crates/sargon/src/profile/encrypted/version_of_algorithm.rs rename to crates/sargon-core/src/encryption/version_of_algorithm.rs index 032ac44ad..b28f0b4ac 100644 --- a/crates/sargon/src/profile/encrypted/version_of_algorithm.rs +++ b/crates/sargon-core/src/encryption/version_of_algorithm.rs @@ -1,5 +1,3 @@ -use crate::prelude::*; - /// A version of an algorithm so that we can change the implementation between /// app releases and remain backwards compatible. pub trait VersionOfAlgorithm { diff --git a/crates/sargon/src/profile/encrypted/encryption/versioned_encryption.rs b/crates/sargon-core/src/encryption/versioned_encryption.rs similarity index 100% rename from crates/sargon/src/profile/encrypted/encryption/versioned_encryption.rs rename to crates/sargon-core/src/encryption/versioned_encryption.rs diff --git a/crates/sargon-core/src/error/mod.rs b/crates/sargon-core/src/error/mod.rs deleted file mode 100644 index 997f816f1..000000000 --- a/crates/sargon-core/src/error/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -mod common_error; -mod common_error_map; - -pub use common_error::*; -pub use common_error_map::*; diff --git a/crates/sargon-core/src/has_sample_values.rs b/crates/sargon-core/src/has_sample_values.rs index a3fbaca15..f324e74b7 100644 --- a/crates/sargon-core/src/has_sample_values.rs +++ b/crates/sargon-core/src/has_sample_values.rs @@ -5,6 +5,16 @@ pub trait HasSampleValues { fn sample_other() -> Self; } +impl HasSampleValues for CommonError { + fn sample() -> Self { + CommonError::UnknownAccount + } + + fn sample_other() -> Self { + CommonError::UnknownPersona + } +} + impl HasSampleValues for String { fn sample() -> Self { "sample".to_string() @@ -35,6 +45,25 @@ impl HasSampleValues for u64 { } } +impl HasSampleValues for Uuid { + fn sample() -> Self { + Self::from_bytes([0xff; 16]) + } + + fn sample_other() -> Self { + Self::from_bytes([0xde; 16]) + } +} +impl HasSampleValues for Timestamp { + fn sample() -> Self { + Self::parse("2023-09-11T16:05:56Z").unwrap() + } + + fn sample_other() -> Self { + Self::parse("2023-12-24T17:13:56.123Z").unwrap() + } +} + impl HasSampleValues for u32 { fn sample() -> Self { 42 diff --git a/crates/sargon-core/src/utils/image_url_utils.rs b/crates/sargon-core/src/image_url_utils.rs similarity index 99% rename from crates/sargon-core/src/utils/image_url_utils.rs rename to crates/sargon-core/src/image_url_utils.rs index 5ff69534f..65cc12e09 100644 --- a/crates/sargon-core/src/utils/image_url_utils.rs +++ b/crates/sargon-core/src/image_url_utils.rs @@ -1,4 +1,4 @@ -use crate::prelude::*; +use crate::{parse_url, prelude::*}; pub fn is_vector_image(url: &str, image_type: VectorImageType) -> bool { let parsed_url = match parse_url(url) { diff --git a/crates/sargon-core/src/lib.rs b/crates/sargon-core/src/lib.rs index d5dd5ec07..911522c88 100644 --- a/crates/sargon-core/src/lib.rs +++ b/crates/sargon-core/src/lib.rs @@ -3,32 +3,37 @@ #![feature(trivial_bounds)] #![allow(trivial_bounds)] -mod assert_json; -mod error; +mod encryption; mod has_sample_values; mod hash; -mod identifiable; +mod image_url_utils; mod is_network_aware; mod network_id; mod secure_random_bytes; mod types; mod unsafe_id_stepper; mod unsigned_ints; -mod utils; + +pub fn parse_url(s: impl AsRef) -> Result { + Url::try_from(s.as_ref()).map_err(|_| CommonError::InvalidURL { + bad_value: s.as_ref().to_owned(), + }) +} pub mod prelude { - pub use crate::assert_json::*; - pub use crate::error::*; + pub use identified_vec_of::prelude::*; + pub use sargon_core_utils::prelude::*; + + pub use crate::encryption::*; pub use crate::has_sample_values::*; pub use crate::hash::*; - pub use crate::identifiable::*; + pub use crate::image_url_utils::*; pub use crate::is_network_aware::*; pub use crate::network_id::*; pub use crate::secure_random_bytes::*; pub use crate::types::*; pub use crate::unsafe_id_stepper::*; pub use crate::unsigned_ints::*; - pub use crate::utils::*; pub use radix_rust::prelude::{ indexmap, BTreeSet, HashMap, HashSet, IndexMap, IndexSet, @@ -37,7 +42,6 @@ pub mod prelude { pub use ::hex::decode as hex_decode; pub use ::hex::encode as hex_encode; - pub use iso8601_timestamp::Timestamp; pub use itertools::Itertools; pub use log::{debug, error, info, trace, warn}; pub use serde::{ @@ -99,3 +103,18 @@ pub mod prelude { } pub use prelude::*; + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_parse_url() { + assert!(parse_url("https://radixdlt.com").is_ok()); + } + + #[test] + fn test_parse_url_invalid() { + assert!(parse_url("https/radixdlt").is_err()); + } +} diff --git a/crates/sargon/src/profile/v100/entity/display_name.rs b/crates/sargon-core/src/types/display_name.rs similarity index 87% rename from crates/sargon/src/profile/v100/entity/display_name.rs rename to crates/sargon-core/src/types/display_name.rs index c2830c0a2..100194960 100644 --- a/crates/sargon/src/profile/v100/entity/display_name.rs +++ b/crates/sargon-core/src/types/display_name.rs @@ -24,33 +24,38 @@ use crate::prelude::*; /// #[derive( Clone, + Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, - SerializeDisplay, + Serialize, DeserializeFromStr, derive_more::Display, )] -#[display("{value}")] -pub struct DisplayName { - pub value: String, -} +#[display("{}", self.value())] +pub struct DisplayName(ShortString); impl DisplayName { pub const MAX_LEN: usize = 30; + pub fn value(&self) -> String { + self.0.value() + } + + pub fn update(&mut self, new_value: impl AsRef) { + *self = Self::new(new_value).unwrap(); + } + pub fn new(value: impl AsRef) -> Result { let value = value.as_ref().trim().to_string(); if value.is_empty() { return Err(CommonError::InvalidDisplayNameEmpty); } - Ok(Self { - value: prefix_str(Self::MAX_LEN, value), - }) + ShortString::new(prefix_str(Self::MAX_LEN, value)).map(Self) } } @@ -78,7 +83,6 @@ impl HasSampleValues for DisplayName { } } -#[cfg(test)] impl DisplayName { pub fn random() -> Self { Self::new(format!( @@ -111,7 +115,7 @@ mod tests { fn invalid() { let s = "this is a much much too long display name"; assert_eq!( - SUT::new(s).unwrap().value, + SUT::new(s).unwrap().value(), "this is a much much too long d" ); } @@ -138,7 +142,7 @@ mod tests { #[test] fn inner() { - assert_eq!(SUT::new("Main account").unwrap().value, "Main account"); + assert_eq!(SUT::new("Main account").unwrap().value(), "Main account"); } #[test] diff --git a/crates/sargon/src/profile/supporting_types/email_address.rs b/crates/sargon-core/src/types/email_address.rs similarity index 86% rename from crates/sargon/src/profile/supporting_types/email_address.rs rename to crates/sargon-core/src/types/email_address.rs index 8d15bcc9f..f9d086db2 100644 --- a/crates/sargon/src/profile/supporting_types/email_address.rs +++ b/crates/sargon-core/src/types/email_address.rs @@ -8,24 +8,23 @@ use crate::prelude::*; Serialize, Deserialize, Clone, + Copy, PartialEq, Hash, Eq, derive_more::Display, derive_more::Debug, )] -#[display("{email}")] -#[debug("{email}")] +#[display("{}", self.0.to_string())] +#[debug("{:?}", self.0.to_string())] #[serde(transparent)] -pub struct EmailAddress { - pub email: String, -} +pub struct EmailAddress(ShortString); impl Identifiable for EmailAddress { type ID = String; fn id(&self) -> Self::ID { - self.email.clone() + self.0.value() } } @@ -43,7 +42,7 @@ impl EmailAddress { if email.is_empty() { return Err(CommonError::EmailAddressEmpty); } - Ok(Self { email }) + ShortString::new(email).map(Self) } } @@ -59,7 +58,8 @@ impl HasSampleValues for EmailAddress { #[cfg(test)] mod tests { - use crate::prelude::*; + + use super::*; #[test] fn equality() { @@ -84,8 +84,11 @@ mod tests { } #[test] - fn id_is_email() { - assert_eq!(EmailAddress::sample().id(), EmailAddress::sample().email); + fn id_is_display() { + assert_eq!( + EmailAddress::sample().id(), + EmailAddress::sample().to_string() + ); } #[test] diff --git a/crates/sargon/src/factor_instances_provider/types/hidden_constructor.rs b/crates/sargon-core/src/types/hidden_constructor.rs similarity index 95% rename from crates/sargon/src/factor_instances_provider/types/hidden_constructor.rs rename to crates/sargon-core/src/types/hidden_constructor.rs index cdfaba9fb..66c416d2a 100644 --- a/crates/sargon/src/factor_instances_provider/types/hidden_constructor.rs +++ b/crates/sargon-core/src/types/hidden_constructor.rs @@ -1,7 +1,5 @@ use serde::{Deserialize, Serialize}; -use crate::HasSampleValues; - /// A type used to hide a constructor for some other type, use /// it like this: /// diff --git a/crates/sargon/src/profile/v100/header/device_id.rs b/crates/sargon-core/src/types/host_info/device_id.rs similarity index 100% rename from crates/sargon/src/profile/v100/header/device_id.rs rename to crates/sargon-core/src/types/host_info/device_id.rs diff --git a/crates/sargon/src/profile/v100/header/device_info_description.rs b/crates/sargon-core/src/types/host_info/device_info_description.rs similarity index 100% rename from crates/sargon/src/profile/v100/header/device_info_description.rs rename to crates/sargon-core/src/types/host_info/device_info_description.rs diff --git a/crates/sargon/src/profile/supporting_types/host_id.rs b/crates/sargon-core/src/types/host_info/host_id.rs similarity index 100% rename from crates/sargon/src/profile/supporting_types/host_id.rs rename to crates/sargon-core/src/types/host_info/host_id.rs diff --git a/crates/sargon/src/profile/supporting_types/host_info.rs b/crates/sargon-core/src/types/host_info/host_info.rs similarity index 100% rename from crates/sargon/src/profile/supporting_types/host_info.rs rename to crates/sargon-core/src/types/host_info/host_info.rs diff --git a/crates/sargon/src/profile/supporting_types/host_os.rs b/crates/sargon-core/src/types/host_info/host_os.rs similarity index 97% rename from crates/sargon/src/profile/supporting_types/host_os.rs rename to crates/sargon-core/src/types/host_info/host_os.rs index 500dcaf55..4eaa2596e 100644 --- a/crates/sargon/src/profile/supporting_types/host_os.rs +++ b/crates/sargon-core/src/types/host_info/host_os.rs @@ -1,7 +1,5 @@ -use enum_as_inner::EnumAsInner; - use crate::HasSampleValues; -use std::fmt::{Display, Formatter, Pointer}; +use std::fmt::{Display, Formatter}; /// Describes the type of the Host machine and its version. Currently, as it stands at runtime /// the possible values will be IOS or Android. Other is in place to facilitate unit tests diff --git a/crates/sargon-core/src/types/host_info/mod.rs b/crates/sargon-core/src/types/host_info/mod.rs new file mode 100644 index 000000000..e7b29e237 --- /dev/null +++ b/crates/sargon-core/src/types/host_info/mod.rs @@ -0,0 +1,11 @@ +mod device_id; +mod device_info_description; +mod host_id; +mod host_info; +mod host_os; + +pub use device_id::*; +pub use device_info_description::*; +pub use host_id::*; +pub use host_info::*; +pub use host_os::*; diff --git a/crates/sargon-core/src/types/keys/ed25519/private_key.rs b/crates/sargon-core/src/types/keys/ed25519/private_key.rs index f1d4bc0c2..04a02aba4 100644 --- a/crates/sargon-core/src/types/keys/ed25519/private_key.rs +++ b/crates/sargon-core/src/types/keys/ed25519/private_key.rs @@ -45,7 +45,7 @@ impl IsPrivateKey for Ed25519PrivateKey { fn from_bytes(slice: &[u8]) -> Result { ScryptoEd25519PrivateKey::from_bytes(slice) .map_err(|_| CommonError::InvalidEd25519PrivateKeyFromBytes { - bad_value: slice.into(), + bad_value: hex_encode(slice), }) .map(Self::from_scrypto) } @@ -259,7 +259,7 @@ mod tests { assert_eq!( Ed25519PrivateKey::from_bytes(&[0u8] as &[u8]), Err(CommonError::InvalidEd25519PrivateKeyFromBytes { - bad_value: vec![0].into() + bad_value: "00".to_owned() }) ); } diff --git a/crates/sargon-core/src/types/keys/ed25519/public_key.rs b/crates/sargon-core/src/types/keys/ed25519/public_key.rs index 61d5549d7..7cb2fede3 100644 --- a/crates/sargon-core/src/types/keys/ed25519/public_key.rs +++ b/crates/sargon-core/src/types/keys/ed25519/public_key.rs @@ -91,7 +91,7 @@ impl TryFrom<&[u8]> for Ed25519PublicKey { fn try_from(slice: &[u8]) -> Result { ScryptoEd25519PublicKey::try_from(slice) .map_err(|_| CommonError::InvalidEd25519PublicKeyFromBytes { - bad_value: slice.to_vec().into(), + bad_value: hex_encode(slice), }) .and_then(|k| k.try_into()) } @@ -252,7 +252,7 @@ mod tests { assert_eq!( Ed25519PublicKey::try_from(&[0u8] as &[u8]), Err(CommonError::InvalidEd25519PublicKeyFromBytes { - bad_value: vec![0].into() + bad_value: "00".to_owned() }) ); } diff --git a/crates/sargon-core/src/types/keys/key_agreement/private_key.rs b/crates/sargon-core/src/types/keys/key_agreement/private_key.rs index 88e6bc913..a2fd98773 100644 --- a/crates/sargon-core/src/types/keys/key_agreement/private_key.rs +++ b/crates/sargon-core/src/types/keys/key_agreement/private_key.rs @@ -44,7 +44,7 @@ impl TryFrom<&[u8]> for KeyAgreementPrivateKey { fn try_from(slice: &[u8]) -> Result { X25519PrivateKey::try_from_slice(slice) .map_err(|_| CommonError::InvalidKeyAgreementPrivateKeyFromBytes { - bad_value: slice.into(), + bad_value: hex_encode(slice), }) .map(Self::from) } @@ -139,7 +139,7 @@ mod tests { assert_eq!( from_bytes, Err(CommonError::InvalidKeyAgreementPrivateKeyFromBytes { - bad_value: bytes, + bad_value: bytes.to_hex(), }) ); } diff --git a/crates/sargon-core/src/types/keys/key_agreement/public_key.rs b/crates/sargon-core/src/types/keys/key_agreement/public_key.rs index 1391bdf38..22eedb307 100644 --- a/crates/sargon-core/src/types/keys/key_agreement/public_key.rs +++ b/crates/sargon-core/src/types/keys/key_agreement/public_key.rs @@ -52,7 +52,7 @@ impl TryFrom<&[u8]> for KeyAgreementPublicKey { fn try_from(slice: &[u8]) -> Result { X25519PublicKey::try_from_slice(slice) .map_err(|_| CommonError::InvalidKeyAgreementPublicKeyFromBytes { - bad_value: slice.to_vec().into(), + bad_value: hex_encode(slice), }) .map(|k| k.into()) } @@ -208,7 +208,7 @@ mod tests { pretty_assertions::assert_eq!( SUT::try_from(vec![0]), Err(CommonError::InvalidKeyAgreementPublicKeyFromBytes { - bad_value: vec![0].into() + bad_value: "00".to_owned() }) ); } diff --git a/crates/sargon-core/src/types/keys/secp256k1/private_key.rs b/crates/sargon-core/src/types/keys/secp256k1/private_key.rs index e8afd76e5..a6f197884 100644 --- a/crates/sargon-core/src/types/keys/secp256k1/private_key.rs +++ b/crates/sargon-core/src/types/keys/secp256k1/private_key.rs @@ -93,7 +93,7 @@ impl IsPrivateKey for Secp256k1PrivateKey { fn from_bytes(slice: &[u8]) -> Result { ScryptoSecp256k1PrivateKey::from_bytes(slice) .map_err(|_| CommonError::InvalidSecp256k1PrivateKeyFromBytes { - bad_value: slice.to_owned().into(), + bad_value: hex_encode(slice), }) .map(Self::from_scrypto) } @@ -249,7 +249,7 @@ mod tests { assert_eq!( SUT::from_bytes(&[0u8] as &[u8]), Err(CommonError::InvalidSecp256k1PrivateKeyFromBytes { - bad_value: vec![0].into() + bad_value: "00".to_owned() }) ); } @@ -260,7 +260,7 @@ mod tests { assert_eq!( SUT::from_bytes(&bytes), Err(CommonError::InvalidSecp256k1PrivateKeyFromBytes { - bad_value: bytes.to_vec().into() + bad_value: hex_encode(bytes) }) ); } @@ -271,7 +271,7 @@ mod tests { assert_eq!( SUT::from_bytes(&bytes), Err(CommonError::InvalidSecp256k1PrivateKeyFromBytes { - bad_value: bytes.to_vec().into() + bad_value: hex_encode(bytes) }) ); } diff --git a/crates/sargon-core/src/types/keys/secp256k1/public_key.rs b/crates/sargon-core/src/types/keys/secp256k1/public_key.rs index d135ab1b9..f1c811f1d 100644 --- a/crates/sargon-core/src/types/keys/secp256k1/public_key.rs +++ b/crates/sargon-core/src/types/keys/secp256k1/public_key.rs @@ -111,7 +111,7 @@ impl TryFrom<&[u8]> for Secp256k1PublicKeyUncheckedBytes { .map(Self::Compressed) .or(Exactly65Bytes::try_from(value).map(Self::Uncompressed)) .map_err(|_| CommonError::InvalidSecp256k1PublicKeyFromBytes { - bad_value: BagOfBytes::from(value), + bad_value: hex_encode(value), }) } } @@ -334,7 +334,7 @@ mod tests { assert_eq!( SUT::from_str("dead"), Err(CommonError::InvalidSecp256k1PublicKeyFromBytes { - bad_value: vec![0xde, 0xad].into() + bad_value: "dead".to_owned() }) ); } @@ -345,7 +345,7 @@ mod tests { assert_eq!( SUT::try_from(bytes), Err(CommonError::InvalidSecp256k1PublicKeyFromBytes { - bad_value: bytes.to_vec().into() + bad_value: hex_encode(bytes) }) ); } diff --git a/crates/sargon-core/src/types/keys/slip10_curve.rs b/crates/sargon-core/src/types/keys/slip10_curve.rs index 5241bf08c..05b07afba 100644 --- a/crates/sargon-core/src/types/keys/slip10_curve.rs +++ b/crates/sargon-core/src/types/keys/slip10_curve.rs @@ -1,5 +1,7 @@ use std::fmt::Display; +use identified_vec_of::prelude::Identifiable; + use crate::prelude::*; /// Elliptic Curves which the SLIP10 derivation algorithm supports. diff --git a/crates/sargon-core/src/types/mod.rs b/crates/sargon-core/src/types/mod.rs index fbf844f90..651f444cf 100644 --- a/crates/sargon-core/src/types/mod.rs +++ b/crates/sargon-core/src/types/mod.rs @@ -3,9 +3,13 @@ mod bag_of_bytes; mod bool_type; mod collections; mod decimal192; +mod display_name; +mod email_address; mod entity_kind; mod epoch; mod exactly_n_bytes; +mod hidden_constructor; +mod host_info; mod instant; mod intent_discriminator; mod keys; @@ -18,6 +22,7 @@ mod requested_quantity; mod rounding_mode; mod safe_to_log; mod secret_bytes; +mod short_string; mod signatures; mod vector_image_type; mod version_type; @@ -27,9 +32,13 @@ pub use bag_of_bytes::*; pub(crate) use bool_type::*; pub use collections::*; pub use decimal192::*; +pub use display_name::*; +pub use email_address::*; pub use entity_kind::*; pub use epoch::*; pub use exactly_n_bytes::*; +pub use hidden_constructor::*; +pub use host_info::*; pub use instant::*; pub use intent_discriminator::*; pub use keys::*; @@ -42,6 +51,7 @@ pub use requested_quantity::*; pub use rounding_mode::*; pub use safe_to_log::*; pub use secret_bytes::*; +pub use short_string::*; pub use signatures::*; pub use vector_image_type::*; pub(crate) use version_type::*; diff --git a/crates/sargon-core/src/types/short_string.rs b/crates/sargon-core/src/types/short_string.rs new file mode 100644 index 000000000..80d237838 --- /dev/null +++ b/crates/sargon-core/src/types/short_string.rs @@ -0,0 +1,98 @@ +use crate::prelude::*; + +/// A max 255 chars string which impl Copy +#[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + PartialOrd, + Ord, + Hash, + SerializeDisplay, + DeserializeFromStr, + derive_more::Display, +)] +#[display("{}", self.value())] +pub struct ShortString(arraystring::MaxString); + +impl ShortString { + pub fn value(&self) -> String { + self.0.clone().to_string() + } + + pub fn new(value: impl AsRef) -> Result { + arraystring::MaxString::try_from_str(value.as_ref()) + .map_err(|_| CommonError::Unknown) + .map(Self) + } +} + +impl FromStr for ShortString { + type Err = CommonError; + + fn from_str(s: &str) -> Result { + ShortString::new(s) + } +} + +impl HasSampleValues for ShortString { + fn sample() -> Self { + "Hello World".parse().unwrap() + } + + fn sample_other() -> Self { + "The human spirit must prevail over technology" + .parse() + .unwrap() + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[allow(clippy::upper_case_acronyms)] + type SUT = ShortString; + + #[test] + fn equality() { + assert_eq!(SUT::sample(), SUT::sample()); + assert_eq!(SUT::sample_other(), SUT::sample_other()); + } + + #[test] + fn inequality() { + assert_ne!(SUT::sample(), SUT::sample_other()); + } + + #[test] + fn max_is_ok() { + assert!(SUT::new("0|RDX|Dev Nano S|Some very lon").is_ok()); + } + + #[test] + fn valid_try_from() { + assert_eq!(SUT::new("Main"), Ok(SUT::new("Main").unwrap())); + } + + #[test] + fn inner() { + assert_eq!(SUT::new("Main account").unwrap().value(), "Main account"); + } + + #[test] + fn json_roundtrip() { + let a: SUT = "Cool persona".parse().unwrap(); + + assert_json_value_eq_after_roundtrip(&a, json!("Cool persona")); + assert_json_roundtrip(&a); + assert_json_value_ne_after_roundtrip(&a, json!("Main account")); + } + + #[test] + fn json_fails_for_invalid() { + assert_json_value_fails::(json!("this is a much much too long string which character count way exceed the limit which is two hundred and fifty five or written with digits 255 which is u8 max value which is 2^8 - 1 and it is in fact quite a long string it allows for, but this is just too long.")); + } +} diff --git a/crates/sargon-core/src/utils/mod.rs b/crates/sargon-core/src/utils/mod.rs deleted file mode 100644 index 95ceda33c..000000000 --- a/crates/sargon-core/src/utils/mod.rs +++ /dev/null @@ -1,31 +0,0 @@ -mod constants; -mod factory; -mod image_url_utils; -mod logged_panic; -mod serialization; -mod string_utils; - -pub use constants::*; -pub use factory::*; -pub use image_url_utils::*; -pub use logged_panic::*; -pub use serialization::*; -pub use string_utils::*; - -pub fn type_name() -> String { - std::any::type_name::() - .split("::") - .last() - .unwrap() - .to_owned() -} - -#[cfg(test)] -mod tests { - use super::*; - #[test] - fn test_typename() { - struct GreatStruct {} - assert_eq!(type_name::(), "GreatStruct"); - } -} diff --git a/crates/sargon-factors/Cargo.toml b/crates/sargon-factors/Cargo.toml new file mode 100644 index 000000000..00a4d8a64 --- /dev/null +++ b/crates/sargon-factors/Cargo.toml @@ -0,0 +1,64 @@ +[package] +name = "sargon-factors" +version = "1.2.1" +edition = "2021" +build = "build.rs" + +[dependencies] +# ==== INTERNAL DEPENDENCIES ==== +identified-vec-of = { path = "../identified-vec-of" } +sargon-core = { path = "../sargon-core" } +sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } + + +# ==== RADIX DEPENDENCIES ==== +radix-common = { workspace = true } +radix-engine-interface = { workspace = true } +radix-rust = { workspace = true } +radix-transactions = { workspace = true } + + +# ==== EXTERNAL DEPENDENCIES ==== +arraystring = { workspace = true } +assert-json-diff = { workspace = true } +delegate = { workspace = true } +enum-as-inner = { workspace = true } +enum-iterator = { workspace = true } +hkdf = { workspace = true } +hex = { workspace = true } +pretty_assertions = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +derive_more = { workspace = true } +once_cell = { workspace = true } + + +itertools = { workspace = true } +iota-crypto = { workspace = true } +k256 = { workspace = true } +rand = { workspace = true } +log = { workspace = true } + + +serde_with = { workspace = true } + +paste = { workspace = true } +serde_repr = { workspace = true } +iso8601-timestamp = { workspace = true } +zeroize = { workspace = true } +strum = { workspace = true } +url = { workspace = true } +thiserror = { workspace = true } + +uuid = { workspace = true } + +# bip39 = "2.0.0" +bip39 = { git = "https://github.com/rust-bitcoin/rust-bip39", rev = "a30760beac21d595b2bda376df4f4e6bf029bcc5", features = [ + "serde", + "zeroize", + "french", +] } + +[build-dependencies] + +cargo_toml = { workspace = true } diff --git a/crates/sargon-factors/build.rs b/crates/sargon-factors/build.rs new file mode 100644 index 000000000..8d09b6b65 --- /dev/null +++ b/crates/sargon-factors/build.rs @@ -0,0 +1,14 @@ +use std::env; +use std::path::Path; + +pub fn main() { + // Paths for reading fixtures used by tests + let fixtures_path = Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures"); + println!("cargo:rustc-env=FIXTURES={}/", fixtures_path.display()); + + let fixtures_vector_path = fixtures_path.join("vector"); + println!( + "cargo:rustc-env=FIXTURES_VECTOR={}/", + fixtures_vector_path.display() + ); +} diff --git a/crates/sargon/fixtures/vector/security_questions_factor_source_sample.json b/crates/sargon-factors/fixtures/vector/security_questions_factor_source_sample.json similarity index 100% rename from crates/sargon/fixtures/vector/security_questions_factor_source_sample.json rename to crates/sargon-factors/fixtures/vector/security_questions_factor_source_sample.json diff --git a/crates/sargon/fixtures/vector/security_questions_factor_source_sample_other.json b/crates/sargon-factors/fixtures/vector/security_questions_factor_source_sample_other.json similarity index 100% rename from crates/sargon/fixtures/vector/security_questions_factor_source_sample_other.json rename to crates/sargon-factors/fixtures/vector/security_questions_factor_source_sample_other.json diff --git a/crates/sargon/src/profile/v100/factors/factor_instance/badge_virtual_source.rs b/crates/sargon-factors/src/factor_instance/badge_virtual_source.rs similarity index 97% rename from crates/sargon/src/profile/v100/factors/factor_instance/badge_virtual_source.rs rename to crates/sargon-factors/src/factor_instance/badge_virtual_source.rs index cc2231045..7d4ca9d20 100644 --- a/crates/sargon/src/profile/v100/factors/factor_instance/badge_virtual_source.rs +++ b/crates/sargon-factors/src/factor_instance/badge_virtual_source.rs @@ -40,7 +40,6 @@ impl From } impl<'de> Deserialize<'de> for FactorInstanceBadgeVirtualSource { - #[cfg(not(tarpaulin_include))] // false negative fn deserialize>( deserializer: D, ) -> Result { @@ -55,7 +54,6 @@ impl<'de> Deserialize<'de> for FactorInstanceBadgeVirtualSource { } impl Serialize for FactorInstanceBadgeVirtualSource { - #[cfg(not(tarpaulin_include))] // false negative fn serialize(&self, serializer: S) -> Result where S: Serializer, diff --git a/crates/sargon/src/profile/v100/factors/factor_instance/factor_instance.rs b/crates/sargon-factors/src/factor_instance/factor_instance.rs similarity index 98% rename from crates/sargon/src/profile/v100/factors/factor_instance/factor_instance.rs rename to crates/sargon-factors/src/factor_instance/factor_instance.rs index 6a5a9f4b6..c72280f11 100644 --- a/crates/sargon/src/profile/v100/factors/factor_instance/factor_instance.rs +++ b/crates/sargon-factors/src/factor_instance/factor_instance.rs @@ -23,7 +23,7 @@ impl IsMaybeKeySpaceAware for FactorInstance { fn maybe_key_space(&self) -> Option { match self.badge.clone() { FactorInstanceBadge::Virtual { value } => Some(value.key_space()), - FactorInstanceBadge::Physical { .. } => None, + // FactorInstanceBadge::Physical { .. } => None, } } } @@ -65,7 +65,7 @@ impl FactorInstance { impl From for FactorInstance { fn from(value: HierarchicalDeterministicFactorInstance) -> Self { Self::with_hierarchical_deterministic_public_key( - value.factor_source_id().into(), + value.factor_source_id.into(), value.hd_public_key(), ) } diff --git a/crates/sargon/src/profile/v100/factors/factor_instance/factor_instance_badge.rs b/crates/sargon-factors/src/factor_instance/factor_instance_badge.rs similarity index 72% rename from crates/sargon/src/profile/v100/factors/factor_instance/factor_instance_badge.rs rename to crates/sargon-factors/src/factor_instance/factor_instance_badge.rs index 6259a5776..5ebfeb767 100644 --- a/crates/sargon/src/profile/v100/factors/factor_instance/factor_instance_badge.rs +++ b/crates/sargon-factors/src/factor_instance/factor_instance_badge.rs @@ -12,9 +12,9 @@ pub enum FactorInstanceBadge { #[serde(rename = "virtualSource")] value: FactorInstanceBadgeVirtualSource, }, - Physical { - value: ResourceAddress, - }, + // Physical { + // value: ResourceAddress, + // }, } impl HasSampleValues for FactorInstanceBadge { @@ -25,7 +25,7 @@ impl HasSampleValues for FactorInstanceBadge { /// A sample used to facilitate unit tests. fn sample_other() -> Self { - Self::sample_physical() + Self::sample_virtual_other() } } @@ -44,13 +44,6 @@ impl FactorInstanceBadge { value: FactorInstanceBadgeVirtualSource::sample_other(), } } - - /// A sample used to facilitate unit tests. - fn sample_physical() -> Self { - Self::Physical { - value: ResourceAddress::sample(), - } - } } impl From for FactorInstanceBadge { @@ -67,11 +60,11 @@ impl From for FactorInstanceBadge { } } -impl From for FactorInstanceBadge { - fn from(value: ResourceAddress) -> Self { - Self::Physical { value } - } -} +// impl From for FactorInstanceBadge { +// fn from(value: ResourceAddress) -> Self { +// Self::Physical { value } +// } +// } impl From for ScryptoResourceOrNonFungible { fn from(value: FactorInstanceBadge) -> Self { @@ -86,17 +79,16 @@ impl From for ScryptoResourceOrNonFungible { &ScryptoPublicKey::from(value.public_key), ), ), - FactorInstanceBadge::Physical { value } => { - ScryptoResourceOrNonFungible::Resource( - ScryptoResourceAddress::new_or_panic(value.0.node_id().0), - ) - } + // FactorInstanceBadge::Physical { value } => { + // ScryptoResourceOrNonFungible::Resource( + // ScryptoResourceAddress::new_or_panic(value.0.node_id().0), + // ) + // } } } } impl<'de> Deserialize<'de> for FactorInstanceBadge { - #[cfg(not(tarpaulin_include))] // false negative fn deserialize>( deserializer: D, ) -> Result { @@ -111,7 +103,6 @@ impl<'de> Deserialize<'de> for FactorInstanceBadge { } impl Serialize for FactorInstanceBadge { - #[cfg(not(tarpaulin_include))] // false negative fn serialize(&self, serializer: S) -> Result where S: Serializer, @@ -123,12 +114,11 @@ impl Serialize for FactorInstanceBadge { let discriminant = "virtualSource"; state.serialize_field("discriminator", discriminant)?; state.serialize_field(discriminant, value)?; - } - Self::Physical { value } => { - let discriminant = "physical"; - state.serialize_field("discriminator", discriminant)?; - state.serialize_field(discriminant, value)?; - } + } // Self::Physical { value } => { + // let discriminant = "physical"; + // state.serialize_field("discriminator", discriminant)?; + // state.serialize_field(discriminant, value)?; + // } } state.end() } @@ -212,31 +202,31 @@ mod tests { ) } - #[test] - fn a_correct_resource_or_non_fungible_is_derived_from_a_physical_factor_instance_badge( - ) { - let sut = FactorInstanceBadge::sample_physical(); - let resource_or_non_fungible = ScryptoResourceOrNonFungible::from(sut); - assert_eq!( - resource_or_non_fungible, - ScryptoResourceOrNonFungible::Resource(XRD) - ); - } - - #[test] - fn a_correct_resource_or_non_fungible_is_derived_from_a_virtual_factor_instance_badge( - ) { - let sut = FactorInstanceBadge::sample_virtual(); - let resource_or_non_fungible = ScryptoResourceOrNonFungible::from(sut); - assert_eq!( - resource_or_non_fungible, - ScryptoResourceOrNonFungible::NonFungible( - ScryptoNonFungibleGlobalId::from_public_key( - &ScryptoPublicKey::from( - HierarchicalDeterministicPublicKey::sample().public_key - ) - ) - ) - ); - } + // #[test] + // fn a_correct_resource_or_non_fungible_is_derived_from_a_physical_factor_instance_badge( + // ) { + // let sut = FactorInstanceBadge::sample_physical(); + // let resource_or_non_fungible = ScryptoResourceOrNonFungible::from(sut); + // assert_eq!( + // resource_or_non_fungible, + // ScryptoResourceOrNonFungible::Resource(XRD) + // ); + // } + + // #[test] + // fn a_correct_resource_or_non_fungible_is_derived_from_a_virtual_factor_instance_badge( + // ) { + // let sut = FactorInstanceBadge::sample_virtual(); + // let resource_or_non_fungible = ScryptoResourceOrNonFungible::from(sut); + // assert_eq!( + // resource_or_non_fungible, + // ScryptoResourceOrNonFungible::NonFungible( + // ScryptoNonFungibleGlobalId::from_public_key( + // &ScryptoPublicKey::from( + // HierarchicalDeterministicPublicKey::sample().public_key + // ) + // ) + // ) + // ); + // } } diff --git a/crates/sargon/src/factor_instances_provider/types/factor_instances.rs b/crates/sargon-factors/src/factor_instance/factor_instances.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/types/factor_instances.rs rename to crates/sargon-factors/src/factor_instance/factor_instances.rs diff --git a/crates/sargon/src/profile/v100/factors/factor_instance/mod.rs b/crates/sargon-factors/src/factor_instance/mod.rs similarity index 85% rename from crates/sargon/src/profile/v100/factors/factor_instance/mod.rs rename to crates/sargon-factors/src/factor_instance/mod.rs index 134ef4e2e..decfed256 100644 --- a/crates/sargon/src/profile/v100/factors/factor_instance/mod.rs +++ b/crates/sargon-factors/src/factor_instance/mod.rs @@ -1,9 +1,11 @@ mod badge_virtual_source; mod factor_instance; mod factor_instance_badge; +mod factor_instances; mod private_hierarchical_deterministic_factor_instance; pub use badge_virtual_source::*; pub use factor_instance::*; pub use factor_instance_badge::*; +pub use factor_instances::*; pub use private_hierarchical_deterministic_factor_instance::*; diff --git a/crates/sargon/src/profile/v100/factors/factor_instance/private_hierarchical_deterministic_factor_instance.rs b/crates/sargon-factors/src/factor_instance/private_hierarchical_deterministic_factor_instance.rs similarity index 100% rename from crates/sargon/src/profile/v100/factors/factor_instance/private_hierarchical_deterministic_factor_instance.rs rename to crates/sargon-factors/src/factor_instance/private_hierarchical_deterministic_factor_instance.rs diff --git a/crates/sargon/src/profile/v100/factors/factor_source.rs b/crates/sargon-factors/src/factor_source.rs similarity index 99% rename from crates/sargon/src/profile/v100/factors/factor_source.rs rename to crates/sargon-factors/src/factor_source.rs index 3b25cf137..fdb2915c5 100644 --- a/crates/sargon/src/profile/v100/factors/factor_source.rs +++ b/crates/sargon-factors/src/factor_source.rs @@ -1,5 +1,6 @@ use crate::prelude::*; +#[allow(clippy::large_enum_variant)] #[derive( Serialize, Deserialize, @@ -176,7 +177,6 @@ impl Ord for FactorSource { } impl<'de> Deserialize<'de> for FactorSource { - #[cfg(not(tarpaulin_include))] // false negative fn deserialize>( deserializer: D, ) -> Result { @@ -192,7 +192,6 @@ impl<'de> Deserialize<'de> for FactorSource { } impl Serialize for FactorSource { - #[cfg(not(tarpaulin_include))] // false negative fn serialize(&self, serializer: S) -> Result where S: Serializer, diff --git a/crates/sargon/src/profile/v100/factors/factor_source_category.rs b/crates/sargon-factors/src/factor_source_category.rs similarity index 62% rename from crates/sargon/src/profile/v100/factors/factor_source_category.rs rename to crates/sargon-factors/src/factor_source_category.rs index 20b1d7ca8..91ec885e6 100644 --- a/crates/sargon/src/profile/v100/factors/factor_source_category.rs +++ b/crates/sargon-factors/src/factor_source_category.rs @@ -18,3 +18,13 @@ pub enum FactorSourceCategory { /// Some institution I trust. Custodian, } + +impl FactorSourceCategory { + pub fn is_supported(&self) -> bool { + use FactorSourceCategory::*; + match self { + Identity | Hardware | Contact | Information => true, + Custodian => false, + } + } +} diff --git a/crates/sargon/src/profile/v100/factors/factor_source_common.rs b/crates/sargon-factors/src/factor_source_common.rs similarity index 100% rename from crates/sargon/src/profile/v100/factors/factor_source_common.rs rename to crates/sargon-factors/src/factor_source_common.rs diff --git a/crates/sargon/src/profile/v100/factors/factor_source_crypto_parameters.rs b/crates/sargon-factors/src/factor_source_crypto_parameters.rs similarity index 99% rename from crates/sargon/src/profile/v100/factors/factor_source_crypto_parameters.rs rename to crates/sargon-factors/src/factor_source_crypto_parameters.rs index a37cb542f..1d99efcfd 100644 --- a/crates/sargon/src/profile/v100/factors/factor_source_crypto_parameters.rs +++ b/crates/sargon-factors/src/factor_source_crypto_parameters.rs @@ -32,7 +32,6 @@ pub struct FactorSourceCryptoParameters { } impl FactorSourceCryptoParameters { - #[cfg(not(tarpaulin_include))] // false negative pub fn new(curves: I, schemes: J) -> Result where I: IntoIterator, diff --git a/crates/sargon/src/profile/v100/factors/factor_source_flag.rs b/crates/sargon-factors/src/factor_source_flag.rs similarity index 100% rename from crates/sargon/src/profile/v100/factors/factor_source_flag.rs rename to crates/sargon-factors/src/factor_source_flag.rs diff --git a/crates/sargon/src/profile/v100/factors/factor_source_id.rs b/crates/sargon-factors/src/factor_source_id.rs similarity index 93% rename from crates/sargon/src/profile/v100/factors/factor_source_id.rs rename to crates/sargon-factors/src/factor_source_id.rs index 2c5b980ef..a85568bd4 100644 --- a/crates/sargon/src/profile/v100/factors/factor_source_id.rs +++ b/crates/sargon-factors/src/factor_source_id.rs @@ -4,6 +4,7 @@ use crate::prelude::*; /// DeviceFactorSource being a mnemonic securely stored in a /// device (phone), where the ID of it is the hash of a special /// key derived near the root of it. +#[allow(clippy::large_enum_variant)] #[derive( Serialize, Deserialize, @@ -25,7 +26,6 @@ pub enum FactorSourceID { #[display("{}", value)] value: FactorSourceIDFromHash, }, - /// FactorSourceID from an AccountAddress, typically used by `trustedContact` FactorSource. Address { #[serde(rename = "fromAddress")] @@ -40,6 +40,18 @@ impl FactorSourceID { } } +pub trait HasFactorSourceKindObjectSafe { + fn get_factor_source_kind(&self) -> FactorSourceKind; +} +impl HasFactorSourceKindObjectSafe for FactorSourceID { + fn get_factor_source_kind(&self) -> FactorSourceKind { + match self { + FactorSourceID::Hash { value } => value.kind, + FactorSourceID::Address { value } => value.kind, + } + } +} + /// A bit hacky... but used to make it possible for us to validate FactorSourceID /// in RoleWithFactor... impl IsMaybeKeySpaceAware for FactorSourceID { @@ -61,7 +73,6 @@ impl From for FactorSourceID { } impl<'de> Deserialize<'de> for FactorSourceID { - #[cfg(not(tarpaulin_include))] // false negative fn deserialize>( deserializer: D, ) -> Result { @@ -76,7 +87,6 @@ impl<'de> Deserialize<'de> for FactorSourceID { } impl Serialize for FactorSourceID { - #[cfg(not(tarpaulin_include))] // false negative fn serialize(&self, serializer: S) -> Result where S: Serializer, diff --git a/crates/sargon/src/profile/v100/factors/factor_source_id_from_address.rs b/crates/sargon-factors/src/factor_source_id_from_address.rs similarity index 78% rename from crates/sargon/src/profile/v100/factors/factor_source_id_from_address.rs rename to crates/sargon-factors/src/factor_source_id_from_address.rs index 639b25f58..f47e53ed6 100644 --- a/crates/sargon/src/profile/v100/factors/factor_source_id_from_address.rs +++ b/crates/sargon-factors/src/factor_source_id_from_address.rs @@ -19,19 +19,22 @@ pub struct FactorSourceIDFromAddress { pub kind: FactorSourceKind, /// An account address which the FactorSource this ID refers uses/needs. - pub body: AccountAddress, + pub body: ShortString, // actually `AccountAddress` - TODO split out addresses into separate crate and add it dependency in this crate...? } impl FactorSourceIDFromAddress { - pub fn new(kind: FactorSourceKind, body: AccountAddress) -> Self { + pub fn new(kind: FactorSourceKind, body: impl AsRef) -> Self { assert!(kind == FactorSourceKind::TrustedContact, "Only supported FactorSourceKind to be used with FactorSourceIDFromAddress is `trustedContact` at this moment."); - Self { kind, body } + Self { + kind, + body: ShortString::new(body).unwrap(), + } } } impl FactorSourceIDFromAddress { - pub fn new_for_trusted_contact(address: AccountAddress) -> Self { - Self::new(FactorSourceKind::TrustedContact, address) + pub fn new_for_trusted_contact(address: impl AsRef) -> Self { + Self::new(FactorSourceKind::TrustedContact, address.as_ref()) } } @@ -44,22 +47,22 @@ impl FactorSourceIDFromAddress { impl FactorSourceIDFromAddress { /// A sample used to facilitate unit tests. pub fn sample_trusted_contact_friend_frank() -> Self { - Self::new_for_trusted_contact(AccountAddress::sample_frank()) + Self::new_for_trusted_contact("account_rdx1298d59ae3k94htjzpy2z6mx4436h98e5u4qpnwhek8lukv7lkfrank") } /// A sample used to facilitate unit tests. pub fn sample_trusted_contact_friend_judy() -> Self { - Self::new_for_trusted_contact(AccountAddress::sample_judy()) + Self::new_for_trusted_contact("account_rdx12y0389ew2xn7w02d059hhye6t0mjzqxqyavsetyg2j3p3xqyepjudy") } /// A sample used to facilitate unit tests. pub fn sample_trusted_contact_friend_oscar() -> Self { - Self::new_for_trusted_contact(AccountAddress::sample_oscar()) + Self::new_for_trusted_contact("account_rdx129uc6rf5vmkj2gau7fgxlsqdg8008nca8yd57sxx4v67dyw7u0scar") } /// A sample used to facilitate unit tests. pub fn sample_trusted_entity_radix() -> Self { - Self::new_for_trusted_contact(AccountAddress::sample_radix()) + Self::new_for_trusted_contact("account_rdx12y7uww27s250g9d3d72ey9wdp5z78zpmq5la0r0wgw4fkf6y8eerdx") } } diff --git a/crates/sargon/src/profile/v100/factors/factor_source_id_from_hash.rs b/crates/sargon-factors/src/factor_source_id_from_hash.rs similarity index 99% rename from crates/sargon/src/profile/v100/factors/factor_source_id_from_hash.rs rename to crates/sargon-factors/src/factor_source_id_from_hash.rs index 8be286f24..c9bcde7c8 100644 --- a/crates/sargon/src/profile/v100/factors/factor_source_id_from_hash.rs +++ b/crates/sargon-factors/src/factor_source_id_from_hash.rs @@ -1,5 +1,3 @@ -use itertools::join; - use crate::prelude::*; /// FactorSourceID from the blake2b hash of the special HD public key derived at `CAP26::GetID`, diff --git a/crates/sargon/src/profile/v100/factors/factor_source_kind.rs b/crates/sargon-factors/src/factor_source_kind.rs similarity index 99% rename from crates/sargon/src/profile/v100/factors/factor_source_kind.rs rename to crates/sargon-factors/src/factor_source_kind.rs index c881b4ba3..02adb0689 100644 --- a/crates/sargon/src/profile/v100/factors/factor_source_kind.rs +++ b/crates/sargon-factors/src/factor_source_kind.rs @@ -151,7 +151,6 @@ impl HasSampleValues for FactorSourceKind { } impl std::fmt::Display for FactorSourceKind { - #[cfg(not(tarpaulin_include))] // false negative fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{}", self.discriminant()) } diff --git a/crates/sargon/src/profile/v100/factors/factor_sources/device_factor_source/device_factor_source.rs b/crates/sargon-factors/src/factor_sources/device_factor_source/device_factor_source.rs similarity index 100% rename from crates/sargon/src/profile/v100/factors/factor_sources/device_factor_source/device_factor_source.rs rename to crates/sargon-factors/src/factor_sources/device_factor_source/device_factor_source.rs diff --git a/crates/sargon/src/profile/v100/factors/factor_sources/device_factor_source/device_factor_source_hint.rs b/crates/sargon-factors/src/factor_sources/device_factor_source/device_factor_source_hint.rs similarity index 100% rename from crates/sargon/src/profile/v100/factors/factor_sources/device_factor_source/device_factor_source_hint.rs rename to crates/sargon-factors/src/factor_sources/device_factor_source/device_factor_source_hint.rs diff --git a/crates/sargon/src/profile/v100/factors/factor_sources/device_factor_source/mod.rs b/crates/sargon-factors/src/factor_sources/device_factor_source/mod.rs similarity index 100% rename from crates/sargon/src/profile/v100/factors/factor_sources/device_factor_source/mod.rs rename to crates/sargon-factors/src/factor_sources/device_factor_source/mod.rs diff --git a/crates/sargon/src/profile/v100/factors/factor_sources/factor_sources.rs b/crates/sargon-factors/src/factor_sources/factor_sources.rs similarity index 100% rename from crates/sargon/src/profile/v100/factors/factor_sources/factor_sources.rs rename to crates/sargon-factors/src/factor_sources/factor_sources.rs diff --git a/crates/sargon/src/profile/v100/factors/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_factor_source.rs b/crates/sargon-factors/src/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_factor_source.rs similarity index 100% rename from crates/sargon/src/profile/v100/factors/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_factor_source.rs rename to crates/sargon-factors/src/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_factor_source.rs diff --git a/crates/sargon/src/profile/v100/factors/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_hint.rs b/crates/sargon-factors/src/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_hint.rs similarity index 100% rename from crates/sargon/src/profile/v100/factors/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_hint.rs rename to crates/sargon-factors/src/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_hint.rs diff --git a/crates/sargon/src/profile/v100/factors/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_model.rs b/crates/sargon-factors/src/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_model.rs similarity index 100% rename from crates/sargon/src/profile/v100/factors/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_model.rs rename to crates/sargon-factors/src/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_model.rs diff --git a/crates/sargon/src/profile/v100/factors/factor_sources/ledger_hardware_wallet_factor_source/mod.rs b/crates/sargon-factors/src/factor_sources/ledger_hardware_wallet_factor_source/mod.rs similarity index 100% rename from crates/sargon/src/profile/v100/factors/factor_sources/ledger_hardware_wallet_factor_source/mod.rs rename to crates/sargon-factors/src/factor_sources/ledger_hardware_wallet_factor_source/mod.rs diff --git a/crates/sargon/src/profile/v100/factors/factor_sources/mod.rs b/crates/sargon-factors/src/factor_sources/mod.rs similarity index 100% rename from crates/sargon/src/profile/v100/factors/factor_sources/mod.rs rename to crates/sargon-factors/src/factor_sources/mod.rs diff --git a/crates/sargon/src/profile/v100/factors/factor_sources/private_hierarchical_deterministic_factor_source.rs b/crates/sargon-factors/src/factor_sources/private_hierarchical_deterministic_factor_source.rs similarity index 98% rename from crates/sargon/src/profile/v100/factors/factor_sources/private_hierarchical_deterministic_factor_source.rs rename to crates/sargon-factors/src/factor_sources/private_hierarchical_deterministic_factor_source.rs index 892234b8d..7f7ed21b3 100644 --- a/crates/sargon/src/profile/v100/factors/factor_sources/private_hierarchical_deterministic_factor_source.rs +++ b/crates/sargon-factors/src/factor_sources/private_hierarchical_deterministic_factor_source.rs @@ -1,5 +1,3 @@ -use sbor::prelude::indexmap::IndexSet; - use crate::prelude::*; #[derive(Zeroize, Debug, Clone, PartialEq, Eq, Hash)] @@ -94,7 +92,7 @@ impl PrivateHierarchicalDeterministicFactorSource { impl PrivateHierarchicalDeterministicFactorSource { /// Should only be used for testing and sample values, for production code use /// `VirtualEntityCreatingInstanceProvider` powered by the `FactorInstancesProvider` - pub(crate) fn _derive_entity_creation_factor_instance( + pub fn _derive_entity_creation_factor_instance( &self, network_id: NetworkID, index: HDPathComponent, @@ -110,7 +108,7 @@ impl PrivateHierarchicalDeterministicFactorSource { /// Should only be used for testing and sample values, for production code use /// `VirtualEntityCreatingInstanceProvider` powered by the `FactorInstancesProvider` - pub(crate) fn _derive_entity_creation_factor_instances( + pub fn _derive_entity_creation_factor_instances( &self, network_id: NetworkID, indices: impl IntoIterator, diff --git a/crates/sargon/src/types/factor_sources_of_kind.rs b/crates/sargon-factors/src/factor_sources_of_kind.rs similarity index 76% rename from crates/sargon/src/types/factor_sources_of_kind.rs rename to crates/sargon-factors/src/factor_sources_of_kind.rs index 7aafb3e30..5fb9cd98a 100644 --- a/crates/sargon/src/types/factor_sources_of_kind.rs +++ b/crates/sargon-factors/src/factor_sources_of_kind.rs @@ -2,12 +2,12 @@ use crate::prelude::*; #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct FactorSourcesOfKind { - pub(crate) kind: FactorSourceKind, + pub kind: FactorSourceKind, factor_sources: Vec, } impl FactorSourcesOfKind { - pub(crate) fn new( + pub fn new( kind: FactorSourceKind, factor_sources: impl IntoIterator, ) -> Result { @@ -32,11 +32,36 @@ impl FactorSourcesOfKind { }) } - pub(crate) fn factor_sources(&self) -> IndexSet { + pub fn factor_sources(&self) -> IndexSet { self.factor_sources.clone().into_iter().collect() } } +pub fn sort_group_factors( + used_factor_sources: HashSet, +) -> IndexSet { + let factors_of_kind: HashMap> = + used_factor_sources + .into_iter() + .into_grouping_map_by(|x| x.factor_source_kind()) + .collect::>(); + + let mut factors_of_kind = factors_of_kind + .into_iter() + .map(|(k, v)| (k, v.into_iter().sorted().collect::>())) + .collect::>>(); + + factors_of_kind.sort_keys(); + + factors_of_kind + .into_iter() + .map(|(k, v)| { + FactorSourcesOfKind::new(k, v) + .expect("All factors should be of the same kind, since this is calling iter on a Map, using kind as key. Did you just move around lines of code?") + }) + .collect::>() +} + #[cfg(test)] mod tests { use super::*; diff --git a/crates/sargon/src/profile/v100/factors/hd_factor_instance_account_creation.rs b/crates/sargon-factors/src/hd_factor_instance_account_creation.rs similarity index 100% rename from crates/sargon/src/profile/v100/factors/hd_factor_instance_account_creation.rs rename to crates/sargon-factors/src/hd_factor_instance_account_creation.rs diff --git a/crates/sargon/src/profile/v100/factors/hd_factor_instance_identity_creation.rs b/crates/sargon-factors/src/hd_factor_instance_identity_creation.rs similarity index 100% rename from crates/sargon/src/profile/v100/factors/hd_factor_instance_identity_creation.rs rename to crates/sargon-factors/src/hd_factor_instance_identity_creation.rs diff --git a/crates/sargon/src/profile/v100/factors/hd_transaction_signing_factor_instance.rs b/crates/sargon-factors/src/hd_transaction_signing_factor_instance.rs similarity index 100% rename from crates/sargon/src/profile/v100/factors/hd_transaction_signing_factor_instance.rs rename to crates/sargon-factors/src/hd_transaction_signing_factor_instance.rs diff --git a/crates/sargon/src/profile/v100/factors/hierarchical_deterministic_factor_instance.rs b/crates/sargon-factors/src/hierarchical_deterministic_factor_instance.rs similarity index 96% rename from crates/sargon/src/profile/v100/factors/hierarchical_deterministic_factor_instance.rs rename to crates/sargon-factors/src/hierarchical_deterministic_factor_instance.rs index bfedeacd3..c2e225eb6 100644 --- a/crates/sargon/src/profile/v100/factors/hierarchical_deterministic_factor_instance.rs +++ b/crates/sargon-factors/src/hierarchical_deterministic_factor_instance.rs @@ -158,7 +158,6 @@ impl HierarchicalDeterministicFactorInstance { } impl Serialize for HierarchicalDeterministicFactorInstance { - #[cfg(not(tarpaulin_include))] // false negative fn serialize( &self, serializer: S, @@ -171,7 +170,6 @@ impl Serialize for HierarchicalDeterministicFactorInstance { } impl<'de> serde::Deserialize<'de> for HierarchicalDeterministicFactorInstance { - #[cfg(not(tarpaulin_include))] // false negative fn deserialize>( d: D, ) -> Result { @@ -227,10 +225,7 @@ impl HierarchicalDeterministicFactorInstance { /// Account | Mainnet /// A sample used to facilitate unit tests. - pub(crate) fn sample_with_key_kind( - key_kind: CAP26KeyKind, - index: u32, - ) -> Self { + pub fn sample_with_key_kind(key_kind: CAP26KeyKind, index: u32) -> Self { Self::sample_with_key_kind_entity_kind( key_kind, CAP26EntityKind::Account, @@ -252,7 +247,7 @@ impl HierarchicalDeterministicFactorInstance { } /// A sample used to facilitate unit tests. - pub(crate) fn sample_with_key_kind_entity_kind( + pub fn sample_with_key_kind_entity_kind( key_kind: CAP26KeyKind, entity_kind: CAP26EntityKind, index: u32, @@ -266,7 +261,7 @@ impl HierarchicalDeterministicFactorInstance { } /// A sample used to facilitate unit tests. - pub(crate) fn sample_with_key_kind_entity_kind_on_network( + pub fn sample_with_key_kind_entity_kind_on_network( network_id: NetworkID, key_kind: CAP26KeyKind, entity_kind: CAP26EntityKind, @@ -280,7 +275,7 @@ impl HierarchicalDeterministicFactorInstance { ) } - pub(crate) fn sample_with_key_kind_entity_kind_on_network_and_hardened_index( + pub fn sample_with_key_kind_entity_kind_on_network_and_hardened_index( network_id: NetworkID, key_kind: CAP26KeyKind, entity_kind: CAP26EntityKind, diff --git a/crates/sargon/src/profile/v100/factors/is_entity_path.rs b/crates/sargon-factors/src/is_entity_path.rs similarity index 100% rename from crates/sargon/src/profile/v100/factors/is_entity_path.rs rename to crates/sargon-factors/src/is_entity_path.rs diff --git a/crates/sargon/src/profile/v100/factors/is_factor_source.rs b/crates/sargon-factors/src/is_factor_source.rs similarity index 100% rename from crates/sargon/src/profile/v100/factors/is_factor_source.rs rename to crates/sargon-factors/src/is_factor_source.rs diff --git a/crates/sargon-factors/src/lib.rs b/crates/sargon-factors/src/lib.rs new file mode 100644 index 000000000..22b38e6d2 --- /dev/null +++ b/crates/sargon-factors/src/lib.rs @@ -0,0 +1,62 @@ +#![feature(trivial_bounds)] +#![allow(trivial_bounds)] + +mod factor_instance; +mod factor_source; +mod factor_source_category; +mod factor_source_common; +mod factor_source_crypto_parameters; +mod factor_source_flag; +mod factor_source_id; +mod factor_source_id_from_address; +mod factor_source_id_from_hash; +mod factor_source_kind; +mod factor_sources; +mod factor_sources_of_kind; +mod hd_factor_instance_account_creation; +mod hd_factor_instance_identity_creation; +mod hd_transaction_signing_factor_instance; +mod hierarchical_deterministic_factor_instance; +mod is_entity_path; +mod is_factor_source; +mod mfa_factor_sources; +mod samples; + +pub mod prelude { + + pub(crate) use identified_vec_of::prelude::*; + pub(crate) use sargon_core::prelude::*; + pub(crate) use sargon_hierarchical_deterministic::prelude::*; + + pub(crate) use once_cell::sync::Lazy; + + pub use crate::factor_instance::*; + pub use crate::factor_source::*; + pub use crate::factor_source_category::*; + pub use crate::factor_source_common::*; + pub use crate::factor_source_crypto_parameters::*; + pub use crate::factor_source_flag::*; + pub use crate::factor_source_id::*; + pub use crate::factor_source_id_from_address::*; + pub use crate::factor_source_id_from_hash::*; + pub use crate::factor_source_kind::*; + pub use crate::factor_sources::*; + pub use crate::factor_sources_of_kind::*; + pub use crate::hd_factor_instance_account_creation::*; + pub use crate::hd_factor_instance_identity_creation::*; + pub use crate::hd_transaction_signing_factor_instance::*; + pub use crate::hierarchical_deterministic_factor_instance::*; + pub use crate::is_entity_path::*; + pub use crate::is_factor_source::*; + pub use crate::mfa_factor_sources::*; + pub use crate::samples::*; + + pub(crate) use radix_common::{ + crypto::PublicKey as ScryptoPublicKey, + prelude::NonFungibleGlobalId as ScryptoNonFungibleGlobalId, + types::FromPublicKey as _, + }; + pub(crate) use radix_engine_interface::blueprints::resource::ResourceOrNonFungible as ScryptoResourceOrNonFungible; +} + +pub use prelude::*; diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/arculus_card_factor_source/arculus_card_factor_source.rs b/crates/sargon-factors/src/mfa_factor_sources/arculus_card_factor_source/arculus_card_factor_source.rs similarity index 99% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/arculus_card_factor_source/arculus_card_factor_source.rs rename to crates/sargon-factors/src/mfa_factor_sources/arculus_card_factor_source/arculus_card_factor_source.rs index fd5152b40..278d0651f 100644 --- a/crates/sargon/src/profile/mfa/mfa_factor_sources/arculus_card_factor_source/arculus_card_factor_source.rs +++ b/crates/sargon-factors/src/mfa_factor_sources/arculus_card_factor_source/arculus_card_factor_source.rs @@ -1,5 +1,4 @@ use crate::prelude::*; -use crate::prelude::*; /// An Arculus card, a hierarchal deterministic wallet capable of CAP26 derivation /// which users interact with by placing it near their host device, which diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/arculus_card_factor_source/arculus_card_hint.rs b/crates/sargon-factors/src/mfa_factor_sources/arculus_card_factor_source/arculus_card_hint.rs similarity index 100% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/arculus_card_factor_source/arculus_card_hint.rs rename to crates/sargon-factors/src/mfa_factor_sources/arculus_card_factor_source/arculus_card_hint.rs diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/arculus_card_factor_source/arculus_card_model.rs b/crates/sargon-factors/src/mfa_factor_sources/arculus_card_factor_source/arculus_card_model.rs similarity index 100% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/arculus_card_factor_source/arculus_card_model.rs rename to crates/sargon-factors/src/mfa_factor_sources/arculus_card_factor_source/arculus_card_model.rs diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/arculus_card_factor_source/mod.rs b/crates/sargon-factors/src/mfa_factor_sources/arculus_card_factor_source/mod.rs similarity index 100% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/arculus_card_factor_source/mod.rs rename to crates/sargon-factors/src/mfa_factor_sources/arculus_card_factor_source/mod.rs diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/mod.rs b/crates/sargon-factors/src/mfa_factor_sources/mod.rs similarity index 100% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/mod.rs rename to crates/sargon-factors/src/mfa_factor_sources/mod.rs diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/off_device_mnemonic_factor_source/mod.rs b/crates/sargon-factors/src/mfa_factor_sources/off_device_mnemonic_factor_source/mod.rs similarity index 100% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/off_device_mnemonic_factor_source/mod.rs rename to crates/sargon-factors/src/mfa_factor_sources/off_device_mnemonic_factor_source/mod.rs diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_factor_source_hint.rs b/crates/sargon-factors/src/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_factor_source_hint.rs similarity index 100% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_factor_source_hint.rs rename to crates/sargon-factors/src/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_factor_source_hint.rs diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_mnemonic_factor_source.rs b/crates/sargon-factors/src/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_mnemonic_factor_source.rs similarity index 98% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_mnemonic_factor_source.rs rename to crates/sargon-factors/src/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_mnemonic_factor_source.rs index 33856f897..2b3982b63 100644 --- a/crates/sargon/src/profile/mfa/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_mnemonic_factor_source.rs +++ b/crates/sargon-factors/src/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_mnemonic_factor_source.rs @@ -110,11 +110,11 @@ impl BaseBaseIsFactorSource for OffDeviceMnemonicFactorSource { } fn name(&self) -> String { - self.hint.label.value.clone() + self.hint.label.value() } fn set_name(&mut self, updated: String) { - self.hint.label.value = updated; + self.hint.label.update(updated); } } diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/password_factor_source/mod.rs b/crates/sargon-factors/src/mfa_factor_sources/password_factor_source/mod.rs similarity index 100% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/password_factor_source/mod.rs rename to crates/sargon-factors/src/mfa_factor_sources/password_factor_source/mod.rs diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/password_factor_source/password_factor_source.rs b/crates/sargon-factors/src/mfa_factor_sources/password_factor_source/password_factor_source.rs similarity index 100% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/password_factor_source/password_factor_source.rs rename to crates/sargon-factors/src/mfa_factor_sources/password_factor_source/password_factor_source.rs diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/password_factor_source/password_factor_source_hint.rs b/crates/sargon-factors/src/mfa_factor_sources/password_factor_source/password_factor_source_hint.rs similarity index 100% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/password_factor_source/password_factor_source_hint.rs rename to crates/sargon-factors/src/mfa_factor_sources/password_factor_source/password_factor_source_hint.rs diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/answer/mod.rs b/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/answer/mod.rs similarity index 100% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/answer/mod.rs rename to crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/answer/mod.rs diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/answer/security_question_and_answer.rs b/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/answer/security_question_and_answer.rs similarity index 100% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/answer/security_question_and_answer.rs rename to crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/answer/security_question_and_answer.rs diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/answer/security_questions_and_answers.rs b/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/answer/security_questions_and_answers.rs similarity index 100% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/answer/security_questions_and_answers.rs rename to crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/answer/security_questions_and_answers.rs diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/is_security_questions_kdf_scheme.rs b/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/is_security_questions_kdf_scheme.rs similarity index 100% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/is_security_questions_kdf_scheme.rs rename to crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/is_security_questions_kdf_scheme.rs diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/mod.rs b/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/mod.rs similarity index 100% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/mod.rs rename to crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/mod.rs diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/security_questions_keys_from_questions_and_answer_scheme.rs b/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/security_questions_keys_from_questions_and_answer_scheme.rs similarity index 100% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/security_questions_keys_from_questions_and_answer_scheme.rs rename to crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/security_questions_keys_from_questions_and_answer_scheme.rs diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/keys_by_diffie_hellman_fold.rs b/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/keys_by_diffie_hellman_fold.rs similarity index 89% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/keys_by_diffie_hellman_fold.rs rename to crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/keys_by_diffie_hellman_fold.rs index 3367747c3..6203d5fb6 100644 --- a/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/keys_by_diffie_hellman_fold.rs +++ b/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/keys_by_diffie_hellman_fold.rs @@ -2,17 +2,6 @@ use crate::prelude::*; use crypto::keys::x25519::PublicKey as X25519PublicKey; use crypto::keys::x25519::SecretKey as X25519PrivateKey; -// impl From for Exactly32Bytes { -// fn from(value: X25519PublicKey) -> Exactly32Bytes { -// Exactly32Bytes::from(&value.to_bytes()) -// } -// } -impl From for EncryptionKey { - fn from(value: X25519PublicKey) -> EncryptionKey { - EncryptionKey(Exactly32Bytes::from(&value.to_bytes())) - } -} - /// ❗️ NOT PRODUCTION READY YET ❗️ /// A key derivation function which produces Encryption Keys from a set of /// key exchange keys, by performing Diffie-Hellman key exchange on each diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/mod.rs b/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/mod.rs similarity index 100% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/mod.rs rename to crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/mod.rs diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/keys_from_questions_and_answers_lower_trim_utf8.rs b/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/keys_from_questions_and_answers_lower_trim_utf8.rs similarity index 96% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/keys_from_questions_and_answers_lower_trim_utf8.rs rename to crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/keys_from_questions_and_answers_lower_trim_utf8.rs index 26bbb9d1d..cd98cb556 100644 --- a/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/keys_from_questions_and_answers_lower_trim_utf8.rs +++ b/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/keys_from_questions_and_answers_lower_trim_utf8.rs @@ -1,10 +1,5 @@ use crate::prelude::*; -use aes_gcm::{ - aead::{generic_array::sequence::Concat, Aead, AeadCore, KeyInit, OsRng}, - Aes256Gcm, Key, Nonce, -}; -use crypto::keys::x25519::PublicKey as X25519PublicKey; use crypto::keys::x25519::SecretKey as X25519PrivateKey; use hkdf::Hkdf; use k256::sha2::Sha256; diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/mod.rs b/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/mod.rs similarity index 100% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/mod.rs rename to crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/mod.rs diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/security_question_and_answer_as_bytes.rs b/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/security_question_and_answer_as_bytes.rs similarity index 100% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/security_question_and_answer_as_bytes.rs rename to crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/security_question_and_answer_as_bytes.rs diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/security_question_answer_as_bytes.rs b/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/security_question_answer_as_bytes.rs similarity index 100% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/security_question_answer_as_bytes.rs rename to crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/security_question_answer_as_bytes.rs diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/mod.rs b/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/mod.rs similarity index 100% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/mod.rs rename to crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/mod.rs diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/mod.rs b/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/mod.rs similarity index 100% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/mod.rs rename to crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/mod.rs diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/mod.rs b/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/question/mod.rs similarity index 100% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/mod.rs rename to crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/question/mod.rs diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/security_question.rs b/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/question/security_question.rs similarity index 100% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/security_question.rs rename to crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/question/security_question.rs diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/security_question_kind.rs b/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/question/security_question_kind.rs similarity index 100% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/security_question_kind.rs rename to crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/question/security_question_kind.rs diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/security_questions.rs b/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/question/security_questions.rs similarity index 100% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/security_questions.rs rename to crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/question/security_questions.rs diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/security_questions_factor_source.rs b/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/security_questions_factor_source.rs similarity index 98% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/security_questions_factor_source.rs rename to crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/security_questions_factor_source.rs index 318c816fe..ac79cbd9d 100644 --- a/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/security_questions_factor_source.rs +++ b/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/security_questions_factor_source.rs @@ -1,15 +1,5 @@ use crate::prelude::*; -use aes_gcm::{ - aead::{generic_array::sequence::Concat, Aead, AeadCore, KeyInit, OsRng}, - Aes256Gcm, Key, Nonce, -}; -use hkdf::Hkdf; -use k256::sha2::Sha256; - -use crypto::keys::x25519::PublicKey as X25519PublicKey; -use crypto::keys::x25519::SecretKey as X25519PrivateKey; - /// ❗️ NOT PRODUCTION READY YET ❗️ /// A mnemonic "sealed" by "security questions" (personal questions). /// @@ -299,7 +289,6 @@ impl BaseBaseIsFactorSource #[cfg(test)] mod tests { - use std::borrow::BorrowMut; use super::*; diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/security_questions_sealed_mnemonic.rs b/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/security_questions_sealed_mnemonic.rs similarity index 100% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/security_questions_sealed_mnemonic.rs rename to crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/security_questions_sealed_mnemonic.rs diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/trusted_contact_factor_source/mod.rs b/crates/sargon-factors/src/mfa_factor_sources/trusted_contact_factor_source/mod.rs similarity index 100% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/trusted_contact_factor_source/mod.rs rename to crates/sargon-factors/src/mfa_factor_sources/trusted_contact_factor_source/mod.rs diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source.rs b/crates/sargon-factors/src/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source.rs similarity index 86% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source.rs rename to crates/sargon-factors/src/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source.rs index 1da3a6566..6b9dcb391 100644 --- a/crates/sargon/src/profile/mfa/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source.rs +++ b/crates/sargon-factors/src/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source.rs @@ -40,7 +40,7 @@ impl TrustedContactFactorSource { } pub fn new( - address: AccountAddress, + address: impl AsRef, // Actually an AccountAddress contact: TrustedContactFactorSourceContact, ) -> Self { let id = FactorSourceIDFromAddress::new_for_trusted_contact(address); @@ -89,15 +89,15 @@ impl BaseBaseIsFactorSource for TrustedContactFactorSource { } fn name(&self) -> String { - self.contact.name.value.clone() + self.contact.name.value() } fn set_name(&mut self, updated: String) { - self.contact.name.value = updated; + self.contact.name.update(updated); } } impl TrustedContactFactorSource { - fn new_sample(name: &str, email: &str, address: AccountAddress) -> Self { + fn new_sample(name: &str, email: &str, address: impl AsRef) -> Self { let mut source = Self::new( address, TrustedContactFactorSourceContact::new( @@ -114,49 +114,49 @@ impl TrustedContactFactorSource { Self::new_sample( "Frank Sample", "frank.sample@gmail.com", - AccountAddress::sample_frank(), + "account_rdx1298d59ae3k94htjzpy2z6mx4436h98e5u4qpnwhek8lukv7lkfrank", ) } pub fn sample_grace() -> Self { Self::new_sample( "Grace Sample", "grace.sample@gmail.com", - AccountAddress::sample_grace(), + "account_rdx128c4f8dnuvd73d2r3fl95ryfuavw5zjf8zr57hjw0qjagz7s7grace", ) } pub fn sample_judy() -> Self { Self::new_sample( "Judy Sample", "judy.sample@gmail.com", - AccountAddress::sample_judy(), + "account_rdx12y0389ew2xn7w02d059hhye6t0mjzqxqyavsetyg2j3p3xqyepjudy", ) } pub fn sample_oscar() -> Self { Self::new_sample( "Oscar Sample", "oscar.sample@gmail.com", - AccountAddress::sample_oscar(), + "account_rdx129uc6rf5vmkj2gau7fgxlsqdg8008nca8yd57sxx4v67dyw7u0scar", ) } pub fn sample_trudy() -> Self { Self::new_sample( "Trudy Sample", "trudy.sample@gmail.com", - AccountAddress::sample_trudy(), + "account_rdx1284z0gpg9vnhevn7sytdncszc7ukcrycntg7zjktqvggmwe6ctrudy", ) } pub fn sample_radix() -> Self { Self::new_sample( "Radix InstaBridge", "hello@instabridge.com", - AccountAddress::sample_radix(), + "account_rdx12y7uww27s250g9d3d72ey9wdp5z78zpmq5la0r0wgw4fkf6y8eerdx", ) } } impl HasSampleValues for TrustedContactFactorSource { fn sample() -> Self { let mut source = Self::new( - AccountAddress::sample_mainnet(), + "account_rdx128y6j78mt0aqv6372evz28hrxp8mn06ccddkr7xppc88hyvynvjdwr", TrustedContactFactorSourceContact::sample(), ); source.common.last_used_on = Timestamp::sample(); @@ -166,7 +166,7 @@ impl HasSampleValues for TrustedContactFactorSource { fn sample_other() -> Self { let mut source = Self::new( - AccountAddress::sample_mainnet_other(), + "account_rdx12xkzynhzgtpnnd02tudw2els2g9xl73yk54ppw8xekt2sdrlaer264", TrustedContactFactorSourceContact::sample_other(), ); source.common.last_used_on = Timestamp::sample(); diff --git a/crates/sargon/src/profile/mfa/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source_contact.rs b/crates/sargon-factors/src/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source_contact.rs similarity index 100% rename from crates/sargon/src/profile/mfa/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source_contact.rs rename to crates/sargon-factors/src/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source_contact.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/matrices/factor_source_id_samples.rs b/crates/sargon-factors/src/samples/factor_source_id_samples.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/matrices/factor_source_id_samples.rs rename to crates/sargon-factors/src/samples/factor_source_id_samples.rs diff --git a/crates/sargon/src/types/samples/factor_source_ids_with_samples.rs b/crates/sargon-factors/src/samples/factor_source_ids_with_samples.rs similarity index 100% rename from crates/sargon/src/types/samples/factor_source_ids_with_samples.rs rename to crates/sargon-factors/src/samples/factor_source_ids_with_samples.rs diff --git a/crates/sargon/src/types/samples/factor_source_samples.rs b/crates/sargon-factors/src/samples/factor_source_samples.rs similarity index 94% rename from crates/sargon/src/types/samples/factor_source_samples.rs rename to crates/sargon-factors/src/samples/factor_source_samples.rs index 7c87a765f..c38a662ed 100644 --- a/crates/sargon/src/types/samples/factor_source_samples.rs +++ b/crates/sargon-factors/src/samples/factor_source_samples.rs @@ -3,7 +3,7 @@ use crate::prelude::*; #[allow(dead_code)] pub(crate) static ALL_FACTOR_SOURCE_SAMPLES: Lazy<[FactorSource; 12]> = Lazy::new(|| { - crate::types::samples::ALL_FACTOR_SOURCE_ID_SAMPLES + crate::samples::ALL_FACTOR_SOURCE_ID_SAMPLES .iter() .map(FactorSource::sample_from) .collect::>() @@ -11,13 +11,12 @@ pub(crate) static ALL_FACTOR_SOURCE_SAMPLES: Lazy<[FactorSource; 12]> = .unwrap() }); -#[allow(dead_code)] impl FactorSource { - pub(crate) fn sample_at(index: usize) -> FactorSource { + pub fn sample_at(index: usize) -> FactorSource { ALL_FACTOR_SOURCE_SAMPLES[index].clone() } - pub(crate) fn sample_all() -> IndexSet { + pub fn sample_all() -> IndexSet { IndexSet::from_iter(ALL_FACTOR_SOURCE_SAMPLES.clone()) } diff --git a/crates/sargon/src/types/samples/hierarchical_deterministic_factor_instance_samples.rs b/crates/sargon-factors/src/samples/hierarchical_deterministic_factor_instance_samples.rs similarity index 99% rename from crates/sargon/src/types/samples/hierarchical_deterministic_factor_instance_samples.rs rename to crates/sargon-factors/src/samples/hierarchical_deterministic_factor_instance_samples.rs index 3e08a94f3..1eaa13129 100644 --- a/crates/sargon/src/types/samples/hierarchical_deterministic_factor_instance_samples.rs +++ b/crates/sargon-factors/src/samples/hierarchical_deterministic_factor_instance_samples.rs @@ -1,7 +1,7 @@ use crate::prelude::*; impl HierarchicalDeterministicFactorInstance { - pub(crate) fn sample_id_to_instance( + pub fn sample_id_to_instance( entity_kind: CAP26EntityKind, index: Hardened, ) -> impl Fn(FactorSourceIDFromHash) -> Self { diff --git a/crates/sargon-factors/src/samples/mod.rs b/crates/sargon-factors/src/samples/mod.rs new file mode 100644 index 000000000..56dc0cbd9 --- /dev/null +++ b/crates/sargon-factors/src/samples/mod.rs @@ -0,0 +1,7 @@ +mod factor_source_id_samples; +mod factor_source_ids_with_samples; +mod factor_source_samples; +mod hierarchical_deterministic_factor_instance_samples; + +pub use factor_source_id_samples::*; +pub(crate) use factor_source_ids_with_samples::*; diff --git a/crates/sargon-hierarchical-deterministic/Cargo.toml b/crates/sargon-hierarchical-deterministic/Cargo.toml index ab076faec..d32008ca3 100644 --- a/crates/sargon-hierarchical-deterministic/Cargo.toml +++ b/crates/sargon-hierarchical-deterministic/Cargo.toml @@ -5,6 +5,7 @@ edition = "2021" [dependencies] # ==== INTERNAL DEPENDENCIES ==== +identified-vec-of = { path = "../identified-vec-of" } sargon-core = { path = "../sargon-core" } # ==== RADIX DEPENDENCIES ==== @@ -13,7 +14,6 @@ radix-engine-interface = { workspace = true } radix-rust = { workspace = true } radix-transactions = { workspace = true } - # ==== EXTERNAL DEPENDENCIES ==== assert-json-diff = { workspace = true } delegate = { workspace = true } diff --git a/crates/sargon-keys-collector/Cargo.toml b/crates/sargon-keys-collector/Cargo.toml new file mode 100644 index 000000000..c1cf8ffcc --- /dev/null +++ b/crates/sargon-keys-collector/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "sargon-keys-collector" +version = "1.2.1" +edition = "2021" + +[dependencies] +sargon-core = { path = "../sargon-core" } +sargon-factors = { path = "../sargon-factors" } +sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } +sargon-addresses = { path = "../sargon-addresses" } + +actix-rt = { workspace = true } +async-trait = { workspace = true } +derive_more = { workspace = true } +log = { workspace = true } diff --git a/crates/sargon/src/keys_collector/collector/derivation_purpose.rs b/crates/sargon-keys-collector/src/collector/derivation_purpose.rs similarity index 100% rename from crates/sargon/src/keys_collector/collector/derivation_purpose.rs rename to crates/sargon-keys-collector/src/collector/derivation_purpose.rs diff --git a/crates/sargon/src/keys_collector/collector/key_derivation_outcome.rs b/crates/sargon-keys-collector/src/collector/key_derivation_outcome.rs similarity index 100% rename from crates/sargon/src/keys_collector/collector/key_derivation_outcome.rs rename to crates/sargon-keys-collector/src/collector/key_derivation_outcome.rs diff --git a/crates/sargon/src/keys_collector/collector/key_ring.rs b/crates/sargon-keys-collector/src/collector/key_ring.rs similarity index 100% rename from crates/sargon/src/keys_collector/collector/key_ring.rs rename to crates/sargon-keys-collector/src/collector/key_ring.rs diff --git a/crates/sargon/src/keys_collector/collector/keys_collector.rs b/crates/sargon-keys-collector/src/collector/keys_collector.rs similarity index 66% rename from crates/sargon/src/keys_collector/collector/keys_collector.rs rename to crates/sargon-keys-collector/src/collector/keys_collector.rs index 298f0401b..e7fb9fbb0 100644 --- a/crates/sargon/src/keys_collector/collector/keys_collector.rs +++ b/crates/sargon-keys-collector/src/collector/keys_collector.rs @@ -182,94 +182,3 @@ impl KeysCollector { .process_batch_response(response) } } - -#[cfg(test)] -mod tests { - use super::*; - use crate::DerivationPathConstructors; - - #[actix_rt::test] - async fn valid() { - let f0 = FactorSource::sample_ledger(); - let f1 = FactorSource::sample_device(); - let f2 = FactorSource::sample_device_babylon_other(); - let f3 = FactorSource::sample_arculus(); - - let paths = IndexMap::<_, _>::from_iter([ - ( - f0.id_from_hash(), - IndexSet::<_>::from_iter([ - DerivationPath::for_entity( - NetworkID::Mainnet, - CAP26EntityKind::Account, - CAP26KeyKind::TransactionSigning, - Hardened::Securified(SecurifiedU30::ZERO), - ), - DerivationPath::for_entity( - NetworkID::Mainnet, - CAP26EntityKind::Account, - CAP26KeyKind::TransactionSigning, - Hardened::Securified(SecurifiedU30::ONE), - ), - DerivationPath::for_entity( - NetworkID::Stokenet, - CAP26EntityKind::Account, - CAP26KeyKind::TransactionSigning, - Hardened::Unsecurified(UnsecurifiedHardened::TWO), - ), - ]), - ), - ( - f1.id_from_hash(), - IndexSet::<_>::just(DerivationPath::for_entity( - NetworkID::Stokenet, - CAP26EntityKind::Account, - CAP26KeyKind::TransactionSigning, - Hardened::Unsecurified(UnsecurifiedHardened::THREE), - )), - ), - ( - f2.id_from_hash(), - IndexSet::<_>::just(DerivationPath::for_entity( - NetworkID::Mainnet, - CAP26EntityKind::Account, - CAP26KeyKind::TransactionSigning, - Hardened::Unsecurified( - UnsecurifiedHardened::try_from(4u32).unwrap(), - ), - )), - ), - ( - f3.id_from_hash(), - IndexSet::<_>::just(DerivationPath::for_entity( - NetworkID::Mainnet, - CAP26EntityKind::Identity, - CAP26KeyKind::AuthenticationSigning, - Hardened::Securified( - SecurifiedU30::try_from(5u32).unwrap(), - ), - )), - ), - ]); - - let collector = KeysCollector::new( - [f0, f1, f2, f3], - paths.clone(), - Arc::new(TestDerivationInteractor::default()), - DerivationPurpose::PreDerivingKeys, - ) - .unwrap(); - - let outcome = collector.collect_keys().await; - let factors = outcome.all_factors().factor_instances(); - assert_eq!( - factors.len(), - paths - .clone() - .into_iter() - .flat_map(|(_, v)| v) - .collect::>() - .len(), - ); - } -} diff --git a/crates/sargon/src/keys_collector/collector/keys_collector_dependencies.rs b/crates/sargon-keys-collector/src/collector/keys_collector_dependencies.rs similarity index 100% rename from crates/sargon/src/keys_collector/collector/keys_collector_dependencies.rs rename to crates/sargon-keys-collector/src/collector/keys_collector_dependencies.rs diff --git a/crates/sargon/src/keys_collector/collector/keys_collector_preprocessor.rs b/crates/sargon-keys-collector/src/collector/keys_collector_preprocessor.rs similarity index 100% rename from crates/sargon/src/keys_collector/collector/keys_collector_preprocessor.rs rename to crates/sargon-keys-collector/src/collector/keys_collector_preprocessor.rs diff --git a/crates/sargon/src/keys_collector/collector/keys_collector_state.rs b/crates/sargon-keys-collector/src/collector/keys_collector_state.rs similarity index 100% rename from crates/sargon/src/keys_collector/collector/keys_collector_state.rs rename to crates/sargon-keys-collector/src/collector/keys_collector_state.rs diff --git a/crates/sargon/src/keys_collector/collector/mod.rs b/crates/sargon-keys-collector/src/collector/mod.rs similarity index 100% rename from crates/sargon/src/keys_collector/collector/mod.rs rename to crates/sargon-keys-collector/src/collector/mod.rs diff --git a/crates/sargon/src/keys_collector/derivation_testing/mod.rs b/crates/sargon-keys-collector/src/derivation_testing/mod.rs similarity index 53% rename from crates/sargon/src/keys_collector/derivation_testing/mod.rs rename to crates/sargon-keys-collector/src/derivation_testing/mod.rs index 639ebd080..4ac019438 100644 --- a/crates/sargon/src/keys_collector/derivation_testing/mod.rs +++ b/crates/sargon-keys-collector/src/derivation_testing/mod.rs @@ -3,8 +3,5 @@ mod test_keys_collector; #[cfg(test)] pub(crate) use stateless_dummy_indices::*; -#[cfg(test)] -pub(crate) use test_keys_collector::*; -use crate::prelude::*; -use std::future::ready; +pub use test_keys_collector::*; diff --git a/crates/sargon/src/keys_collector/derivation_testing/stateless_dummy_indices.rs b/crates/sargon-keys-collector/src/derivation_testing/stateless_dummy_indices.rs similarity index 100% rename from crates/sargon/src/keys_collector/derivation_testing/stateless_dummy_indices.rs rename to crates/sargon-keys-collector/src/derivation_testing/stateless_dummy_indices.rs diff --git a/crates/sargon/src/keys_collector/derivation_testing/test_keys_collector/mod.rs b/crates/sargon-keys-collector/src/derivation_testing/test_keys_collector/mod.rs similarity index 69% rename from crates/sargon/src/keys_collector/derivation_testing/test_keys_collector/mod.rs rename to crates/sargon-keys-collector/src/derivation_testing/test_keys_collector/mod.rs index e5becebab..e46d0513e 100644 --- a/crates/sargon/src/keys_collector/derivation_testing/test_keys_collector/mod.rs +++ b/crates/sargon-keys-collector/src/derivation_testing/test_keys_collector/mod.rs @@ -2,7 +2,4 @@ mod test_derivation_interactor; #[allow(clippy::module_inception)] mod test_keys_collector; -#[cfg(test)] pub use test_derivation_interactor::*; -#[cfg(test)] -pub use test_keys_collector::*; diff --git a/crates/sargon/src/keys_collector/derivation_testing/test_keys_collector/test_derivation_interactor.rs b/crates/sargon-keys-collector/src/derivation_testing/test_keys_collector/test_derivation_interactor.rs similarity index 62% rename from crates/sargon/src/keys_collector/derivation_testing/test_keys_collector/test_derivation_interactor.rs rename to crates/sargon-keys-collector/src/derivation_testing/test_keys_collector/test_derivation_interactor.rs index 1dbcf7d30..b5d0f4931 100644 --- a/crates/sargon/src/keys_collector/derivation_testing/test_keys_collector/test_derivation_interactor.rs +++ b/crates/sargon-keys-collector/src/derivation_testing/test_keys_collector/test_derivation_interactor.rs @@ -1,40 +1,64 @@ -#![cfg(test)] -#![allow(unused)] +use std::{ + future::Future, + pin::Pin, + task::{Context, Poll}, +}; use crate::prelude::*; +#[async_trait::async_trait] +pub trait MnemonicLoading: Debug + Send + Sync { + async fn load_mnemonic( + &self, + id: FactorSourceIDFromHash, + ) -> Result; +} + +#[derive(Debug, Default, Clone)] +pub struct FailingMnemonicLoader; + +#[async_trait::async_trait] +impl MnemonicLoading for FailingMnemonicLoader { + async fn load_mnemonic( + &self, + _id: FactorSourceIDFromHash, + ) -> Result { + Err(CommonError::Unknown) + } +} + /// A type impl KeyDerivationInteractor suitable for tests. /// /// Uses Sample values of MnemonicWithPassphrase for derivation, or looks up the mnemonic /// using a SecureStorageClient #[derive(Debug)] -pub(crate) struct TestDerivationInteractor { +pub struct TestDerivationInteractor { pub always_fail: bool, - pub secure_storage_client: Arc, + pub mnemonic_loading: Arc, } impl Default for TestDerivationInteractor { fn default() -> Self { Self { always_fail: false, - secure_storage_client: Arc::new(SecureStorageClient::ephemeral().0), + mnemonic_loading: Arc::new(FailingMnemonicLoader), } } } impl TestDerivationInteractor { - pub(crate) fn new( + pub fn with_mnemonic_loading( always_fail: bool, - secure_storage_client: Arc, + mnemonic_loading: Arc, ) -> Self { Self { always_fail, - secure_storage_client, + mnemonic_loading, } } - pub(crate) fn fail() -> Self { - Self::new(true, Arc::new(SecureStorageClient::always_fail())) + pub fn fail() -> Self { + Self::with_mnemonic_loading(true, Arc::new(FailingMnemonicLoader)) } async fn do_derive( @@ -46,12 +70,12 @@ impl TestDerivationInteractor { return Err(CommonError::Unknown); } - let cloned_client = self.secure_storage_client.clone(); + let cloned_mnemonic_loading = self.mnemonic_loading.clone(); Self::do_derive_serially_looking_up_with_secure_storage_and_extra( factor_source_id, derivation_paths, - cloned_client, + cloned_mnemonic_loading, async move |id| { id.maybe_sample_associated_mnemonic() .ok_or(CommonError::FactorSourceDiscrepancy) @@ -89,13 +113,13 @@ impl TestDerivationInteractor { async fn do_derive_serially_looking_up_with_secure_storage_and_extra( factor_source_id: FactorSourceIDFromHash, derivation_paths: IndexSet, - secure_storage: Arc, + mnemonic_loading: Arc, lookup_mnemonic: F, ) -> Result> where F: async Fn(FactorSourceIDFromHash) -> Result, { - let cloned_client = secure_storage.clone(); + let cloned_mnemonic_loading = mnemonic_loading.clone(); Self::do_derive_serially_with_lookup_of_mnemonic( factor_source_id, derivation_paths, @@ -103,14 +127,35 @@ impl TestDerivationInteractor { if let Ok(m) = lookup_mnemonic(id).await { return Ok(m); } - let cloned_cloned_client = cloned_client.clone(); - cloned_cloned_client.load_mnemonic_with_passphrase(id).await + let cloned_cloned_mnemonic_loading = + cloned_mnemonic_loading.clone(); + cloned_cloned_mnemonic_loading.load_mnemonic(id).await }, ) .await } } +// ==== HERE BE DRAGONS ==== +// Workaround from: +// https://github.com/rust-lang/rust/issues/64552#issuecomment-604419315 +// for Implementation of `Send` is not general enough bug +struct IamSend { + f: F, +} +impl IamSend { + pub unsafe fn new(f: F) -> Self { + IamSend { f } + } +} +unsafe impl Send for IamSend {} +impl Future for IamSend { + type Output = F::Output; + fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll { + unsafe { self.map_unchecked_mut(|s| &mut s.f).poll(cx) } + } +} + #[async_trait::async_trait] impl KeyDerivationInteractor for TestDerivationInteractor { async fn derive( @@ -119,7 +164,8 @@ impl KeyDerivationInteractor for TestDerivationInteractor { ) -> Result { let mut pairs = IndexMap::new(); for (k, r) in request.per_factor_source { - let instances = self.do_derive(k, r).await?; + let instances = + unsafe { IamSend::new(self.do_derive(k, r)) }.await?; pairs.insert(k, instances); } Ok(KeyDerivationResponse::new(pairs)) diff --git a/crates/sargon/src/keys_collector/derivation_testing/test_keys_collector/test_keys_collector.rs b/crates/sargon-keys-collector/src/derivation_testing/test_keys_collector/test_keys_collector.rs similarity index 100% rename from crates/sargon/src/keys_collector/derivation_testing/test_keys_collector/test_keys_collector.rs rename to crates/sargon-keys-collector/src/derivation_testing/test_keys_collector/test_keys_collector.rs diff --git a/crates/sargon/src/keys_collector/host_interaction/key_derivation_interactor.rs b/crates/sargon-keys-collector/src/host_interaction/key_derivation_interactor.rs similarity index 100% rename from crates/sargon/src/keys_collector/host_interaction/key_derivation_interactor.rs rename to crates/sargon-keys-collector/src/host_interaction/key_derivation_interactor.rs diff --git a/crates/sargon/src/keys_collector/host_interaction/key_derivation_request.rs b/crates/sargon-keys-collector/src/host_interaction/key_derivation_request.rs similarity index 100% rename from crates/sargon/src/keys_collector/host_interaction/key_derivation_request.rs rename to crates/sargon-keys-collector/src/host_interaction/key_derivation_request.rs diff --git a/crates/sargon/src/keys_collector/host_interaction/key_derivation_response.rs b/crates/sargon-keys-collector/src/host_interaction/key_derivation_response.rs similarity index 100% rename from crates/sargon/src/keys_collector/host_interaction/key_derivation_response.rs rename to crates/sargon-keys-collector/src/host_interaction/key_derivation_response.rs diff --git a/crates/sargon/src/keys_collector/host_interaction/mod.rs b/crates/sargon-keys-collector/src/host_interaction/mod.rs similarity index 100% rename from crates/sargon/src/keys_collector/host_interaction/mod.rs rename to crates/sargon-keys-collector/src/host_interaction/mod.rs diff --git a/crates/sargon-keys-collector/src/lib.rs b/crates/sargon-keys-collector/src/lib.rs new file mode 100644 index 000000000..ca4042739 --- /dev/null +++ b/crates/sargon-keys-collector/src/lib.rs @@ -0,0 +1,26 @@ +#![feature(async_closure)] + +mod collector; +mod host_interaction; + +#[cfg(test)] +mod tests; + +mod derivation_testing; + +#[cfg(test)] +pub(crate) use tests::*; + +pub mod prelude { + + pub(crate) use sargon_addresses::prelude::*; + pub(crate) use sargon_core::prelude::*; + pub(crate) use sargon_factors::prelude::*; + pub(crate) use sargon_hierarchical_deterministic::prelude::*; + + pub use crate::collector::*; + pub use crate::derivation_testing::*; + pub use crate::host_interaction::*; +} + +pub use prelude::*; diff --git a/crates/sargon/src/keys_collector/tests/derivation_tests.rs b/crates/sargon-keys-collector/src/tests/derivation_tests.rs similarity index 88% rename from crates/sargon/src/keys_collector/tests/derivation_tests.rs rename to crates/sargon-keys-collector/src/tests/derivation_tests.rs index 4d08868b3..7bc3e0d01 100644 --- a/crates/sargon/src/keys_collector/tests/derivation_tests.rs +++ b/crates/sargon-keys-collector/src/tests/derivation_tests.rs @@ -115,6 +115,97 @@ impl DerivationPathConstructors for DerivationPath { } } +#[cfg(test)] +mod basic_tests { + use super::*; + use crate::DerivationPathConstructors; + + #[actix_rt::test] + async fn valid() { + let f0 = FactorSource::sample_ledger(); + let f1 = FactorSource::sample_device(); + let f2 = FactorSource::sample_device_babylon_other(); + let f3 = FactorSource::sample_arculus(); + + let paths = IndexMap::<_, _>::from_iter([ + ( + f0.id_from_hash(), + IndexSet::<_>::from_iter([ + DerivationPath::for_entity( + NetworkID::Mainnet, + CAP26EntityKind::Account, + CAP26KeyKind::TransactionSigning, + Hardened::Securified(SecurifiedU30::ZERO), + ), + DerivationPath::for_entity( + NetworkID::Mainnet, + CAP26EntityKind::Account, + CAP26KeyKind::TransactionSigning, + Hardened::Securified(SecurifiedU30::ONE), + ), + DerivationPath::for_entity( + NetworkID::Stokenet, + CAP26EntityKind::Account, + CAP26KeyKind::TransactionSigning, + Hardened::Unsecurified(UnsecurifiedHardened::TWO), + ), + ]), + ), + ( + f1.id_from_hash(), + IndexSet::<_>::just(DerivationPath::for_entity( + NetworkID::Stokenet, + CAP26EntityKind::Account, + CAP26KeyKind::TransactionSigning, + Hardened::Unsecurified(UnsecurifiedHardened::THREE), + )), + ), + ( + f2.id_from_hash(), + IndexSet::<_>::just(DerivationPath::for_entity( + NetworkID::Mainnet, + CAP26EntityKind::Account, + CAP26KeyKind::TransactionSigning, + Hardened::Unsecurified( + UnsecurifiedHardened::try_from(4u32).unwrap(), + ), + )), + ), + ( + f3.id_from_hash(), + IndexSet::<_>::just(DerivationPath::for_entity( + NetworkID::Mainnet, + CAP26EntityKind::Identity, + CAP26KeyKind::AuthenticationSigning, + Hardened::Securified( + SecurifiedU30::try_from(5u32).unwrap(), + ), + )), + ), + ]); + + let collector = KeysCollector::new( + [f0, f1, f2, f3], + paths.clone(), + Arc::new(TestDerivationInteractor::default()), + DerivationPurpose::PreDerivingKeys, + ) + .unwrap(); + + let outcome = collector.collect_keys().await; + let factors = outcome.all_factors().factor_instances(); + assert_eq!( + factors.len(), + paths + .clone() + .into_iter() + .flat_map(|(_, v)| v) + .collect::>() + .len(), + ); + } +} + mod key_derivation_tests { use super::*; use sargon_hierarchical_deterministic::CAP26EntityKind::*; diff --git a/crates/sargon/src/keys_collector/tests/mod.rs b/crates/sargon-keys-collector/src/tests/mod.rs similarity index 100% rename from crates/sargon/src/keys_collector/tests/mod.rs rename to crates/sargon-keys-collector/src/tests/mod.rs diff --git a/crates/sargon-uniffi/Cargo.toml b/crates/sargon-uniffi/Cargo.toml index 928085e20..3d85ca5ad 100644 --- a/crates/sargon-uniffi/Cargo.toml +++ b/crates/sargon-uniffi/Cargo.toml @@ -17,11 +17,11 @@ path = "src/bindgen/bin.rs" required-features = ["build-binary"] [dependencies] - +sargon-core = { path = "../sargon-core" } sargon = { path = "../sargon" } sargon-uniffi-conversion-macros = { path = "../sargon-uniffi-conversion-macros" } -radix-engine-toolkit = { git = "https://github.com/radixdlt/radix-engine-toolkit", rev = "2ab5b35a6cb96c9faeb98ed8df67b870336e6873" } +radix-engine-toolkit = { workspace = true } zeroize = { workspace = true } @@ -74,11 +74,9 @@ clap = { git = "https://github.com/clap-rs/clap/", rev = "8a7a13a5618cfdc4ff3286 # camino = "1.0.8" camino = { git = "https://github.com/camino-rs/camino/", rev = "afa51b1b4c684b7e6698a6717ccda3affd0abd42", optional = true } -# async-trait = "0.1.79" -async-trait = { git = "https://github.com/dtolnay/async-trait", rev = "1eb21ed8bd87029bf4dcbea41ff309f2b2220c43" } +async-trait = { workspace = true } -# pretty_assertions = "1.4.0" -pretty_assertions = { git = "https://github.com/rust-pretty-assertions/rust-pretty-assertions", rev = "3f1ebc0cac5f88e875f036bf16636e15fa935c8d" } +pretty_assertions = { workspace = true } base64 = { git = "https://github.com/marshallpierce/rust-base64.git", rev = "e14400697453bcc85997119b874bc03d9601d0af" } @@ -92,9 +90,7 @@ uniffi = { git = "https://github.com/mozilla/uniffi-rs/", rev = "9127d4d9cfb8ff8 "bindgen-tests", ] } -# actix-rt = "3.3.0" -actix-rt = { git = "https://github.com/actix/actix-net", rev = "57fd6ea8098d1f2d281c305fc331216c4fe1992e" } - +actix-rt = { workspace = true } [build-dependencies] # uniffi = "0.28.3" uniffi = { git = "https://github.com/mozilla/uniffi-rs/", rev = "9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d", features = [ diff --git a/crates/sargon-uniffi/src/core/error/common_error.rs b/crates/sargon-uniffi/src/core/error/common_error.rs index 77892185b..f166cd2df 100644 --- a/crates/sargon-uniffi/src/core/error/common_error.rs +++ b/crates/sargon-uniffi/src/core/error/common_error.rs @@ -12,7 +12,7 @@ pub enum CommonError { Unknown = 10000, #[error("Failed to create Ed25519 Private key from bytes {bad_value:?}")] - InvalidEd25519PrivateKeyFromBytes { bad_value: BagOfBytes } = 10001, + InvalidEd25519PrivateKeyFromBytes { bad_value: String } = 10001, #[error("Failed to create Ed25519 Private key from String {bad_value}.")] InvalidEd25519PrivateKeyFromString { bad_value: String } = 10002, @@ -20,7 +20,7 @@ pub enum CommonError { #[error( "Failed to create Secp256k1 Private key from bytes {bad_value:?}." )] - InvalidSecp256k1PrivateKeyFromBytes { bad_value: BagOfBytes } = 10003, + InvalidSecp256k1PrivateKeyFromBytes { bad_value: String } = 10003, #[error( "Failed to create Secp256k1 Private key from String {bad_value:?}." @@ -28,13 +28,13 @@ pub enum CommonError { InvalidSecp256k1PrivateKeyFromString { bad_value: String } = 10004, #[error("Failed to create Ed25519 Public key from bytes {bad_value:?}.")] - InvalidEd25519PublicKeyFromBytes { bad_value: BagOfBytes } = 10005, + InvalidEd25519PublicKeyFromBytes { bad_value: String } = 10005, #[error("Failed to create Ed25519 Public key from String {bad_value}.")] InvalidEd25519PublicKeyFromString { bad_value: String } = 10006, #[error("Failed to create Secp256k1 Public key from bytes {bad_value:?}.")] - InvalidSecp256k1PublicKeyFromBytes { bad_value: BagOfBytes } = 10007, + InvalidSecp256k1PublicKeyFromBytes { bad_value: String } = 10007, #[error("Failed to create Secp256k1 Public key from String {bad_value}.")] InvalidSecp256k1PublicKeyFromString { bad_value: String } = 10008, @@ -204,7 +204,7 @@ pub enum CommonError { InvalidLength { expected: u64, found: u64, - data: BagOfBytes, + data: String, } = 10057, #[error("Invalid NonFungibleLocalID::String")] @@ -486,12 +486,12 @@ pub enum CommonError { #[error( "Failed to create KeyAgreementPublicKey from bytes: {bad_value:?}" )] - InvalidKeyAgreementPublicKeyFromBytes { bad_value: BagOfBytes } = 10138, + InvalidKeyAgreementPublicKeyFromBytes { bad_value: String } = 10138, #[error( "Failed to create KeyAgreementPrivateKey from bytes: {bad_value:?}" )] - InvalidKeyAgreementPrivateKeyFromBytes { bad_value: BagOfBytes } = 10139, + InvalidKeyAgreementPrivateKeyFromBytes { bad_value: String } = 10139, #[error("RadixConnectMobileSession not found, session id: {session_id}")] RadixConnectMobileSessionNotFound { session_id: String } = 10140, diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source.rs b/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source.rs index 9bd8ffe5c..579185516 100644 --- a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source.rs +++ b/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source.rs @@ -34,7 +34,7 @@ fn new_trusted_contact_factor_source_from_address_and_contact( contact: TrustedContactFactorSourceContact, ) -> TrustedContactFactorSource { InternalTrustedContactFactorSource::new( - account_address.into_internal(), + account_address.to_string(), contact.into_internal(), ) .into() diff --git a/crates/sargon-uniffi/src/profile/supporting_types/email_address.rs b/crates/sargon-uniffi/src/profile/supporting_types/email_address.rs index c60b9a90e..30575ec5d 100644 --- a/crates/sargon-uniffi/src/profile/supporting_types/email_address.rs +++ b/crates/sargon-uniffi/src/profile/supporting_types/email_address.rs @@ -5,11 +5,29 @@ use sargon::EmailAddress as InternalEmailAddress; /// /// Current implementation does not validate the email address other than it /// cannot be empty (in the future we might add some simple validation). -#[derive(Clone, PartialEq, Hash, Eq, InternalConversion, uniffi::Record)] +#[derive(Clone, PartialEq, Hash, Eq, uniffi::Record)] pub struct EmailAddress { pub email: String, } +impl EmailAddress { + pub fn into_internal(&self) -> InternalEmailAddress { + self.clone().into() + } +} +impl From for EmailAddress { + fn from(value: InternalEmailAddress) -> Self { + Self { + email: value.to_string(), + } + } +} +impl From for InternalEmailAddress { + fn from(value: EmailAddress) -> Self { + Self::new(value.email.as_str()).unwrap() + } +} + #[uniffi::export] pub fn new_email_address_sample() -> EmailAddress { InternalEmailAddress::sample().into() diff --git a/crates/sargon-uniffi/src/profile/v100/entity/display_name.rs b/crates/sargon-uniffi/src/profile/v100/entity/display_name.rs index ccb7c3266..c9c4a2c4b 100644 --- a/crates/sargon-uniffi/src/profile/v100/entity/display_name.rs +++ b/crates/sargon-uniffi/src/profile/v100/entity/display_name.rs @@ -23,11 +23,29 @@ use sargon::DisplayName as InternalDisplayName; /// assert_eq!("A very big name that is over than 30 characters long".parse::().unwrap().to_string(), "A very big name that is over t"); /// ``` /// -#[derive(Clone, PartialEq, Eq, Hash, InternalConversion, uniffi::Record)] +#[derive(Clone, PartialEq, Eq, Hash, uniffi::Record)] pub struct DisplayName { pub value: String, } +impl DisplayName { + pub fn into_internal(&self) -> InternalDisplayName { + self.clone().into() + } +} +impl From for DisplayName { + fn from(display_name: InternalDisplayName) -> Self { + Self { + value: display_name.value(), + } + } +} +impl From for InternalDisplayName { + fn from(display_name: DisplayName) -> Self { + Self::new(display_name.value.as_str()).unwrap() + } +} + json_string_convertible!(DisplayName); #[uniffi::export] diff --git a/crates/sargon-uniffi/src/profile/v100/factors/factor_instance/factor_instance_badge.rs b/crates/sargon-uniffi/src/profile/v100/factors/factor_instance/factor_instance_badge.rs index 9d2156ad6..b4108a592 100644 --- a/crates/sargon-uniffi/src/profile/v100/factors/factor_instance/factor_instance_badge.rs +++ b/crates/sargon-uniffi/src/profile/v100/factors/factor_instance/factor_instance_badge.rs @@ -9,9 +9,9 @@ pub enum FactorInstanceBadge { Virtual { value: FactorInstanceBadgeVirtualSource, }, - Physical { - value: ResourceAddress, - }, + // Physical { + // value: ResourceAddress, + // }, } delegate_debug_into!(FactorInstanceBadge, InternalFactorInstanceBadge); diff --git a/crates/sargon-uniffi/src/profile/v100/factors/factor_source_id_from_address.rs b/crates/sargon-uniffi/src/profile/v100/factors/factor_source_id_from_address.rs index 527adb2a8..9f08fefbe 100644 --- a/crates/sargon-uniffi/src/profile/v100/factors/factor_source_id_from_address.rs +++ b/crates/sargon-uniffi/src/profile/v100/factors/factor_source_id_from_address.rs @@ -2,13 +2,34 @@ use crate::prelude::*; use sargon::FactorSourceIDFromAddress as InternalFactorSourceIDFromAddress; /// FactorSourceID from an AccountAddress, typically used by `trustedContact` FactorSource. -#[derive(Clone, PartialEq, Eq, Hash, InternalConversion, uniffi::Record)] +#[derive(Clone, PartialEq, Eq, Hash, uniffi::Record)] pub struct FactorSourceIDFromAddress { /// The kind of the FactorSource this ID refers to, typically `trustedContact`. pub kind: FactorSourceKind, /// An account address which the FactorSource this ID refers uses/needs. - pub body: AccountAddress, + pub body: String, +} +impl FactorSourceIDFromAddress { + pub fn into_internal(&self) -> InternalFactorSourceIDFromAddress { + self.clone().into() + } +} +impl From for FactorSourceIDFromAddress { + fn from(factor_source_id: InternalFactorSourceIDFromAddress) -> Self { + Self { + kind: factor_source_id.kind.into(), + body: factor_source_id.body.to_string(), + } + } +} +impl From for InternalFactorSourceIDFromAddress { + fn from(value: FactorSourceIDFromAddress) -> Self { + InternalFactorSourceIDFromAddress::new( + value.kind.into(), + value.body.as_str(), + ) + } } json_data_convertible!(FactorSourceIDFromAddress); diff --git a/crates/sargon-uniffi/src/types/ffi_url.rs b/crates/sargon-uniffi/src/types/ffi_url.rs index 686d4de78..7b5ae7d54 100644 --- a/crates/sargon-uniffi/src/types/ffi_url.rs +++ b/crates/sargon-uniffi/src/types/ffi_url.rs @@ -1,3 +1,5 @@ +use sargon_core::parse_url; + use crate::prelude::*; /// A wrapper around `Url` that allows us to safely deal with Urls generated on hosts. @@ -32,7 +34,7 @@ impl FromStr for FfiUrl { type Err = CommonError; fn from_str(s: &str) -> Result { - let url = sargon::parse_url(s)?; + let url = parse_url(s)?; Ok(Self { url }) } } diff --git a/crates/sargon/Cargo.toml b/crates/sargon/Cargo.toml index ff345e6f0..46820b5b5 100644 --- a/crates/sargon/Cargo.toml +++ b/crates/sargon/Cargo.toml @@ -13,7 +13,11 @@ crate-type = ["staticlib", "cdylib", "lib"] [dependencies] sargon-core = { path = "../sargon-core" } +identified-vec-of = { path = "../identified-vec-of" } sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } +sargon-factors = { path = "../sargon-factors" } +sargon-keys-collector = { path = "../sargon-keys-collector" } +sargon-addresses = { path = "../sargon-addresses" } zeroize = { workspace = true } @@ -42,7 +46,7 @@ uuid = { workspace = true } strum = { workspace = true } sbor = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } radix-rust = { workspace = true } -radix-engine = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } +radix-engine = { workspace = true } radix-common = { workspace = true } radix-common-derive = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } radix-engine-interface = { workspace = true } @@ -50,7 +54,7 @@ radix-engine-toolkit-common = { git = "https://github.com/radixdlt/radixdlt-scry radix-transactions = { workspace = true } -radix-engine-toolkit = { git = "https://github.com/radixdlt/radix-engine-toolkit", rev = "2ab5b35a6cb96c9faeb98ed8df67b870336e6873" } +radix-engine-toolkit = { workspace = true } enum-iterator = { workspace = true } @@ -70,7 +74,6 @@ iota-crypto = { workspace = true } k256 = { workspace = true } - assert-json-diff = { workspace = true } url = { workspace = true } @@ -82,19 +85,11 @@ paste = { workspace = true } # camino = "1.0.8" camino = { git = "https://github.com/camino-rs/camino/", rev = "afa51b1b4c684b7e6698a6717ccda3affd0abd42", optional = true } -# async-trait = "0.1.79" -async-trait = { git = "https://github.com/dtolnay/async-trait", rev = "1eb21ed8bd87029bf4dcbea41ff309f2b2220c43" } +async-trait = { workspace = true } pretty_assertions = { workspace = true } -# AES for Profile Encryption -# aes-gcm = "10.3" -aes-gcm = { git = "https://github.com/RustCrypto/AEADs", rev = "7e82b01cd4901f6a35b5153536f11b87f5e4e622", default-features = false, features = [ - "aes", - "alloc", - "getrandom", - "zeroize", -] } +aes-gcm = { workspace = true } # hkdf = "0.12.4" hkdf = { workspace = true } @@ -118,13 +113,11 @@ security-framework-sys = "=2.10.0" [dev-dependencies] -# actix-rt = "3.3.0" -actix-rt = { git = "https://github.com/actix/actix-net", rev = "57fd6ea8098d1f2d281c305fc331216c4fe1992e" } +actix-rt = { workspace = true } [build-dependencies] -# cargo_toml = "0.15.3" -cargo_toml = { git = "https://gitlab.com/lib.rs/cargo_toml", rev = "e498c94fc42a660c1ca1a28999ce1d757cfe77fe" } +cargo_toml = { workspace = true } [lints.rust] unexpected_cfgs = { level = "forbid", check-cfg = ['cfg(tarpaulin_include)'] } diff --git a/crates/sargon/src/factor_instances_provider/agnostic_paths/index_agnostic_path.rs b/crates/sargon/src/factor_instances_provider/agnostic_paths/index_agnostic_path.rs index c928d80d5..dd5eead59 100644 --- a/crates/sargon/src/factor_instances_provider/agnostic_paths/index_agnostic_path.rs +++ b/crates/sargon/src/factor_instances_provider/agnostic_paths/index_agnostic_path.rs @@ -205,8 +205,8 @@ impl ToAgnosticPath for DerivationPath { } } } -impl HierarchicalDeterministicFactorInstance { - pub fn agnostic_path(&self) -> IndexAgnosticPath { +impl ToAgnosticPath for HierarchicalDeterministicFactorInstance { + fn agnostic(&self) -> IndexAgnosticPath { self.derivation_path().agnostic() } } diff --git a/crates/sargon/src/factor_instances_provider/factor_instances_cache/keyed_instances.rs b/crates/sargon/src/factor_instances_provider/factor_instances_cache/keyed_instances.rs index 64f805f28..1de60b643 100644 --- a/crates/sargon/src/factor_instances_provider/factor_instances_cache/keyed_instances.rs +++ b/crates/sargon/src/factor_instances_provider/factor_instances_cache/keyed_instances.rs @@ -73,7 +73,7 @@ impl From for InstancesByAgnosticPath { let map = value .factor_instances() .into_iter() - .into_group_map_by(|f| f.agnostic_path()) + .into_group_map_by(|f| f.agnostic()) .into_iter() .map(|(k, v)| (k, FactorInstances::from_iter(v))) .collect::>(); diff --git a/crates/sargon/src/factor_instances_provider/types/mod.rs b/crates/sargon/src/factor_instances_provider/types/mod.rs index 27fa95349..cfe91737f 100644 --- a/crates/sargon/src/factor_instances_provider/types/mod.rs +++ b/crates/sargon/src/factor_instances_provider/types/mod.rs @@ -2,8 +2,6 @@ mod abstract_securified_entity; mod any_securified_entity; mod appendable_collection; mod assert_derivation_path; -mod factor_instances; -mod hidden_constructor; mod is_securified_entity; mod securified_account; mod securified_persona; @@ -14,8 +12,6 @@ pub use abstract_securified_entity::*; pub use any_securified_entity::*; pub use appendable_collection::*; pub use assert_derivation_path::*; -pub use factor_instances::*; -pub use hidden_constructor::*; pub use is_securified_entity::*; pub use securified_account::*; pub use securified_persona::*; diff --git a/crates/sargon/src/identified_vec_of/mod.rs b/crates/sargon/src/identified_vec_of/mod.rs deleted file mode 100644 index a7b46f348..000000000 --- a/crates/sargon/src/identified_vec_of/mod.rs +++ /dev/null @@ -1,23 +0,0 @@ -mod decl_identified_vec_of_with_samples; -mod identified_vec_of; -mod identified_vec_of_display_debug; -mod identified_vec_of_iterator; -mod identified_vec_of_modify; -mod identified_vec_of_query; -mod identified_vec_of_serde; -mod identified_vec_of_validation_import_export; - -#[cfg(test)] -mod user; - -pub use decl_identified_vec_of_with_samples::*; -pub use identified_vec_of::*; -pub use identified_vec_of_display_debug::*; -pub use identified_vec_of_iterator::*; -pub use identified_vec_of_modify::*; -pub use identified_vec_of_query::*; -pub use identified_vec_of_serde::*; -pub use identified_vec_of_validation_import_export::*; - -#[cfg(test)] -pub use user::*; diff --git a/crates/sargon/src/keys_collector/mod.rs b/crates/sargon/src/keys_collector/mod.rs deleted file mode 100644 index 943b5ef13..000000000 --- a/crates/sargon/src/keys_collector/mod.rs +++ /dev/null @@ -1,15 +0,0 @@ -mod collector; -mod host_interaction; - -#[cfg(test)] -mod tests; - -mod derivation_testing; - -pub use collector::*; -pub use host_interaction::*; - -pub use derivation_testing::*; - -#[cfg(test)] -pub(crate) use tests::*; diff --git a/crates/sargon/src/lib.rs b/crates/sargon/src/lib.rs index e09909299..c754d6419 100644 --- a/crates/sargon/src/lib.rs +++ b/crates/sargon/src/lib.rs @@ -15,8 +15,6 @@ mod error_from; mod factor_instances_provider; mod gateway_api; mod home_cards; -mod identified_vec_of; -mod keys_collector; mod profile; mod radix_connect; mod security_center; @@ -26,15 +24,17 @@ mod types; mod wrapped_radix_engine_toolkit; pub mod prelude { + pub use identified_vec_of::prelude::*; + pub use sargon_addresses::prelude::*; pub use sargon_core::prelude::*; + pub use sargon_factors::prelude::*; pub use sargon_hierarchical_deterministic::prelude::*; + pub use sargon_keys_collector::prelude::*; pub use crate::error_from::*; pub use crate::factor_instances_provider::*; pub use crate::gateway_api::*; pub use crate::home_cards::*; - pub use crate::identified_vec_of::*; - pub use crate::keys_collector::*; pub use crate::profile::*; pub use crate::radix_connect::*; pub use crate::security_center::*; @@ -60,67 +60,23 @@ pub mod prelude { pub(crate) use sbor::Versioned; pub(crate) use radix_common::{ - address::{ - AddressBech32Decoder as ScryptoAddressBech32Decoder, - AddressBech32Encoder as ScryptoAddressBech32Encoder, - }, crypto::{ blake2b_256_hash, verify_ed25519 as scrypto_verify_ed25519, verify_secp256k1 as scrypto_verify_secp256k1, Ed25519PrivateKey as ScryptoEd25519PrivateKey, - Ed25519PublicKey as ScryptoEd25519PublicKey, - Ed25519PublicKeyHash as ScryptoEd25519PublicKeyHash, - Ed25519Signature as ScryptoEd25519Signature, Hash as ScryptoHash, - PublicKey as ScryptoPublicKey, - PublicKeyHash as ScryptoPublicKeyHash, + Ed25519Signature as ScryptoEd25519Signature, Secp256k1PrivateKey as ScryptoSecp256k1PrivateKey, Secp256k1PublicKey as ScryptoSecp256k1PublicKey, - Secp256k1PublicKeyHash as ScryptoSecp256k1PublicKeyHash, Secp256k1Signature as ScryptoSecp256k1Signature, }, - data::scrypto::{ - model::{ - BytesNonFungibleLocalId as ScryptoBytesNonFungibleLocalId, - IntegerNonFungibleLocalId as ScryptoIntegerNonFungibleLocalId, - NonFungibleLocalId as ScryptoNonFungibleLocalId, - RUIDNonFungibleLocalId as ScryptoRUIDNonFungibleLocalId, - StringNonFungibleLocalId as ScryptoStringNonFungibleLocalId, - }, - scrypto_decode as Scrypto_scrypto_decode, - scrypto_encode as Scrypto_scrypto_encode, - }, math::{ Decimal as ScryptoDecimal192, RoundingMode as ScryptoRoundingMode, }, network::NetworkDefinition as ScryptoNetworkDefinition, prelude::{ - AllowedIds as ScryptoAllowedIds, - DynamicComponentAddress as ScryptoDynamicComponentAddress, - DynamicGlobalAddress as ScryptoDynamicGlobalAddress, - DynamicResourceAddress as ScryptoDynamicResourceAddress, - FromPublicKey as ScryptoFromPublicKey, Instant as ScryptoInstant, - LowerBound as ScryptoLowerBound, - ManifestAddress as ScryptoManifestAddress, - ManifestAddressReservation as ScryptoManifestAddressReservation, - ManifestBucket as ScryptoManifestBucket, - ManifestCustomValue as ScryptoManifestCustomValue, - ManifestCustomValueKind as ScryptoManifestCustomValueKind, - ManifestEncode as ScryptoManifestEncode, - ManifestNamedAddress as ScryptoManifestNamedAddress, - ManifestProof as ScryptoManifestProof, - ManifestValue as ScryptoManifestValue, - NonFungibleData as ScryptoNonFungibleData, - NonFungibleGlobalId as ScryptoNonFungibleGlobalId, - NonFungibleIdType as ScryptoNonFungibleIdType, UpperBound as ScryptoUpperBound, ACCOUNT_OWNER_BADGE as SCRYPTO_ACCOUNT_OWNER_BADGE, - IDENTITY_OWNER_BADGE as SCRYPTO_IDENTITY_OWNER_BADGE, XRD, - }, - types::{ - ComponentAddress as ScryptoComponentAddress, - EntityType as ScryptoEntityType, - GlobalAddress as ScryptoGlobalAddress, NodeId as ScryptoNodeId, - ResourceAddress as ScryptoResourceAddress, + IDENTITY_OWNER_BADGE as SCRYPTO_IDENTITY_OWNER_BADGE, }, ManifestSbor as ScryptoManifestSbor, ScryptoSbor, }; diff --git a/crates/sargon/src/profile/encrypted/encryption/encrypted_profile_snapshot.rs b/crates/sargon/src/profile/encrypted/encrypted_profile/encrypted_profile_snapshot.rs similarity index 100% rename from crates/sargon/src/profile/encrypted/encryption/encrypted_profile_snapshot.rs rename to crates/sargon/src/profile/encrypted/encrypted_profile/encrypted_profile_snapshot.rs diff --git a/crates/sargon/src/profile/encrypted/encrypted_profile/mod.rs b/crates/sargon/src/profile/encrypted/encrypted_profile/mod.rs new file mode 100644 index 000000000..a33707d53 --- /dev/null +++ b/crates/sargon/src/profile/encrypted/encrypted_profile/mod.rs @@ -0,0 +1,3 @@ +mod encrypted_profile_snapshot; + +pub use encrypted_profile_snapshot::*; diff --git a/crates/sargon/src/profile/encrypted/mod.rs b/crates/sargon/src/profile/encrypted/mod.rs index 58604b39b..544e43b22 100644 --- a/crates/sargon/src/profile/encrypted/mod.rs +++ b/crates/sargon/src/profile/encrypted/mod.rs @@ -1,11 +1,9 @@ -mod encryption; +mod encrypted_profile; mod key_derivation; mod pb_hkdf_sha256; -mod version_of_algorithm; mod versioned_algorithm; -pub use encryption::*; +pub use encrypted_profile::*; pub use key_derivation::*; pub use pb_hkdf_sha256::*; -pub use version_of_algorithm::*; pub use versioned_algorithm::*; diff --git a/crates/sargon/src/profile/encrypted/pb_hkdf_sha256.rs b/crates/sargon/src/profile/encrypted/pb_hkdf_sha256.rs index 4a79fd8d8..d36957466 100644 --- a/crates/sargon/src/profile/encrypted/pb_hkdf_sha256.rs +++ b/crates/sargon/src/profile/encrypted/pb_hkdf_sha256.rs @@ -1,9 +1,9 @@ use hkdf::Hkdf; use k256::sha2::Sha256; -use sargon_core::Exactly32Bytes; +use sargon_core::{Exactly32Bytes, VersionOfAlgorithm}; use super::{ - PasswordBasedKeyDerivationSchemeVersion, VersionOfAlgorithm, + PasswordBasedKeyDerivationSchemeVersion, VersionedPasswordBasedKeyDerivation, }; diff --git a/crates/sargon/src/profile/logic/account/create_account.rs b/crates/sargon/src/profile/logic/account/create_account.rs index d05cbd529..5b49285eb 100644 --- a/crates/sargon/src/profile/logic/account/create_account.rs +++ b/crates/sargon/src/profile/logic/account/create_account.rs @@ -27,7 +27,7 @@ impl Profile { 1, factor_instances_cache_client, key_derivation_interactor, - |_| name.clone(), + |_| name, ) .await?; diff --git a/crates/sargon/src/profile/logic/persona/create_persona.rs b/crates/sargon/src/profile/logic/persona/create_persona.rs index 666170dbd..c5fac1585 100644 --- a/crates/sargon/src/profile/logic/persona/create_persona.rs +++ b/crates/sargon/src/profile/logic/persona/create_persona.rs @@ -26,7 +26,7 @@ impl Profile { 1, factor_instances_cache_client, key_derivation_interactor, - |_| name.clone(), + |_| name, ) .await?; diff --git a/crates/sargon/src/profile/logic/profile_network/profile_network_details.rs b/crates/sargon/src/profile/logic/profile_network/profile_network_details.rs index 1412e0a9d..ff40b9aa0 100644 --- a/crates/sargon/src/profile/logic/profile_network/profile_network_details.rs +++ b/crates/sargon/src/profile/logic/profile_network/profile_network_details.rs @@ -22,7 +22,7 @@ impl AuthorizedPersonaSimple { }; Ok(AccountForDisplay::new( account.address, - account.display_name.clone(), + account.display_name, account.appearance_id )) }).collect::>()?; @@ -121,7 +121,7 @@ impl AuthorizedPersonaSimple { let has_auth_signing_key = persona.is_securified(); Ok(AuthorizedPersonaDetailed::new( persona.address, - persona.display_name.clone(), + persona.display_name, shared_accounts.clone(), persona_data, has_auth_signing_key, @@ -266,7 +266,10 @@ mod tests { ); assert_eq!(&details.network_id, &dapp.network_id); - assert_eq!(&details.display_name.map(|x| x.value), &dapp.display_name); + assert_eq!( + &details.display_name.map(|x| x.value()), + &dapp.display_name + ); assert_eq!( &details diff --git a/crates/sargon/src/profile/mfa/mod.rs b/crates/sargon/src/profile/mfa/mod.rs index 59afd062f..b39fbbfa8 100644 --- a/crates/sargon/src/profile/mfa/mod.rs +++ b/crates/sargon/src/profile/mfa/mod.rs @@ -1,7 +1,5 @@ -mod mfa_factor_sources; mod secured_entity_control; mod security_structures; -pub use mfa_factor_sources::*; pub use secured_entity_control::*; pub use security_structures::*; diff --git a/crates/sargon/src/profile/mfa/security_structures/automatic_shield_builder/automatic_shield_builder.rs b/crates/sargon/src/profile/mfa/security_structures/automatic_shield_builder/automatic_shield_builder.rs index a4f5e27f7..450095e6a 100644 --- a/crates/sargon/src/profile/mfa/security_structures/automatic_shield_builder/automatic_shield_builder.rs +++ b/crates/sargon/src/profile/mfa/security_structures/automatic_shield_builder/automatic_shield_builder.rs @@ -8,15 +8,6 @@ use super::{ use FactorSourceCategory::*; use RoleKind::*; -impl FactorSourceCategory { - fn is_supported(&self) -> bool { - match self { - Identity | Hardware | Contact | Information => true, - Custodian => false, - } - } -} - /// A crate internal helper builder which assigns factors to /// Recovery and Confirmation roles based on the heuristic /// laid out in ["Automatic Security Shield Construction" document][doc] diff --git a/crates/sargon/src/profile/mfa/security_structures/matrices/matrix_of_factor_instances.rs b/crates/sargon/src/profile/mfa/security_structures/matrices/matrix_of_factor_instances.rs index 3b1516c55..e0e877a58 100644 --- a/crates/sargon/src/profile/mfa/security_structures/matrices/matrix_of_factor_instances.rs +++ b/crates/sargon/src/profile/mfa/security_structures/matrices/matrix_of_factor_instances.rs @@ -81,18 +81,6 @@ pub trait HasFactorInstances { } } -pub trait HasFactorSourceKindObjectSafe { - fn get_factor_source_kind(&self) -> FactorSourceKind; -} -impl HasFactorSourceKindObjectSafe for FactorSourceID { - fn get_factor_source_kind(&self) -> FactorSourceKind { - match self { - FactorSourceID::Hash { value } => value.kind, - FactorSourceID::Address { value } => value.kind, - } - } -} - impl HasFactorInstances for MatrixOfFactorInstances { fn unique_tx_signing_factor_instances(&self) -> IndexSet { let mut set = IndexSet::new(); diff --git a/crates/sargon/src/profile/mfa/security_structures/matrices/mod.rs b/crates/sargon/src/profile/mfa/security_structures/matrices/mod.rs index e5e1338a6..4c9d36a24 100644 --- a/crates/sargon/src/profile/mfa/security_structures/matrices/mod.rs +++ b/crates/sargon/src/profile/mfa/security_structures/matrices/mod.rs @@ -1,6 +1,5 @@ mod abstract_matrix_builder_or_built; mod builder; -mod factor_source_id_samples; mod matrix_of_factor_instances; mod matrix_of_factor_source_ids; mod matrix_of_factor_sources; @@ -8,7 +7,6 @@ mod matrix_of_factor_sources; pub(crate) use abstract_matrix_builder_or_built::*; #[allow(unused_imports)] pub use builder::*; -pub use factor_source_id_samples::*; pub use matrix_of_factor_instances::*; pub use matrix_of_factor_source_ids::*; pub use matrix_of_factor_sources::*; diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/builder/confirmation_roles_builder_unit_tests.rs b/crates/sargon/src/profile/mfa/security_structures/roles/builder/confirmation_roles_builder_unit_tests.rs index aa92c9880..90e97ade9 100644 --- a/crates/sargon/src/profile/mfa/security_structures/roles/builder/confirmation_roles_builder_unit_tests.rs +++ b/crates/sargon/src/profile/mfa/security_structures/roles/builder/confirmation_roles_builder_unit_tests.rs @@ -1,5 +1,7 @@ #![cfg(test)] +use sargon_factors::FactorSourceKind; + use crate::prelude::*; #[allow(clippy::upper_case_acronyms)] diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_instance_level/general_role_with_hierarchical_deterministic_factor_instances.rs b/crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_instance_level/general_role_with_hierarchical_deterministic_factor_instances.rs index 57a7b1e04..a8a86ada1 100644 --- a/crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_instance_level/general_role_with_hierarchical_deterministic_factor_instances.rs +++ b/crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_instance_level/general_role_with_hierarchical_deterministic_factor_instances.rs @@ -278,18 +278,18 @@ mod test { ) } - #[test] - fn test_from_matrix_containing_physical_badge() { - let mut matrix = MatrixOfFactorInstances::sample(); - matrix.primary_role = PrimaryRoleWithFactorInstances::with_factors( - 0, - [], - [FactorInstance::sample_other()], - ); + // #[test] + // fn test_from_matrix_containing_physical_badge() { + // let mut matrix = MatrixOfFactorInstances::sample(); + // matrix.primary_role = PrimaryRoleWithFactorInstances::with_factors( + // 0, + // [], + // [FactorInstance::sample_other()], + // ); - assert_eq!( - SUT::try_from((matrix, RoleKind::Primary)), - Err(CommonError::BadgeIsNotVirtualHierarchicalDeterministic) - ); - } + // assert_eq!( + // SUT::try_from((matrix, RoleKind::Primary)), + // Err(CommonError::BadgeIsNotVirtualHierarchicalDeterministic) + // ); + // } } diff --git a/crates/sargon/src/profile/mfa/security_structures/security_shield_builder.rs b/crates/sargon/src/profile/mfa/security_structures/security_shield_builder.rs index fc230ae09..b23884bac 100644 --- a/crates/sargon/src/profile/mfa/security_structures/security_shield_builder.rs +++ b/crates/sargon/src/profile/mfa/security_structures/security_shield_builder.rs @@ -800,6 +800,7 @@ mod tests { } #[test] + #[allow(clippy::mutable_key_type)] fn hash() { assert_eq!( radix_rust::hashset![ @@ -926,7 +927,7 @@ mod tests { let shield = sut.build().unwrap(); pretty_assertions::assert_eq!(shield0, shield); - assert_eq!(shield.metadata.display_name.value, "S.H.I.E.L.D."); + assert_eq!(shield.metadata.display_name.value(), "S.H.I.E.L.D."); assert_eq!( shield.matrix_of_factors.primary().get_override_factors(), &vec![FactorSourceID::sample_arculus()] @@ -1326,7 +1327,7 @@ mod test_invalid { ); let shield = sut.build().unwrap(); assert_eq!( - shield.metadata.display_name.value, + shield.metadata.display_name.value(), "This shield name's too long an" ); } diff --git a/crates/sargon/src/profile/supporting_types/account_for_display.rs b/crates/sargon/src/profile/supporting_types/account_for_display.rs index f334b79d6..c0312cf78 100644 --- a/crates/sargon/src/profile/supporting_types/account_for_display.rs +++ b/crates/sargon/src/profile/supporting_types/account_for_display.rs @@ -104,7 +104,7 @@ mod tests { assert_eq!( lhs, SUT::new( - "account_rdx128dtethfy8ujrsfdztemyjk0kvhnah6dafr57frz85dcw2c8z0td87", + "account_rdx128dtethfy8ujrsfdztemyjk0kvhnah6dafr57frz85dcw2c8z0td87".parse::().unwrap(), DisplayName::new("Alice").unwrap(), AppearanceID::new(0).unwrap(), ) diff --git a/crates/sargon/src/profile/supporting_types/mod.rs b/crates/sargon/src/profile/supporting_types/mod.rs index 644adb5e2..a2da50a39 100644 --- a/crates/sargon/src/profile/supporting_types/mod.rs +++ b/crates/sargon/src/profile/supporting_types/mod.rs @@ -5,10 +5,6 @@ mod accounts_or_personas; mod authorized_dapp_detailed; mod authorized_persona_detailed; mod detailed_authorized_personas; -mod email_address; -mod host_id; -mod host_info; -mod host_os; mod on_same_network_validating; pub use account_for_display::*; @@ -18,8 +14,4 @@ pub use accounts_or_personas::*; pub use authorized_dapp_detailed::*; pub use authorized_persona_detailed::*; pub use detailed_authorized_personas::*; -pub use email_address::*; -pub use host_id::*; -pub use host_info::*; -pub use host_os::*; pub use on_same_network_validating::*; diff --git a/crates/sargon/src/profile/v100/app_preferences/gateways/gateway.rs b/crates/sargon/src/profile/v100/app_preferences/gateways/gateway.rs index e79c9b052..07bdc181c 100644 --- a/crates/sargon/src/profile/v100/app_preferences/gateways/gateway.rs +++ b/crates/sargon/src/profile/v100/app_preferences/gateways/gateway.rs @@ -1,3 +1,5 @@ +use sargon_core::parse_url; + use crate::prelude::*; use std::ops::Deref; diff --git a/crates/sargon/src/profile/v100/entity/account/account.rs b/crates/sargon/src/profile/v100/entity/account/account.rs index 7e2867325..352669dd8 100644 --- a/crates/sargon/src/profile/v100/entity/account/account.rs +++ b/crates/sargon/src/profile/v100/entity/account/account.rs @@ -470,9 +470,9 @@ mod tests { #[test] fn update() { let mut account = SUT::sample(); - assert_eq!(account.display_name.value, "Alice"); + assert_eq!(account.display_name.value(), "Alice"); account.display_name = DisplayName::new("Satoshi").unwrap(); - assert_eq!(account.display_name.value, "Satoshi"); + assert_eq!(account.display_name.value(), "Satoshi"); } #[test] @@ -802,7 +802,7 @@ mod tests { "#, ).unwrap(); let account = serde_json::from_value::(json).unwrap(); - assert_eq!(account.display_name.value, "Olympia|Soft|0".to_string()); // soundness + assert_eq!(account.display_name.value(), "Olympia|Soft|0".to_string()); // soundness assert_eq!(account.flags.len(), 0); // assert Default value is empty flags. } diff --git a/crates/sargon/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/mod.rs b/crates/sargon/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/mod.rs index 98687ea35..47e6ce3bc 100644 --- a/crates/sargon/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/mod.rs +++ b/crates/sargon/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/mod.rs @@ -3,7 +3,6 @@ mod assets_exception_list; mod deposit_address_exception_rule; mod deposit_rule; mod depositors_allow_list; -mod resource_or_non_fungible; mod third_party_deposits; pub use asset_exception::*; @@ -11,5 +10,4 @@ pub use assets_exception_list::*; pub use deposit_address_exception_rule::*; pub use deposit_rule::*; pub use depositors_allow_list::*; -pub use resource_or_non_fungible::*; pub use third_party_deposits::*; diff --git a/crates/sargon/src/profile/v100/entity/mod.rs b/crates/sargon/src/profile/v100/entity/mod.rs index 339f9b4de..b8ce3dc18 100644 --- a/crates/sargon/src/profile/v100/entity/mod.rs +++ b/crates/sargon/src/profile/v100/entity/mod.rs @@ -1,6 +1,5 @@ mod abstract_entity_type; mod account; -mod display_name; mod entity_flag; mod entity_flags; mod has_security_state; @@ -9,7 +8,6 @@ mod persona; pub use abstract_entity_type::*; pub use account::*; -pub use display_name::*; pub use entity_flag::*; pub use entity_flags::*; pub use has_security_state::*; diff --git a/crates/sargon/src/profile/v100/factors/mod.rs b/crates/sargon/src/profile/v100/factors/mod.rs deleted file mode 100644 index 9f85b8187..000000000 --- a/crates/sargon/src/profile/v100/factors/mod.rs +++ /dev/null @@ -1,35 +0,0 @@ -mod factor_instance; -mod factor_source; -mod factor_source_category; -mod factor_source_common; -mod factor_source_crypto_parameters; -mod factor_source_flag; -mod factor_source_id; -mod factor_source_id_from_address; -mod factor_source_id_from_hash; -mod factor_source_kind; -mod factor_sources; -mod hd_factor_instance_account_creation; -mod hd_factor_instance_identity_creation; -mod hd_transaction_signing_factor_instance; -mod hierarchical_deterministic_factor_instance; -mod is_entity_path; -mod is_factor_source; - -pub use factor_instance::*; -pub use factor_source::*; -pub use factor_source_category::*; -pub use factor_source_common::*; -pub use factor_source_crypto_parameters::*; -pub use factor_source_flag::*; -pub use factor_source_id::*; -pub use factor_source_id_from_address::*; -pub use factor_source_id_from_hash::*; -pub use factor_source_kind::*; -pub use factor_sources::*; -pub use hd_factor_instance_account_creation::*; -pub use hd_factor_instance_identity_creation::*; -pub use hd_transaction_signing_factor_instance::*; -pub use hierarchical_deterministic_factor_instance::*; -pub use is_entity_path::*; -pub use is_factor_source::*; diff --git a/crates/sargon/src/profile/v100/header/mod.rs b/crates/sargon/src/profile/v100/header/mod.rs index 9cc9d7948..3182e632d 100644 --- a/crates/sargon/src/profile/v100/header/mod.rs +++ b/crates/sargon/src/profile/v100/header/mod.rs @@ -1,13 +1,9 @@ mod content_hint; -mod device_id; mod device_info; -mod device_info_description; mod header; mod profile_id; pub use content_hint::*; -pub use device_id::*; pub use device_info::*; -pub use device_info_description::*; pub use header::*; pub use profile_id::*; diff --git a/crates/sargon/src/profile/v100/mod.rs b/crates/sargon/src/profile/v100/mod.rs index 0c75e3c75..8c5fd0258 100644 --- a/crates/sargon/src/profile/v100/mod.rs +++ b/crates/sargon/src/profile/v100/mod.rs @@ -1,9 +1,7 @@ -mod address; mod app_preferences; mod entities_linked_to_factor_source; mod entity; mod entity_security_state; -mod factors; mod header; mod networks; mod profile; @@ -11,12 +9,10 @@ mod profile_file_contents; mod profile_legacy_state_bugs; mod proto_profile_maybe_with_legacy_p2p_links; -pub use address::*; pub use app_preferences::*; pub use entities_linked_to_factor_source::*; pub use entity::*; pub use entity_security_state::*; -pub use factors::*; pub use header::*; pub use networks::*; pub use profile::*; diff --git a/crates/sargon/src/profile/v100/networks/network/authorized_dapp/authorized_dapp.rs b/crates/sargon/src/profile/v100/networks/network/authorized_dapp/authorized_dapp.rs index ed1e9db95..49bd58589 100644 --- a/crates/sargon/src/profile/v100/networks/network/authorized_dapp/authorized_dapp.rs +++ b/crates/sargon/src/profile/v100/networks/network/authorized_dapp/authorized_dapp.rs @@ -106,14 +106,6 @@ impl Identifiable for AuthorizedDapp { pub type DappDefinitionAddress = AccountAddress; -impl Identifiable for AccountAddress { - type ID = Self; - - fn id(&self) -> Self::ID { - *self - } -} - impl AuthorizedDapp { pub fn sample_mainnet_dashboard() -> Self { Self::new( diff --git a/crates/sargon/src/profile/v100/networks/profile_networks.rs b/crates/sargon/src/profile/v100/networks/profile_networks.rs index 4faf846e1..b54e37420 100644 --- a/crates/sargon/src/profile/v100/networks/profile_networks.rs +++ b/crates/sargon/src/profile/v100/networks/profile_networks.rs @@ -243,7 +243,7 @@ mod tests { .get_id(account_address) .unwrap() .display_name - .value, + .value(), "Alice" ); @@ -258,7 +258,7 @@ mod tests { .get_id(account_address) .unwrap() .display_name - .value, + .value(), "Stella" ); } diff --git a/crates/sargon/src/profile/v100/profile.rs b/crates/sargon/src/profile/v100/profile.rs index d241eba0e..2a1eab412 100644 --- a/crates/sargon/src/profile/v100/profile.rs +++ b/crates/sargon/src/profile/v100/profile.rs @@ -840,7 +840,7 @@ mod tests { .unwrap() .clone(); - assert_eq!(account.display_name.value, "Alice"); + assert_eq!(account.display_name.value(), "Alice"); assert!(sut .update_account(&account.address, |a| a.display_name = DisplayName::new("Bob").unwrap()) @@ -854,7 +854,7 @@ mod tests { .get_at_index(0) .unwrap() .display_name - .value, + .value(), "Bob" ); } @@ -871,7 +871,7 @@ mod tests { .unwrap() .clone(); - assert_eq!(persona.display_name.value, "Satoshi"); + assert_eq!(persona.display_name.value(), "Satoshi"); assert!(sut .update_persona(&persona.address, |a| a.display_name = DisplayName::new("Batman").unwrap()) @@ -885,7 +885,7 @@ mod tests { .get_at_index(0) .unwrap() .display_name - .value, + .value(), "Batman" ); } diff --git a/crates/sargon/src/radix_connect/mobile/deep_link_parsing/parser.rs b/crates/sargon/src/radix_connect/mobile/deep_link_parsing/parser.rs index 0c7973fca..9d489ac00 100644 --- a/crates/sargon/src/radix_connect/mobile/deep_link_parsing/parser.rs +++ b/crates/sargon/src/radix_connect/mobile/deep_link_parsing/parser.rs @@ -4,6 +4,7 @@ use base64::engine::general_purpose::URL_SAFE; use base64::engine::general_purpose::URL_SAFE_NO_PAD; use base64::Engine; use crypto::signatures::ed25519::Signature; +use sargon_core::parse_url; use url::form_urlencoded; use url::Url; @@ -217,6 +218,7 @@ impl SampleRequestParams { mod tests { use hex::ToHex; use rand::random; + use sargon_core::parse_url; use super::*; diff --git a/crates/sargon/src/signing/collector/signatures_collector_preprocessor.rs b/crates/sargon/src/signing/collector/signatures_collector_preprocessor.rs index 5a64f43be..a5fefd8df 100644 --- a/crates/sargon/src/signing/collector/signatures_collector_preprocessor.rs +++ b/crates/sargon/src/signing/collector/signatures_collector_preprocessor.rs @@ -4,31 +4,6 @@ pub(crate) struct SignaturesCollectorPreprocessor { signables_with_entities: IdentifiedVecOf>, } -pub(crate) fn sort_group_factors( - used_factor_sources: HashSet, -) -> IndexSet { - let factors_of_kind: HashMap> = - used_factor_sources - .into_iter() - .into_grouping_map_by(|x| x.factor_source_kind()) - .collect::>(); - - let mut factors_of_kind = factors_of_kind - .into_iter() - .map(|(k, v)| (k, v.into_iter().sorted().collect::>())) - .collect::>>(); - - factors_of_kind.sort_keys(); - - factors_of_kind - .into_iter() - .map(|(k, v)| { - FactorSourcesOfKind::new(k, v) - .expect("All factors should be of the same kind, since this is calling iter on a Map, using kind as key. Did you just move around lines of code?") - }) - .collect::>() -} - impl SignaturesCollectorPreprocessor { pub(super) fn new( signables_with_entities: IdentifiedVecOf>, diff --git a/crates/sargon/src/system/clients/client/secure_storage_client/secure_storage_client.rs b/crates/sargon/src/system/clients/client/secure_storage_client/secure_storage_client.rs index 52c423c73..8498f1d0a 100644 --- a/crates/sargon/src/system/clients/client/secure_storage_client/secure_storage_client.rs +++ b/crates/sargon/src/system/clients/client/secure_storage_client/secure_storage_client.rs @@ -229,6 +229,37 @@ impl SecureStorageClient { } } +pub trait TestDerivationInteractorFromSecureStorageClient: Sized { + fn new( + always_fail: bool, + secure_storage_client: Arc, + ) -> Self; +} + +#[async_trait::async_trait] +impl MnemonicLoading for SecureStorageClient { + async fn load_mnemonic( + &self, + id: FactorSourceIDFromHash, + ) -> Result { + self.load_mnemonic_with_passphrase(id).await + } +} + +impl TestDerivationInteractorFromSecureStorageClient + for TestDerivationInteractor +{ + fn new( + always_fail: bool, + secure_storage_client: Arc, + ) -> Self { + Self::with_mnemonic_loading( + always_fail, + secure_storage_client as Arc, + ) + } +} + #[cfg(test)] impl SecureStorageClient { pub(crate) fn ephemeral( diff --git a/crates/sargon/src/system/sargon_os/profile_state_holder.rs b/crates/sargon/src/system/sargon_os/profile_state_holder.rs index 7102c7334..78cd5cbe3 100644 --- a/crates/sargon/src/system/sargon_os/profile_state_holder.rs +++ b/crates/sargon/src/system/sargon_os/profile_state_holder.rs @@ -314,7 +314,7 @@ mod tests { &first_mainnet_account.address, |account| { let display_name = - account.display_name.value.clone(); + account.display_name.value(); account.display_name = DisplayName::new( display_name + i.to_string().as_str(), @@ -347,12 +347,12 @@ mod tests { .first() .unwrap() .display_name - .value - .clone() + .value() }) .unwrap(); - let expected_name = first_mainnet_account.display_name.value + "01234"; + let expected_name = + first_mainnet_account.display_name.value() + "01234"; pretty_assertions::assert_eq!(expected_name, result_name) } diff --git a/crates/sargon/src/system/sargon_os/sargon_os_accounts.rs b/crates/sargon/src/system/sargon_os/sargon_os_accounts.rs index 4933161f7..9f25ac777 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os_accounts.rs +++ b/crates/sargon/src/system/sargon_os/sargon_os_accounts.rs @@ -1279,7 +1279,7 @@ mod tests { let names = os.profile().unwrap().networks[0] .accounts .iter() - .map(|x| x.display_name.value.clone()) + .map(|x| x.display_name.value()) .collect_vec(); assert_eq!( diff --git a/crates/sargon/src/system/sargon_os/sargon_os_personas.rs b/crates/sargon/src/system/sargon_os/sargon_os_personas.rs index cb700512a..b1d372ce5 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os_personas.rs +++ b/crates/sargon/src/system/sargon_os/sargon_os_personas.rs @@ -804,7 +804,7 @@ mod tests { let names = os.profile().unwrap().networks[0] .personas .iter() - .map(|x| x.display_name.value.clone()) + .map(|x| x.display_name.value()) .collect_vec(); assert_eq!( diff --git a/crates/sargon/src/types/mod.rs b/crates/sargon/src/types/mod.rs index c53204156..cdeacaeee 100644 --- a/crates/sargon/src/types/mod.rs +++ b/crates/sargon/src/types/mod.rs @@ -1,11 +1,9 @@ -mod factor_sources_of_kind; mod hd_signature; mod hd_signature_input; mod invalid_transaction_if_neglected; mod owned_types; mod samples; -pub(crate) use factor_sources_of_kind::*; pub use hd_signature::*; pub use hd_signature_input::*; pub use invalid_transaction_if_neglected::*; diff --git a/crates/sargon/src/types/samples/access_controller_address_samples.rs b/crates/sargon/src/types/samples/access_controller_address_samples.rs index d20b92b8c..dbe70874f 100644 --- a/crates/sargon/src/types/samples/access_controller_address_samples.rs +++ b/crates/sargon/src/types/samples/access_controller_address_samples.rs @@ -3,10 +3,16 @@ use crate::{ IsNetworkAware, }; -impl AccessControllerAddress { - pub fn sample_from_account_address( - account_address: AccountAddress, - ) -> Self { +pub trait SamplesFromAccountAddress { + fn sample_from_account_address(account_address: AccountAddress) -> Self; +} + +pub trait SamplesFromIdentityAddress { + fn sample_from_identity_address(identity_address: IdentityAddress) -> Self; +} + +impl SamplesFromAccountAddress for AccessControllerAddress { + fn sample_from_account_address(account_address: AccountAddress) -> Self { let node_id: [u8; 29] = account_address.node_id().as_bytes()[0..29] .try_into() .unwrap(); @@ -16,10 +22,10 @@ impl AccessControllerAddress { account_address.network_id(), ) } +} - pub fn sample_from_identity_address( - identity_address: IdentityAddress, - ) -> Self { +impl SamplesFromIdentityAddress for AccessControllerAddress { + fn sample_from_identity_address(identity_address: IdentityAddress) -> Self { let node_id: [u8; 29] = identity_address.node_id().as_bytes()[0..29] .try_into() .unwrap(); diff --git a/crates/sargon/src/types/samples/account_address_samples.rs b/crates/sargon/src/types/samples/account_address_samples.rs index 2ba27edc6..619546fe4 100644 --- a/crates/sargon/src/types/samples/account_address_samples.rs +++ b/crates/sargon/src/types/samples/account_address_samples.rs @@ -1,11 +1,14 @@ use crate::prelude::*; +use crate::types::samples::{HasIndexedSampleValues, HasManySampleValues}; -impl AccountAddress { - pub fn sample_at(index: usize) -> Self { +impl HasIndexedSampleValues for AccountAddress { + fn sample_at(index: usize) -> Self { Account::sample_at(index).address } +} - pub fn sample_all() -> Vec { +impl HasManySampleValues for AccountAddress { + fn sample_all() -> Vec { Account::sample_all().iter().map(|a| a.address).collect() } } diff --git a/crates/sargon/src/types/samples/account_samples.rs b/crates/sargon/src/types/samples/account_samples.rs index 31c69e05f..f50e37e77 100644 --- a/crates/sargon/src/types/samples/account_samples.rs +++ b/crates/sargon/src/types/samples/account_samples.rs @@ -1,6 +1,6 @@ -use radix_common::address; - use crate::prelude::*; +use crate::types::samples::access_controller_address_samples::SamplesFromAccountAddress; +use radix_common::address; static ALL_ACCOUNT_SAMPLES: Lazy<[Account; 10]> = Lazy::new(|| { [ diff --git a/crates/sargon/src/types/samples/identity_address_samples.rs b/crates/sargon/src/types/samples/identity_address_samples.rs index 4a788ecf7..bb3e12e66 100644 --- a/crates/sargon/src/types/samples/identity_address_samples.rs +++ b/crates/sargon/src/types/samples/identity_address_samples.rs @@ -1,11 +1,23 @@ use crate::prelude::*; -impl IdentityAddress { - pub fn sample_at(index: usize) -> Self { +pub trait HasManySampleValues: Sized { + #[allow(dead_code)] + fn sample_all() -> Vec; +} + +pub trait HasIndexedSampleValues: Sized { + #[allow(dead_code)] + fn sample_at(index: usize) -> Self; +} + +impl HasIndexedSampleValues for IdentityAddress { + fn sample_at(index: usize) -> Self { Persona::sample_at(index).address } +} - pub fn sample_all() -> Vec { +impl HasManySampleValues for IdentityAddress { + fn sample_all() -> Vec { Persona::sample_all().iter().map(|a| a.address).collect() } } diff --git a/crates/sargon/src/types/samples/mod.rs b/crates/sargon/src/types/samples/mod.rs index e3b59ba34..0681ba86f 100644 --- a/crates/sargon/src/types/samples/mod.rs +++ b/crates/sargon/src/types/samples/mod.rs @@ -1,10 +1,7 @@ mod access_controller_address_samples; mod account_address_samples; mod account_samples; -mod factor_source_ids_with_samples; -mod factor_source_samples; mod general_role_with_hd_factor_instance_samples; -mod hierarchical_deterministic_factor_instance_samples; mod identity_address_samples; mod persona_samples; mod profile_samples; @@ -12,10 +9,7 @@ mod profile_samples; pub use access_controller_address_samples::*; pub use account_address_samples::*; pub use account_samples::*; -pub use factor_source_ids_with_samples::*; -pub use factor_source_samples::*; pub use general_role_with_hd_factor_instance_samples::*; -pub use hierarchical_deterministic_factor_instance_samples::*; pub use identity_address_samples::*; pub use persona_samples::*; pub use profile_samples::*; diff --git a/crates/sargon/src/types/samples/persona_samples.rs b/crates/sargon/src/types/samples/persona_samples.rs index e04e30543..13c172620 100644 --- a/crates/sargon/src/types/samples/persona_samples.rs +++ b/crates/sargon/src/types/samples/persona_samples.rs @@ -1,4 +1,5 @@ use crate::prelude::*; +use crate::types::samples::access_controller_address_samples::SamplesFromIdentityAddress; static ALL_PERSONA_SAMPLES: Lazy<[Persona; 8]> = Lazy::new(|| { [ @@ -119,7 +120,12 @@ impl UnsafeAsPersona for DerivationPath { } } -impl HierarchicalDeterministicFactorInstance { +trait UnsafeHardcodingDerivationPathAsPersona { + unsafe fn invalid_hard_coding_derivation_path_as_persona(&self) -> Self; +} +impl UnsafeHardcodingDerivationPathAsPersona + for HierarchicalDeterministicFactorInstance +{ /// # Safety /// Completely unsafe, this is an invalid FactorInstance! It hardcodes /// the derivation path as a persona, resulting in an invalid (DerivationPath, PublicKey) pair.! diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/delete_account/manifest_delete_account.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/delete_account/manifest_delete_account.rs index 58f5f4f70..f5f548329 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/delete_account/manifest_delete_account.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/delete_account/manifest_delete_account.rs @@ -136,7 +136,7 @@ mod tests { fn manifest_without_transfers() { manifest_eq( SUT::delete_account( - &"account_tdx_2_16yll6clntk9za0wvrw0nat848uazduyqy635m8ms77md99q7yf9fzg".into(), + &"account_tdx_2_16yll6clntk9za0wvrw0nat848uazduyqy635m8ms77md99q7yf9fzg".parse::().unwrap(), None, vec![ AccountResourcePreference::sample_other().into(), @@ -206,7 +206,7 @@ CALL_METHOD vec![], ); let manifest = SUT::delete_account( - &"account_tdx_2_16yll6clntk9za0wvrw0nat848uazduyqy635m8ms77md99q7yf9fzg".into(), + &"account_tdx_2_16yll6clntk9za0wvrw0nat848uazduyqy635m8ms77md99q7yf9fzg".parse::().unwrap(), transfers, vec![ AccountResourcePreference::sample_other().into(), diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/manifest_account_locker.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/manifest_account_locker.rs index 127625d45..bef36f393 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/manifest_account_locker.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/manifest_account_locker.rs @@ -5,12 +5,6 @@ use radix_engine_interface::blueprints::locker::{ }; use std::cmp::min; -impl From for ScryptoComponentAddress { - fn from(value: AccountAddress) -> ScryptoComponentAddress { - ScryptoComponentAddress::new_or_panic(value.node_id().0) - } -} - impl TransactionManifest { pub fn account_locker_claim( locker_address: &LockerAddress, @@ -87,7 +81,7 @@ impl TransactionManifest { #[cfg(test)] mod tests { use super::*; - use radix_common::prelude::ResourceAddress; + use sargon_addresses::ResourceAddress; #[allow(clippy::upper_case_acronyms)] type SUT = TransactionManifest; @@ -95,8 +89,8 @@ mod tests { #[test] fn empty() { let manifest = SUT::account_locker_claim( - &"locker_rdx1drn4q2zk6dvljehytnhfah330xk7emfznv59rqlps5ayy52d7xkzzz".into(), - &"account_rdx128y6j78mt0aqv6372evz28hrxp8mn06ccddkr7xppc88hyvynvjdwr".into(), + &"locker_rdx1drn4q2zk6dvljehytnhfah330xk7emfznv59rqlps5ayy52d7xkzzz".parse::().unwrap(), + &"account_rdx128y6j78mt0aqv6372evz28hrxp8mn06ccddkr7xppc88hyvynvjdwr".parse::().unwrap(), vec![], ); manifest_eq(manifest, "") @@ -110,23 +104,23 @@ mod tests { )); let manifest = SUT::account_locker_claim( - &"locker_rdx1drn4q2zk6dvljehytnhfah330xk7emfznv59rqlps5ayy52d7xkzzz".into(), - &"account_rdx128y6j78mt0aqv6372evz28hrxp8mn06ccddkr7xppc88hyvynvjdwr".into(), + &"locker_rdx1drn4q2zk6dvljehytnhfah330xk7emfznv59rqlps5ayy52d7xkzzz".parse::().unwrap(), + &"account_rdx128y6j78mt0aqv6372evz28hrxp8mn06ccddkr7xppc88hyvynvjdwr".parse::().unwrap(), vec![ AccountLockerClaimableResource::Fungible { - resource_address: "resource_rdx1t4dy69k6s0gv040xa64cyadyefwtett62ng6xfdnljyydnml7t6g3j".into(), + resource_address: "resource_rdx1t4dy69k6s0gv040xa64cyadyefwtett62ng6xfdnljyydnml7t6g3j".parse::().unwrap(), amount: 123.into(), }, AccountLockerClaimableResource::NonFungible { - resource_address: "resource_rdx1nfyg2f68jw7hfdlg5hzvd8ylsa7e0kjl68t5t62v3ttamtejc9wlxa".into(), + resource_address: "resource_rdx1nfyg2f68jw7hfdlg5hzvd8ylsa7e0kjl68t5t62v3ttamtejc9wlxa".parse::().unwrap(), number_of_items: 10, }, AccountLockerClaimableResource::Fungible { - resource_address: "resource_rdx1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxradxrd".into(), + resource_address: "resource_rdx1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxradxrd".parse::().unwrap(), amount: 1500.into(), }, AccountLockerClaimableResource::NonFungible { - resource_address: "resource_rdx1n2ekdd2m0jsxjt9wasmu3p49twy2yfalpaa6wf08md46sk8dfmldnd".into(), + resource_address: "resource_rdx1n2ekdd2m0jsxjt9wasmu3p49twy2yfalpaa6wf08md46sk8dfmldnd".parse::().unwrap(), number_of_items: 1, }, ], @@ -142,15 +136,15 @@ mod tests { "account_locker_claim_max_nft_items.rtm" )); let manifest = SUT::account_locker_claim( - &"locker_rdx1drn4q2zk6dvljehytnhfah330xk7emfznv59rqlps5ayy52d7xkzzz".into(), - &"account_rdx128y6j78mt0aqv6372evz28hrxp8mn06ccddkr7xppc88hyvynvjdwr".into(), + &"locker_rdx1drn4q2zk6dvljehytnhfah330xk7emfznv59rqlps5ayy52d7xkzzz".parse::().unwrap(), + &"account_rdx128y6j78mt0aqv6372evz28hrxp8mn06ccddkr7xppc88hyvynvjdwr".parse::().unwrap(), vec![ AccountLockerClaimableResource::NonFungible { - resource_address: "resource_rdx1n2ekdd2m0jsxjt9wasmu3p49twy2yfalpaa6wf08md46sk8dfmldnd".into(), + resource_address: "resource_rdx1n2ekdd2m0jsxjt9wasmu3p49twy2yfalpaa6wf08md46sk8dfmldnd".parse::().unwrap(), number_of_items: 100, }, AccountLockerClaimableResource::Fungible { - resource_address: "resource_rdx1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxradxrd".into(), + resource_address: "resource_rdx1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxradxrd".parse::().unwrap(), amount: Decimal192::one(), } ], diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/mod.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/mod.rs index d9e8cc0a8..6a5033f08 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/mod.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/mod.rs @@ -1,4 +1,3 @@ -mod addresses_manifest_builder_support; mod assert_manifest; mod bucket; mod bucket_factory; @@ -12,7 +11,6 @@ mod metadata; mod modify_manifest; mod third_party_deposit_update; -pub use addresses_manifest_builder_support::*; pub use assert_manifest::*; pub use bucket::*; pub use bucket_factory::*; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/third_party_deposit_update/manifest_third_party_deposit_update.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/third_party_deposit_update/manifest_third_party_deposit_update.rs index 5775fa2bd..938169401 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/third_party_deposit_update/manifest_third_party_deposit_update.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/third_party_deposit_update/manifest_third_party_deposit_update.rs @@ -107,7 +107,7 @@ CALL_METHOD #[test] fn update_third_party_deposits() { - let owner:AccountAddress = "account_tdx_2_128x8q5es2dstqtcc8wqm843xdtfs0lgetfcdn62a54wxspj6yhpxkf".into(); + let owner: AccountAddress = "account_tdx_2_128x8q5es2dstqtcc8wqm843xdtfs0lgetfcdn62a54wxspj6yhpxkf".parse::().unwrap(); let to_json = r#" { "assetsExceptionList" : [ diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/third_party_deposit_update/third_party_deposits_delta.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/third_party_deposit_update/third_party_deposits_delta.rs index ce023dfa5..d37e3e042 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/third_party_deposit_update/third_party_deposits_delta.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/third_party_deposit_update/third_party_deposits_delta.rs @@ -99,37 +99,6 @@ impl ThirdPartyDepositsDelta { } } -impl From - for ScryptoAccountRemoveAuthorizedDepositorInput -{ - fn from(value: ResourceOrNonFungible) -> Self { - Self { - badge: value.into(), - } - } -} -impl From for ScryptoAccountAddAuthorizedDepositorInput { - fn from(value: ResourceOrNonFungible) -> Self { - Self { - badge: value.into(), - } - } -} -impl From - for ScryptoAccountRemoveResourcePreferenceInput -{ - fn from(value: ResourceOrNonFungible) -> Self { - match value { - ResourceOrNonFungible::Resource { value } => Self { - resource_address: value.into(), - }, - ResourceOrNonFungible::NonFungible { value } => Self { - resource_address: value.resource_address.into(), - }, - } - } -} - impl From for ScryptoAccountSetResourcePreferenceInput { fn from(value: AssetException) -> Self { Self { diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfers.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfers.rs index 9d66b76fb..b64897a60 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfers.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfers.rs @@ -284,12 +284,12 @@ mod tests { #[test] fn transpose_complex() { - let sender: AccountAddress = "account_tdx_2_128rkfzdztjpgajucstydar2gz2vp9jj779k33jy3gect2rh5r28rgn".into(); - let recip0: AccountAddress = "account_tdx_2_129e9h6zp5z08qkc0q5tdqz9zc67gg2k7tergrj9erznmke6qeevmsv".into(); - let recip1: AccountAddress = "account_tdx_2_128a45a7hetjfpfqdlsp07eyrmhq7edldefgd7263jd58puzuq09qks".into(); + let sender: AccountAddress = "account_tdx_2_128rkfzdztjpgajucstydar2gz2vp9jj779k33jy3gect2rh5r28rgn".parse::().unwrap(); + let recip0: AccountAddress = "account_tdx_2_129e9h6zp5z08qkc0q5tdqz9zc67gg2k7tergrj9erznmke6qeevmsv".parse::().unwrap(); + let recip1: AccountAddress = "account_tdx_2_128a45a7hetjfpfqdlsp07eyrmhq7edldefgd7263jd58puzuq09qks".parse::().unwrap(); - let nft_c0: NonFungibleResourceAddress = "resource_tdx_2_1n2sjxxtk6vm6pvk8dxr798e8zpxqz50q5wlmldlat0qhh04u2mwmy8".into(); - let nft_c1: NonFungibleResourceAddress = "resource_tdx_2_1ntuaekqexa73m9en04jj3vdt3fk9u9kdk8q9su4efldun2y7nd3cga".into(); + let nft_c0 = "resource_tdx_2_1n2sjxxtk6vm6pvk8dxr798e8zpxqz50q5wlmldlat0qhh04u2mwmy8".parse::().unwrap(); + let nft_c1 = "resource_tdx_2_1ntuaekqexa73m9en04jj3vdt3fk9u9kdk8q9su4efldun2y7nd3cga".parse::().unwrap(); let fung_0: ResourceAddress = ResourceAddress::sample_stokenet_xrd(); let fung_1: ResourceAddress = diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/manifest_encountered_component_address.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/manifest_encountered_component_address.rs index 558ac059d..fd2bcb83d 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/manifest_encountered_component_address.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/manifest_encountered_component_address.rs @@ -1,3 +1,5 @@ +use sargon_addresses::address_union; + use crate::prelude::*; address_union!( diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/mod.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/mod.rs index 9318e7e28..f34302f1e 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/mod.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/mod.rs @@ -1,8 +1,4 @@ -#[macro_use] -mod address_union; - mod account_locker; -mod address_of_account_or_persona; mod assets_transfers; mod build_information; mod manifest_encountered_component_address; @@ -10,12 +6,9 @@ mod stake_claim; mod transaction; mod transaction_guarantee; -pub use address_of_account_or_persona::*; pub use assets_transfers::*; pub use build_information::*; -pub use address_union::*; - pub use stake_claim::*; pub use transaction_guarantee::*; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/address_conversion/mod.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/address_conversion/mod.rs deleted file mode 100644 index 9db861074..000000000 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/address_conversion/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -mod resource_address_from; -pub use resource_address_from::*; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/execution_summary.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/execution_summary.rs index 718df8e97..50634d9a6 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/execution_summary.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/execution_summary.rs @@ -2,6 +2,49 @@ use radix_rust::prelude::IndexMap; use crate::prelude::*; +pub(crate) fn to_vec_network_aware( + values: impl IntoIterator, + network_id: NetworkID, +) -> Vec +where + U: From<(T, NetworkID)>, +{ + values + .into_iter() + .map(|x| (x, network_id)) + .map(U::from) + .collect_vec() +} + +pub(crate) fn to_hashmap_network_aware_key( + values: impl IntoIterator, + network_id: NetworkID, +) -> HashMap +where + L: Eq + std::hash::Hash + From<(K, NetworkID)>, + U: From, +{ + values + .into_iter() + .map(|(k, v)| (L::from((k, network_id)), U::from(v))) + .collect::>() +} + +pub(crate) fn filter_try_to_vec_network_aware( + values: impl IntoIterator, + network_id: NetworkID, +) -> Vec +where + U: TryFrom<(T, NetworkID)>, +{ + values + .into_iter() + .map(|x| (x, network_id)) + .map(U::try_from) + .filter_map(Result::ok) + .collect_vec() +} + /// A summary of the execution of the manifest and the information that helps /// wallets present the contents of a transaction. #[derive(Clone, Debug, PartialEq, Eq)] diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/mod.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/mod.rs index 761c2b189..36085b203 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/mod.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/mod.rs @@ -1,4 +1,3 @@ -mod address_conversion; mod compiled_notarized_intent; mod compiled_transaction_intent; mod dynamically_analyzable_manifest; @@ -7,7 +6,6 @@ mod intent_signature; mod manifest_summary; mod notarized_transaction; mod notary_signature; -mod public_key_hash; mod sbor_depth_validation; mod signed_intent; mod statically_analyzable_manifest; @@ -16,7 +14,6 @@ mod transaction_hashes; mod v1; mod v2; -pub use address_conversion::*; pub use compiled_notarized_intent::*; pub use compiled_transaction_intent::*; pub use dynamically_analyzable_manifest::*; @@ -25,7 +22,6 @@ pub use intent_signature::*; pub use manifest_summary::*; pub use notarized_transaction::*; pub use notary_signature::*; -pub use public_key_hash::*; pub(crate) use sbor_depth_validation::*; pub use signed_intent::*; pub use statically_analyzable_manifest::*; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/execution_summary/transaction_manifest_execution_summary.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/execution_summary/transaction_manifest_execution_summary.rs index 8bdbf8236..40b0ca07f 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/execution_summary/transaction_manifest_execution_summary.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/execution_summary/transaction_manifest_execution_summary.rs @@ -79,7 +79,7 @@ mod tests { let sut = transaction_manifest.execution_summary(receipt).unwrap(); - let acc_v3: AccountAddress = "account_tdx_2_12x55t8w9lf2qjh6z98jjxy04tkpjgjxawqm252gerhyath7qka34v3".into(); + let acc_v3 = "account_tdx_2_12x55t8w9lf2qjh6z98jjxy04tkpjgjxawqm252gerhyath7qka34v3".parse::().unwrap(); pretty_assertions::assert_eq!( sut, @@ -89,21 +89,21 @@ mod tests { acc_v3, vec![ ResourceIndicator::fungible( - "resource_tdx_2_1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxtfd2jc", + "resource_tdx_2_1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxtfd2jc".parse::().unwrap(), FungibleResourceIndicator::guaranteed(10) ), ResourceIndicator::fungible( - "resource_tdx_2_1t4nnqzrdympy0n74yhvkp7vnver90j5yurlhqu3083z8mt2gdvu7sq", + "resource_tdx_2_1t4nnqzrdympy0n74yhvkp7vnver90j5yurlhqu3083z8mt2gdvu7sq".parse::().unwrap(), FungibleResourceIndicator::guaranteed(5) ), ResourceIndicator::non_fungible( - "resource_tdx_2_1n2uml563pnl0yjmd57xnj80mzdwyh4ca4w29zt2ljwpwq2p837c4a7", + "resource_tdx_2_1n2uml563pnl0yjmd57xnj80mzdwyh4ca4w29zt2ljwpwq2p837c4a7".parse::().unwrap(), NonFungibleResourceIndicator::by_ids([ NonFungibleLocalId::integer(64), ]) ), ResourceIndicator::non_fungible( - "resource_tdx_2_1nfmxggm4plrrmc9ft9qn79g7uehqlhjaszv02dnuk85s0h9xnh3xue", + "resource_tdx_2_1nfmxggm4plrrmc9ft9qn79g7uehqlhjaszv02dnuk85s0h9xnh3xue".parse::().unwrap(), NonFungibleResourceIndicator::by_ids([ NonFungibleLocalId::string("Member_6").unwrap(), ]) @@ -113,14 +113,14 @@ mod tests { ], //withdrawals [ ( - AccountAddress::from("account_tdx_2_129n8v0x9q2zj78293sv7xhz9zcysvcvwp70pc6826k8f7dte96sfcn"), + AccountAddress::from_str("account_tdx_2_129n8v0x9q2zj78293sv7xhz9zcysvcvwp70pc6826k8f7dte96sfcn").unwrap(), vec![ ResourceIndicator::fungible( - "resource_tdx_2_1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxtfd2jc", + "resource_tdx_2_1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxtfd2jc".parse::().unwrap(), FungibleResourceIndicator::guaranteed(10) ), ResourceIndicator::non_fungible( - "resource_tdx_2_1n2uml563pnl0yjmd57xnj80mzdwyh4ca4w29zt2ljwpwq2p837c4a7", + "resource_tdx_2_1n2uml563pnl0yjmd57xnj80mzdwyh4ca4w29zt2ljwpwq2p837c4a7".parse::().unwrap(), NonFungibleResourceIndicator::by_ids([ NonFungibleLocalId::integer(64), ]) @@ -128,14 +128,14 @@ mod tests { ] ), ( - AccountAddress::from("account_tdx_2_12x58hfy598wl5vukv3sqrkc7h3n699nqygufncycayeuwydel8esnu"), + AccountAddress::from_str("account_tdx_2_12x58hfy598wl5vukv3sqrkc7h3n699nqygufncycayeuwydel8esnu").unwrap(), vec![ ResourceIndicator::fungible( - "resource_tdx_2_1t4nnqzrdympy0n74yhvkp7vnver90j5yurlhqu3083z8mt2gdvu7sq", + "resource_tdx_2_1t4nnqzrdympy0n74yhvkp7vnver90j5yurlhqu3083z8mt2gdvu7sq".parse::().unwrap(), FungibleResourceIndicator::guaranteed(5) ), ResourceIndicator::non_fungible( - "resource_tdx_2_1nfmxggm4plrrmc9ft9qn79g7uehqlhjaszv02dnuk85s0h9xnh3xue", + "resource_tdx_2_1nfmxggm4plrrmc9ft9qn79g7uehqlhjaszv02dnuk85s0h9xnh3xue".parse::().unwrap(), NonFungibleResourceIndicator::by_ids([ NonFungibleLocalId::string("Member_6").unwrap(), ]) @@ -187,7 +187,7 @@ mod tests { let sut = transaction_manifest.execution_summary(receipt).unwrap(); - let acc_g2: AccountAddress = "account_tdx_2_129uv9r46an4hwng8wc97qwpraspvnrc7v2farne4lr6ff7yaevaz2a".into(); + let acc_g2: AccountAddress = "account_tdx_2_129uv9r46an4hwng8wc97qwpraspvnrc7v2farne4lr6ff7yaevaz2a".parse().unwrap(); pretty_assertions::assert_eq!( sut, @@ -208,7 +208,7 @@ mod tests { >::from_iter([( acc_g2, HashMap::<_, _>::from_iter([( - "resource_tdx_2_1t4nnqzrdympy0n74yhvkp7vnver90j5yurlhqu3083z8mt2gdvu7sq".into(), + "resource_tdx_2_1t4nnqzrdympy0n74yhvkp7vnver90j5yurlhqu3083z8mt2gdvu7sq".parse::().unwrap(), ResourcePreferenceUpdate::Remove, )]), )]), @@ -253,8 +253,8 @@ mod tests { let sut = transaction_manifest.execution_summary(receipt).unwrap(); - let acc_v3: AccountAddress = "account_tdx_2_12x55t8w9lf2qjh6z98jjxy04tkpjgjxawqm252gerhyath7qka34v3".into(); - let token_address: ResourceAddress = "resource_tdx_2_1tkd0xf49tvq4wjdxn7khkt9l900750rd2jqdajukgwsyv8k9md5hh6".into(); + let acc_v3 = "account_tdx_2_12x55t8w9lf2qjh6z98jjxy04tkpjgjxawqm252gerhyath7qka34v3".parse::().unwrap(); + let token_address = "resource_tdx_2_1tkd0xf49tvq4wjdxn7khkt9l900750rd2jqdajukgwsyv8k9md5hh6".parse::().unwrap(); pretty_assertions::assert_eq!( sut, @@ -309,8 +309,8 @@ mod tests { let sut = transaction_manifest.execution_summary(receipt).unwrap(); - let acc: AccountAddress = "account_tdx_2_12x55t8w9lf2qjh6z98jjxy04tkpjgjxawqm252gerhyath7qka34v3".into(); - let non_fungible_address: ResourceAddress = "resource_tdx_2_1nfnyenkeznzwpnf0nufa6ajsahpu00quhm8xwfrzt8u3dqm2ltzzhl".into(); + let acc: AccountAddress = "account_tdx_2_12x55t8w9lf2qjh6z98jjxy04tkpjgjxawqm252gerhyath7qka34v3".parse().unwrap(); + let non_fungible_address: ResourceAddress = "resource_tdx_2_1nfnyenkeznzwpnf0nufa6ajsahpu00quhm8xwfrzt8u3dqm2ltzzhl".parse().unwrap(); pretty_assertions::assert_eq!( sut, @@ -396,7 +396,7 @@ mod tests { let sut = transaction_manifest.execution_summary(receipt).unwrap(); - let acc_ac: AccountAddress = "account_tdx_2_129qq7m9ttup2kn6t4g4s0dvazxplktj7vd7my76hfd7xh7ham5zeac".into(); + let acc_ac: AccountAddress = "account_tdx_2_129qq7m9ttup2kn6t4g4s0dvazxplktj7vd7my76hfd7xh7ham5zeac".parse().unwrap(); pretty_assertions::assert_eq!( sut, @@ -406,7 +406,7 @@ mod tests { acc_ac, vec![ ResourceIndicator::fungible( - "resource_tdx_2_1t5dapa24l4xvwqtqe2jrdphtn7ga46gw67wr9fwn4gp532myfjqpck", + "resource_tdx_2_1t5dapa24l4xvwqtqe2jrdphtn7ga46gw67wr9fwn4gp532myfjqpck".parse::().unwrap(), FungibleResourceIndicator::guaranteed(5) ), ] @@ -417,7 +417,7 @@ mod tests { acc_ac, vec![ ResourceIndicator::non_fungible( - "resource_tdx_2_1nfmxggm4plrrmc9ft9qn79g7uehqlhjaszv02dnuk85s0h9xnh3xue", + "resource_tdx_2_1nfmxggm4plrrmc9ft9qn79g7uehqlhjaszv02dnuk85s0h9xnh3xue".parse::().unwrap(), NonFungibleResourceIndicator::by_amount(1, PredictedNonFungibleLocalIds::new( [], 4 @@ -479,7 +479,7 @@ mod tests { acc_ac, vec![ ResourceIndicator::fungible( - "resource_tdx_2_1t5dapa24l4xvwqtqe2jrdphtn7ga46gw67wr9fwn4gp532myfjqpck", + "resource_tdx_2_1t5dapa24l4xvwqtqe2jrdphtn7ga46gw67wr9fwn4gp532myfjqpck".parse::().unwrap(), FungibleResourceIndicator::guaranteed(1) ), ] @@ -490,7 +490,7 @@ mod tests { [], // addresses_of_identities_requiring_auth [], // newly_created_non_fungibles [ReservedInstruction::AccountLockFee], // reserved_instructions - [ResourceSpecifier::non_fungible("resource_tdx_2_1nfmxggm4plrrmc9ft9qn79g7uehqlhjaszv02dnuk85s0h9xnh3xue", vec!["".parse().unwrap()])], // presented_proofs + [ResourceSpecifier::non_fungible("resource_tdx_2_1nfmxggm4plrrmc9ft9qn79g7uehqlhjaszv02dnuk85s0h9xnh3xue".parse::().unwrap(), vec!["".parse().unwrap()])], // presented_proofs ["component_tdx_2_1cr4pa9ex9xhwzfjzclv8vjnfylw93wvhkwcwc0xlahpkel0krxqedw".parse::().unwrap()], // encountered_component_addresses [ DetailedManifestClass::General @@ -581,7 +581,7 @@ mod tests { FungibleResourceIndicator::guaranteed(237) ), ResourceIndicator::fungible( - r"resource_tdx_2_1thw7yclz24h5xjp3086cj8z2ya0d7p9mydk0yh68c28ha02uhzrnyy", + r"resource_tdx_2_1thw7yclz24h5xjp3086cj8z2ya0d7p9mydk0yh68c28ha02uhzrnyy".parse::().unwrap(), FungibleResourceIndicator::guaranteed(1337) ), ] @@ -713,9 +713,9 @@ mod tests { let sut = transaction_manifest.execution_summary(receipt).unwrap(); - let acc_gk = AccountAddress::from("account_tdx_2_12x55t8w9lf2qjh6z98jjxy04tkpjgjxawqm252gerhyath7qka34v3"); - let resource_address_of_pool = ResourceAddress::from("resource_tdx_2_1thgnc84xkcjhs46pfvm9s8zn8t9kxwryvyr9x3947xpt6jxty7qn25"); - let pool_address = PoolAddress::from("pool_tdx_2_1c5mygu9t8rlfq6j8v2ynrg60ltts2dctsghust8u2tuztrml427830"); + let acc_gk = AccountAddress::from_str("account_tdx_2_12x55t8w9lf2qjh6z98jjxy04tkpjgjxawqm252gerhyath7qka34v3").unwrap(); + let resource_address_of_pool = ResourceAddress::from_str("resource_tdx_2_1thgnc84xkcjhs46pfvm9s8zn8t9kxwryvyr9x3947xpt6jxty7qn25").unwrap(); + let pool_address = PoolAddress::from_str("pool_tdx_2_1c5mygu9t8rlfq6j8v2ynrg60ltts2dctsghust8u2tuztrml427830").unwrap(); pretty_assertions::assert_eq!( sut, @@ -738,7 +738,7 @@ mod tests { pool_addresses: vec![pool_address], pool_redemptions: vec![TrackedPoolRedemption::new( pool_address, - ResourceAddress::from("resource_tdx_2_1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxtfd2jc"), + ResourceAddress::from_str("resource_tdx_2_1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxtfd2jc").unwrap(), 3.162277, [] )] @@ -770,11 +770,11 @@ mod tests { let sut = transaction_manifest.execution_summary(receipt).unwrap(); - let acc_gk: AccountAddress = "account_tdx_2_129uv9r46an4hwng8wc97qwpraspvnrc7v2farne4lr6ff7yaevaz2a".into(); + let acc_gk: AccountAddress = "account_tdx_2_129uv9r46an4hwng8wc97qwpraspvnrc7v2farne4lr6ff7yaevaz2a".parse().unwrap(); - let nf_global_id: NonFungibleGlobalId = "resource_tdx_2_1ngw8z6ut9mw54am4rr65kwcuz24q3n7waxtzyfvug5g4yuc00jydqj:{8a190d8fd0725713-e9072f0fd954196f-5f9be7adaf8d5b78-cf811ea9992983c3}".into(); + let nf_global_id: NonFungibleGlobalId = "resource_tdx_2_1ngw8z6ut9mw54am4rr65kwcuz24q3n7waxtzyfvug5g4yuc00jydqj:{8a190d8fd0725713-e9072f0fd954196f-5f9be7adaf8d5b78-cf811ea9992983c3}".parse().unwrap(); - let validator: ValidatorAddress = "validator_tdx_2_1sdlkptcwjpajqawnuya8r2mgl3eqt89hw27ww6du8kxmx3thmyu8l4".into(); + let validator: ValidatorAddress = "validator_tdx_2_1sdlkptcwjpajqawnuya8r2mgl3eqt89hw27ww6du8kxmx3thmyu8l4".parse().unwrap(); pretty_assertions::assert_eq!( sut, @@ -784,7 +784,7 @@ mod tests { acc_gk, vec![ ResourceIndicator::fungible( - "resource_tdx_2_1t5hpjckz9tm63gqvxsl60ejhzvnlguly77tltvywnj06s2x9wjdxjn", + "resource_tdx_2_1t5hpjckz9tm63gqvxsl60ejhzvnlguly77tltvywnj06s2x9wjdxjn".parse::().unwrap(), FungibleResourceIndicator::guaranteed(500) ), ] @@ -795,7 +795,7 @@ mod tests { acc_gk, vec![ ResourceIndicator::non_fungible( - "resource_tdx_2_1ngw8z6ut9mw54am4rr65kwcuz24q3n7waxtzyfvug5g4yuc00jydqj", + "resource_tdx_2_1ngw8z6ut9mw54am4rr65kwcuz24q3n7waxtzyfvug5g4yuc00jydqj".parse::().unwrap(), NonFungibleResourceIndicator::by_all( PredictedDecimal::new(0, 4), PredictedNonFungibleLocalIds::new( @@ -851,9 +851,9 @@ mod tests { let sut = transaction_manifest.execution_summary(receipt).unwrap(); - let acc_gk: AccountAddress = "account_tdx_2_129uv9r46an4hwng8wc97qwpraspvnrc7v2farne4lr6ff7yaevaz2a".into(); + let acc_gk: AccountAddress = "account_tdx_2_129uv9r46an4hwng8wc97qwpraspvnrc7v2farne4lr6ff7yaevaz2a".parse().unwrap(); - let validator: ValidatorAddress = "validator_tdx_2_1sdtnujyn3720ymg8lakydkvc5tw4q3zecdj95akdwt9de362mvtd94".into(); + let validator: ValidatorAddress = "validator_tdx_2_1sdtnujyn3720ymg8lakydkvc5tw4q3zecdj95akdwt9de362mvtd94".parse().unwrap(); pretty_assertions::assert_eq!( sut, @@ -863,7 +863,7 @@ mod tests { acc_gk, vec![ ResourceIndicator::non_fungible( - "resource_tdx_2_1ng3g2nj5pfpmdphgz0nrh8z0gtqcxx5z5dn48t85ar0z0zjhefufaw", + "resource_tdx_2_1ng3g2nj5pfpmdphgz0nrh8z0gtqcxx5z5dn48t85ar0z0zjhefufaw".parse::().unwrap(), NonFungibleResourceIndicator::by_ids([ NonFungibleLocalId::ruid(hex_decode("1c1ce92c810094a765659db6a666c19c6cea4367bb789b55276b137712ceecce").unwrap()).unwrap(), NonFungibleLocalId::ruid(hex_decode("5aebd0270caf3f8751031498741f57b5d24fe0d62a976589519c6a92423888cc").unwrap()).unwrap() @@ -928,9 +928,9 @@ mod tests { let sut = transaction_manifest.execution_summary(receipt).unwrap(); - let acc: AccountAddress = "account_tdx_2_12x2lmewv5lfen4x96aurw7a5z5ukdzyyc0fkytamqgml77lah44kkp".into(); - let fungible_address: ResourceAddress = "resource_tdx_2_1th75jg2gx9l3v0r8duzrmknfarhd3ha0387lg9n78qc9849xsfyq32".into(); - let non_fungible_address: ResourceAddress = "resource_tdx_2_1n2z4k99wuqlph9lj64ckc64znm48axl37xctsa0xqmm2sqg7klrte3".into(); + let acc: AccountAddress = "account_tdx_2_12x2lmewv5lfen4x96aurw7a5z5ukdzyyc0fkytamqgml77lah44kkp".parse().unwrap(); + let fungible_address: ResourceAddress = "resource_tdx_2_1th75jg2gx9l3v0r8duzrmknfarhd3ha0387lg9n78qc9849xsfyq32".parse().unwrap(); + let non_fungible_address: ResourceAddress = "resource_tdx_2_1n2z4k99wuqlph9lj64ckc64znm48axl37xctsa0xqmm2sqg7klrte3".parse::().unwrap(); pretty_assertions::assert_eq!( sut, @@ -953,7 +953,7 @@ mod tests { ), ] )], - vec!["account_tdx_2_12x2lmewv5lfen4x96aurw7a5z5ukdzyyc0fkytamqgml77lah44kkp".into()], // addresses_of_accounts_requiring_auth + vec!["account_tdx_2_12x2lmewv5lfen4x96aurw7a5z5ukdzyyc0fkytamqgml77lah44kkp".parse::().unwrap()], // addresses_of_accounts_requiring_auth [], // addresses_of_identities_requiring_auth [], // newly_created_non_fungibles [ReservedInstruction::AccountLockFee], // reserved_instructions @@ -986,8 +986,8 @@ mod tests { let sut = transaction_manifest.execution_summary(receipt).unwrap(); - let acc: AccountAddress = "account_tdx_2_12xy65ekdcrehj24t0ks5lvvqcvr48qgac4efq3phecp0xyetze5nyy".into(); - let badge_address: ResourceAddress = "resource_tdx_2_1nfxxxxxxxxxxaccwnrxxxxxxxxx006664022062xxxxxxxxx4vczzk".into(); + let acc = "account_tdx_2_12xy65ekdcrehj24t0ks5lvvqcvr48qgac4efq3phecp0xyetze5nyy".parse::().unwrap(); + let badge_address = "resource_tdx_2_1nfxxxxxxxxxxaccwnrxxxxxxxxx006664022062xxxxxxxxx4vczzk".parse::().unwrap(); let badge_id = NonFungibleLocalId::bytes( NonEmptyMax64Bytes::from_hex( "5189aa66cdc0f3792aab7da14fb180c30753811dc572904437ce02f3132b", diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/transaction_manifest.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/transaction_manifest.rs index cdd11424c..8b66a77b9 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/transaction_manifest.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/transaction_manifest.rs @@ -480,7 +480,7 @@ BURN_RESOURCE #[test] fn manifest_summary_multi_account_resources_transfer() { - let a = AccountAddress::from("account_sim1cyvgx33089ukm2pl97pv4max0x40ruvfy4lt60yvya744cve475w0q"); + let a = AccountAddress::from_str("account_sim1cyvgx33089ukm2pl97pv4max0x40ruvfy4lt60yvya744cve475w0q").unwrap(); let manifest = SUT::sample_other(); let summary = manifest.summary().unwrap(); @@ -491,19 +491,19 @@ BURN_RESOURCE a => vec![AccountWithdraw::sample()], ), hashmap!( - AccountAddress::from("account_sim1c8mulhl5yrk6hh4jsyldps5sdrp08r5v9wusupvzxgqvhlp4c4nwjz") => + AccountAddress::from_str("account_sim1c8mulhl5yrk6hh4jsyldps5sdrp08r5v9wusupvzxgqvhlp4c4nwjz").unwrap() => AccountDeposits::new_for_test( vec![SimpleResourceBounds::exact_fungible(ResourceAddress::sample_sim_xrd(), 150)], UnspecifiedResources::NonePresent, ) , - AccountAddress::from("account_sim1c8ct6jdcwqrg3gzskyxuy0z933fe55fyjz6p56730r95ulzwl3ppva") => + AccountAddress::from_str("account_sim1c8ct6jdcwqrg3gzskyxuy0z933fe55fyjz6p56730r95ulzwl3ppva").unwrap() => AccountDeposits::new_for_test( vec![SimpleResourceBounds::exact_fungible(ResourceAddress::sample_sim_xrd(), 50)], UnspecifiedResources::NonePresent, ) , - AccountAddress::from("account_sim1c8s2hass5g62ckwpv78y8ykdqljtetv4ve6etcz64gveykxznj36tr") => + AccountAddress::from_str("account_sim1c8s2hass5g62ckwpv78y8ykdqljtetv4ve6etcz64gveykxznj36tr").unwrap() => AccountDeposits::new_for_test( vec![SimpleResourceBounds::exact_fungible(ResourceAddress::sample_sim_xrd(), 130)], UnspecifiedResources::NonePresent, @@ -514,9 +514,9 @@ BURN_RESOURCE a ], [ - AccountAddress::from("account_sim1c8mulhl5yrk6hh4jsyldps5sdrp08r5v9wusupvzxgqvhlp4c4nwjz"), - AccountAddress::from("account_sim1c8s2hass5g62ckwpv78y8ykdqljtetv4ve6etcz64gveykxznj36tr"), - AccountAddress::from("account_sim1c8ct6jdcwqrg3gzskyxuy0z933fe55fyjz6p56730r95ulzwl3ppva"), + AccountAddress::from_str("account_sim1c8mulhl5yrk6hh4jsyldps5sdrp08r5v9wusupvzxgqvhlp4c4nwjz").unwrap(), + AccountAddress::from_str("account_sim1c8s2hass5g62ckwpv78y8ykdqljtetv4ve6etcz64gveykxznj36tr").unwrap(), + AccountAddress::from_str("account_sim1c8ct6jdcwqrg3gzskyxuy0z933fe55fyjz6p56730r95ulzwl3ppva").unwrap(), ], [], [a], @@ -547,6 +547,6 @@ BURN_RESOURCE ) .unwrap(); let pool_addresses = sut.involved_pool_addresses(); - assert_eq!(pool_addresses, ["pool_tdx_2_1c5mygu9t8rlfq6j8v2ynrg60ltts2dctsghust8u2tuztrml427830"].into_iter().map(PoolAddress::from).collect_vec()); + assert_eq!(pool_addresses, ["pool_tdx_2_1c5mygu9t8rlfq6j8v2ynrg60ltts2dctsghust8u2tuztrml427830"].into_iter().map(PoolAddress::from_str).map(Result::unwrap).collect_vec()); } } diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/subintent_manifest.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/subintent_manifest.rs index dfac6e327..cc143fe7d 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/subintent_manifest.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/subintent_manifest.rs @@ -523,7 +523,7 @@ DROP_AUTH_ZONE_PROOFS; #[test] fn manifest_summary_multi_account_resources_transfer() { - let a = AccountAddress::from("account_sim1cyvgx33089ukm2pl97pv4max0x40ruvfy4lt60yvya744cve475w0q"); + let a = AccountAddress::from_str("account_sim1cyvgx33089ukm2pl97pv4max0x40ruvfy4lt60yvya744cve475w0q").unwrap(); let manifest = SUT::sample_other(); let summary = manifest.summary().unwrap(); @@ -534,19 +534,19 @@ DROP_AUTH_ZONE_PROOFS; a => vec![AccountWithdraw::sample()], ), hashmap!( - AccountAddress::from("account_sim1c8mulhl5yrk6hh4jsyldps5sdrp08r5v9wusupvzxgqvhlp4c4nwjz") => + AccountAddress::from_str("account_sim1c8mulhl5yrk6hh4jsyldps5sdrp08r5v9wusupvzxgqvhlp4c4nwjz").unwrap() => AccountDeposits::new_for_test( vec![SimpleResourceBounds::exact_fungible(ResourceAddress::sample_sim_xrd(), 150)], UnspecifiedResources::NonePresent, ) , - AccountAddress::from("account_sim1c8ct6jdcwqrg3gzskyxuy0z933fe55fyjz6p56730r95ulzwl3ppva") => + AccountAddress::from_str("account_sim1c8ct6jdcwqrg3gzskyxuy0z933fe55fyjz6p56730r95ulzwl3ppva").unwrap() => AccountDeposits::new_for_test( vec![SimpleResourceBounds::exact_fungible(ResourceAddress::sample_sim_xrd(), 50)], UnspecifiedResources::NonePresent, ) , - AccountAddress::from("account_sim1c8s2hass5g62ckwpv78y8ykdqljtetv4ve6etcz64gveykxznj36tr") => + AccountAddress::from_str("account_sim1c8s2hass5g62ckwpv78y8ykdqljtetv4ve6etcz64gveykxznj36tr").unwrap() => AccountDeposits::new_for_test( vec![SimpleResourceBounds::exact_fungible(ResourceAddress::sample_sim_xrd(), 130)], UnspecifiedResources::NonePresent, @@ -557,9 +557,9 @@ DROP_AUTH_ZONE_PROOFS; a ], [ - AccountAddress::from("account_sim1c8mulhl5yrk6hh4jsyldps5sdrp08r5v9wusupvzxgqvhlp4c4nwjz"), - AccountAddress::from("account_sim1c8s2hass5g62ckwpv78y8ykdqljtetv4ve6etcz64gveykxznj36tr"), - AccountAddress::from("account_sim1c8ct6jdcwqrg3gzskyxuy0z933fe55fyjz6p56730r95ulzwl3ppva"), + AccountAddress::from_str("account_sim1c8mulhl5yrk6hh4jsyldps5sdrp08r5v9wusupvzxgqvhlp4c4nwjz").unwrap(), + AccountAddress::from_str("account_sim1c8s2hass5g62ckwpv78y8ykdqljtetv4ve6etcz64gveykxznj36tr").unwrap(), + AccountAddress::from_str("account_sim1c8ct6jdcwqrg3gzskyxuy0z933fe55fyjz6p56730r95ulzwl3ppva").unwrap(), ], [], [a], @@ -591,7 +591,7 @@ DROP_AUTH_ZONE_PROOFS; ) .unwrap(); let pool_addresses = sut.involved_pool_addresses(); - assert_eq!(pool_addresses, ["pool_tdx_2_1c5mygu9t8rlfq6j8v2ynrg60ltts2dctsghust8u2tuztrml427830"].into_iter().map(PoolAddress::from).collect_vec()); + assert_eq!(pool_addresses, ["pool_tdx_2_1c5mygu9t8rlfq6j8v2ynrg60ltts2dctsghust8u2tuztrml427830"].into_iter().map(PoolAddress::from_str).map(Result::unwrap).collect_vec()); } #[test] @@ -629,14 +629,14 @@ DROP_AUTH_ZONE_PROOFS; pretty_assertions::assert_eq!( summary.account_deposits, hashmap! { - AccountAddress::from("account_tdx_2_129rfcz44zxflyaf6d65fdvaqtk5rlvdu8nzek2nz435zknhqure2xl") => + AccountAddress::from_str("account_tdx_2_129rfcz44zxflyaf6d65fdvaqtk5rlvdu8nzek2nz435zknhqure2xl").unwrap() => AccountDeposits::new_for_test( vec![ - SimpleResourceBounds::fungible("resource_tdx_2_1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxtfd2jc", SimpleCountedResourceBounds::unknown_amount()), - SimpleResourceBounds::fungible("resource_tdx_2_1th4gzm9rk5s28yf5gud0a32m082g4x60d6na4ecsccte032y3xu785", SimpleCountedResourceBounds::at_least(6)), - SimpleResourceBounds::fungible("resource_tdx_2_1tkd957yt3rwqze7elmzlphfjnmfyzkf9l5rau5ccsx9h2vs9nq3tzp", SimpleCountedResourceBounds::at_most(10)), - SimpleResourceBounds::fungible("resource_tdx_2_1t5jcmwqx39ym7fw0hrlpnxwechr0mzlgulcfcye59qm9y9fa5uvdrd", SimpleCountedResourceBounds::between(100, 159)), - SimpleResourceBounds::fungible("resource_tdx_2_1t5dapa24l4xvwqtqe2jrdphtn7ga46gw67wr9fwn4gp532myfjqpck", SimpleCountedResourceBounds::exact(3)), + SimpleResourceBounds::fungible("resource_tdx_2_1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxtfd2jc".parse::().unwrap(), SimpleCountedResourceBounds::unknown_amount()), + SimpleResourceBounds::fungible("resource_tdx_2_1th4gzm9rk5s28yf5gud0a32m082g4x60d6na4ecsccte032y3xu785".parse::().unwrap(), SimpleCountedResourceBounds::at_least(6)), + SimpleResourceBounds::fungible("resource_tdx_2_1tkd957yt3rwqze7elmzlphfjnmfyzkf9l5rau5ccsx9h2vs9nq3tzp".parse::().unwrap(), SimpleCountedResourceBounds::at_most(10)), + SimpleResourceBounds::fungible("resource_tdx_2_1t5jcmwqx39ym7fw0hrlpnxwechr0mzlgulcfcye59qm9y9fa5uvdrd".parse::().unwrap(), SimpleCountedResourceBounds::between(100, 159)), + SimpleResourceBounds::fungible("resource_tdx_2_1t5dapa24l4xvwqtqe2jrdphtn7ga46gw67wr9fwn4gp532myfjqpck".parse::().unwrap(), SimpleCountedResourceBounds::exact(3)), ], UnspecifiedResources::MayBePresent, ), @@ -666,27 +666,27 @@ DROP_AUTH_ZONE_PROOFS; pretty_assertions::assert_eq!( summary.account_deposits, hashmap!( - AccountAddress::from("account_tdx_2_129rfcz44zxflyaf6d65fdvaqtk5rlvdu8nzek2nz435zknhqure2xl") => + AccountAddress::from_str("account_tdx_2_129rfcz44zxflyaf6d65fdvaqtk5rlvdu8nzek2nz435zknhqure2xl").unwrap() => AccountDeposits::new_for_test( vec![ SimpleResourceBounds::non_fungible( - "resource_tdx_2_1nfmxggm4plrrmc9ft9qn79g7uehqlhjaszv02dnuk85s0h9xnh3xue", + "resource_tdx_2_1nfmxggm4plrrmc9ft9qn79g7uehqlhjaszv02dnuk85s0h9xnh3xue".parse::().unwrap(), SimpleNonFungibleResourceBounds::new(Vec::new(), Some(SimpleCountedResourceBounds::unknown_amount())), ), SimpleResourceBounds::non_fungible( - "resource_tdx_2_1n2lj0rk7pye8h2cxs347lf70ksyzwaez0mjkssccfthp6m408hfny7", + "resource_tdx_2_1n2lj0rk7pye8h2cxs347lf70ksyzwaez0mjkssccfthp6m408hfny7".parse::().unwrap(), SimpleNonFungibleResourceBounds::new(Vec::new(), Some(SimpleCountedResourceBounds::at_least(6))), ), SimpleResourceBounds::non_fungible( - "resource_tdx_2_1nf8g5dhl6rxvq78j6q3kdxfkl7rweychjzyv848clhezg44rn0qgy5", + "resource_tdx_2_1nf8g5dhl6rxvq78j6q3kdxfkl7rweychjzyv848clhezg44rn0qgy5".parse::().unwrap(), SimpleNonFungibleResourceBounds::new(Vec::new(), Some(SimpleCountedResourceBounds::at_most(10))), ), SimpleResourceBounds::non_fungible( - "resource_tdx_2_1nfn4gd24pcpnqegcq07mgvz9cea4zryytswn5vmgepnan7tjqedkxp", + "resource_tdx_2_1nfn4gd24pcpnqegcq07mgvz9cea4zryytswn5vmgepnan7tjqedkxp".parse::().unwrap(), SimpleNonFungibleResourceBounds::new(Vec::new(), Some(SimpleCountedResourceBounds::between(100, 159))), ), SimpleResourceBounds::non_fungible( - "resource_tdx_2_1nt8pgfd7xj954403vfgkej25g8kcc56ldu4j3akl4vzlcfen6jcfjg", + "resource_tdx_2_1nt8pgfd7xj954403vfgkej25g8kcc56ldu4j3akl4vzlcfen6jcfjg".parse::().unwrap(), SimpleNonFungibleResourceBounds::new(Vec::new(), Some(SimpleCountedResourceBounds::exact(3))), ), ], @@ -716,53 +716,54 @@ DROP_AUTH_ZONE_PROOFS; let summary = manifest.summary().unwrap(); let certain_ids_sample = vec![ - NonFungibleLocalId::from("#0#"), - NonFungibleLocalId::from("#1#"), - NonFungibleLocalId::from("#2#"), + NonFungibleLocalId::from_str("#0#").unwrap(), + NonFungibleLocalId::from_str("#1#").unwrap(), + NonFungibleLocalId::from_str("#2#").unwrap(), ]; - let member_card_id = NonFungibleLocalId::from(""); + let member_card_id = + NonFungibleLocalId::from_str("").unwrap(); pretty_assertions::assert_eq!( summary.account_deposits, hashmap!( - AccountAddress::from("account_tdx_2_129rfcz44zxflyaf6d65fdvaqtk5rlvdu8nzek2nz435zknhqure2xl") => + AccountAddress::from_str("account_tdx_2_129rfcz44zxflyaf6d65fdvaqtk5rlvdu8nzek2nz435zknhqure2xl").unwrap() => AccountDeposits::new_for_test( vec![ SimpleResourceBounds::non_fungible( - "resource_tdx_2_1nfmxggm4plrrmc9ft9qn79g7uehqlhjaszv02dnuk85s0h9xnh3xue", + "resource_tdx_2_1nfmxggm4plrrmc9ft9qn79g7uehqlhjaszv02dnuk85s0h9xnh3xue".parse::().unwrap(), SimpleNonFungibleResourceBounds::new(vec![member_card_id], Some(SimpleCountedResourceBounds::unknown_amount())), ), SimpleResourceBounds::non_fungible( - "resource_tdx_2_1n2lj0rk7pye8h2cxs347lf70ksyzwaez0mjkssccfthp6m408hfny7", + "resource_tdx_2_1n2lj0rk7pye8h2cxs347lf70ksyzwaez0mjkssccfthp6m408hfny7".parse::().unwrap(), SimpleNonFungibleResourceBounds::new(certain_ids_sample.clone(), Some(SimpleCountedResourceBounds::unknown_amount())), ), SimpleResourceBounds::non_fungible( - "resource_tdx_2_1nf8g5dhl6rxvq78j6q3kdxfkl7rweychjzyv848clhezg44rn0qgy5", + "resource_tdx_2_1nf8g5dhl6rxvq78j6q3kdxfkl7rweychjzyv848clhezg44rn0qgy5".parse::().unwrap(), SimpleNonFungibleResourceBounds::new(certain_ids_sample.clone(), None), ), SimpleResourceBounds::non_fungible( - "resource_tdx_2_1nfn4gd24pcpnqegcq07mgvz9cea4zryytswn5vmgepnan7tjqedkxp", + "resource_tdx_2_1nfn4gd24pcpnqegcq07mgvz9cea4zryytswn5vmgepnan7tjqedkxp".parse::().unwrap(), SimpleNonFungibleResourceBounds::new(certain_ids_sample.clone(), Some(SimpleCountedResourceBounds::at_most(2))), ), SimpleResourceBounds::non_fungible( - "resource_tdx_2_1nt8pgfd7xj954403vfgkej25g8kcc56ldu4j3akl4vzlcfen6jcfjg", + "resource_tdx_2_1nt8pgfd7xj954403vfgkej25g8kcc56ldu4j3akl4vzlcfen6jcfjg".parse::().unwrap(), SimpleNonFungibleResourceBounds::new(certain_ids_sample.clone(), None), ), SimpleResourceBounds::non_fungible( - "resource_tdx_2_1n2q3kj4sfa6sh45kvau2f08hfhjuls7zcevwl77vjzmgf3sea0uzzu", + "resource_tdx_2_1n2q3kj4sfa6sh45kvau2f08hfhjuls7zcevwl77vjzmgf3sea0uzzu".parse::().unwrap(), SimpleNonFungibleResourceBounds::new(certain_ids_sample.clone(), Some(SimpleCountedResourceBounds::at_most(2))), ), SimpleResourceBounds::non_fungible( - "resource_tdx_2_1n2rpk9w8d8kzu578jxvqr0dplctfh5clylmyqpu9kvnz7hvceh2mxe", + "resource_tdx_2_1n2rpk9w8d8kzu578jxvqr0dplctfh5clylmyqpu9kvnz7hvceh2mxe".parse::().unwrap(), SimpleNonFungibleResourceBounds::new(certain_ids_sample.clone(), Some(SimpleCountedResourceBounds::at_least(2))), ), SimpleResourceBounds::non_fungible( - "resource_tdx_2_1ngu8tgxvv26rpmdwxxfd8gclnsnjeew7zdcw2p3genru58a7wkmue4", + "resource_tdx_2_1ngu8tgxvv26rpmdwxxfd8gclnsnjeew7zdcw2p3genru58a7wkmue4".parse::().unwrap(), SimpleNonFungibleResourceBounds::new(certain_ids_sample.clone(), Some(SimpleCountedResourceBounds::exact(2))), ), SimpleResourceBounds::non_fungible( - "resource_tdx_2_1nfve52p2wvx0kp0eq3xaznuvwakcu5a6aqtsjqq8x30zk4wkglxmlv", + "resource_tdx_2_1nfve52p2wvx0kp0eq3xaznuvwakcu5a6aqtsjqq8x30zk4wkglxmlv".parse::().unwrap(), SimpleNonFungibleResourceBounds::new(certain_ids_sample.clone(), Some(SimpleCountedResourceBounds::between(2, 5))), ), ], @@ -794,30 +795,30 @@ DROP_AUTH_ZONE_PROOFS; pretty_assertions::assert_eq!( summary.account_deposits, hashmap!( - AccountAddress::from("account_tdx_2_129rfcz44zxflyaf6d65fdvaqtk5rlvdu8nzek2nz435zknhqure2xl") => + AccountAddress::from_str("account_tdx_2_129rfcz44zxflyaf6d65fdvaqtk5rlvdu8nzek2nz435zknhqure2xl").unwrap() => AccountDeposits::new_for_test( vec![ - SimpleResourceBounds::fungible("resource_tdx_2_1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxtfd2jc", SimpleCountedResourceBounds::unknown_amount()), - SimpleResourceBounds::fungible("resource_tdx_2_1th4gzm9rk5s28yf5gud0a32m082g4x60d6na4ecsccte032y3xu785", SimpleCountedResourceBounds::at_least(6)), - SimpleResourceBounds::fungible("resource_tdx_2_1tkd957yt3rwqze7elmzlphfjnmfyzkf9l5rau5ccsx9h2vs9nq3tzp", SimpleCountedResourceBounds::at_most(10)), - SimpleResourceBounds::fungible("resource_tdx_2_1t5jcmwqx39ym7fw0hrlpnxwechr0mzlgulcfcye59qm9y9fa5uvdrd", SimpleCountedResourceBounds::between(100, 159)), - SimpleResourceBounds::fungible("resource_tdx_2_1t5dapa24l4xvwqtqe2jrdphtn7ga46gw67wr9fwn4gp532myfjqpck", SimpleCountedResourceBounds::exact(3)), - - SimpleResourceBounds::fungible("resource_tdx_2_1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxtfd2jc", SimpleCountedResourceBounds::unknown_amount()), - SimpleResourceBounds::fungible("resource_tdx_2_1th4gzm9rk5s28yf5gud0a32m082g4x60d6na4ecsccte032y3xu785", SimpleCountedResourceBounds::at_least(6)), - SimpleResourceBounds::fungible("resource_tdx_2_1tkd957yt3rwqze7elmzlphfjnmfyzkf9l5rau5ccsx9h2vs9nq3tzp", SimpleCountedResourceBounds::at_most(10)), - SimpleResourceBounds::fungible("resource_tdx_2_1t5jcmwqx39ym7fw0hrlpnxwechr0mzlgulcfcye59qm9y9fa5uvdrd", SimpleCountedResourceBounds::between(100, 159)), - SimpleResourceBounds::fungible("resource_tdx_2_1t5dapa24l4xvwqtqe2jrdphtn7ga46gw67wr9fwn4gp532myfjqpck", SimpleCountedResourceBounds::exact(3)), + SimpleResourceBounds::fungible("resource_tdx_2_1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxtfd2jc".parse::().unwrap(), SimpleCountedResourceBounds::unknown_amount()), + SimpleResourceBounds::fungible("resource_tdx_2_1th4gzm9rk5s28yf5gud0a32m082g4x60d6na4ecsccte032y3xu785".parse::().unwrap(), SimpleCountedResourceBounds::at_least(6)), + SimpleResourceBounds::fungible("resource_tdx_2_1tkd957yt3rwqze7elmzlphfjnmfyzkf9l5rau5ccsx9h2vs9nq3tzp".parse::().unwrap(), SimpleCountedResourceBounds::at_most(10)), + SimpleResourceBounds::fungible("resource_tdx_2_1t5jcmwqx39ym7fw0hrlpnxwechr0mzlgulcfcye59qm9y9fa5uvdrd".parse::().unwrap(), SimpleCountedResourceBounds::between(100, 159)), + SimpleResourceBounds::fungible("resource_tdx_2_1t5dapa24l4xvwqtqe2jrdphtn7ga46gw67wr9fwn4gp532myfjqpck".parse::().unwrap(), SimpleCountedResourceBounds::exact(3)), + + SimpleResourceBounds::fungible("resource_tdx_2_1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxtfd2jc".parse::().unwrap(), SimpleCountedResourceBounds::unknown_amount()), + SimpleResourceBounds::fungible("resource_tdx_2_1th4gzm9rk5s28yf5gud0a32m082g4x60d6na4ecsccte032y3xu785".parse::().unwrap(), SimpleCountedResourceBounds::at_least(6)), + SimpleResourceBounds::fungible("resource_tdx_2_1tkd957yt3rwqze7elmzlphfjnmfyzkf9l5rau5ccsx9h2vs9nq3tzp".parse::().unwrap(), SimpleCountedResourceBounds::at_most(10)), + SimpleResourceBounds::fungible("resource_tdx_2_1t5jcmwqx39ym7fw0hrlpnxwechr0mzlgulcfcye59qm9y9fa5uvdrd".parse::().unwrap(), SimpleCountedResourceBounds::between(100, 159)), + SimpleResourceBounds::fungible("resource_tdx_2_1t5dapa24l4xvwqtqe2jrdphtn7ga46gw67wr9fwn4gp532myfjqpck".parse::().unwrap(), SimpleCountedResourceBounds::exact(3)), ], UnspecifiedResources::MayBePresent, ), - AccountAddress::from("account_tdx_2_1288u4aka2dm8787texaeta8ruzhcr7dyckmnck5wt0llrm6x0ak7e4") => AccountDeposits::new_for_test( + AccountAddress::from_str("account_tdx_2_1288u4aka2dm8787texaeta8ruzhcr7dyckmnck5wt0llrm6x0ak7e4").unwrap() => AccountDeposits::new_for_test( vec![ - SimpleResourceBounds::fungible("resource_tdx_2_1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxtfd2jc", SimpleCountedResourceBounds::unknown_amount()), - SimpleResourceBounds::fungible("resource_tdx_2_1th4gzm9rk5s28yf5gud0a32m082g4x60d6na4ecsccte032y3xu785", SimpleCountedResourceBounds::at_least(6)), - SimpleResourceBounds::fungible("resource_tdx_2_1tkd957yt3rwqze7elmzlphfjnmfyzkf9l5rau5ccsx9h2vs9nq3tzp", SimpleCountedResourceBounds::at_most(10)), - SimpleResourceBounds::fungible("resource_tdx_2_1t5jcmwqx39ym7fw0hrlpnxwechr0mzlgulcfcye59qm9y9fa5uvdrd", SimpleCountedResourceBounds::between(100, 159)), - SimpleResourceBounds::fungible("resource_tdx_2_1t5dapa24l4xvwqtqe2jrdphtn7ga46gw67wr9fwn4gp532myfjqpck", SimpleCountedResourceBounds::exact(3)), + SimpleResourceBounds::fungible("resource_tdx_2_1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxtfd2jc".parse::().unwrap(), SimpleCountedResourceBounds::unknown_amount()), + SimpleResourceBounds::fungible("resource_tdx_2_1th4gzm9rk5s28yf5gud0a32m082g4x60d6na4ecsccte032y3xu785".parse::().unwrap(), SimpleCountedResourceBounds::at_least(6)), + SimpleResourceBounds::fungible("resource_tdx_2_1tkd957yt3rwqze7elmzlphfjnmfyzkf9l5rau5ccsx9h2vs9nq3tzp".parse::().unwrap(), SimpleCountedResourceBounds::at_most(10)), + SimpleResourceBounds::fungible("resource_tdx_2_1t5jcmwqx39ym7fw0hrlpnxwechr0mzlgulcfcye59qm9y9fa5uvdrd".parse::().unwrap(), SimpleCountedResourceBounds::between(100, 159)), + SimpleResourceBounds::fungible("resource_tdx_2_1t5dapa24l4xvwqtqe2jrdphtn7ga46gw67wr9fwn4gp532myfjqpck".parse::().unwrap(), SimpleCountedResourceBounds::exact(3)), ], UnspecifiedResources::NonePresent, ), diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/transaction_manifest_v2.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/transaction_manifest_v2.rs index ce1d36a10..08ec33355 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/transaction_manifest_v2.rs +++ b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/transaction_manifest_v2.rs @@ -476,7 +476,7 @@ DROP_AUTH_ZONE_PROOFS; #[test] fn manifest_summary_multi_account_resources_transfer() { - let a = AccountAddress::from("account_sim1cyvgx33089ukm2pl97pv4max0x40ruvfy4lt60yvya744cve475w0q"); + let a = AccountAddress::from_str("account_sim1cyvgx33089ukm2pl97pv4max0x40ruvfy4lt60yvya744cve475w0q").unwrap(); let manifest = SUT::sample_other(); let summary = manifest.summary().unwrap(); @@ -487,19 +487,19 @@ DROP_AUTH_ZONE_PROOFS; a => vec![AccountWithdraw::sample()], ), hashmap!( - AccountAddress::from("account_sim1c8mulhl5yrk6hh4jsyldps5sdrp08r5v9wusupvzxgqvhlp4c4nwjz") => + AccountAddress::from_str("account_sim1c8mulhl5yrk6hh4jsyldps5sdrp08r5v9wusupvzxgqvhlp4c4nwjz").unwrap() => AccountDeposits::new_for_test( vec![SimpleResourceBounds::exact_fungible(ResourceAddress::sample_sim_xrd(), 150)], UnspecifiedResources::NonePresent, ) , - AccountAddress::from("account_sim1c8ct6jdcwqrg3gzskyxuy0z933fe55fyjz6p56730r95ulzwl3ppva") => + AccountAddress::from_str("account_sim1c8ct6jdcwqrg3gzskyxuy0z933fe55fyjz6p56730r95ulzwl3ppva").unwrap() => AccountDeposits::new_for_test( vec![SimpleResourceBounds::exact_fungible(ResourceAddress::sample_sim_xrd(), 50)], UnspecifiedResources::NonePresent, ) , - AccountAddress::from("account_sim1c8s2hass5g62ckwpv78y8ykdqljtetv4ve6etcz64gveykxznj36tr") => + AccountAddress::from_str("account_sim1c8s2hass5g62ckwpv78y8ykdqljtetv4ve6etcz64gveykxznj36tr").unwrap() => AccountDeposits::new_for_test( vec![SimpleResourceBounds::exact_fungible(ResourceAddress::sample_sim_xrd(), 130)], UnspecifiedResources::NonePresent, @@ -510,9 +510,9 @@ DROP_AUTH_ZONE_PROOFS; a ], [ - AccountAddress::from("account_sim1c8mulhl5yrk6hh4jsyldps5sdrp08r5v9wusupvzxgqvhlp4c4nwjz"), - AccountAddress::from("account_sim1c8s2hass5g62ckwpv78y8ykdqljtetv4ve6etcz64gveykxznj36tr"), - AccountAddress::from("account_sim1c8ct6jdcwqrg3gzskyxuy0z933fe55fyjz6p56730r95ulzwl3ppva"), + AccountAddress::from_str("account_sim1c8mulhl5yrk6hh4jsyldps5sdrp08r5v9wusupvzxgqvhlp4c4nwjz").unwrap(), + AccountAddress::from_str("account_sim1c8s2hass5g62ckwpv78y8ykdqljtetv4ve6etcz64gveykxznj36tr").unwrap(), + AccountAddress::from_str("account_sim1c8ct6jdcwqrg3gzskyxuy0z933fe55fyjz6p56730r95ulzwl3ppva").unwrap(), ], [], [a], @@ -544,7 +544,7 @@ DROP_AUTH_ZONE_PROOFS; ) .unwrap(); let pool_addresses = sut.involved_pool_addresses(); - assert_eq!(pool_addresses, ["pool_tdx_2_1c5mygu9t8rlfq6j8v2ynrg60ltts2dctsghust8u2tuztrml427830"].into_iter().map(PoolAddress::from).collect_vec()); + assert_eq!(pool_addresses, ["pool_tdx_2_1c5mygu9t8rlfq6j8v2ynrg60ltts2dctsghust8u2tuztrml427830"].into_iter().map(PoolAddress::from_str).map(Result::unwrap).collect_vec()); } #[test] diff --git a/jvm/sargon-android/src/test/java/com/radixdlt/sargon/FactorSourceIdTest.kt b/jvm/sargon-android/src/test/java/com/radixdlt/sargon/FactorSourceIdTest.kt index 022e35191..11ed031b6 100644 --- a/jvm/sargon-android/src/test/java/com/radixdlt/sargon/FactorSourceIdTest.kt +++ b/jvm/sargon-android/src/test/java/com/radixdlt/sargon/FactorSourceIdTest.kt @@ -4,6 +4,7 @@ import com.radixdlt.sargon.extensions.asGeneral import com.radixdlt.sargon.extensions.fromJson import com.radixdlt.sargon.extensions.hex import com.radixdlt.sargon.extensions.init +import com.radixdlt.sargon.extensions.string import com.radixdlt.sargon.extensions.randomBagOfBytes import com.radixdlt.sargon.extensions.toJson import com.radixdlt.sargon.samples.sampleMainnet @@ -25,7 +26,7 @@ class FactorSourceIdTest { val addressFactorSourceId = FactorSourceIdFromAddress( kind = FactorSourceKind.TRUSTED_CONTACT, - body = AccountAddress.sampleMainnet() + body = AccountAddress.sampleMainnet().string ) assertEquals( FactorSourceId.Address(addressFactorSourceId), @@ -47,7 +48,7 @@ class FactorSourceIdTest { val sutAddress = FactorSourceIdFromAddress( kind = FactorSourceKind.TRUSTED_CONTACT, - body = AccountAddress.sampleMainnet() + body = AccountAddress.sampleMainnet().string ).asGeneral() assertEquals( diff --git a/jvm/sargon-android/src/test/java/com/radixdlt/sargon/FactorSourceTest.kt b/jvm/sargon-android/src/test/java/com/radixdlt/sargon/FactorSourceTest.kt index cfe9bebfc..96b8d4823 100644 --- a/jvm/sargon-android/src/test/java/com/radixdlt/sargon/FactorSourceTest.kt +++ b/jvm/sargon-android/src/test/java/com/radixdlt/sargon/FactorSourceTest.kt @@ -10,6 +10,7 @@ import com.radixdlt.sargon.extensions.olympia import com.radixdlt.sargon.extensions.supportsBabylon import com.radixdlt.sargon.extensions.supportsOlympia import com.radixdlt.sargon.extensions.name +import com.radixdlt.sargon.extensions.string import com.radixdlt.sargon.samples.Sample import com.radixdlt.sargon.samples.sample import com.radixdlt.sargon.samples.sampleMainnet @@ -190,7 +191,7 @@ class FactorSourceTest : SampleTestable { private val trustedContact = FactorSource.TrustedContact( value = TrustedContactFactorSource( id = FactorSourceIdFromAddress( - kind = FactorSourceKind.TRUSTED_CONTACT, body = AccountAddress.sampleMainnet() + kind = FactorSourceKind.TRUSTED_CONTACT, body = AccountAddress.sampleMainnet().string ), common = FactorSourceCommon( cryptoParameters = FactorSourceCryptoParameters( From 1b27e20901cfc3ad928d6e777c46a1ba97ec86ef Mon Sep 17 00:00:00 2001 From: Alexander Cyon <116169792+CyonAlexRDX@users.noreply.github.com> Date: Thu, 2 Jan 2025 13:29:50 +0100 Subject: [PATCH 06/13] Split out Profile, Gateway, FIP, Drivers, Clients, Manifest building and TX models (#326) --- Cargo.lock | 718 +++++++- Cargo.toml | 139 +- Package.resolved | 12 +- _typos.toml | 2 +- .../AccountOrAddressOf+Wrap+Functions.swift | 2 +- .../AccountOrAddressOf+SampleValues.swift | 2 +- .../AccountOrAddressOf+Swiftified.swift | 12 +- .../ManifestBuildingTests.swift | 15 +- ...WalletToDappInteractionResponseTests.swift | 7 +- .../Transaction/AccountOrAddressOfTests.swift | 2 +- apple/Tests/Utils/Test.swift | 5 +- codecov.yml | 22 - crates/.DS_Store | Bin 6148 -> 0 bytes crates/gateway-client-and-api/Cargo.toml | 25 + .../src}/assert_network_request.rs | 0 .../src/client/gateway_client.rs} | 125 +- .../client/gateway_client_dispatch_request.rs | 14 +- .../src}/client/mod.rs | 0 .../src/endpoints/mod.rs | 3 + .../src}/endpoints/state_endpoints.rs | 16 +- .../src}/endpoints/status_endpoints.rs | 2 +- .../src}/endpoints/transaction_endpoints.rs | 12 +- crates/gateway-client-and-api/src/lib.rs | 18 + .../src}/methods/mod.rs | 4 - .../src}/methods/page_methods.rs | 3 +- .../src}/methods/state_methods.rs | 6 +- .../src}/methods/transaction_methods.rs | 1 - crates/gateway-models/Cargo.toml | 21 + crates/gateway-models/build.rs | 14 + ...ity_details__single_account_no_assets.json | 0 ...quest_entity_details__single_resource.json | 0 .../request_entity_details__two_accounts.json | 0 ...ingle_account_many_nfts_and_fungibles.json | 0 ...ity_details__single_account_no_assets.json | 0 ...ponse_entity_details__single_resource.json | 0 ..._details__single_resource_no_metadata.json | 0 ...response_entity_details__two_accounts.json | 0 ...ty_details_details__fungible_resource.json | 0 ...etails_details__non_fungible_resource.json | 0 .../models}/transaction/request_preview.json | 0 .../models}/transaction/request_status.json | 0 .../models}/transaction/request_submit.json | 0 .../transaction/response_construction.json | 0 .../models}/transaction/response_preview.json | 0 .../response_status__committed_success.json | 0 .../transaction/response_status__pending.json | 0 .../models}/transaction/response_submit.json | 0 crates/gateway-models/src/lib.rs | 66 + .../src}/types/mod.rs | 0 .../src}/types/request/gw_public_key.rs | 2 +- .../src/types/request/gw_public_key_serde.rs} | 0 .../types/request/ledger_state_selector.rs | 8 +- .../src}/types/request/mod.rs | 1 + .../src}/types/request/state/account/mod.rs | 0 .../account/page/authorized_depositors.rs | 8 +- .../types/request/state/account/page/mod.rs | 0 .../account/page/resource_preferences.rs | 8 +- .../types/request/state/entity/details/mod.rs | 0 .../request/state/entity/details/opt_ins.rs | 0 .../request/state/entity/details/request.rs | 44 +- .../src}/types/request/state/entity/mod.rs | 0 .../request/state/entity/page/fungibles.rs | 8 +- .../types/request/state/entity/page/mod.rs | 0 .../entity/page/non_fungible_vault_ids.rs | 12 +- .../state/entity/page/non_fungible_vaults.rs | 14 +- .../state/entity/page/non_fungibles.rs | 8 +- .../src}/types/request/state/mod.rs | 0 .../request/state/non_fungible/location.rs | 0 .../types/request/state/non_fungible/mod.rs | 0 .../src}/types/request/transaction/mod.rs | 0 .../types}/request/transaction/preview/mod.rs | 0 .../request/transaction/preview/opt_ins.rs | 14 + .../request/transaction/preview/opt_ins_v2.rs | 29 + .../transaction/preview/request_flags.rs | 20 + .../preview/transaction_preview.rs | 41 + .../preview/transaction_preview_v2.rs | 49 +- .../types/request/transaction/status/mod.rs | 0 .../transaction/status/subintent_status.rs | 2 +- .../transaction/status/transaction_status.rs | 2 +- .../types}/request/transaction/submit/mod.rs | 0 .../transaction/submit/transaction_submit.rs | 13 + .../src}/types/response/ledger_state.rs | 14 + .../src}/types/response/mod.rs | 0 .../src}/types/response/page_response.rs | 0 .../src}/types/response/state/account/mod.rs | 0 .../account/page/authorized_depositor.rs | 42 + .../types/response/state/account/page/mod.rs | 0 .../state/account/page/resource_preference.rs | 12 + .../state/entity/details/details/item.rs | 0 .../entity/details/details/item_component.rs | 0 .../details/details/item_fungible_resource.rs | 0 .../details/item_non_fungible_resource.rs | 0 .../entity/details/details/item_package.rs | 0 .../state/entity/details/details/mod.rs | 0 .../details/role_assignments/assignment.rs | 0 .../details/role_assignments/collection.rs | 0 .../details/details/role_assignments/entry.rs | 0 .../details/role_assignments/explicit_rule.rs | 0 .../details/details/role_assignments/mod.rs | 0 .../details/role_assignments/module.rs | 0 .../details/details/role_assignments/owner.rs | 0 .../details/role_assignments/resolution.rs | 0 .../details/role_assignments/role_key.rs | 0 .../entity/details/fungible/collection.rs | 0 .../details/fungible/collection_item.rs | 74 + .../fungible/collection_item_global.rs | 0 .../state/entity/details/fungible/mod.rs | 0 .../entity/details/metadata/collection.rs | 1 - .../state/entity/details/metadata/item.rs | 0 .../entity/details/metadata/item_value.rs | 0 .../state/entity/details/metadata/mod.rs | 0 .../entity/details/metadata/typed_value.rs | 0 .../response/state/entity/details/mod.rs | 0 .../entity/details/non_fungible/collection.rs | 0 .../details/non_fungible/collection_item.rs | 0 .../non_fungible/collection_item_global.rs | 0 .../state/entity/details/non_fungible}/mod.rs | 0 .../state/entity/details/response.rs} | 20 + .../state/entity/details/response_item.rs} | 43 + .../src}/types/response/state/entity/mod.rs | 0 .../types/response/state/entity/page/mod.rs | 0 .../entity/page/non_fungible_vault_item.rs | 0 .../src}/types/response/state/mod.rs | 0 .../response/state/non_fungible/location.rs | 0 .../types/response/state/non_fungible/mod.rs | 0 .../types/response/status/gateway_status.rs | 0 .../src}/types/response/status/mod.rs | 0 .../response/transaction/construction/mod.rs | 0 .../transaction_construction_response.rs | 12 + .../src/types}/response/transaction/mod.rs | 0 .../transaction/preview/logs_inner.rs | 0 .../types/response/transaction/preview/mod.rs | 0 .../preview/transaction_preview_response.rs | 17 + .../transaction_preview_response_v2.rs | 0 .../preview/transaction_receipt.rs | 0 .../preview/transaction_receipt_status.rs | 0 .../types/response/transaction/status/mod.rs | 0 .../transaction/status/payload_item.rs | 5 + .../transaction/status/payload_status.rs | 0 .../transaction/status/transaction_status.rs | 16 +- .../transaction/subintent_status/mod.rs | 0 .../transaction/subintent_status/response.rs | 58 + .../transaction/subintent_status/status.rs | 0 .../types}/response/transaction/submit/mod.rs | 0 .../response/transaction/submit/submit.rs | 13 + .../types/support/fetch_resources_output.rs | 20 - .../fetch_transferable_resources_output.rs | 0 .../src}/types/support/mod.rs | 0 crates/http-client/Cargo.toml | 19 + crates/http-client/src/http_client.rs | 75 + crates/http-client/src/lib.rs | 10 + crates/identified-vec-of/Cargo.toml | 14 +- .../Cargo.toml | 22 + .../src}/agnostic_paths/derivation_preset.rs | 0 .../agnostic_paths/index_agnostic_path.rs | 2 - .../src}/agnostic_paths/mod.rs | 0 .../quantified_derivation_preset.rs | 0 .../src}/agnostic_paths/quantities.rs | 0 .../src/lib.rs | 14 + ...ion_entity_index_with_ephemeral_offsets.rs | 0 ...ith_ephemeral_offsets_for_factor_source.rs | 2 - crates/sargon-addresses/Cargo.toml | 8 +- .../src/address/account_address.rs | 2 + crates/sargon-clients/Cargo.toml | 64 + .../src}/clients/README.md | 0 .../client/entropy_client/entropy_client.rs | 0 .../src}/clients/client/entropy_client/mod.rs | 0 .../event_bus_client/event_bus_client.rs | 0 .../clients/client/event_bus_client/mod.rs | 0 .../cache}/factor_instances_cache.rs | 101 +- .../cache}/keyed_instances.rs | 0 .../cache}/mod.rs | 0 .../factor_instances_cache_snapshot.rs | 4 +- .../factor_source_id_from_hash_dense_key.rs | 0 .../cache}/serializable_cache/mod.rs | 0 .../factor_instances_cache_client/client.rs} | 6 +- .../factor_instances_cache_client/mod.rs | 7 + .../models/mod.rs | 3 + .../models/outcome.rs | 92 + .../file_system_client/file_system_client.rs | 1 - .../clients/client/file_system_client/mod.rs | 0 .../host_info_client/host_info_client.rs | 6 +- .../clients/client/host_info_client/mod.rs | 0 .../src}/clients/client/mod.rs | 2 - .../client/profile_change_client/mod.rs | 0 .../profile_change_client.rs | 0 .../client/secure_storage_client/mod.rs | 0 .../secure_storage_client.rs | 49 +- .../client/unsafe_storage_client/mod.rs | 0 .../unsafe_storage_client.rs | 0 .../src}/clients/clients.rs | 6 +- .../src}/clients/mod.rs | 0 crates/sargon-clients/src/lib.rs | 14 + crates/sargon-core-assert-json/Cargo.toml | 9 +- crates/sargon-core-error/Cargo.toml | 11 +- crates/sargon-core-utils/Cargo.toml | 4 +- crates/sargon-core/Cargo.toml | 31 +- .../src}/appendable_collection.rs | 8 - crates/sargon-core/src/lib.rs | 9 + .../src}/metadata.rs | 1 - crates/sargon-drivers/Cargo.toml | 61 + .../src}/drivers/README.md | 0 .../src}/drivers/drivers.rs | 1 - .../entropy_provider_driver.rs | 0 .../drivers/entropy_provider_driver/mod.rs | 0 .../entropy_provider_driver/support/mod.rs | 0 .../support/test/mod.rs | 0 .../support/test/rust_entropy_driver.rs | 0 .../event_bus_driver/event_bus_driver.rs | 0 .../src}/drivers/event_bus_driver/mod.rs | 0 .../drivers/event_bus_driver/support/event.rs | 3 - .../event_bus_driver/support/event_kind.rs | 4 - .../support/event_notification.rs | 0 .../support/event_profile_modified.rs | 57 + .../support/has_event_kind.rs | 0 .../drivers/event_bus_driver/support/mod.rs | 0 .../event_bus_driver/support/test/mod.rs | 0 .../support/test/rust_event_bus_driver.rs | 0 .../file_system_driver/file_system_driver.rs | 0 .../src}/drivers/file_system_driver/mod.rs | 0 .../drivers/file_system_driver/support/mod.rs | 0 .../test/in_memory_file_system_driver.rs | 2 - .../file_system_driver/support/test/mod.rs | 0 .../support/test/rust_file_system_driver.rs | 0 .../host_info_driver/host_info_driver.rs | 0 .../src}/drivers/host_info_driver/mod.rs | 0 .../drivers/host_info_driver/support/mod.rs | 0 .../host_info_driver/support/test/mod.rs | 0 .../support/test/rust_host_info_driver.rs | 0 .../drivers/logging_driver/logging_driver.rs | 0 .../src}/drivers/logging_driver/mod.rs | 0 .../logging_driver/support/log_level.rs | 0 .../drivers/logging_driver/support/mod.rs | 0 .../logging_driver/support/test/mod.rs | 0 .../support/test/rust_logging_driver.rs | 0 .../src}/drivers/mod.rs | 0 .../src}/drivers/networking_driver/mod.rs | 0 .../networking_driver/networking_driver.rs | 0 .../drivers/networking_driver/support/mod.rs | 2 - .../support/network_method.rs | 0 .../support/network_request.rs | 0 .../support/network_response.rs | 0 .../support/test/mock_networking_driver.rs | 2 - .../networking_driver/support/test/mod.rs | 7 +- .../support/test/rust_networking_driver.rs | 0 .../src}/drivers/profile_change_driver/mod.rs | 0 .../profile_change_driver.rs | 0 .../profile_change_driver/support/mod.rs | 0 .../profile_change_driver/support/test/mod.rs | 2 - .../test/rust_profile_change_driver.rs | 0 .../src}/drivers/secure_storage_driver/mod.rs | 0 .../secure_storage_driver.rs | 0 .../secure_storage_driver/support/mod.rs | 0 .../secure_storage_access_error_kind.rs | 0 .../support/secure_storage_key.rs | 1 - .../support/test/ephemeral_secure_storage.rs | 2 - .../support/test/fail_secure_storage.rs | 4 +- .../secure_storage_driver/support/test/mod.rs | 6 +- .../src}/drivers/unsafe_storage_driver/mod.rs | 0 .../support}/ephemeral_unsafe_storage.rs | 0 .../unsafe_storage_driver/support}/mod.rs | 5 +- .../support/unsafe_storage_key.rs | 0 .../unsafe_storage_driver.rs | 0 crates/sargon-drivers/src/lib.rs | 17 + .../Cargo.toml | 60 + .../src/lib.rs | 17 + .../src}/next_index_assigner/mod.rs | 4 - .../next_derivation_entity_index_assigner.rs | 0 ...n_entity_index_cache_analyzing_assigner.rs | 0 ...entity_index_profile_analyzing_assigner.rs | 0 .../provider/factor_instances_provider.rs | 1 - .../provider/instances_in_cache_consumer.rs | 0 .../src}/provider/mod.rs | 3 - .../factor_instances_provider_outcome.rs | 7 +- ...r_instances_provider_outcome_for_factor.rs | 17 +- ...ernal_factor_instances_provider_outcome.rs | 0 ...r_instances_provider_outcome_for_factor.rs | 0 .../src}/provider/outcome/mod.rs | 0 .../provider_adopters/cache_filler.rs | 0 .../src}/provider/provider_adopters/mod.rs | 0 ...curify_entity_factor_instances_provider.rs | 86 - ...rtual_entity_creating_instance_provider.rs | 0 .../src/types/mod.rs | 3 + ...n_interactor_from_secure_storage_client.rs | 22 + .../Cargo.toml | 18 + .../src/lib.rs | 11 + .../src/mnemonic_loading.rs | 22 + crates/sargon-factors/Cargo.toml | 43 +- .../src/factor_instance/factor_instances.rs | 8 + ...rarchical_deterministic_factor_instance.rs | 13 + .../Cargo.toml | 38 +- crates/sargon-keys-collector/Cargo.toml | 8 +- .../test_derivation_interactor.rs | 21 - crates/sargon-keys-collector/src/lib.rs | 1 + crates/sargon-manifests/Cargo.toml | 59 + crates/sargon-manifests/build.rs | 50 + .../transaction/account_locker_claim.rtm | 0 .../account_locker_claim_max_nft_items.rtm | 0 .../transaction/create_3_nft_collections.rtm | 0 .../create_access_controller_for_account.rtm | 0 .../create_access_controller_for_persona.rtm | 0 .../src}/bucket.rs | 5 +- .../src}/bucket_factory.rs | 2 +- .../delete_account/delete_account_transfer.rs | 0 .../delete_account_transfers.rs | 0 .../delete_account/manifest_delete_account.rs | 19 +- .../src}/delete_account/mod.rs | 0 .../src}/high_level/mod.rs | 2 - .../account_locker_claimable_resource.rs | 0 .../account_locker/mod.rs | 0 .../assets_transfers/mod.rs | 4 +- .../owned_or_third_party_account_address.rs} | 73 +- .../assets_transfers/per_asset/mod.rs | 2 - .../per_asset/per_asset_fungible_resource.rs | 0 .../per_asset/per_asset_fungible_transfer.rs | 26 +- .../per_asset_non_fungible_transfer.rs | 26 +- .../per_asset/per_asset_transfers.rs | 0 ...er_asset_transfers_of_fungible_resource.rs | 0 ...sset_transfers_of_non_fungible_resource.rs | 0 .../assets_transfers/per_recipient/mod.rs | 2 - .../per_recipient_asset_transfer.rs | 12 +- .../per_recipient_asset_transfers.rs | 37 +- .../per_recipient_fungible_transfer.rs | 0 .../per_recipient_non_fungibles_transfer.rs | 0 .../assets_transfers/transfer_types.rs | 6 +- .../dependency_information.rs | 0 .../build_information/mod.rs | 0 .../sargon_build_information.rs | 0 .../build_information/sargon_dependencies.rs | 0 .../high_level/sargon_specific_types/mod.rs | 2 - .../sargon_specific_types/stake_claim.rs | 0 .../sargon_specific_types/transaction/mod.rs | 0 .../transaction/transaction_status.rs | 0 .../transaction/transaction_status_reason.rs | 0 .../transaction_guarantee.rs | 0 .../high_level/token_definition_metadata.rs | 1 - crates/sargon-manifests/src/lib.rs | 154 ++ .../src}/manifest_account_locker.rs | 26 +- .../src}/manifest_assets_transfers.rs | 19 +- .../src}/manifests.rs | 111 +- .../src}/manifests_access_controller.rs | 15 +- .../src}/manifests_create_tokens.rs | 120 +- .../src}/modify_manifest.rs | 64 +- .../sample_resource_definition_metadata.json | 0 .../manifest_third_party_deposit_update.rs | 17 +- .../src}/third_party_deposit_update/mod.rs | 0 .../third_party_deposits_delta.rs | 31 +- .../sargon-profile-app-preferences/Cargo.toml | 62 + .../app_display_settings.rs | 0 .../app_display_settings/fiat_currency.rs | 0 .../src}/app_display_settings/mod.rs | 0 .../src}/app_preferences.rs | 0 .../sargon-profile-app-preferences/src/lib.rs | 14 + .../src}/security.rs | 0 .../src}/transaction_preferences.rs | 0 crates/sargon-profile-gateway/Cargo.toml | 60 + .../src}/gateway.rs | 3 +- crates/sargon-profile-gateway/src/lib.rs | 13 + .../src}/network_definition.rs | 4 +- .../src}/saved_gateways.rs | 87 +- crates/sargon-profile-logic/Cargo.toml | 32 + crates/sargon-profile-logic/src/lib.rs | 13 + .../src}/logic/account/account_visibility.rs | 11 +- .../src}/logic/account/accounts_visibility.rs | 0 .../src}/logic/account/mod.rs | 2 - .../src}/logic/account/query_accounts.rs | 152 +- .../account/query_security_structures.rs | 20 +- .../src/logic/authorized_dapps_logic.rs | 29 + .../src}/logic/gateway/current_gateway.rs | 148 +- .../src}/logic/gateway/mod.rs | 0 .../instances_deriving_with_factor_sources.rs | 77 + .../src}/logic/mod.rs | 7 +- .../src}/logic/persona/mod.rs | 2 - .../src}/logic/persona/persona_data_ids.rs | 8 +- .../src}/logic/persona/query_personas.rs | 53 - .../logic/persona/shared_persona_data_ids.rs | 8 +- .../src}/logic/profile_header.rs | 23 +- .../src}/logic/profile_network/mod.rs | 0 .../profile_network_details.rs | 35 +- ...etwork_entities_linked_to_factor_source.rs | 12 +- .../profile_network_get_entities.rs | 85 +- .../src/logic/profile_networks.rs | 403 +++++ .../src/logic/profile_update.rs | 518 ++++++ .../src}/logic/query_factor_sources.rs | 77 +- ...trix_of_factor_instances_index_agnostic.rs | 73 + crates/sargon-profile-logic/src/tests/mod.rs | 1 + .../Cargo.toml | 59 + .../src}/factor_list_kind.rs | 2 +- .../src/lib.rs | 30 + .../src}/role_kind.rs | 0 .../auto_build_outcome_for_testing.rs | 0 .../automatic_shield_builder.rs | 3 - .../factor_selector.rs | 0 .../automatic_shield_builder/mod.rs | 1 - .../automatic_shield_builder/proto_shield.rs | 0 .../automatic_shield_builder/quantity.rs | 0 ...al_role_with_hd_factor_instance_samples.rs | 14 +- .../has_role_kind.rs | 0 .../abstract_matrix_builder_or_built.rs | 42 + .../matrices/builder/error.rs | 0 .../matrices/builder/matrix_builder.rs | 0 .../builder/matrix_builder_unit_tests.rs | 0 .../matrices/builder/matrix_template.rs | 0 .../matrices/builder/mod.rs | 0 .../matrices/matrix_of_factor_instances.rs | 171 +- .../matrices/matrix_of_factor_source_ids.rs | 0 .../matrices/matrix_of_factor_sources.rs | 0 .../matrices/mod.rs | 0 .../src/roles_matrices_structures}/mod.rs | 1 + .../roles/abstract_role_builder_or_built.rs | 6 +- .../confirmation_roles_builder_unit_tests.rs | 0 .../roles/builder/mod.rs | 0 .../primary_roles_builder_unit_tests.rs | 0 .../recovery_roles_builder_unit_tests.rs | 0 .../roles/builder/roles_builder.rs | 2 - .../roles/builder/roles_builder_unit_tests.rs | 0 ...confirmation_role_with_factor_instances.rs | 0 ...archical_deterministic_factor_instances.rs | 0 .../factor_instance_level/mod.rs | 3 +- .../primary_role_with_factor_instances.rs | 0 .../recovery_role_with_factor_instances.rs | 0 .../role_into_scrypto_access_rule.rs | 0 .../role_with_factor_instances.rs | 0 ...onfirmation_role_with_factor_source_ids.rs | 0 .../factor_source_id_level/mod.rs | 0 .../primary_role_with_factor_source_ids.rs | 0 .../recovery_role_with_factor_source_ids.rs | 0 .../roles_with_factor_ids.rs | 0 .../factor_source_kind_level/mod.rs | 0 .../factor_source_kind_level/role_template.rs | 0 .../confirmation_role_with_factor_sources.rs | 0 .../factor_levels/factor_source_level/mod.rs | 2 +- .../primary_role_with_factor_sources.rs | 0 .../recovery_role_with_factor_sources.rs | 0 .../roles_with_factor_sources.rs | 0 .../roles/factor_levels/mod.rs | 0 .../roles_matrices_structures}/roles/mod.rs | 0 .../security_shield_builder.rs | 0 .../security_shield_builder_invalid_reason.rs | 0 .../security_shield_prerequisites_status.rs | 0 .../security_structure_id.rs | 0 .../security_structure_metadata.rs | 0 .../abstract_security_structure_of_factors.rs | 12 +- .../security_structure_of_factors/mod.rs | 0 .../security_structure_of_factor_instances.rs | 0 ...security_structure_of_factor_source_ids.rs | 0 .../security_structure_of_factor_sources.rs | 0 .../selected_factor_sources_status.rs | 0 .../Cargo.toml | 31 + .../src}/abstract_securified_entity.rs | 0 .../src}/any_securified_entity.rs | 0 .../src}/assert_derivation_path.rs | 14 +- .../src}/is_securified_entity.rs | 2 +- .../src/lib.rs | 27 + .../src/profile_state.rs | 17 + .../src}/securified_account.rs | 0 .../src}/securified_persona.rs | 0 .../src}/unsecurified_entity.rs | 0 .../src}/veci.rs | 0 crates/sargon-profile/Cargo.toml | 72 + crates/sargon-profile/build.rs | 14 + .../vector/huge_profile_1000_accounts.json | 0 ...rsion_100_patch_after_app_version_120.json | 1448 ++++++++++++++++ ...laintext_profile_snapshot_version_100.json | 1229 ++++++++++++++ .../profile_encrypted_by_password_empty.json | 0 ...file_encrypted_by_password_of_babylon.json | 0 .../encrypted_profile_snapshot.rs | 0 .../src}/encrypted/encrypted_profile/mod.rs | 0 .../src}/encrypted/key_derivation/mod.rs | 0 .../password_based_key_derivation_scheme.rs | 2 - ...ord_based_key_derivation_scheme_version.rs | 0 ...versioned_password_based_key_derivation.rs | 0 .../src}/encrypted/mod.rs | 0 .../src}/encrypted/pb_hkdf_sha256.rs | 0 .../src}/encrypted/versioned_algorithm.rs | 0 crates/sargon-profile/src/lib.rs | 28 + .../src}/profilesnapshot_version.rs | 7 +- .../access_controller_address_samples.rs | 5 +- .../src}/samples/account_address_samples.rs | 1 - .../src}/samples/account_samples.rs | 29 +- .../src}/samples/identity_address_samples.rs | 0 .../src}/samples/mod.rs | 6 - .../src}/samples/persona_samples.rs | 39 +- .../src}/samples/profile_samples.rs | 0 .../supporting_types/account_for_display.rs | 0 .../supporting_types/account_or_persona.rs | 5 + .../supporting_types/accounts_for_display.rs | 0 .../supporting_types/accounts_or_personas.rs | 0 .../authorized_dapp_detailed.rs | 0 .../authorized_persona_detailed.rs | 0 .../detailed_authorized_personas.rs | 0 .../src}/supporting_types/mod.rs | 0 .../on_same_network_validating.rs | 0 .../entities_linked_to_factor_source.rs | 0 .../integrity/device.rs | 0 .../integrity/integrity.rs | 0 .../integrity/mod.rs | 0 .../entities_linked_to_factor_source/mod.rs | 0 .../profile_to_check.rs | 0 .../src}/v100/entity/abstract_entity_type.rs | 0 .../src}/v100/entity/account/account.rs | 29 +- .../src}/v100/entity/account/mod.rs | 0 .../entity/account/on_ledger_settings/mod.rs | 3 + .../on_ledger_settings/on_ledger_settings.rs | 0 .../src}/v100/entity/entity_flag.rs | 0 .../src}/v100/entity/entity_flags.rs | 0 .../src}/v100/entity/has_security_state.rs | 6 - .../src}/v100/entity/is_entity.rs | 11 - .../src}/v100/entity/mod.rs | 0 .../src}/v100/entity/persona/mod.rs | 0 .../src}/v100/entity/persona/persona.rs | 31 +- .../collection_of_email_addresses.rs | 0 .../collection_of_phone_numbers.rs | 0 .../persona/persona_data/entry_kinds/mod.rs | 0 .../persona_data_entry_email_address.rs | 0 .../entry_kinds/persona_data_entry_name.rs | 0 .../persona_data_entry_phone_number.rs | 0 .../v100/entity/persona/persona_data/mod.rs | 2 +- .../persona/persona_data/persona_data.rs | 0 .../persona_data/persona_data_entry_id.rs | 0 ...ersona_data_identified_collection_types.rs | 0 .../persona_data_identified_entry_types.rs | 0 .../entity_security_state.rs | 3 +- .../src}/v100/entity_security_state/mod.rs | 0 .../provisional_securified_config.rs | 0 ...ovisional_securified_transaction_queued.rs | 0 .../unsecured_entity_control.rs | 1 - .../src}/v100/header/content_hint.rs | 0 .../src}/v100/header/device_info.rs | 0 .../src}/v100/header/header.rs | 0 .../src}/v100/header/mod.rs | 0 .../src}/v100/header/profile_id.rs | 0 .../src}/v100/mod.rs | 6 +- .../src}/v100/networks/mod.rs | 0 .../src}/v100/networks/network/accounts.rs | 0 .../authorized_dapp/authorized_dapp.rs | 15 - .../authorized_persona_simple.rs | 2 +- .../networks/network/authorized_dapp/mod.rs | 2 +- .../authorized_dapp_preference_deposits.rs | 0 .../authorized_dapp_preferences.rs | 0 .../authorized_dapp/preferences/mod.rs | 0 .../references_to_authorized_personas.rs | 0 .../authorized_dapp/shared_persona_data.rs | 0 ..._to_dapp_with_persona_account_addresses.rs | 0 ...ith_persona_ids_of_persona_data_entries.rs | 0 .../authorized_dapp/shared_with_dapp.rs | 0 .../v100/networks/network/authorized_dapps.rs | 13 - .../src}/v100/networks/network/mod.rs | 0 .../src}/v100/networks/network/personas.rs | 0 .../v100/networks/network/profile_network.rs | 88 - .../resource_preferences/hidden_resources.rs | 0 .../network/resource_preferences/mod.rs | 0 .../resource_app_preference.rs | 0 .../resource_identifier.rs | 0 .../resource_preferences.rs | 2 - .../resource_visibility.rs | 0 .../src}/v100/networks/profile_networks.rs | 194 +-- .../src}/v100/profile.rs | 448 +---- .../src}/v100/profile_file_contents.rs | 0 ...oto_profile_maybe_with_legacy_p2p_links.rs | 0 .../src/v100}/secured_entity_control/mod.rs | 0 .../secured_entity_control.rs | 0 crates/sargon-transaction-models/Cargo.toml | 54 + crates/sargon-transaction-models/build.rs | 14 + .../fixtures/transaction/account_delete.dat | 0 .../fixtures/transaction/account_delete.rtm | 0 ...cker_claim_fungibles_and_non_fungibles.dat | 0 ...cker_claim_fungibles_and_non_fungibles.rtm | 0 .../claim_two_stakes_from_one_validator.dat | 0 .../claim_two_stakes_from_one_validator.rtm | 0 .../transaction/contribute_to_bi_pool.dat | 0 .../transaction/contribute_to_bi_pool.rtm | 0 .../transaction/create_3_nft_collections.rtm | 1506 +++++++++++++++++ .../create_access_controller_for_account.rtm | 98 ++ .../create_access_controller_for_persona.rtm | 92 + .../transaction/create_nft_collection.dat | 0 .../transaction/create_nft_collection.rtm | 0 .../fixtures/transaction/create_pool.dat | 0 .../fixtures/transaction/create_pool.rtm | 0 .../transaction/create_single_fungible.dat | 0 .../transaction/create_single_fungible.rtm | 0 .../transaction/mint_nft_gumball_card.dat | 0 .../transaction/mint_nft_gumball_card.rtm | 0 .../multi_account_resource_transfer.rtm | 0 ...ti_account_resource_transfer_subintent.rtm | 0 .../transaction/open_subintent_fungibles.rtm | 0 .../open_subintent_mix_multiple_deposits.rtm | 0 ...subintent_non_fungibles_no_certain_ids.rtm | 0 ...bintent_non_fungibles_with_certain_ids.rtm | 0 ...open_subintent_pool_stakes_stake_claim.rtm | 0 .../transaction/present_proof_swap_candy.dat | 0 .../transaction/present_proof_swap_candy.rtm | 0 .../transaction/redeem_from_bi_pool.dat | 0 .../transaction/redeem_from_bi_pool.rtm | 0 .../transaction/resource_transfer.rtm | 0 .../resource_transfer_subintent.rtm | 0 .../transaction/stake_to_three_validators.dat | 0 .../transaction/stake_to_three_validators.rtm | 0 .../third_party_deposits_update.dat | 0 .../third_party_deposits_update.rtm | 0 ...transfer_1to2_multiple_nf_and_f_tokens.dat | 0 ...transfer_1to2_multiple_nf_and_f_tokens.rtm | 0 .../unstake_partially_from_one_validator.dat | 0 .../unstake_partially_from_one_validator.rtm | 0 .../src}/assert_manifest.rs | 2 - .../src/error_from.rs | 0 .../src}/is_intent_signing.rs | 0 crates/sargon-transaction-models/src/lib.rs | 198 +++ .../low_level/compiled_notarized_intent.rs | 4 + .../low_level/compiled_transaction_intent.rs | 0 .../dynamically_analyzable_manifest.rs | 0 .../execution_summary/execution_summary.rs | 0 .../low_level/execution_summary/fee_locks.rs | 0 .../execution_summary/fee_summary.rs | 0 .../src}/low_level/execution_summary/mod.rs | 0 .../execution_summary/new_entities.rs | 0 .../newly_created_resource.rs | 0 .../execution_summary/reserved_instruction.rs | 0 .../fungible_resource_indicator.rs | 0 .../resource_indicator/mod.rs | 0 .../non_fungible_resource_indicator.rs | 0 .../resource_indicator/predicted.rs | 2 +- .../resource_indicator/resource_indicator.rs | 0 .../resource_specifier/mod.rs | 0 .../resource_specifier/resource_specifier.rs | 0 .../src}/low_level/intent_signature.rs | 0 .../manifest_encountered_component_address.rs | 0 .../account_deposit/account_deposits.rs | 1 - .../account_deposit/change_source.rs | 0 .../manifest_summary/account_deposit/mod.rs | 0 .../simple_counted_resource_bounds.rs | 0 .../simple_non_fungible_resource_bounds.rs | 2 - .../account_deposit/simple_resource_bounds.rs | 0 .../account_deposit/unspecified_resources.rs | 0 .../account_withdraw/account_withdraw.rs | 0 .../manifest_summary/account_withdraw/mod.rs | 0 .../manifest_summary/manifest_summary.rs | 0 .../src}/low_level/manifest_summary/mod.rs | 0 .../src}/low_level/mod.rs | 3 +- .../src}/low_level/notarized_transaction.rs | 0 .../src}/low_level/notary_signature.rs | 0 .../src}/low_level/sbor_depth_validation.rs | 9 +- .../src}/low_level/signed_intent.rs | 14 + .../statically_analyzable_manifest.rs | 0 .../detailed_manifest_class.rs | 2 +- .../detailed_manifest_class_kind.rs | 0 .../src}/low_level/transaction_classes/mod.rs | 0 .../transaction_classes/types/mod.rs | 0 .../types/resource_preference_update.rs | 0 .../types/tracked_pool_contribution.rs | 0 .../types/tracked_pool_redemption.rs | 0 .../types/tracked_validator_claim.rs | 0 .../types/tracked_validator_stake.rs | 0 .../transaction_classes/types/unstake_data.rs | 0 .../transaction_hashes/intent_hash.rs | 0 .../src}/low_level/transaction_hashes/mod.rs | 3 - .../transaction_hashes/signed_intent_hash.rs | 0 .../transaction_hashes/subintent_hash.rs | 0 .../transaction_hashes/transaction_hashes.rs | 2 +- .../validate_and_decode_hash.rs | 0 .../src}/low_level/v1/intent_signatures.rs | 0 .../src}/low_level/v1/message/message.rs | 0 .../src}/low_level/v1/message/mod.rs | 0 .../v1/message/plaintext_message/mod.rs | 0 .../plaintext_message/plaintext_message.rs | 0 .../plaintext_message_contents.rs | 0 .../src}/low_level/v1/mod.rs | 0 .../src}/low_level/v1/transaction_header.rs | 0 .../src}/low_level/v1/transaction_intent.rs | 6 + .../v1/transaction_manifest/blobs/blob.rs | 0 .../v1/transaction_manifest/blobs/blobs.rs | 0 .../v1/transaction_manifest/blobs/mod.rs | 0 .../execution_summary/mod.rs | 1 + .../transaction_manifest_execution_summary.rs | 15 +- .../instructions/instructions.rs | 13 +- .../transaction_manifest/instructions/mod.rs | 0 .../low_level/v1/transaction_manifest/mod.rs | 1 - .../transaction_manifest.rs | 8 +- .../src}/low_level/v2/compiled_subintent.rs | 0 .../src}/low_level/v2/intent_header_v2.rs | 0 .../low_level/v2/message_v2/message_v2.rs | 4 +- .../src}/low_level/v2/message_v2/mod.rs | 0 .../src}/low_level/v2/mod.rs | 0 .../v2/signed_partial_transaction.rs | 0 .../src}/low_level/v2/signed_subintent.rs | 14 + .../src}/low_level/v2/subintent.rs | 10 +- .../child_subintent_specifier.rs | 0 .../child_subintent_specifiers.rs | 0 .../execution_summary_v2/mod.rs | 1 + ...ansaction_manifest_execution_summary_v2.rs | 0 .../instructions_v2/instructions_v2.rs | 7 + .../instructions_v2/mod.rs | 0 .../v2/transaction_manifest_v2/mod.rs | 1 - .../subintent_manifest.rs | 2 - .../transaction_manifest_v2.rs | 3 - .../src/profile_models}/deposit_rule.rs | 0 .../src/profile_models}/mod.rs | 4 +- .../third_party_deposits/asset_exception.rs | 30 + .../assets_exception_list.rs | 0 .../deposit_address_exception_rule.rs | 0 .../depositors_allow_list.rs | 0 .../third_party_deposits/mod.rs | 2 - .../third_party_deposits.rs | 0 .../src}/unvalidated_transaction_manifest.rs | 0 crates/sargon-uniffi/Cargo.toml | 111 +- .../sargon-uniffi/src/core/result/result.rs | 1 - .../src/core/types/bag_of_bytes.rs | 2 - .../src/core/types/exactly_n_bytes.rs | 1 - .../src/core/types/keys/public_key.rs | 1 - crates/sargon-uniffi/src/core/types/mod.rs | 4 +- .../src/core/types/version_type.rs | 1 - .../sargon-uniffi/src/core/utils/constants.rs | 2 - crates/sargon-uniffi/src/core/utils/mod.rs | 6 +- .../bip32/hd_path_component.rs | 5 +- .../bip32/securified.rs | 3 +- .../bip32/unhardened.rs | 2 +- .../bip32/unsecurified.rs | 5 - .../bip32/unsecurified_hardened.rs | 2 +- .../bip39/bip39_word/bip39_word.rs | 1 - .../derivation/derivation_path.rs | 1 - crates/sargon-uniffi/src/lib.rs | 22 +- .../roles/decl_role_macro.rs | 4 - .../security_shield_builder.rs | 17 +- .../security_structure_of_factor_sources.rs | 1 - .../supporting_types/decl_vec_samples_for.rs | 1 - .../src/profile/supporting_types/mod.rs | 2 +- .../src/profile/v100/address/mod.rs | 2 +- .../gateways/saved_gateways.rs | 1 + .../v100/entity/persona/persona_data/mod.rs | 2 +- .../src/profile/v100/factors/factor_source.rs | 1 - ...ierarchical_deterministic_factor_source.rs | 1 - crates/sargon-uniffi/src/profile/v100/mod.rs | 2 +- .../networks/network/authorized_dapp/mod.rs | 2 +- .../v100/networks/network/profile_network.rs | 1 + .../dapp_to_wallet/interaction_unvalidated.rs | 1 - .../security_center/support/backup_result.rs | 1 - .../src/security_center/support/input.rs | 1 - .../sargon-uniffi/src/signing/sign_request.rs | 1 - .../src/signing/sign_response.rs | 1 - .../signing/signatures_per_fractor_source.rs | 1 - .../signing/transaction_sign_request_input.rs | 1 - .../transactions_to_sign_per_factor_source.rs | 2 - .../unsafe_storage_driver/support/mod.rs | 1 - .../src/system/sargon_os/sargon_os.rs | 5 +- .../src/system/sargon_os/sargon_os_profile.rs | 2 - .../src/system/sargon_os/sargon_os_signing.rs | 2 - .../sargon_os_transaction_analysis.rs | 1 - .../high_level/ret_api.rs | 12 + .../assets_transfers/account_or_address_of.rs | 26 - .../assets_transfers/mod.rs | 4 +- .../owned_or_third_party_account_address.rs | 27 + .../per_recipient_asset_transfer.rs | 2 +- .../assets_transfers/transfer_types.rs | 4 +- .../high_level/sargon_specific_types/mod.rs | 2 - crates/sargon/Cargo.toml | 125 +- crates/sargon/build.rs | 43 +- .../src/factor_instances_provider/mod.rs | 11 - .../factor_instances_provider/types/mod.rs | 19 - .../src/gateway_api/client/gateway_client.rs | 72 - .../sargon/src/gateway_api/endpoints/mod.rs | 7 - crates/sargon/src/gateway_api/mod.rs | 11 - .../src/gateway_api/models/logic/mod.rs | 5 - .../gateway_api/models/logic/request/mod.rs | 7 - .../models/logic/request/state/entity/mod.rs | 3 - .../state/entity/state_entity_details.rs | 39 - .../models/logic/request/state/mod.rs | 3 - .../models/logic/request/transaction/mod.rs | 5 - .../models/logic/response/ledger_state.rs | 15 - .../gateway_api/models/logic/response/mod.rs | 9 - .../entity/details/fungible/collection.rs | 3 - .../details/fungible/collection_item.rs | 28 - .../fungible/collection_item_global.rs | 3 - .../response/state/entity/details/mod.rs | 7 - .../models/logic/response/state/entity/mod.rs | 2 - .../models/logic/response/state/mod.rs | 3 - .../transaction/preview/logs_inner.rs | 3 - .../logic/response/transaction/preview/mod.rs | 5 - .../logic/response/transaction/status/mod.rs | 2 - .../transaction/subintent_status/mod.rs | 1 - .../subintent_status/subintent_status.rs | 42 - crates/sargon/src/gateway_api/models/mod.rs | 5 - .../types/request/transaction/preview/mod.rs | 11 - .../request/transaction/preview/opt_ins.rs | 15 - .../request/transaction/preview/opt_ins_v2.rs | 30 - .../transaction/preview/request_flags.rs | 21 - .../preview/transaction_preview.rs | 42 - .../preview/transaction_preview_v2.rs | 47 - .../types/request/transaction/submit/mod.rs | 3 - .../transaction/submit/transaction_submit.rs | 14 - .../details/fungible/collection_item.rs | 27 - .../state/entity/details/non_fungible/mod.rs | 7 - .../response/state/entity/details/response.rs | 21 - .../state/entity/details/response_item.rs | 44 - .../response/transaction/construction/mod.rs | 3 - .../transaction_construction_response.rs | 13 - .../models/types/response/transaction/mod.rs | 11 - .../preview/transaction_preview_response.rs | 18 - .../transaction/status/payload_item.rs | 6 - .../transaction/status/transaction_status.rs | 8 - .../transaction/subintent_status/response.rs | 16 - .../types/response/transaction/submit/mod.rs | 3 - .../response/transaction/submit/submit.rs | 14 - crates/sargon/src/home_cards/home_card.rs | 1 - crates/sargon/src/lib.rs | 168 +- .../diagnose_instance_duplicates.rs | 276 +++ .../needs_a_new_home_dumping_ground/mod.rs | 1 + .../profile/logic/account/create_account.rs | 179 -- .../sargon/src/profile/logic/create_entity.rs | 81 - .../profile/logic/persona/create_persona.rs | 70 - .../src/profile/logic/profile_networks.rs | 43 - crates/sargon/src/profile/mfa/mod.rs | 5 - crates/sargon/src/profile/mod.rs | 13 - .../v100/app_preferences/gateways/mod.rs | 7 - .../src/profile/v100/app_preferences/mod.rs | 11 - .../profile/v100/profile_legacy_state_bugs.rs | 309 ---- .../sargon/src/radix_connect/mobile/client.rs | 3 - .../mobile/deep_link_parsing/parser.rs | 16 +- .../mobile/deep_link_parsing/request.rs | 2 - .../mobile/relay_service/service.rs | 18 +- .../radix_connect/mobile/session/session.rs | 1 - .../interaction_items/transaction/mod.rs | 2 - .../pre_authorization/pre_authorization.rs | 1 - .../pre_authorization/subintent_response.rs | 2 - .../transaction/transaction.rs | 2 - .../radix_connect/well_known_client/client.rs | 10 +- crates/sargon/src/signing/collector/mod.rs | 1 - .../signing/collector/signatures_collector.rs | 8 +- .../signatures_collector_preprocessor.rs | 2 +- .../sargon/src/signing/petition_types/mod.rs | 4 - .../factor_source_referencing.rs | 13 - .../petition_for_factors_types/mod.rs | 1 - .../petition_for_factors_state.rs | 3 - crates/sargon/src/signing/signables/mod.rs | 3 - .../sargon/src/signing/signables/signable.rs | 1 - .../signing/signables/signable_subintent.rs | 21 - .../signables/signable_transaction_intent.rs | 20 - .../signing/signatures_outecome_types/mod.rs | 2 +- crates/sargon/src/signing/testing/mod.rs | 1 - .../system/clients/client/http_client/mod.rs | 3 - .../unsafe_storage_driver/support/mod.rs | 5 - crates/sargon/src/system/mod.rs | 4 - .../system/sargon_os/delete_account/mod.rs | 1 - .../sargon_os_delete_account.rs | 51 - ...th_factor_source_and_derivation_outcome.rs | 357 ++++ .../factor_instances_provider_unit_tests.rs | 686 ++++---- crates/sargon/src/system/sargon_os/mod.rs | 13 +- .../system/sargon_os/pre_authorization/mod.rs | 2 - .../sargon_os_create_subintent.rs | 2 +- .../sargon_os_pre_authorization_status.rs | 3 +- .../system/sargon_os/profile_state_holder.rs | 22 +- .../sargon/src/system/sargon_os/sargon_os.rs | 16 +- .../system/sargon_os/sargon_os_accounts.rs | 23 +- .../src/system/sargon_os/sargon_os_factors.rs | 3 +- .../src/system/sargon_os/sargon_os_gateway.rs | 1 - .../system/sargon_os/sargon_os_personas.rs | 3 - .../src/system/sargon_os/sargon_os_profile.rs | 2 - .../sargon_os_security_structures.rs | 1 - .../src/system/sargon_os/sargon_os_signing.rs | 1 - .../sargon_os/sargon_os_sync_accounts.rs | 2 + .../src/system/sargon_os/transactions/mod.rs | 3 - .../sargon_os_transaction_analysis.rs | 4 +- .../sargon_os_transaction_status.rs | 2 - .../sargon_os_transaction_submit.rs | 2 - .../support/signable_manifest_summary.rs | 3 - .../subsystems/log_system/log_system.rs | 4 +- crates/sargon/src/types/mod.rs | 4 - .../high_level/manifest_building/mod.rs | 25 - .../execution_summary/mod.rs | 3 - .../execution_summary_v2/mod.rs | 3 - .../src/wrapped_radix_engine_toolkit/mod.rs | 6 - crates/sargon/tests/integration/main.rs | 4 +- jvm/sargon-android/build.gradle.kts | 1 - .../java/com/radixdlt/sargon/ProfileTest.kt | 2 +- .../sargon/TransactionManifestTest.kt | 22 +- scripts/ios/build-sargon.sh | 2 +- 875 files changed, 11244 insertions(+), 4802 deletions(-) delete mode 100644 codecov.yml delete mode 100644 crates/.DS_Store create mode 100644 crates/gateway-client-and-api/Cargo.toml rename crates/{sargon/src/gateway_api => gateway-client-and-api/src}/assert_network_request.rs (100%) rename crates/{sargon/src/system/clients/client/http_client/http_client.rs => gateway-client-and-api/src/client/gateway_client.rs} (58%) rename crates/{sargon/src/gateway_api => gateway-client-and-api/src}/client/gateway_client_dispatch_request.rs (85%) rename crates/{sargon/src/gateway_api => gateway-client-and-api/src}/client/mod.rs (100%) create mode 100644 crates/gateway-client-and-api/src/endpoints/mod.rs rename crates/{sargon/src/gateway_api => gateway-client-and-api/src}/endpoints/state_endpoints.rs (91%) rename crates/{sargon/src/gateway_api => gateway-client-and-api/src}/endpoints/status_endpoints.rs (81%) rename crates/{sargon/src/gateway_api => gateway-client-and-api/src}/endpoints/transaction_endpoints.rs (90%) create mode 100644 crates/gateway-client-and-api/src/lib.rs rename crates/{sargon/src/gateway_api => gateway-client-and-api/src}/methods/mod.rs (80%) rename crates/{sargon/src/gateway_api => gateway-client-and-api/src}/methods/page_methods.rs (99%) rename crates/{sargon/src/gateway_api => gateway-client-and-api/src}/methods/state_methods.rs (99%) rename crates/{sargon/src/gateway_api => gateway-client-and-api/src}/methods/transaction_methods.rs (96%) create mode 100644 crates/gateway-models/Cargo.toml create mode 100644 crates/gateway-models/build.rs rename crates/{sargon/fixtures/models/gateway => gateway-models/fixtures/models}/state/request_entity_details__single_account_no_assets.json (100%) rename crates/{sargon/fixtures/models/gateway => gateway-models/fixtures/models}/state/request_entity_details__single_resource.json (100%) rename crates/{sargon/fixtures/models/gateway => gateway-models/fixtures/models}/state/request_entity_details__two_accounts.json (100%) rename crates/{sargon/fixtures/models/gateway => gateway-models/fixtures/models}/state/response_entity_details__single_account_many_nfts_and_fungibles.json (100%) rename crates/{sargon/fixtures/models/gateway => gateway-models/fixtures/models}/state/response_entity_details__single_account_no_assets.json (100%) rename crates/{sargon/fixtures/models/gateway => gateway-models/fixtures/models}/state/response_entity_details__single_resource.json (100%) rename crates/{sargon/fixtures/models/gateway => gateway-models/fixtures/models}/state/response_entity_details__single_resource_no_metadata.json (100%) rename crates/{sargon/fixtures/models/gateway => gateway-models/fixtures/models}/state/response_entity_details__two_accounts.json (100%) rename crates/{sargon/fixtures/models/gateway => gateway-models/fixtures/models}/state/response_entity_details_details__fungible_resource.json (100%) rename crates/{sargon/fixtures/models/gateway => gateway-models/fixtures/models}/state/response_entity_details_details__non_fungible_resource.json (100%) rename crates/{sargon/fixtures/models/gateway => gateway-models/fixtures/models}/transaction/request_preview.json (100%) rename crates/{sargon/fixtures/models/gateway => gateway-models/fixtures/models}/transaction/request_status.json (100%) rename crates/{sargon/fixtures/models/gateway => gateway-models/fixtures/models}/transaction/request_submit.json (100%) rename crates/{sargon/fixtures/models/gateway => gateway-models/fixtures/models}/transaction/response_construction.json (100%) rename crates/{sargon/fixtures/models/gateway => gateway-models/fixtures/models}/transaction/response_preview.json (100%) rename crates/{sargon/fixtures/models/gateway => gateway-models/fixtures/models}/transaction/response_status__committed_success.json (100%) rename crates/{sargon/fixtures/models/gateway => gateway-models/fixtures/models}/transaction/response_status__pending.json (100%) rename crates/{sargon/fixtures/models/gateway => gateway-models/fixtures/models}/transaction/response_submit.json (100%) create mode 100644 crates/gateway-models/src/lib.rs rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/mod.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/request/gw_public_key.rs (82%) rename crates/{sargon/src/gateway_api/models/logic/request/gw_public_key.rs => gateway-models/src/types/request/gw_public_key_serde.rs} (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/request/ledger_state_selector.rs (94%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/request/mod.rs (87%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/request/state/account/mod.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/request/state/account/page/authorized_depositors.rs (87%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/request/state/account/page/mod.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/request/state/account/page/resource_preferences.rs (87%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/request/state/entity/details/mod.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/request/state/entity/details/opt_ins.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/request/state/entity/details/request.rs (54%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/request/state/entity/mod.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/request/state/entity/page/fungibles.rs (87%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/request/state/entity/page/mod.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/request/state/entity/page/non_fungible_vault_ids.rs (84%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/request/state/entity/page/non_fungible_vaults.rs (84%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/request/state/entity/page/non_fungibles.rs (87%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/request/state/mod.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/request/state/non_fungible/location.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/request/state/non_fungible/mod.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/request/transaction/mod.rs (100%) rename crates/{sargon/src/gateway_api/models/logic => gateway-models/src/types}/request/transaction/preview/mod.rs (100%) rename crates/{sargon/src/gateway_api/models/logic => gateway-models/src/types}/request/transaction/preview/opt_ins.rs (60%) rename crates/{sargon/src/gateway_api/models/logic => gateway-models/src/types}/request/transaction/preview/opt_ins_v2.rs (52%) rename crates/{sargon/src/gateway_api/models/logic => gateway-models/src/types}/request/transaction/preview/request_flags.rs (74%) rename crates/{sargon/src/gateway_api/models/logic => gateway-models/src/types}/request/transaction/preview/transaction_preview.rs (71%) rename crates/{sargon/src/gateway_api/models/logic => gateway-models/src/types}/request/transaction/preview/transaction_preview_v2.rs (67%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/request/transaction/status/mod.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/request/transaction/status/subintent_status.rs (87%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/request/transaction/status/transaction_status.rs (88%) rename crates/{sargon/src/gateway_api/models/logic => gateway-models/src/types}/request/transaction/submit/mod.rs (100%) rename crates/{sargon/src/gateway_api/models/logic => gateway-models/src/types}/request/transaction/submit/transaction_submit.rs (67%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/ledger_state.rs (86%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/mod.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/page_response.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/account/mod.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/account/page/authorized_depositor.rs (54%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/account/page/mod.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/account/page/resource_preference.rs (83%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/entity/details/details/item.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/entity/details/details/item_component.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/entity/details/details/item_fungible_resource.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/entity/details/details/item_non_fungible_resource.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/entity/details/details/item_package.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/entity/details/details/mod.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/entity/details/details/role_assignments/assignment.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/entity/details/details/role_assignments/collection.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/entity/details/details/role_assignments/entry.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/entity/details/details/role_assignments/explicit_rule.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/entity/details/details/role_assignments/mod.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/entity/details/details/role_assignments/module.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/entity/details/details/role_assignments/owner.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/entity/details/details/role_assignments/resolution.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/entity/details/details/role_assignments/role_key.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/entity/details/fungible/collection.rs (100%) create mode 100644 crates/gateway-models/src/types/response/state/entity/details/fungible/collection_item.rs rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/entity/details/fungible/collection_item_global.rs (100%) rename crates/{sargon/src/gateway_api/models/logic => gateway-models/src/types}/response/state/entity/details/fungible/mod.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/entity/details/metadata/collection.rs (98%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/entity/details/metadata/item.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/entity/details/metadata/item_value.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/entity/details/metadata/mod.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/entity/details/metadata/typed_value.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/entity/details/mod.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/entity/details/non_fungible/collection.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/entity/details/non_fungible/collection_item.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/entity/details/non_fungible/collection_item_global.rs (100%) rename crates/{sargon/src/gateway_api/models/types/response/state/entity/details/fungible => gateway-models/src/types/response/state/entity/details/non_fungible}/mod.rs (100%) rename crates/{sargon/src/gateway_api/models/logic/response/state/entity/details/state_entity_details_response.rs => gateway-models/src/types/response/state/entity/details/response.rs} (80%) rename crates/{sargon/src/gateway_api/models/logic/response/state/entity/details/state_entity_details_response_item.rs => gateway-models/src/types/response/state/entity/details/response_item.rs} (55%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/entity/mod.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/entity/page/mod.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/entity/page/non_fungible_vault_item.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/mod.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/non_fungible/location.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/state/non_fungible/mod.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/status/gateway_status.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/status/mod.rs (100%) rename crates/{sargon/src/gateway_api/models/logic => gateway-models/src/types}/response/transaction/construction/mod.rs (100%) rename crates/{sargon/src/gateway_api/models/logic => gateway-models/src/types}/response/transaction/construction/transaction_construction_response.rs (66%) rename crates/{sargon/src/gateway_api/models/logic => gateway-models/src/types}/response/transaction/mod.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/transaction/preview/logs_inner.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/transaction/preview/mod.rs (100%) rename crates/{sargon/src/gateway_api/models/logic => gateway-models/src/types}/response/transaction/preview/transaction_preview_response.rs (51%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/transaction/preview/transaction_preview_response_v2.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/transaction/preview/transaction_receipt.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/transaction/preview/transaction_receipt_status.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/transaction/status/mod.rs (100%) rename crates/{sargon/src/gateway_api/models/logic => gateway-models/src/types}/response/transaction/status/payload_item.rs (91%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/transaction/status/payload_status.rs (100%) rename crates/{sargon/src/gateway_api/models/logic => gateway-models/src/types}/response/transaction/status/transaction_status.rs (89%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/transaction/subintent_status/mod.rs (100%) create mode 100644 crates/gateway-models/src/types/response/transaction/subintent_status/response.rs rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/transaction/subintent_status/status.rs (100%) rename crates/{sargon/src/gateway_api/models/logic => gateway-models/src/types}/response/transaction/submit/mod.rs (100%) rename crates/{sargon/src/gateway_api/models/logic => gateway-models/src/types}/response/transaction/submit/submit.rs (61%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/support/fetch_resources_output.rs (65%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/support/fetch_transferable_resources_output.rs (100%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/support/mod.rs (100%) create mode 100644 crates/http-client/Cargo.toml create mode 100644 crates/http-client/src/http_client.rs create mode 100644 crates/http-client/src/lib.rs create mode 100644 crates/next-derivation-index-ephemeral/Cargo.toml rename crates/{sargon/src/factor_instances_provider => next-derivation-index-ephemeral/src}/agnostic_paths/derivation_preset.rs (100%) rename crates/{sargon/src/factor_instances_provider => next-derivation-index-ephemeral/src}/agnostic_paths/index_agnostic_path.rs (99%) rename crates/{sargon/src/factor_instances_provider => next-derivation-index-ephemeral/src}/agnostic_paths/mod.rs (100%) rename crates/{sargon/src/factor_instances_provider => next-derivation-index-ephemeral/src}/agnostic_paths/quantified_derivation_preset.rs (100%) rename crates/{sargon/src/factor_instances_provider => next-derivation-index-ephemeral/src}/agnostic_paths/quantities.rs (100%) create mode 100644 crates/next-derivation-index-ephemeral/src/lib.rs rename crates/{sargon/src/factor_instances_provider/next_index_assigner => next-derivation-index-ephemeral/src}/next_derivation_entity_index_with_ephemeral_offsets.rs (100%) rename crates/{sargon/src/factor_instances_provider/next_index_assigner => next-derivation-index-ephemeral/src}/next_derivation_entity_index_with_ephemeral_offsets_for_factor_source.rs (97%) create mode 100644 crates/sargon-clients/Cargo.toml rename crates/{sargon/src/system => sargon-clients/src}/clients/README.md (100%) rename crates/{sargon/src/system => sargon-clients/src}/clients/client/entropy_client/entropy_client.rs (100%) rename crates/{sargon/src/system => sargon-clients/src}/clients/client/entropy_client/mod.rs (100%) rename crates/{sargon/src/system => sargon-clients/src}/clients/client/event_bus_client/event_bus_client.rs (100%) rename crates/{sargon/src/system => sargon-clients/src}/clients/client/event_bus_client/mod.rs (100%) rename crates/{sargon/src/factor_instances_provider/factor_instances_cache => sargon-clients/src/clients/client/factor_instances_cache_client/cache}/factor_instances_cache.rs (92%) rename crates/{sargon/src/factor_instances_provider/factor_instances_cache => sargon-clients/src/clients/client/factor_instances_cache_client/cache}/keyed_instances.rs (100%) rename crates/{sargon/src/factor_instances_provider/factor_instances_cache => sargon-clients/src/clients/client/factor_instances_cache_client/cache}/mod.rs (100%) rename crates/{sargon/src/factor_instances_provider/factor_instances_cache => sargon-clients/src/clients/client/factor_instances_cache_client/cache}/serializable_cache/factor_instances_cache_snapshot.rs (96%) rename crates/{sargon/src/factor_instances_provider/factor_instances_cache => sargon-clients/src/clients/client/factor_instances_cache_client/cache}/serializable_cache/factor_source_id_from_hash_dense_key.rs (100%) rename crates/{sargon/src/factor_instances_provider/factor_instances_cache => sargon-clients/src/clients/client/factor_instances_cache_client/cache}/serializable_cache/mod.rs (100%) rename crates/{sargon/src/system/clients/client/factor_instances_cache_client.rs => sargon-clients/src/clients/client/factor_instances_cache_client/client.rs} (99%) create mode 100644 crates/sargon-clients/src/clients/client/factor_instances_cache_client/mod.rs create mode 100644 crates/sargon-clients/src/clients/client/factor_instances_cache_client/models/mod.rs create mode 100644 crates/sargon-clients/src/clients/client/factor_instances_cache_client/models/outcome.rs rename crates/{sargon/src/system => sargon-clients/src}/clients/client/file_system_client/file_system_client.rs (99%) rename crates/{sargon/src/system => sargon-clients/src}/clients/client/file_system_client/mod.rs (100%) rename crates/{sargon/src/system => sargon-clients/src}/clients/client/host_info_client/host_info_client.rs (90%) rename crates/{sargon/src/system => sargon-clients/src}/clients/client/host_info_client/mod.rs (100%) rename crates/{sargon/src/system => sargon-clients/src}/clients/client/mod.rs (91%) rename crates/{sargon/src/system => sargon-clients/src}/clients/client/profile_change_client/mod.rs (100%) rename crates/{sargon/src/system => sargon-clients/src}/clients/client/profile_change_client/profile_change_client.rs (100%) rename crates/{sargon/src/system => sargon-clients/src}/clients/client/secure_storage_client/mod.rs (100%) rename crates/{sargon/src/system => sargon-clients/src}/clients/client/secure_storage_client/secure_storage_client.rs (94%) rename crates/{sargon/src/system => sargon-clients/src}/clients/client/unsafe_storage_client/mod.rs (100%) rename crates/{sargon/src/system => sargon-clients/src}/clients/client/unsafe_storage_client/unsafe_storage_client.rs (100%) rename crates/{sargon/src/system => sargon-clients/src}/clients/clients.rs (94%) rename crates/{sargon/src/system => sargon-clients/src}/clients/mod.rs (100%) create mode 100644 crates/sargon-clients/src/lib.rs rename crates/{sargon/src/factor_instances_provider/types => sargon-core/src}/appendable_collection.rs (92%) rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building => sargon-core/src}/metadata.rs (99%) create mode 100644 crates/sargon-drivers/Cargo.toml rename crates/{sargon/src/system => sargon-drivers/src}/drivers/README.md (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/drivers.rs (99%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/entropy_provider_driver/entropy_provider_driver.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/entropy_provider_driver/mod.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/entropy_provider_driver/support/mod.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/entropy_provider_driver/support/test/mod.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/entropy_provider_driver/support/test/rust_entropy_driver.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/event_bus_driver/event_bus_driver.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/event_bus_driver/mod.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/event_bus_driver/support/event.rs (97%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/event_bus_driver/support/event_kind.rs (98%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/event_bus_driver/support/event_notification.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/event_bus_driver/support/event_profile_modified.rs (72%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/event_bus_driver/support/has_event_kind.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/event_bus_driver/support/mod.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/event_bus_driver/support/test/mod.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/event_bus_driver/support/test/rust_event_bus_driver.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/file_system_driver/file_system_driver.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/file_system_driver/mod.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/file_system_driver/support/mod.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/file_system_driver/support/test/in_memory_file_system_driver.rs (98%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/file_system_driver/support/test/mod.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/file_system_driver/support/test/rust_file_system_driver.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/host_info_driver/host_info_driver.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/host_info_driver/mod.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/host_info_driver/support/mod.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/host_info_driver/support/test/mod.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/host_info_driver/support/test/rust_host_info_driver.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/logging_driver/logging_driver.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/logging_driver/mod.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/logging_driver/support/log_level.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/logging_driver/support/mod.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/logging_driver/support/test/mod.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/logging_driver/support/test/rust_logging_driver.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/mod.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/networking_driver/mod.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/networking_driver/networking_driver.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/networking_driver/support/mod.rs (98%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/networking_driver/support/network_method.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/networking_driver/support/network_request.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/networking_driver/support/network_response.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/networking_driver/support/test/mock_networking_driver.rs (99%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/networking_driver/support/test/mod.rs (89%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/networking_driver/support/test/rust_networking_driver.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/profile_change_driver/mod.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/profile_change_driver/profile_change_driver.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/profile_change_driver/support/mod.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/profile_change_driver/support/test/mod.rs (73%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/profile_change_driver/support/test/rust_profile_change_driver.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/secure_storage_driver/mod.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/secure_storage_driver/secure_storage_driver.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/secure_storage_driver/support/mod.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/secure_storage_driver/support/secure_storage_access_error_kind.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/secure_storage_driver/support/secure_storage_key.rs (98%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/secure_storage_driver/support/test/ephemeral_secure_storage.rs (99%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/secure_storage_driver/support/test/fail_secure_storage.rs (93%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/secure_storage_driver/support/test/mod.rs (81%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/unsafe_storage_driver/mod.rs (100%) rename crates/{sargon/src/system/drivers/unsafe_storage_driver/support/test => sargon-drivers/src/drivers/unsafe_storage_driver/support}/ephemeral_unsafe_storage.rs (100%) rename crates/{sargon/src/system/drivers/unsafe_storage_driver/support/test => sargon-drivers/src/drivers/unsafe_storage_driver/support}/mod.rs (54%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/unsafe_storage_driver/support/unsafe_storage_key.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/unsafe_storage_driver/unsafe_storage_driver.rs (100%) create mode 100644 crates/sargon-drivers/src/lib.rs create mode 100644 crates/sargon-factor-instances-provider/Cargo.toml create mode 100644 crates/sargon-factor-instances-provider/src/lib.rs rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/next_index_assigner/mod.rs (55%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/next_index_assigner/next_derivation_entity_index_assigner.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/next_index_assigner/next_derivation_entity_index_cache_analyzing_assigner.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/next_index_assigner/next_derivation_entity_index_profile_analyzing_assigner.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/provider/factor_instances_provider.rs (99%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/provider/instances_in_cache_consumer.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/provider/mod.rs (80%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/provider/outcome/factor_instances_provider_outcome.rs (96%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/provider/outcome/factor_instances_provider_outcome_for_factor.rs (93%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/provider/outcome/internal_factor_instances_provider_outcome.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/provider/outcome/internal_factor_instances_provider_outcome_for_factor.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/provider/outcome/mod.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/provider/provider_adopters/cache_filler.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/provider/provider_adopters/mod.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/provider/provider_adopters/securify_entity_factor_instances_provider.rs (77%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/provider/provider_adopters/virtual_entity_creating_instance_provider.rs (100%) create mode 100644 crates/sargon-factor-instances-provider/src/types/mod.rs create mode 100644 crates/sargon-factor-instances-provider/src/types/test_derivation_interactor_from_secure_storage_client.rs create mode 100644 crates/sargon-factors-supporting-types/Cargo.toml create mode 100644 crates/sargon-factors-supporting-types/src/lib.rs create mode 100644 crates/sargon-factors-supporting-types/src/mnemonic_loading.rs create mode 100644 crates/sargon-manifests/Cargo.toml create mode 100644 crates/sargon-manifests/build.rs rename crates/{sargon => sargon-manifests}/fixtures/transaction/account_locker_claim.rtm (100%) rename crates/{sargon => sargon-manifests}/fixtures/transaction/account_locker_claim_max_nft_items.rtm (100%) rename crates/{sargon => sargon-manifests}/fixtures/transaction/create_3_nft_collections.rtm (100%) rename crates/{sargon => sargon-manifests}/fixtures/transaction/create_access_controller_for_account.rtm (100%) rename crates/{sargon => sargon-manifests}/fixtures/transaction/create_access_controller_for_persona.rtm (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building => sargon-manifests/src}/bucket.rs (85%) rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building => sargon-manifests/src}/bucket_factory.rs (96%) rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building => sargon-manifests/src}/delete_account/delete_account_transfer.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building => sargon-manifests/src}/delete_account/delete_account_transfers.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building => sargon-manifests/src}/delete_account/manifest_delete_account.rs (94%) rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building => sargon-manifests/src}/delete_account/mod.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-manifests/src}/high_level/mod.rs (71%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-manifests/src}/high_level/sargon_specific_types/account_locker/account_locker_claimable_resource.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-manifests/src}/high_level/sargon_specific_types/account_locker/mod.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-manifests/src}/high_level/sargon_specific_types/assets_transfers/mod.rs (58%) rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/account_or_address_of.rs => sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/owned_or_third_party_account_address.rs} (52%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-manifests/src}/high_level/sargon_specific_types/assets_transfers/per_asset/mod.rs (82%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-manifests/src}/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_fungible_resource.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-manifests/src}/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_fungible_transfer.rs (76%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-manifests/src}/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_non_fungible_transfer.rs (79%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-manifests/src}/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-manifests/src}/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers_of_fungible_resource.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-manifests/src}/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers_of_non_fungible_resource.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-manifests/src}/high_level/sargon_specific_types/assets_transfers/per_recipient/mod.rs (71%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-manifests/src}/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfer.rs (89%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-manifests/src}/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfers.rs (87%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-manifests/src}/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_fungible_transfer.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-manifests/src}/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_non_fungibles_transfer.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-manifests/src}/high_level/sargon_specific_types/assets_transfers/transfer_types.rs (92%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-manifests/src}/high_level/sargon_specific_types/build_information/dependency_information.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-manifests/src}/high_level/sargon_specific_types/build_information/mod.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-manifests/src}/high_level/sargon_specific_types/build_information/sargon_build_information.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-manifests/src}/high_level/sargon_specific_types/build_information/sargon_dependencies.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-manifests/src}/high_level/sargon_specific_types/mod.rs (75%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-manifests/src}/high_level/sargon_specific_types/stake_claim.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-manifests/src}/high_level/sargon_specific_types/transaction/mod.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-manifests/src}/high_level/sargon_specific_types/transaction/transaction_status.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-manifests/src}/high_level/sargon_specific_types/transaction/transaction_status_reason.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-manifests/src}/high_level/sargon_specific_types/transaction_guarantee.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-manifests/src}/high_level/token_definition_metadata.rs (99%) create mode 100644 crates/sargon-manifests/src/lib.rs rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building => sargon-manifests/src}/manifest_account_locker.rs (90%) rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building => sargon-manifests/src}/manifest_assets_transfers.rs (96%) rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building => sargon-manifests/src}/manifests.rs (90%) rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building => sargon-manifests/src}/manifests_access_controller.rs (94%) rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building => sargon-manifests/src}/manifests_create_tokens.rs (93%) rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building => sargon-manifests/src}/modify_manifest.rs (97%) rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building => sargon-manifests/src}/sample_resource_definition_metadata.json (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building => sargon-manifests/src}/third_party_deposit_update/manifest_third_party_deposit_update.rs (93%) rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building => sargon-manifests/src}/third_party_deposit_update/mod.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building => sargon-manifests/src}/third_party_deposit_update/third_party_deposits_delta.rs (94%) create mode 100644 crates/sargon-profile-app-preferences/Cargo.toml rename crates/{sargon/src/profile/v100/app_preferences => sargon-profile-app-preferences/src}/app_display_settings/app_display_settings.rs (100%) rename crates/{sargon/src/profile/v100/app_preferences => sargon-profile-app-preferences/src}/app_display_settings/fiat_currency.rs (100%) rename crates/{sargon/src/profile/v100/app_preferences => sargon-profile-app-preferences/src}/app_display_settings/mod.rs (100%) rename crates/{sargon/src/profile/v100/app_preferences => sargon-profile-app-preferences/src}/app_preferences.rs (100%) create mode 100644 crates/sargon-profile-app-preferences/src/lib.rs rename crates/{sargon/src/profile/v100/app_preferences => sargon-profile-app-preferences/src}/security.rs (100%) rename crates/{sargon/src/profile/v100/app_preferences => sargon-profile-app-preferences/src}/transaction_preferences.rs (100%) create mode 100644 crates/sargon-profile-gateway/Cargo.toml rename crates/{sargon/src/profile/v100/app_preferences/gateways => sargon-profile-gateway/src}/gateway.rs (98%) create mode 100644 crates/sargon-profile-gateway/src/lib.rs rename crates/{sargon/src/profile/v100/app_preferences/gateways => sargon-profile-gateway/src}/network_definition.rs (99%) rename crates/{sargon/src/profile/v100/app_preferences/gateways => sargon-profile-gateway/src}/saved_gateways.rs (74%) create mode 100644 crates/sargon-profile-logic/Cargo.toml create mode 100644 crates/sargon-profile-logic/src/lib.rs rename crates/{sargon/src/profile => sargon-profile-logic/src}/logic/account/account_visibility.rs (86%) rename crates/{sargon/src/profile => sargon-profile-logic/src}/logic/account/accounts_visibility.rs (100%) rename crates/{sargon/src/profile => sargon-profile-logic/src}/logic/account/mod.rs (82%) rename crates/{sargon/src/profile => sargon-profile-logic/src}/logic/account/query_accounts.rs (56%) rename crates/{sargon/src/profile => sargon-profile-logic/src}/logic/account/query_security_structures.rs (89%) create mode 100644 crates/sargon-profile-logic/src/logic/authorized_dapps_logic.rs rename crates/{sargon/src/profile => sargon-profile-logic/src}/logic/gateway/current_gateway.rs (51%) rename crates/{sargon/src/profile => sargon-profile-logic/src}/logic/gateway/mod.rs (100%) create mode 100644 crates/sargon-profile-logic/src/logic/instances_deriving_with_factor_sources.rs rename crates/{sargon/src/profile => sargon-profile-logic/src}/logic/mod.rs (66%) rename crates/{sargon/src/profile => sargon-profile-logic/src}/logic/persona/mod.rs (77%) rename crates/{sargon/src/profile => sargon-profile-logic/src}/logic/persona/persona_data_ids.rs (62%) rename crates/{sargon/src/profile => sargon-profile-logic/src}/logic/persona/query_personas.rs (57%) rename crates/{sargon/src/profile => sargon-profile-logic/src}/logic/persona/shared_persona_data_ids.rs (68%) rename crates/{sargon/src/profile => sargon-profile-logic/src}/logic/profile_header.rs (77%) rename crates/{sargon/src/profile => sargon-profile-logic/src}/logic/profile_network/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile-logic/src}/logic/profile_network/profile_network_details.rs (91%) rename crates/{sargon/src/profile => sargon-profile-logic/src}/logic/profile_network/profile_network_entities_linked_to_factor_source.rs (89%) rename crates/{sargon/src/profile => sargon-profile-logic/src}/logic/profile_network/profile_network_get_entities.rs (81%) create mode 100644 crates/sargon-profile-logic/src/logic/profile_networks.rs create mode 100644 crates/sargon-profile-logic/src/logic/profile_update.rs rename crates/{sargon/src/profile => sargon-profile-logic/src}/logic/query_factor_sources.rs (87%) create mode 100644 crates/sargon-profile-logic/src/tests/matrix_of_factor_instances_index_agnostic.rs create mode 100644 crates/sargon-profile-logic/src/tests/mod.rs create mode 100644 crates/sargon-profile-security-structures/Cargo.toml rename crates/{sargon/src/signing/petition_types => sargon-profile-security-structures/src}/factor_list_kind.rs (80%) create mode 100644 crates/sargon-profile-security-structures/src/lib.rs rename crates/{sargon/src/signing/petition_types => sargon-profile-security-structures/src}/role_kind.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/automatic_shield_builder/auto_build_outcome_for_testing.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/automatic_shield_builder/automatic_shield_builder.rs (99%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/automatic_shield_builder/factor_selector.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/automatic_shield_builder/mod.rs (83%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/automatic_shield_builder/proto_shield.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/automatic_shield_builder/quantity.rs (100%) rename crates/{sargon/src/types/samples => sargon-profile-security-structures/src/roles_matrices_structures}/general_role_with_hd_factor_instance_samples.rs (91%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/has_role_kind.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/matrices/abstract_matrix_builder_or_built.rs (76%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/matrices/builder/error.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/matrices/builder/matrix_builder.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/matrices/builder/matrix_builder_unit_tests.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/matrices/builder/matrix_template.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/matrices/builder/mod.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/matrices/matrix_of_factor_instances.rs (86%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/matrices/matrix_of_factor_source_ids.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/matrices/matrix_of_factor_sources.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/matrices/mod.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/mod.rs (93%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/abstract_role_builder_or_built.rs (97%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/builder/confirmation_roles_builder_unit_tests.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/builder/mod.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/builder/primary_roles_builder_unit_tests.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/builder/recovery_roles_builder_unit_tests.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/builder/roles_builder.rs (99%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/builder/roles_builder_unit_tests.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/factor_levels/factor_instance_level/confirmation_role_with_factor_instances.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/factor_levels/factor_instance_level/general_role_with_hierarchical_deterministic_factor_instances.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/factor_levels/factor_instance_level/mod.rs (85%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/factor_levels/factor_instance_level/primary_role_with_factor_instances.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/factor_levels/factor_instance_level/recovery_role_with_factor_instances.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/factor_levels/factor_instance_level/role_into_scrypto_access_rule.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/factor_levels/factor_instance_level/role_with_factor_instances.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/factor_levels/factor_source_id_level/confirmation_role_with_factor_source_ids.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/factor_levels/factor_source_id_level/mod.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/factor_levels/factor_source_id_level/primary_role_with_factor_source_ids.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/factor_levels/factor_source_id_level/recovery_role_with_factor_source_ids.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/factor_levels/factor_source_id_level/roles_with_factor_ids.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/factor_levels/factor_source_kind_level/mod.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/factor_levels/factor_source_kind_level/role_template.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/factor_levels/factor_source_level/confirmation_role_with_factor_sources.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/factor_levels/factor_source_level/mod.rs (86%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/factor_levels/factor_source_level/primary_role_with_factor_sources.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/factor_levels/factor_source_level/recovery_role_with_factor_sources.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/factor_levels/factor_source_level/roles_with_factor_sources.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/factor_levels/mod.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/mod.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/security_shield_builder.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/security_shield_builder_invalid_reason.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/security_shield_prerequisites_status.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/security_structure_id.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/security_structure_metadata.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/security_structure_of_factors/abstract_security_structure_of_factors.rs (91%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/security_structure_of_factors/mod.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/security_structure_of_factors/security_structure_of_factor_instances.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/security_structure_of_factors/security_structure_of_factor_source_ids.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/security_structure_of_factors/security_structure_of_factor_sources.rs (100%) rename crates/{sargon/src/profile/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/selected_factor_sources_status.rs (100%) create mode 100644 crates/sargon-profile-supporting-types/Cargo.toml rename crates/{sargon/src/factor_instances_provider/types => sargon-profile-supporting-types/src}/abstract_securified_entity.rs (100%) rename crates/{sargon/src/factor_instances_provider/types => sargon-profile-supporting-types/src}/any_securified_entity.rs (100%) rename crates/{sargon/src/factor_instances_provider/types => sargon-profile-supporting-types/src}/assert_derivation_path.rs (78%) rename crates/{sargon/src/factor_instances_provider/types => sargon-profile-supporting-types/src}/is_securified_entity.rs (93%) create mode 100644 crates/sargon-profile-supporting-types/src/lib.rs create mode 100644 crates/sargon-profile-supporting-types/src/profile_state.rs rename crates/{sargon/src/factor_instances_provider/types => sargon-profile-supporting-types/src}/securified_account.rs (100%) rename crates/{sargon/src/factor_instances_provider/types => sargon-profile-supporting-types/src}/securified_persona.rs (100%) rename crates/{sargon/src/factor_instances_provider/types => sargon-profile-supporting-types/src}/unsecurified_entity.rs (100%) rename crates/{sargon/src/factor_instances_provider/types => sargon-profile-supporting-types/src}/veci.rs (100%) create mode 100644 crates/sargon-profile/Cargo.toml create mode 100644 crates/sargon-profile/build.rs rename crates/{sargon => sargon-profile}/fixtures/vector/huge_profile_1000_accounts.json (100%) create mode 100644 crates/sargon-profile/fixtures/vector/multi_profile_snapshots_test_version_100_patch_after_app_version_120.json create mode 100644 crates/sargon-profile/fixtures/vector/only_plaintext_profile_snapshot_version_100.json rename crates/{sargon => sargon-profile}/fixtures/vector/profile_encrypted_by_password_empty.json (100%) rename crates/{sargon => sargon-profile}/fixtures/vector/profile_encrypted_by_password_of_babylon.json (100%) rename crates/{sargon/src/profile => sargon-profile/src}/encrypted/encrypted_profile/encrypted_profile_snapshot.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/encrypted/encrypted_profile/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/encrypted/key_derivation/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/encrypted/key_derivation/password_based_key_derivation_scheme.rs (97%) rename crates/{sargon/src/profile => sargon-profile/src}/encrypted/key_derivation/password_based_key_derivation_scheme_version.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/encrypted/key_derivation/versioned_password_based_key_derivation.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/encrypted/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/encrypted/pb_hkdf_sha256.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/encrypted/versioned_algorithm.rs (100%) create mode 100644 crates/sargon-profile/src/lib.rs rename crates/{sargon/src/profile => sargon-profile/src}/profilesnapshot_version.rs (94%) rename crates/{sargon/src/types => sargon-profile/src}/samples/access_controller_address_samples.rs (90%) rename crates/{sargon/src/types => sargon-profile/src}/samples/account_address_samples.rs (81%) rename crates/{sargon/src/types => sargon-profile/src}/samples/account_samples.rs (93%) rename crates/{sargon/src/types => sargon-profile/src}/samples/identity_address_samples.rs (100%) rename crates/{sargon/src/types => sargon-profile/src}/samples/mod.rs (51%) rename crates/{sargon/src/types => sargon-profile/src}/samples/persona_samples.rs (92%) rename crates/{sargon/src/types => sargon-profile/src}/samples/profile_samples.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/supporting_types/account_for_display.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/supporting_types/account_or_persona.rs (97%) rename crates/{sargon/src/profile => sargon-profile/src}/supporting_types/accounts_for_display.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/supporting_types/accounts_or_personas.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/supporting_types/authorized_dapp_detailed.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/supporting_types/authorized_persona_detailed.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/supporting_types/detailed_authorized_personas.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/supporting_types/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/supporting_types/on_same_network_validating.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entities_linked_to_factor_source/entities_linked_to_factor_source.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entities_linked_to_factor_source/integrity/device.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entities_linked_to_factor_source/integrity/integrity.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entities_linked_to_factor_source/integrity/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entities_linked_to_factor_source/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entities_linked_to_factor_source/profile_to_check.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entity/abstract_entity_type.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entity/account/account.rs (96%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entity/account/mod.rs (100%) create mode 100644 crates/sargon-profile/src/v100/entity/account/on_ledger_settings/mod.rs rename crates/{sargon/src/profile => sargon-profile/src}/v100/entity/account/on_ledger_settings/on_ledger_settings.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entity/entity_flag.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entity/entity_flags.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entity/has_security_state.rs (96%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entity/is_entity.rs (82%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entity/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entity/persona/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entity/persona/persona.rs (96%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entity/persona/persona_data/collection_of_email_addresses.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entity/persona/persona_data/collection_of_phone_numbers.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entity/persona/persona_data/entry_kinds/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_email_address.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_name.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_phone_number.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entity/persona/persona_data/mod.rs (87%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entity/persona/persona_data/persona_data.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entity/persona/persona_data/persona_data_entry_id.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entity/persona/persona_data/persona_data_identified_collection_types.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entity/persona/persona_data/persona_data_identified_entry_types.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entity_security_state/entity_security_state.rs (99%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entity_security_state/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entity_security_state/provisional_securified_config.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entity_security_state/provisional_securified_transaction_queued.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/entity_security_state/unsecured_entity_control.rs (98%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/header/content_hint.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/header/device_info.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/header/header.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/header/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/header/profile_id.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/mod.rs (78%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/networks/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/networks/network/accounts.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/networks/network/authorized_dapp/authorized_dapp.rs (96%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/networks/network/authorized_dapp/authorized_persona_simple.rs (99%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/networks/network/authorized_dapp/mod.rs (93%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/networks/network/authorized_dapp/preferences/authorized_dapp_preference_deposits.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/networks/network/authorized_dapp/preferences/authorized_dapp_preferences.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/networks/network/authorized_dapp/preferences/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/networks/network/authorized_dapp/references_to_authorized_personas.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/networks/network/authorized_dapp/shared_persona_data.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_account_addresses.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_ids_of_persona_data_entries.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/networks/network/authorized_dapp/shared_with_dapp.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/networks/network/authorized_dapps.rs (95%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/networks/network/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/networks/network/personas.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/networks/network/profile_network.rs (91%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/networks/network/resource_preferences/hidden_resources.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/networks/network/resource_preferences/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/networks/network/resource_preferences/resource_app_preference.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/networks/network/resource_preferences/resource_identifier.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/networks/network/resource_preferences/resource_preferences.rs (98%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/networks/network/resource_preferences/resource_visibility.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/networks/profile_networks.rs (81%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/profile.rs (76%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/profile_file_contents.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/proto_profile_maybe_with_legacy_p2p_links.rs (100%) rename crates/{sargon/src/profile/mfa => sargon-profile/src/v100}/secured_entity_control/mod.rs (100%) rename crates/{sargon/src/profile/mfa => sargon-profile/src/v100}/secured_entity_control/secured_entity_control.rs (100%) create mode 100644 crates/sargon-transaction-models/Cargo.toml create mode 100644 crates/sargon-transaction-models/build.rs rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/account_delete.dat (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/account_delete.rtm (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/account_locker_claim_fungibles_and_non_fungibles.dat (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/account_locker_claim_fungibles_and_non_fungibles.rtm (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/claim_two_stakes_from_one_validator.dat (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/claim_two_stakes_from_one_validator.rtm (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/contribute_to_bi_pool.dat (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/contribute_to_bi_pool.rtm (100%) create mode 100644 crates/sargon-transaction-models/fixtures/transaction/create_3_nft_collections.rtm create mode 100644 crates/sargon-transaction-models/fixtures/transaction/create_access_controller_for_account.rtm create mode 100644 crates/sargon-transaction-models/fixtures/transaction/create_access_controller_for_persona.rtm rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/create_nft_collection.dat (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/create_nft_collection.rtm (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/create_pool.dat (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/create_pool.rtm (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/create_single_fungible.dat (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/create_single_fungible.rtm (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/mint_nft_gumball_card.dat (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/mint_nft_gumball_card.rtm (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/multi_account_resource_transfer.rtm (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/multi_account_resource_transfer_subintent.rtm (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/open_subintent_fungibles.rtm (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/open_subintent_mix_multiple_deposits.rtm (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/open_subintent_non_fungibles_no_certain_ids.rtm (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/open_subintent_non_fungibles_with_certain_ids.rtm (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/open_subintent_pool_stakes_stake_claim.rtm (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/present_proof_swap_candy.dat (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/present_proof_swap_candy.rtm (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/redeem_from_bi_pool.dat (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/redeem_from_bi_pool.rtm (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/resource_transfer.rtm (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/resource_transfer_subintent.rtm (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/stake_to_three_validators.dat (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/stake_to_three_validators.rtm (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/third_party_deposits_update.dat (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/third_party_deposits_update.rtm (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/transfer_1to2_multiple_nf_and_f_tokens.dat (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/transfer_1to2_multiple_nf_and_f_tokens.rtm (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/unstake_partially_from_one_validator.dat (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/unstake_partially_from_one_validator.rtm (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building => sargon-transaction-models/src}/assert_manifest.rs (99%) rename crates/{sargon => sargon-transaction-models}/src/error_from.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/is_intent_signing.rs (100%) create mode 100644 crates/sargon-transaction-models/src/lib.rs rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/compiled_notarized_intent.rs (99%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/compiled_transaction_intent.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/dynamically_analyzable_manifest.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/execution_summary/execution_summary.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/execution_summary/fee_locks.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/execution_summary/fee_summary.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/execution_summary/mod.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/execution_summary/new_entities.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/execution_summary/newly_created_resource.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/execution_summary/reserved_instruction.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/execution_summary/resource_indicator/fungible_resource_indicator.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/execution_summary/resource_indicator/mod.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/execution_summary/resource_indicator/non_fungible_resource_indicator.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/execution_summary/resource_indicator/predicted.rs (98%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/execution_summary/resource_indicator/resource_indicator.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/execution_summary/resource_specifier/mod.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/execution_summary/resource_specifier/resource_specifier.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/intent_signature.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types => sargon-transaction-models/src/low_level}/manifest_encountered_component_address.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/manifest_summary/account_deposit/account_deposits.rs (98%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/manifest_summary/account_deposit/change_source.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/manifest_summary/account_deposit/mod.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/manifest_summary/account_deposit/simple_counted_resource_bounds.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/manifest_summary/account_deposit/simple_non_fungible_resource_bounds.rs (99%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/manifest_summary/account_deposit/simple_resource_bounds.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/manifest_summary/account_deposit/unspecified_resources.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/manifest_summary/account_withdraw/account_withdraw.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/manifest_summary/account_withdraw/mod.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/manifest_summary/manifest_summary.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/manifest_summary/mod.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/mod.rs (92%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/notarized_transaction.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/notary_signature.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/sbor_depth_validation.rs (92%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/signed_intent.rs (96%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/statically_analyzable_manifest.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/transaction_classes/detailed_manifest_class.rs (99%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/transaction_classes/detailed_manifest_class_kind.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/transaction_classes/mod.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/transaction_classes/types/mod.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/transaction_classes/types/resource_preference_update.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/transaction_classes/types/tracked_pool_contribution.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/transaction_classes/types/tracked_pool_redemption.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/transaction_classes/types/tracked_validator_claim.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/transaction_classes/types/tracked_validator_stake.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/transaction_classes/types/unstake_data.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/transaction_hashes/intent_hash.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/transaction_hashes/mod.rs (64%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/transaction_hashes/signed_intent_hash.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/transaction_hashes/subintent_hash.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/transaction_hashes/transaction_hashes.rs (97%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/transaction_hashes/validate_and_decode_hash.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v1/intent_signatures.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v1/message/message.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v1/message/mod.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v1/message/plaintext_message/mod.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v1/message/plaintext_message/plaintext_message.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v1/message/plaintext_message/plaintext_message_contents.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v1/mod.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v1/transaction_header.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v1/transaction_intent.rs (98%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v1/transaction_manifest/blobs/blob.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v1/transaction_manifest/blobs/blobs.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v1/transaction_manifest/blobs/mod.rs (100%) create mode 100644 crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/execution_summary/mod.rs rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v1/transaction_manifest/execution_summary/transaction_manifest_execution_summary.rs (99%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v1/transaction_manifest/instructions/instructions.rs (98%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v1/transaction_manifest/instructions/mod.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v1/transaction_manifest/mod.rs (83%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v1/transaction_manifest/transaction_manifest.rs (98%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v2/compiled_subintent.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v2/intent_header_v2.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v2/message_v2/message_v2.rs (96%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v2/message_v2/mod.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v2/mod.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v2/signed_partial_transaction.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v2/signed_subintent.rs (95%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v2/subintent.rs (97%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v2/transaction_manifest_v2/child_subintent_specifier.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v2/transaction_manifest_v2/child_subintent_specifiers.rs (100%) create mode 100644 crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/execution_summary_v2/mod.rs rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v2/transaction_manifest_v2/execution_summary_v2/transaction_manifest_execution_summary_v2.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v2/transaction_manifest_v2/instructions_v2/instructions_v2.rs (98%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v2/transaction_manifest_v2/instructions_v2/mod.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v2/transaction_manifest_v2/mod.rs (91%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v2/transaction_manifest_v2/subintent_manifest.rs (99%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v2/transaction_manifest_v2/transaction_manifest_v2.rs (99%) rename crates/{sargon/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits => sargon-transaction-models/src/profile_models}/deposit_rule.rs (100%) rename crates/{sargon/src/profile/v100/entity/account/on_ledger_settings => sargon-transaction-models/src/profile_models}/mod.rs (52%) rename crates/{sargon/src/profile/v100/entity/account/on_ledger_settings => sargon-transaction-models/src/profile_models}/third_party_deposits/asset_exception.rs (79%) rename crates/{sargon/src/profile/v100/entity/account/on_ledger_settings => sargon-transaction-models/src/profile_models}/third_party_deposits/assets_exception_list.rs (100%) rename crates/{sargon/src/profile/v100/entity/account/on_ledger_settings => sargon-transaction-models/src/profile_models}/third_party_deposits/deposit_address_exception_rule.rs (100%) rename crates/{sargon/src/profile/v100/entity/account/on_ledger_settings => sargon-transaction-models/src/profile_models}/third_party_deposits/depositors_allow_list.rs (100%) rename crates/{sargon/src/profile/v100/entity/account/on_ledger_settings => sargon-transaction-models/src/profile_models}/third_party_deposits/mod.rs (87%) rename crates/{sargon/src/profile/v100/entity/account/on_ledger_settings => sargon-transaction-models/src/profile_models}/third_party_deposits/third_party_deposits.rs (100%) rename crates/{sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction => sargon-transaction-models/src}/unvalidated_transaction_manifest.rs (100%) delete mode 100644 crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/account_or_address_of.rs create mode 100644 crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/owned_or_third_party_account_address.rs delete mode 100644 crates/sargon/src/factor_instances_provider/mod.rs delete mode 100644 crates/sargon/src/factor_instances_provider/types/mod.rs delete mode 100644 crates/sargon/src/gateway_api/client/gateway_client.rs delete mode 100644 crates/sargon/src/gateway_api/endpoints/mod.rs delete mode 100644 crates/sargon/src/gateway_api/mod.rs delete mode 100644 crates/sargon/src/gateway_api/models/logic/mod.rs delete mode 100644 crates/sargon/src/gateway_api/models/logic/request/mod.rs delete mode 100644 crates/sargon/src/gateway_api/models/logic/request/state/entity/mod.rs delete mode 100644 crates/sargon/src/gateway_api/models/logic/request/state/entity/state_entity_details.rs delete mode 100644 crates/sargon/src/gateway_api/models/logic/request/state/mod.rs delete mode 100644 crates/sargon/src/gateway_api/models/logic/request/transaction/mod.rs delete mode 100644 crates/sargon/src/gateway_api/models/logic/response/ledger_state.rs delete mode 100644 crates/sargon/src/gateway_api/models/logic/response/mod.rs delete mode 100644 crates/sargon/src/gateway_api/models/logic/response/state/entity/details/fungible/collection.rs delete mode 100644 crates/sargon/src/gateway_api/models/logic/response/state/entity/details/fungible/collection_item.rs delete mode 100644 crates/sargon/src/gateway_api/models/logic/response/state/entity/details/fungible/collection_item_global.rs delete mode 100644 crates/sargon/src/gateway_api/models/logic/response/state/entity/details/mod.rs delete mode 100644 crates/sargon/src/gateway_api/models/logic/response/state/entity/mod.rs delete mode 100644 crates/sargon/src/gateway_api/models/logic/response/state/mod.rs delete mode 100644 crates/sargon/src/gateway_api/models/logic/response/transaction/preview/logs_inner.rs delete mode 100644 crates/sargon/src/gateway_api/models/logic/response/transaction/preview/mod.rs delete mode 100644 crates/sargon/src/gateway_api/models/logic/response/transaction/status/mod.rs delete mode 100644 crates/sargon/src/gateway_api/models/logic/response/transaction/subintent_status/mod.rs delete mode 100644 crates/sargon/src/gateway_api/models/logic/response/transaction/subintent_status/subintent_status.rs delete mode 100644 crates/sargon/src/gateway_api/models/mod.rs delete mode 100644 crates/sargon/src/gateway_api/models/types/request/transaction/preview/mod.rs delete mode 100644 crates/sargon/src/gateway_api/models/types/request/transaction/preview/opt_ins.rs delete mode 100644 crates/sargon/src/gateway_api/models/types/request/transaction/preview/opt_ins_v2.rs delete mode 100644 crates/sargon/src/gateway_api/models/types/request/transaction/preview/request_flags.rs delete mode 100644 crates/sargon/src/gateway_api/models/types/request/transaction/preview/transaction_preview.rs delete mode 100644 crates/sargon/src/gateway_api/models/types/request/transaction/preview/transaction_preview_v2.rs delete mode 100644 crates/sargon/src/gateway_api/models/types/request/transaction/submit/mod.rs delete mode 100644 crates/sargon/src/gateway_api/models/types/request/transaction/submit/transaction_submit.rs delete mode 100644 crates/sargon/src/gateway_api/models/types/response/state/entity/details/fungible/collection_item.rs delete mode 100644 crates/sargon/src/gateway_api/models/types/response/state/entity/details/non_fungible/mod.rs delete mode 100644 crates/sargon/src/gateway_api/models/types/response/state/entity/details/response.rs delete mode 100644 crates/sargon/src/gateway_api/models/types/response/state/entity/details/response_item.rs delete mode 100644 crates/sargon/src/gateway_api/models/types/response/transaction/construction/mod.rs delete mode 100644 crates/sargon/src/gateway_api/models/types/response/transaction/construction/transaction_construction_response.rs delete mode 100644 crates/sargon/src/gateway_api/models/types/response/transaction/mod.rs delete mode 100644 crates/sargon/src/gateway_api/models/types/response/transaction/preview/transaction_preview_response.rs delete mode 100644 crates/sargon/src/gateway_api/models/types/response/transaction/status/payload_item.rs delete mode 100644 crates/sargon/src/gateway_api/models/types/response/transaction/status/transaction_status.rs delete mode 100644 crates/sargon/src/gateway_api/models/types/response/transaction/subintent_status/response.rs delete mode 100644 crates/sargon/src/gateway_api/models/types/response/transaction/submit/mod.rs delete mode 100644 crates/sargon/src/gateway_api/models/types/response/transaction/submit/submit.rs create mode 100644 crates/sargon/src/needs_a_new_home_dumping_ground/diagnose_instance_duplicates.rs create mode 100644 crates/sargon/src/needs_a_new_home_dumping_ground/mod.rs delete mode 100644 crates/sargon/src/profile/logic/account/create_account.rs delete mode 100644 crates/sargon/src/profile/logic/create_entity.rs delete mode 100644 crates/sargon/src/profile/logic/persona/create_persona.rs delete mode 100644 crates/sargon/src/profile/logic/profile_networks.rs delete mode 100644 crates/sargon/src/profile/mfa/mod.rs delete mode 100644 crates/sargon/src/profile/mod.rs delete mode 100644 crates/sargon/src/profile/v100/app_preferences/gateways/mod.rs delete mode 100644 crates/sargon/src/profile/v100/app_preferences/mod.rs delete mode 100644 crates/sargon/src/profile/v100/profile_legacy_state_bugs.rs delete mode 100644 crates/sargon/src/system/clients/client/http_client/mod.rs delete mode 100644 crates/sargon/src/system/drivers/unsafe_storage_driver/support/mod.rs create mode 100644 crates/sargon/src/system/sargon_os/entity_creating_with_factor_source_and_derivation_outcome.rs rename crates/sargon/src/{factor_instances_provider/provider => system/sargon_os}/factor_instances_provider_unit_tests.rs (85%) delete mode 100644 crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/mod.rs delete mode 100644 crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/execution_summary/mod.rs delete mode 100644 crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/execution_summary_v2/mod.rs delete mode 100644 crates/sargon/src/wrapped_radix_engine_toolkit/mod.rs diff --git a/Cargo.lock b/Cargo.lock index d547a7f1b..987908c6e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -126,9 +126,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ "anstyle", "anstyle-parse", @@ -147,30 +147,30 @@ checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-parse" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.4" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -629,11 +629,11 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.20" +version = "4.5.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" +checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84" dependencies = [ - "clap_builder 4.5.20", + "clap_builder 4.5.23", "clap_derive 4.5.18", ] @@ -648,13 +648,13 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.20" +version = "4.5.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" +checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838" dependencies = [ "anstream", "anstyle", - "clap_lex 0.7.2", + "clap_lex 0.7.4", "strsim", ] @@ -688,15 +688,15 @@ source = "git+https://github.com/clap-rs/clap/?rev=8a7a13a5618cfdc4ff328624a5266 [[package]] name = "clap_lex" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "colorchoice" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "colored" @@ -1297,6 +1297,39 @@ dependencies = [ "slab", ] +[[package]] +name = "gateway-client-and-api" +version = "1.1.99" +dependencies = [ + "actix-rt", + "gateway-models", + "http-client", + "radix-common", + "sargon-addresses", + "sargon-core", + "sargon-core-assert-json", + "sargon-drivers", + "sargon-profile-gateway", + "sargon-transaction-models", + "serde", + "serde_json 1.0.108", +] + +[[package]] +name = "gateway-models" +version = "1.1.99" +dependencies = [ + "derive_more", + "radix-engine-interface", + "radix-engine-toolkit-common", + "radix-transactions", + "sargon-addresses", + "sargon-core", + "sargon-core-assert-json", + "sargon-transaction-models", + "serde", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -1495,6 +1528,18 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "http-client" +version = "1.1.99" +dependencies = [ + "actix-rt", + "reqwest", + "sargon-core", + "sargon-drivers", + "serde", + "serde_json 1.0.108", +] + [[package]] name = "httparse" version = "1.9.5" @@ -1592,7 +1637,7 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "identified-vec-of" -version = "1.2.1" +version = "1.1.99" dependencies = [ "derive_more", "itertools 0.12.0", @@ -1918,6 +1963,22 @@ dependencies = [ "tempfile", ] +[[package]] +name = "next-derivation-index-ephemeral" +version = "1.1.99" +dependencies = [ + "derive_more", + "enum-iterator", + "sargon-addresses", + "sargon-core", + "sargon-core-assert-json", + "sargon-core-error", + "sargon-factors", + "sargon-hierarchical-deterministic", + "serde", + "serde_with 3.4.0", +] + [[package]] name = "nom" version = "7.1.3" @@ -2764,7 +2825,7 @@ dependencies = [ [[package]] name = "sargon" -version = "1.2.1" +version = "1.1.99" dependencies = [ "actix-rt", "aes-gcm", @@ -2779,6 +2840,8 @@ dependencies = [ "enum-as-inner", "enum-iterator", "futures", + "gateway-client-and-api", + "gateway-models", "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", "hkdf", "identified-vec-of", @@ -2802,10 +2865,18 @@ dependencies = [ "rand", "reqwest", "sargon-addresses", + "sargon-clients", "sargon-core", + "sargon-drivers", + "sargon-factor-instances-provider", "sargon-factors", "sargon-hierarchical-deterministic", "sargon-keys-collector", + "sargon-manifests", + "sargon-profile", + "sargon-profile-logic", + "sargon-profile-security-structures", + "sargon-transaction-models", "sbor", "security-framework", "security-framework-sys", @@ -2822,7 +2893,7 @@ dependencies = [ [[package]] name = "sargon-addresses" -version = "1.2.1" +version = "1.1.99" dependencies = [ "derive_more", "enum-iterator", @@ -2842,9 +2913,66 @@ dependencies = [ "serde_with 3.4.0", ] +[[package]] +name = "sargon-clients" +version = "1.1.99" +dependencies = [ + "actix-rt", + "aes-gcm", + "assert-json-diff", + "async-std", + "async-trait", + "base64 0.22.1 (git+https://github.com/marshallpierce/rust-base64.git?rev=e14400697453bcc85997119b874bc03d9601d0af)", + "camino 1.0.8", + "delegate", + "derive_more", + "enum-as-inner", + "enum-iterator", + "futures", + "gateway-client-and-api", + "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", + "hkdf", + "http-client", + "iota-crypto", + "iso8601-timestamp", + "itertools 0.12.0", + "k256 0.13.3", + "log", + "once_cell 1.19.0", + "paste 1.0.14", + "pretty_assertions", + "pretty_env_logger", + "radix-common", + "radix-common-derive", + "radix-engine", + "radix-engine-interface", + "radix-engine-toolkit", + "radix-engine-toolkit-common", + "radix-rust", + "radix-transactions", + "rand", + "reqwest", + "sargon-core", + "sargon-drivers", + "sargon-factors-supporting-types", + "sargon-hierarchical-deterministic", + "sargon-profile", + "sargon-profile-supporting-types", + "sbor", + "serde", + "serde_json 1.0.108", + "serde_repr", + "serde_with 3.4.0", + "strum 0.26.1", + "thiserror 1.0.50", + "url", + "uuid 1.6.1", + "zeroize 1.7.0", +] + [[package]] name = "sargon-core" -version = "1.2.1" +version = "1.1.99" dependencies = [ "aes-gcm", "arraystring", @@ -2884,7 +3012,7 @@ dependencies = [ [[package]] name = "sargon-core-assert-json" -version = "1.2.1" +version = "1.1.99" dependencies = [ "assert-json-diff", "log", @@ -2897,7 +3025,7 @@ dependencies = [ [[package]] name = "sargon-core-error" -version = "1.2.1" +version = "1.1.99" dependencies = [ "log", "serde_json 1.0.108", @@ -2906,21 +3034,128 @@ dependencies = [ [[package]] name = "sargon-core-utils" -version = "1.2.1" +version = "1.1.99" +dependencies = [ + "iso8601-timestamp", + "log", + "pretty_assertions", + "sargon-core-error", + "serde", + "serde_json 1.0.108", + "url", + "uuid 1.6.1", +] + +[[package]] +name = "sargon-drivers" +version = "1.1.99" +dependencies = [ + "actix-rt", + "aes-gcm", + "assert-json-diff", + "async-std", + "async-trait", + "base64 0.22.1 (git+https://github.com/marshallpierce/rust-base64.git?rev=e14400697453bcc85997119b874bc03d9601d0af)", + "camino 1.0.8", + "delegate", + "derive_more", + "enum-as-inner", + "enum-iterator", + "futures", + "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", + "hkdf", + "iota-crypto", + "iso8601-timestamp", + "itertools 0.12.0", + "k256 0.13.3", + "log", + "once_cell 1.19.0", + "paste 1.0.14", + "pretty_assertions", + "pretty_env_logger", + "radix-common", + "radix-common-derive", + "radix-engine", + "radix-engine-interface", + "radix-engine-toolkit", + "radix-engine-toolkit-common", + "radix-rust", + "radix-transactions", + "rand", + "reqwest", + "sargon-addresses", + "sargon-core", + "sargon-hierarchical-deterministic", + "sargon-profile", + "sargon-profile-supporting-types", + "sbor", + "serde", + "serde_json 1.0.108", + "serde_repr", + "serde_with 3.4.0", + "strum 0.26.1", + "thiserror 1.0.50", + "url", + "uuid 1.6.1", + "zeroize 1.7.0", +] + +[[package]] +name = "sargon-factor-instances-provider" +version = "1.1.99" dependencies = [ + "actix-rt", + "aes-gcm", + "arraystring", + "assert-json-diff", + "async-trait", + "delegate", + "derive_more", + "enum-as-inner", + "enum-iterator", + "futures", + "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", + "hkdf", + "identified-vec-of", + "iota-crypto", "iso8601-timestamp", + "itertools 0.12.0", + "k256 0.13.3", "log", + "next-derivation-index-ephemeral", + "paste 1.0.14", "pretty_assertions", + "radix-common", + "radix-engine-interface", + "radix-rust", + "radix-transactions", + "rand", + "sargon-addresses", + "sargon-clients", + "sargon-core", + "sargon-core-assert-json", "sargon-core-error", + "sargon-core-utils", + "sargon-factors", + "sargon-hierarchical-deterministic", + "sargon-keys-collector", + "sargon-profile", + "sargon-profile-logic", + "sargon-profile-supporting-types", "serde", "serde_json 1.0.108", + "serde_repr", + "serde_with 3.4.0", + "strum 0.26.1", + "thiserror 1.0.50", "url", "uuid 1.6.1", + "zeroize 1.7.0", ] [[package]] name = "sargon-factors" -version = "1.2.1" +version = "1.1.99" dependencies = [ "arraystring", "assert-json-diff", @@ -2959,9 +3194,20 @@ dependencies = [ "zeroize 1.7.0", ] +[[package]] +name = "sargon-factors-supporting-types" +version = "1.1.99" +dependencies = [ + "async-trait", + "identified-vec-of", + "sargon-core", + "sargon-factors", + "sargon-hierarchical-deterministic", +] + [[package]] name = "sargon-hierarchical-deterministic" -version = "1.2.1" +version = "1.1.99" dependencies = [ "assert-json-diff", "bip39", @@ -2998,7 +3244,7 @@ dependencies = [ [[package]] name = "sargon-keys-collector" -version = "1.2.1" +version = "1.1.99" dependencies = [ "actix-rt", "async-trait", @@ -3007,36 +3253,426 @@ dependencies = [ "sargon-addresses", "sargon-core", "sargon-factors", + "sargon-factors-supporting-types", "sargon-hierarchical-deterministic", ] [[package]] -name = "sargon-uniffi" -version = "1.2.1" +name = "sargon-manifests" +version = "1.1.99" dependencies = [ - "actix-rt", "assert-json-diff", "async-trait", - "base64 0.22.1 (git+https://github.com/marshallpierce/rust-base64.git?rev=e14400697453bcc85997119b874bc03d9601d0af)", - "camino 1.0.8", - "clap 4.5.1", + "cargo_toml 0.15.3 (git+https://gitlab.com/lib.rs/cargo_toml?rev=e498c94fc42a660c1ca1a28999ce1d757cfe77fe)", "delegate", "derive_more", "enum-as-inner", "enum-iterator", + "gateway-models", "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", + "identified-vec-of", + "iota-crypto", "iso8601-timestamp", "itertools 0.12.0", + "k256 0.13.3", "log", + "once_cell 1.19.0", "paste 1.0.14", - "preinterpret", "pretty_assertions", - "pretty_env_logger", + "radix-common", + "radix-common-derive", + "radix-engine", + "radix-engine-interface", "radix-engine-toolkit", + "radix-engine-toolkit-common", + "radix-rust", + "radix-transactions", "rand", - "regex 1.9.3 (git+https://github.com/rust-lang/regex/?rev=72f889ef3cca59ebac6a026f3646e8d92f056d88)", - "sargon", + "sargon-addresses", "sargon-core", + "sargon-core-utils", + "sargon-factors", + "sargon-hierarchical-deterministic", + "sargon-profile", + "sargon-transaction-models", + "sbor", + "serde", + "serde_json 1.0.108", + "serde_repr", + "serde_with 3.4.0", + "strum 0.26.1", + "thiserror 1.0.50", + "url", + "uuid 1.6.1", + "zeroize 1.7.0", +] + +[[package]] +name = "sargon-profile" +version = "1.1.99" +dependencies = [ + "actix-rt", + "aes-gcm", + "assert-json-diff", + "async-std", + "async-trait", + "base64 0.22.1 (git+https://github.com/marshallpierce/rust-base64.git?rev=e14400697453bcc85997119b874bc03d9601d0af)", + "camino 1.0.8", + "cargo_toml 0.15.3 (git+https://gitlab.com/lib.rs/cargo_toml?rev=e498c94fc42a660c1ca1a28999ce1d757cfe77fe)", + "delegate", + "derive_more", + "enum-as-inner", + "enum-iterator", + "futures", + "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", + "hkdf", + "identified-vec-of", + "iota-crypto", + "iso8601-timestamp", + "itertools 0.12.0", + "k256 0.13.3", + "log", + "once_cell 1.19.0", + "paste 1.0.14", + "pretty_assertions", + "pretty_env_logger", + "radix-common", + "radix-common-derive", + "radix-engine", + "radix-engine-interface", + "radix-engine-toolkit", + "radix-engine-toolkit-common", + "radix-rust", + "radix-transactions", + "rand", + "reqwest", + "sargon-addresses", + "sargon-core", + "sargon-factors", + "sargon-hierarchical-deterministic", + "sargon-keys-collector", + "sargon-profile-app-preferences", + "sargon-profile-security-structures", + "sargon-transaction-models", + "sbor", + "serde", + "serde_json 1.0.108", + "serde_repr", + "serde_with 3.4.0", + "strum 0.26.1", + "thiserror 1.0.50", + "url", + "uuid 1.6.1", + "zeroize 1.7.0", +] + +[[package]] +name = "sargon-profile-app-preferences" +version = "1.1.99" +dependencies = [ + "aes-gcm", + "assert-json-diff", + "async-std", + "async-trait", + "base64 0.22.1 (git+https://github.com/marshallpierce/rust-base64.git?rev=e14400697453bcc85997119b874bc03d9601d0af)", + "camino 1.0.8", + "delegate", + "derive_more", + "enum-as-inner", + "enum-iterator", + "futures", + "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", + "hkdf", + "identified-vec-of", + "iota-crypto", + "iso8601-timestamp", + "itertools 0.12.0", + "k256 0.13.3", + "log", + "once_cell 1.19.0", + "paste 1.0.14", + "pretty_assertions", + "pretty_env_logger", + "radix-common", + "radix-common-derive", + "radix-engine", + "radix-engine-interface", + "radix-engine-toolkit", + "radix-engine-toolkit-common", + "radix-rust", + "radix-transactions", + "rand", + "reqwest", + "sargon-addresses", + "sargon-core", + "sargon-factors", + "sargon-hierarchical-deterministic", + "sargon-keys-collector", + "sargon-profile-gateway", + "sargon-profile-security-structures", + "sargon-transaction-models", + "sbor", + "serde", + "serde_json 1.0.108", + "serde_repr", + "serde_with 3.4.0", + "strum 0.26.1", + "thiserror 1.0.50", + "url", + "uuid 1.6.1", + "zeroize 1.7.0", +] + +[[package]] +name = "sargon-profile-gateway" +version = "1.1.99" +dependencies = [ + "aes-gcm", + "assert-json-diff", + "async-std", + "async-trait", + "base64 0.22.1 (git+https://github.com/marshallpierce/rust-base64.git?rev=e14400697453bcc85997119b874bc03d9601d0af)", + "camino 1.0.8", + "delegate", + "derive_more", + "enum-as-inner", + "enum-iterator", + "futures", + "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", + "hkdf", + "identified-vec-of", + "iota-crypto", + "iso8601-timestamp", + "itertools 0.12.0", + "k256 0.13.3", + "log", + "once_cell 1.19.0", + "paste 1.0.14", + "pretty_assertions", + "pretty_env_logger", + "radix-common", + "radix-common-derive", + "radix-engine", + "radix-engine-interface", + "radix-engine-toolkit", + "radix-engine-toolkit-common", + "radix-rust", + "radix-transactions", + "rand", + "reqwest", + "sargon-addresses", + "sargon-core", + "sargon-factors", + "sargon-hierarchical-deterministic", + "sargon-keys-collector", + "sargon-transaction-models", + "sbor", + "serde", + "serde_json 1.0.108", + "serde_repr", + "serde_with 3.4.0", + "strum 0.26.1", + "thiserror 1.0.50", + "url", + "uuid 1.6.1", + "zeroize 1.7.0", +] + +[[package]] +name = "sargon-profile-logic" +version = "1.1.99" +dependencies = [ + "derive_more", + "identified-vec-of", + "itertools 0.12.0", + "pretty_assertions", + "radix-common", + "radix-common-derive", + "radix-engine", + "radix-engine-interface", + "radix-engine-toolkit", + "radix-engine-toolkit-common", + "radix-rust", + "radix-transactions", + "sargon-addresses", + "sargon-core", + "sargon-factors", + "sargon-hierarchical-deterministic", + "sargon-profile", + "sargon-profile-supporting-types", + "sbor", + "serde", + "serde_json 1.0.108", +] + +[[package]] +name = "sargon-profile-security-structures" +version = "1.1.99" +dependencies = [ + "aes-gcm", + "assert-json-diff", + "async-std", + "async-trait", + "base64 0.22.1 (git+https://github.com/marshallpierce/rust-base64.git?rev=e14400697453bcc85997119b874bc03d9601d0af)", + "camino 1.0.8", + "delegate", + "derive_more", + "enum-as-inner", + "enum-iterator", + "futures", + "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", + "hkdf", + "identified-vec-of", + "iota-crypto", + "iso8601-timestamp", + "itertools 0.12.0", + "k256 0.13.3", + "log", + "next-derivation-index-ephemeral", + "once_cell 1.19.0", + "paste 1.0.14", + "pretty_assertions", + "pretty_env_logger", + "radix-common", + "radix-common-derive", + "radix-engine", + "radix-engine-interface", + "radix-engine-toolkit", + "radix-engine-toolkit-common", + "radix-rust", + "radix-transactions", + "rand", + "reqwest", + "sargon-addresses", + "sargon-core", + "sargon-factors", + "sargon-hierarchical-deterministic", + "sbor", + "serde", + "serde_json 1.0.108", + "serde_repr", + "serde_with 3.4.0", + "strum 0.26.1", + "thiserror 1.0.50", + "url", + "uuid 1.6.1", + "zeroize 1.7.0", +] + +[[package]] +name = "sargon-profile-supporting-types" +version = "1.1.99" +dependencies = [ + "derive_more", + "identified-vec-of", + "itertools 0.12.0", + "pretty_assertions", + "radix-common", + "radix-common-derive", + "radix-engine", + "radix-engine-interface", + "radix-engine-toolkit", + "radix-engine-toolkit-common", + "radix-rust", + "radix-transactions", + "sargon-addresses", + "sargon-core", + "sargon-factors", + "sargon-hierarchical-deterministic", + "sargon-profile", + "sbor", + "serde", + "serde_json 1.0.108", +] + +[[package]] +name = "sargon-transaction-models" +version = "1.1.99" +dependencies = [ + "assert-json-diff", + "async-trait", + "cargo_toml 0.15.3 (git+https://gitlab.com/lib.rs/cargo_toml?rev=e498c94fc42a660c1ca1a28999ce1d757cfe77fe)", + "delegate", + "derive_more", + "enum-as-inner", + "enum-iterator", + "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", + "identified-vec-of", + "iota-crypto", + "iso8601-timestamp", + "itertools 0.12.0", + "k256 0.13.3", + "log", + "once_cell 1.19.0", + "paste 1.0.14", + "pretty_assertions", + "radix-common", + "radix-common-derive", + "radix-engine", + "radix-engine-interface", + "radix-engine-toolkit", + "radix-engine-toolkit-common", + "radix-rust", + "radix-transactions", + "rand", + "sargon-addresses", + "sargon-core", + "sargon-factors", + "sargon-hierarchical-deterministic", + "sbor", + "serde", + "serde_json 1.0.108", + "serde_repr", + "serde_with 3.4.0", + "strum 0.26.1", + "thiserror 1.0.50", + "url", + "uuid 1.6.1", + "zeroize 1.7.0", +] + +[[package]] +name = "sargon-uniffi" +version = "1.1.99" +dependencies = [ + "actix-rt", + "assert-json-diff", + "async-trait", + "base64 0.22.1 (git+https://github.com/marshallpierce/rust-base64.git?rev=e14400697453bcc85997119b874bc03d9601d0af)", + "camino 1.0.8", + "clap 4.5.1", + "delegate", + "derive_more", + "enum-as-inner", + "enum-iterator", + "gateway-client-and-api", + "gateway-models", + "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", + "identified-vec-of", + "iso8601-timestamp", + "itertools 0.12.0", + "log", + "paste 1.0.14", + "preinterpret", + "pretty_assertions", + "pretty_env_logger", + "radix-engine-toolkit", + "rand", + "regex 1.9.3 (git+https://github.com/rust-lang/regex/?rev=72f889ef3cca59ebac6a026f3646e8d92f056d88)", + "sargon", + "sargon-addresses", + "sargon-clients", + "sargon-core", + "sargon-drivers", + "sargon-factor-instances-provider", + "sargon-factors", + "sargon-hierarchical-deterministic", + "sargon-keys-collector", + "sargon-manifests", + "sargon-profile", + "sargon-profile-logic", + "sargon-profile-security-structures", + "sargon-transaction-models", "sargon-uniffi-conversion-macros", "strum 0.26.1", "thiserror 1.0.50", @@ -3887,7 +4523,7 @@ dependencies = [ "anyhow", "camino 1.1.9", "cargo_metadata 0.15.4", - "clap 4.5.20", + "clap 4.5.23", "uniffi_bindgen", "uniffi_build", "uniffi_core", diff --git a/Cargo.toml b/Cargo.toml index 2e20d5bb7..930ad069b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,8 +11,25 @@ members = [ "crates/sargon-core", "crates/sargon-hierarchical-deterministic", "crates/sargon-factors", + "crates/sargon-factors-supporting-types", "crates/sargon-addresses", "crates/sargon-keys-collector", + "crates/sargon-transaction-models", + "crates/sargon-manifests", + "crates/sargon-profile-supporting-types", + "crates/sargon-drivers", + "crates/http-client", + "crates/sargon-clients", + "crates/sargon-profile-gateway", + "crates/sargon-profile", + "crates/sargon-profile-app-preferences", + "crates/sargon-profile-security-structures", + "crates/sargon-profile-logic", + "crates/sargon-factor-instances-provider", + "crates/next-derivation-index-ephemeral", + + "crates/gateway-models", + "crates/gateway-client-and-api", "crates/sargon", # to be split @@ -36,31 +53,62 @@ radix-common = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1 "serde", "secp256k1_sign_and_validate", ] } +radix-common-derive = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } radix-engine = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } radix-engine-interface = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } +radix-engine-toolkit = { git = "https://github.com/radixdlt/radix-engine-toolkit", rev = "2ab5b35a6cb96c9faeb98ed8df67b870336e6873" } +radix-engine-toolkit-common = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } radix-rust = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0", features = [ "serde", ] } radix-transactions = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } -radix-engine-toolkit = { git = "https://github.com/radixdlt/radix-engine-toolkit", rev = "2ab5b35a6cb96c9faeb98ed8df67b870336e6873" } +sbor = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } # ===== EXTERNAL DEPENDENCIES ======== + +# actix-rt = "3.3.0" +actix-rt = { git = "https://github.com/actix/actix-net", rev = "57fd6ea8098d1f2d281c305fc331216c4fe1992e" } + +# aes-gcm = "10.3" +aes-gcm = { git = "https://github.com/RustCrypto/AEADs", rev = "7e82b01cd4901f6a35b5153536f11b87f5e4e622", default-features = false, features = [ + "aes", + "alloc", + "getrandom", + "zeroize", +] } + arraystring = { git = "https://github.com/paulocsanz/arraystring", rev = "ebd7d8ba94fa0d5068fe048d5445f6b1af56035d", features = [ "serde-traits", ] } -# actix-rt = "3.3.0" -actix-rt = { git = "https://github.com/actix/actix-net", rev = "57fd6ea8098d1f2d281c305fc331216c4fe1992e" } +async-std = "1.13.0" async-trait = { git = "https://github.com/dtolnay/async-trait", rev = "1eb21ed8bd87029bf4dcbea41ff309f2b2220c43" } -# hkdf = "0.12.4" -hkdf = { git = "https://github.com/RustCrypto/KDFs/", rev = "1ac16e8b9d4ee7a67613c9396c6cc1327652eaba" } -# thiserror = "1.0.50" -thiserror = { git = "https://github.com/dtolnay/thiserror/", rev = "a7d220d7915fb888413aa7978efd70f7006bda9d" } # assert-json-diff = "2.0.2" assert-json-diff = { git = "https://github.com/davidpdrsn/assert-json-diff/", rev = "bca0d2c590808274298d939e0533da79cd09076d" } +base64 = { git = "https://github.com/marshallpierce/rust-base64.git", rev = "e14400697453bcc85997119b874bc03d9601d0af" } + +# bip39 = "2.0.0" +bip39 = { git = "https://github.com/rust-bitcoin/rust-bip39", rev = "a30760beac21d595b2bda376df4f4e6bf029bcc5", features = [ + "serde", + "zeroize", + "french", +] } + +# camino = "1.0.8" +camino = { git = "https://github.com/camino-rs/camino/", rev = "afa51b1b4c684b7e6698a6717ccda3affd0abd42" } + +# cargo_toml = "0.15.3" +cargo_toml = { git = "https://gitlab.com/lib.rs/cargo_toml", rev = "e498c94fc42a660c1ca1a28999ce1d757cfe77fe" } + +# clap = "4.5.1" +clap = { git = "https://github.com/clap-rs/clap/", rev = "8a7a13a5618cfdc4ff328624a5266e7b4d88649a", default-features = false, features = [ + "std", + "derive", +] } + # derive_more = "1.0.0" derive_more = { git = "https://github.com/JelteF/derive_more", rev = "d7f5b9e94d024790682f6fc4dcca13941cce64c8", features = [ "add", @@ -80,21 +128,16 @@ enum-as-inner = { git = "https://github.com/bluejekyll/enum-as-inner/", rev = "c # enum-iterator = "1.4.1" enum-iterator = { git = "https://github.com/stephaneyfx/enum-iterator/", rev = "9d472a1237cfd03b1c7657fdcba74c8070bfb4ea" } - -# aes-gcm = "10.3" -aes-gcm = { git = "https://github.com/RustCrypto/AEADs", rev = "7e82b01cd4901f6a35b5153536f11b87f5e4e622", default-features = false, features = [ - "aes", - "alloc", - "getrandom", - "zeroize", -] } - # delegate = "0.12.0" delegate = { git = "https://github.com/Kobzol/rust-delegate/", rev = "ac852be64f3e4b5f9b58be910d09921488d2845d" } +futures = "0.3.31" + # hex = "0.4.3" hex = { git = "https://github.com/KokaKiwi/rust-hex/", rev = "b2b4370b5bf021b98ee7adc92233e8de3f2de792" } +# hkdf = "0.12.4" +hkdf = { git = "https://github.com/RustCrypto/KDFs/", rev = "1ac16e8b9d4ee7a67613c9396c6cc1327652eaba" } # SLIP10 implementation # iota_crypto = "0.23.2" @@ -104,26 +147,51 @@ iota-crypto = { git = "https://github.com/iotaledger/crypto.rs", rev = "8c131255 "secp256k1", "x25519", ] } + +# iso8601-timestamp = "0.2.16" +iso8601-timestamp = { git = "https://github.com/Lantern-chat/iso8601-timestamp/", rev = "e5a3f2a5911759bc6b0d8100b032a6b4dd6e12c1", features = [ + "serde", + "std", +] } + +# itertools = "0.12.0" +itertools = { git = "https://github.com/rust-itertools/itertools/", rev = "98ecabb47d7147dae06fc3fa400ec758947194f3" } + # Transitive dependency of iota_crypto - used to construct PubKey from uncompressed bytes. # k256 = "0.13.3" k256 = { git = "https://github.com/RustCrypto/elliptic-curves", rev = "e158ce5cf0e9acee2fd76aff2a628334f5c771e5" } log = "0.4.20" +# once_cell = "1.19.0" +once_cell = { git = "https://github.com/matklad/once_cell/", rev = "c48d3c2c01de926228aea2ac1d03672b4ce160c1" } + +# paste = "1.0.14" +paste = { git = "https://github.com/dtolnay/paste", rev = "1e0cc1025af5388397c67fa4389ad7ad24814df8" } + +# preinterpret = "0.2.0" +preinterpret = { git = "https://github.com/dhedey/preinterpret", rev = "6754b92bdead0ddd6f69fbee7d782180d6351605" } + +# pretty_assertions = "1.4.0" +pretty_assertions = { git = "https://github.com/rust-pretty-assertions/rust-pretty-assertions", rev = "3f1ebc0cac5f88e875f036bf16636e15fa935c8d" } + +# pretty_env_logger = "0.5.0" +pretty_env_logger = { git = "https://github.com/seanmonstar/pretty-env-logger/", rev = "0e238400e18649415dc710c025e99c009a1bb744" } # rand = "0.8.5" rand = { git = "https://github.com/rust-random/rand/", rev = "937320cbfeebd4352a23086d9c6e68f067f74644" } +# regex = "1.9.3" +regex = { git = "https://github.com/rust-lang/regex/", rev = "72f889ef3cca59ebac6a026f3646e8d92f056d88" } -# serde_with = "3.4.0" -serde_with = { git = "https://github.com/jonasbb/serde_with/", rev = "1e8e4e75398c6a9de29386473ae7c3157be031c2" } - +# reqwest = "0.12.3" +reqwest = { git = "https://github.com/seanmonstar/reqwest", rev = "0720159f6369f54e045a1fd315e0f24b7a0b4a39", default-features = false, features = [ + "native-tls-vendored", +] } -# paste = "1.0.14" -paste = { git = "https://github.com/dtolnay/paste", rev = "1e0cc1025af5388397c67fa4389ad7ad24814df8" } -# pretty_assertions = "1.4.0" -pretty_assertions = { git = "https://github.com/rust-pretty-assertions/rust-pretty-assertions", rev = "3f1ebc0cac5f88e875f036bf16636e15fa935c8d" } +# serde_with = "3.4.0" +serde_with = { git = "https://github.com/jonasbb/serde_with/", rev = "1e8e4e75398c6a9de29386473ae7c3157be031c2" } serde = { version = "1.0.193", features = ["derive", "rc", "std"] } @@ -132,28 +200,24 @@ serde_json = { git = "https://github.com/serde-rs/json/", rev = "4bc1eaa03a61605 "preserve_order", ] } - # serde_repr = "0.1.17" serde_repr = { git = "https://github.com/dtolnay/serde-repr/", rev = "94cce18a51bc169869f2cdcea6549b3ed81b3b2e" } -# iso8601-timestamp = "0.2.16" -iso8601-timestamp = { git = "https://github.com/Lantern-chat/iso8601-timestamp/", rev = "e5a3f2a5911759bc6b0d8100b032a6b4dd6e12c1", features = [ - "serde", - "std", -] } -# itertools = "0.12.0" -itertools = { git = "https://github.com/rust-itertools/itertools/", rev = "98ecabb47d7147dae06fc3fa400ec758947194f3" } - -# once_cell = "1.19.0" -once_cell = { git = "https://github.com/matklad/once_cell/", rev = "c48d3c2c01de926228aea2ac1d03672b4ce160c1" } - - # strum = "0.26.1" strum = { git = "https://github.com/Peternator7/strum/", rev = "f746c3699acf150112e26c00e6c8ca666d8d068d", features = [ "derive", ] } + +# thiserror = "1.0.50" +thiserror = { git = "https://github.com/dtolnay/thiserror/", rev = "a7d220d7915fb888413aa7978efd70f7006bda9d" } + url = { version = "2.5.0", features = ["serde"] } +# uniffi = "0.28.3" +uniffi = { git = "https://github.com/mozilla/uniffi-rs/", rev = "9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d", features = [ + "cli", +] } + # uuid = "1.6.1" uuid = { git = "https://github.com/uuid-rs/uuid/", rev = "c8891073248ddc7faa8c53ac9ceb629a341c7b9b", features = [ "v4", @@ -165,6 +229,3 @@ zeroize = { git = "https://github.com/RustCrypto/utils", rev = "df6d2f48a5e8afe8 "zeroize_derive", "derive", ] } - -# cargo_toml = "0.15.3" -cargo_toml = { git = "https://gitlab.com/lib.rs/cargo_toml", rev = "e498c94fc42a660c1ca1a28999ce1d757cfe77fe" } diff --git a/Package.resolved b/Package.resolved index af565dc0a..f202b8c0c 100644 --- a/Package.resolved +++ b/Package.resolved @@ -14,8 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-collections.git", "state" : { - "revision" : "94cf62b3ba8d4bed62680a282d4c25f9c63c2efb", - "version" : "1.1.0" + "revision" : "671108c96644956dddcd89dd59c203dcdb36cec7", + "version" : "1.1.4" } }, { @@ -23,8 +23,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/swift-custom-dump", "state" : { - "revision" : "f01efb26f3a192a0e88dcdb7c3c391ec2fc25d9c", - "version" : "1.3.0" + "revision" : "82645ec760917961cfa08c9c0c7104a57a0fa4b1", + "version" : "1.3.3" } }, { @@ -41,8 +41,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/xctest-dynamic-overlay", "state" : { - "revision" : "6f30bdba373bbd7fbfe241dddd732651f2fbd1e2", - "version" : "1.1.2" + "revision" : "a3f634d1a409c7979cabc0a71b3f26ffa9fc8af1", + "version" : "1.4.3" } } ], diff --git a/_typos.toml b/_typos.toml index d9d4336ec..0dafa647f 100644 --- a/_typos.toml +++ b/_typos.toml @@ -1,6 +1,6 @@ [files] extend-exclude = [ - "crates/sargon/fixtures/**", + "crates/**/fixtures/**/**", "scripts/**", "apple/Sources/UniFFI/Sargon.swift", "examples/iOS/Backend/Sources/Planbok/Features/DebugProfileFeature.swift", diff --git a/apple/Sources/Sargon/Extensions/Methods/Transaction/AccountOrAddressOf+Wrap+Functions.swift b/apple/Sources/Sargon/Extensions/Methods/Transaction/AccountOrAddressOf+Wrap+Functions.swift index 5df313883..5c14c5919 100644 --- a/apple/Sources/Sargon/Extensions/Methods/Transaction/AccountOrAddressOf+Wrap+Functions.swift +++ b/apple/Sources/Sargon/Extensions/Methods/Transaction/AccountOrAddressOf+Wrap+Functions.swift @@ -1,6 +1,6 @@ import SargonUniFFI -extension AccountOrAddressOf { +extension OwnedOrThirdPartyAccountAddress { public var accountAddress: AccountAddress { accountOrAddressOfAccountAddress(recipient: self) } diff --git a/apple/Sources/Sargon/Extensions/SampleValues/Transaction/AccountOrAddressOf+SampleValues.swift b/apple/Sources/Sargon/Extensions/SampleValues/Transaction/AccountOrAddressOf+SampleValues.swift index d05f42837..3ea15280b 100644 --- a/apple/Sources/Sargon/Extensions/SampleValues/Transaction/AccountOrAddressOf+SampleValues.swift +++ b/apple/Sources/Sargon/Extensions/SampleValues/Transaction/AccountOrAddressOf+SampleValues.swift @@ -1,7 +1,7 @@ import SargonUniFFI #if DEBUG -extension AccountOrAddressOf { +extension OwnedOrThirdPartyAccountAddress { public static let sample: Self = newAccountOrAddressOfSample() public static let sampleOther: Self = newAccountOrAddressOfSampleOther() } diff --git a/apple/Sources/Sargon/Extensions/Swiftified/Transaction/AccountOrAddressOf+Swiftified.swift b/apple/Sources/Sargon/Extensions/Swiftified/Transaction/AccountOrAddressOf+Swiftified.swift index 66ce64b49..3eba93700 100644 --- a/apple/Sources/Sargon/Extensions/Swiftified/Transaction/AccountOrAddressOf+Swiftified.swift +++ b/apple/Sources/Sargon/Extensions/Swiftified/Transaction/AccountOrAddressOf+Swiftified.swift @@ -1,17 +1,17 @@ import SargonUniFFI -// MARK: - AccountOrAddressOf + SargonModel -extension AccountOrAddressOf: SargonModel {} +// MARK: - OwnedOrThirdPartyAccountAddress + SargonModel +extension OwnedOrThirdPartyAccountAddress: SargonModel {} -// MARK: - AccountOrAddressOf + CustomStringConvertible -extension AccountOrAddressOf: CustomStringConvertible { +// MARK: - OwnedOrThirdPartyAccountAddress + CustomStringConvertible +extension OwnedOrThirdPartyAccountAddress: CustomStringConvertible { public var description: String { accountAddress.address } } -// MARK: - AccountOrAddressOf + Identifiable -extension AccountOrAddressOf: Identifiable { +// MARK: - OwnedOrThirdPartyAccountAddress + Identifiable +extension OwnedOrThirdPartyAccountAddress: Identifiable { public typealias ID = AccountAddress public var id: ID { accountAddress diff --git a/apple/Tests/TestCases/RET/ManifestBuilding/ManifestBuildingTests.swift b/apple/Tests/TestCases/RET/ManifestBuilding/ManifestBuildingTests.swift index b0846de7f..169f4ad14 100644 --- a/apple/Tests/TestCases/RET/ManifestBuilding/ManifestBuildingTests.swift +++ b/apple/Tests/TestCases/RET/ManifestBuilding/ManifestBuildingTests.swift @@ -230,8 +230,11 @@ extension TestCase { return try XCTUnwrap(String(data: utf8, encoding: .utf8)) } - func rtm(_ rtmFile: String) throws -> TransactionManifest { - let data = try openTransactionFile(rtmFile, extension: "rtm") + func rtm( + _ rtmFile: String, + in crate: String = "sargon-transaction-models" + ) throws -> TransactionManifest { + let data = try openTransactionFile(rtmFile, extension: "rtm", in: crate) let instructionsString = try XCTUnwrap(String(data: data, encoding: .utf8)) return try TransactionManifest( @@ -241,7 +244,11 @@ extension TestCase { ) } - private func openTransactionFile(_ fileName: String, extension fileExtension: String) throws -> Data { - try openFile(subPath: "transaction", fileName, extension: fileExtension) + private func openTransactionFile( + _ fileName: String, + extension fileExtension: String, + in crate: String = "sargon-transaction-models" + ) throws -> Data { + try openFile(subPath: "transaction", fileName, extension: fileExtension, in: crate) } } diff --git a/apple/Tests/TestCases/RadixConnect/WalletInteraction/WalletToDappInteractionResponseTests.swift b/apple/Tests/TestCases/RadixConnect/WalletInteraction/WalletToDappInteractionResponseTests.swift index 71e5123cd..9636335ec 100644 --- a/apple/Tests/TestCases/RadixConnect/WalletInteraction/WalletToDappInteractionResponseTests.swift +++ b/apple/Tests/TestCases/RadixConnect/WalletInteraction/WalletToDappInteractionResponseTests.swift @@ -6,7 +6,12 @@ import XCTest final class WalletToDappInteractionResponseTests: Test { func test_codable() throws { - let json = try openFile(subPath: "vector", "wallet_interactions_wallet_to_dapp", extension: "json") + let json = try openFile( + subPath: "vector", + "wallet_interactions_wallet_to_dapp", + extension: "json", + in: "sargon" + ) let sut = try JSONDecoder().decode([SUT].self, from: json) let encoded = try JSONEncoder().encode(sut) try XCTAssertEqual(JSONDecoder().decode([SUT].self, from: encoded), sut) diff --git a/apple/Tests/TestCases/Transaction/AccountOrAddressOfTests.swift b/apple/Tests/TestCases/Transaction/AccountOrAddressOfTests.swift index 70508e864..d0789c814 100644 --- a/apple/Tests/TestCases/Transaction/AccountOrAddressOfTests.swift +++ b/apple/Tests/TestCases/Transaction/AccountOrAddressOfTests.swift @@ -4,7 +4,7 @@ import Sargon import SargonUniFFI import XCTest -final class AccountOrAddressOfTests: Test { +final class AccountOrAddressOfTests: Test { func test_id_is_account_address() { XCTAssertEqual(SUT.sample.id, SUT.sample.accountAddress) } diff --git a/apple/Tests/Utils/Test.swift b/apple/Tests/Utils/Test.swift index dc76610ab..5d1e5758e 100644 --- a/apple/Tests/Utils/Test.swift +++ b/apple/Tests/Utils/Test.swift @@ -24,11 +24,12 @@ class TestCase: XCTestCase { func openFile( subPath: String, _ fileName: String, - extension fileExtension: String + extension fileExtension: String, + in crate: String = "sargon-profile" ) throws -> Data { let testsDirectory: String = URL(fileURLWithPath: "\(#file)").pathComponents.dropLast(4).joined(separator: "/") - let fileURL = try XCTUnwrap(URL(fileURLWithPath: "\(testsDirectory)/crates/sargon/fixtures/\(subPath)/\(fileName).\(fileExtension)")) + let fileURL = try XCTUnwrap(URL(fileURLWithPath: "\(testsDirectory)/crates/\(crate)/fixtures/\(subPath)/\(fileName).\(fileExtension)")) return try Data(contentsOf: fileURL) } diff --git a/codecov.yml b/codecov.yml deleted file mode 100644 index 98d8318b6..000000000 --- a/codecov.yml +++ /dev/null @@ -1,22 +0,0 @@ -codecov: - notify: - wait_for_ci: true - max_report_age: off - require_ci_to_pass: true -comment: - behavior: default - layout: "reach, diff, flags, files" - show_carryforward_flags: false -coverage: - precision: 1 - range: 97...98 # red -> yellow (the inside range) -> green - status: - patch: - default: - target: auto - threshold: 80% - base: auto - only_pulls: true -flag_management: - default_rules: - carryforward: true diff --git a/crates/.DS_Store b/crates/.DS_Store deleted file mode 100644 index 67a13787b4aec80925c61a914ff4aa5a7286cf17..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK!AiqG5S?wSrWBzEg&qT5D^??lcnMK|z=$4HYGSGeaN1hRG&C6961k!b%;RFNDTPXQX01HAJE3P$1(`{upN} zo{471Uu1yZ-6G@=K_70R{Qh3!$1KeUoz9!6RBH>1OU{zha4y3;H3|pOV3-F{|D1X! zN@elXj^fj_H|jQ54wM{3sqFQ2LYnk2dxxg#{O~lK6{Yr*$^r4Kc{8c;uK!cDD5f9ud^7RkpfBsPhnqX zO5UQMCR_eY1gyglB&2YIzjQjqbWNIyg&AN5n1Oj^z@BAJV_rAF&&>=l13$(9oewT5 zp>MG;sE-b8bP0e+pOIS7rdon>T#LTN!XS>I2$PCvQiUxsgh@xgYvX*2g+Y@J!WJLG zt}JYYBJ}DwzpKMR_y)OU2AF{|169*)(*1w*ef?if;vO@=4E!qwMC~v<3~)>KZk^d2 w-L)?26)FkE6$U?2(9l;g#?n>XLe+wPmkdPTVqp+HDEuLyY2bz#_*Dkp0dsd+yZ`_I diff --git a/crates/gateway-client-and-api/Cargo.toml b/crates/gateway-client-and-api/Cargo.toml new file mode 100644 index 000000000..0ad1c1df0 --- /dev/null +++ b/crates/gateway-client-and-api/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "gateway-client-and-api" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +sargon-core-assert-json = { path = "../sargon-core-assert-json" } +sargon-core = { path = "../sargon-core" } +sargon-addresses = { path = "../sargon-addresses" } +sargon-drivers = { path = "../sargon-drivers" } +http-client = { path = "../http-client" } +gateway-models = { path = "../gateway-models" } +sargon-transaction-models = { path = "../sargon-transaction-models" } +sargon-profile-gateway = { path = "../sargon-profile-gateway" } + +# === RADIX DEPENDENCIES === +radix-common = { workspace = true } + +# === EXTERNAL DEPENDENCIES === +serde = { workspace = true } +serde_json = { workspace = true } + +[dev-dependencies] +actix-rt = { workspace = true } diff --git a/crates/sargon/src/gateway_api/assert_network_request.rs b/crates/gateway-client-and-api/src/assert_network_request.rs similarity index 100% rename from crates/sargon/src/gateway_api/assert_network_request.rs rename to crates/gateway-client-and-api/src/assert_network_request.rs diff --git a/crates/sargon/src/system/clients/client/http_client/http_client.rs b/crates/gateway-client-and-api/src/client/gateway_client.rs similarity index 58% rename from crates/sargon/src/system/clients/client/http_client/http_client.rs rename to crates/gateway-client-and-api/src/client/gateway_client.rs index 213284da0..5c048e3ae 100644 --- a/crates/sargon/src/system/clients/client/http_client/http_client.rs +++ b/crates/gateway-client-and-api/src/client/gateway_client.rs @@ -1,77 +1,48 @@ +use sargon_profile_gateway::prelude::Gateway; + use crate::prelude::*; -use serde_json::Value; -/// A `HttpClient` needs a "network antenna" to be able to execute the -/// network requests - which is a trait that clients implement on the FFI side (iOS/Android). -#[derive(Debug)] -pub struct HttpClient { - /// An object implementing the `NetworkingDriver` traits, which iOS/Android - /// clients pass into the constructor of this GatewayClient, so that it can - /// execute network requests. - pub driver: Arc, -} +/// An HTTP client for consuming the Radix ⛩️ Gateway API ([docs]). +/// +/// The implementing FFI clients can then consume the Radix Gateway API to e.g. +/// fetch the XRD balance of an account address or submit a signed transaction. +/// +/// [docs]: https://radix-babylon-gateway-api.redoc.ly/ +pub struct GatewayClient { + /// The HTTP client that actually executes the network requests. + pub http_client: HttpClient, -impl HttpClient { - pub fn new(driver: Arc) -> Self { - Self { driver } - } + /// The gateway this GatewayClient talks to, which is a (URL, NetworkID) tuple + /// essentially. + pub gateway: Gateway, } -impl HttpClient { - pub async fn execute_network_request( - &self, - request: NetworkRequest, - ) -> Result { - let response = self.driver.execute_network_request(request).await?; - - // Check for valid status code - if !(200..=299).contains(&response.status_code) { - return Err(CommonError::NetworkResponseBadCode { - code: response.status_code, - }); +impl GatewayClient { + /// Constructs a new `GatewayClient` with a NetworkingDriver for a specified + /// `Gateway`. + pub fn with_gateway( + networking_driver: Arc, + gateway: Gateway, + ) -> Self { + Self { + http_client: HttpClient { + driver: networking_driver, + }, + gateway, } - - Ok(response.body) - } -} - -impl HttpClient { - fn model_from_response( - &self, - bytes: BagOfBytes, - ) -> Result - where - U: for<'a> Deserialize<'a>, - { - serde_json::from_slice::(&bytes).map_err(|_| { - CommonError::NetworkResponseJSONDeserialize { - into_type: type_name::(), - } - }) - } - - pub async fn execute_request_with_decoding( - &self, - request: NetworkRequest, - ) -> Result - where - U: for<'a> Deserialize<'a>, - { - let response = self.execute_network_request(request).await?; - self.model_from_response(response) } - pub async fn execute_request_with_map( - &self, - request: NetworkRequest, - map: F, - ) -> Result - where - U: for<'a> Deserialize<'a>, - F: Fn(U) -> Result, - { - let model = self.execute_request_with_decoding(request).await?; - map(model) + /// Constructs a new `GatewayClient` with a NetworkingDriver for a specified + /// network, by looking up an Radix DLT provided Gateway on that network. + /// + /// # Panics + /// Panics if Radix DLT does not provide a Gateway for the specified + /// `network_id` - e.g. will panic if you specify `NetworkID::Simulator` (duh). + pub fn new( + networking_driver: Arc, + network_id: NetworkID, + ) -> Self { + Self::with_gateway(networking_driver, Gateway::from(network_id)) } } @@ -79,7 +50,6 @@ impl HttpClient { mod tests { use super::*; use actix_rt::time::timeout; - use reqwest::Response; use std::time::Duration; const MAX: Duration = Duration::from_millis(10); @@ -87,6 +57,27 @@ mod tests { #[allow(clippy::upper_case_acronyms)] type SUT = GatewayClient; + #[actix_rt::test] + async fn test_submit_notarized_transaction_mock_duplicate() { + let mock_networking_driver = + MockNetworkingDriver::with_response(TransactionSubmitResponse { + duplicate: true, + }); + let sut = + SUT::new(Arc::new(mock_networking_driver), NetworkID::Stokenet); + let req = + sut.submit_notarized_transaction(NotarizedTransaction::sample()); + let result = timeout(MAX, req).await.unwrap(); + + assert_eq!( + result, + Err( + CommonError::GatewaySubmitDuplicateTX { + intent_hash: r#"txid_rdx198k527d5wt4ms5tvrdcu8089v4hptp7ztv388k539uzzvmw25ltsj7u4zz"#.to_owned() } + ) + ); + } + #[actix_rt::test] async fn execute_network_request_invalid_url() { let mock_networking_driver = diff --git a/crates/sargon/src/gateway_api/client/gateway_client_dispatch_request.rs b/crates/gateway-client-and-api/src/client/gateway_client_dispatch_request.rs similarity index 85% rename from crates/sargon/src/gateway_api/client/gateway_client_dispatch_request.rs rename to crates/gateway-client-and-api/src/client/gateway_client_dispatch_request.rs index 1c6fc18f8..35b825030 100644 --- a/crates/sargon/src/gateway_api/client/gateway_client_dispatch_request.rs +++ b/crates/gateway-client-and-api/src/client/gateway_client_dispatch_request.rs @@ -6,7 +6,7 @@ use crate::prelude::*; impl GatewayClient { /// Dispatches an HTTP `POST` request by JSON serializing the specified /// `request` and setting it as the `body` for the network request. - pub(crate) async fn post( + pub async fn post( &self, path: impl AsRef, request: T, @@ -38,7 +38,7 @@ impl GatewayClient { } /// Dispatches an HTTP `POST` request without any `body`. - pub(crate) async fn post_empty( + pub async fn post_empty( &self, path: impl AsRef, map: F, @@ -54,12 +54,16 @@ impl GatewayClient { } /// An identity mapping function for Result -pub(crate) const fn res_id(x: T) -> Result { +pub const fn res_id(x: T) -> Result { std::convert::identity::>(Ok(x)) } -impl NetworkRequest { - fn with_gateway_api_headers(self) -> Self { +pub trait NetworkRequestWithGatewayAndApiHeaders { + fn with_gateway_api_headers(self) -> NetworkRequest; +} + +impl NetworkRequestWithGatewayAndApiHeaders for NetworkRequest { + fn with_gateway_api_headers(self) -> NetworkRequest { let headers = HashMap::::from_iter([ ("content-Type".to_owned(), "application/json".to_owned()), ("accept".to_owned(), "application/json".to_owned()), diff --git a/crates/sargon/src/gateway_api/client/mod.rs b/crates/gateway-client-and-api/src/client/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/client/mod.rs rename to crates/gateway-client-and-api/src/client/mod.rs diff --git a/crates/gateway-client-and-api/src/endpoints/mod.rs b/crates/gateway-client-and-api/src/endpoints/mod.rs new file mode 100644 index 000000000..7a6d4cbab --- /dev/null +++ b/crates/gateway-client-and-api/src/endpoints/mod.rs @@ -0,0 +1,3 @@ +mod state_endpoints; +mod status_endpoints; +mod transaction_endpoints; diff --git a/crates/sargon/src/gateway_api/endpoints/state_endpoints.rs b/crates/gateway-client-and-api/src/endpoints/state_endpoints.rs similarity index 91% rename from crates/sargon/src/gateway_api/endpoints/state_endpoints.rs rename to crates/gateway-client-and-api/src/endpoints/state_endpoints.rs index 1d9b84c68..def9cf49d 100644 --- a/crates/sargon/src/gateway_api/endpoints/state_endpoints.rs +++ b/crates/gateway-client-and-api/src/endpoints/state_endpoints.rs @@ -8,7 +8,7 @@ impl GatewayClient { /// See [the Gateway API docs for details][doc]. /// /// [doc]: https://radix-babylon-gateway-api.redoc.ly/#operation/StateEntityDetails - pub(crate) async fn state_entity_details( + pub async fn state_entity_details( &self, request: StateEntityDetailsRequest, ) -> Result { @@ -24,7 +24,7 @@ impl GatewayClient { /// See [the Gateway API docs for details][doc]. /// /// [doc]: https://radix-babylon-gateway-api.redoc.ly/#operation/EntityFungiblesPage - pub(crate) async fn state_entity_page_fungibles( + pub async fn state_entity_page_fungibles( &self, request: StateEntityPageFungiblesRequest, ) -> Result> { @@ -41,7 +41,7 @@ impl GatewayClient { /// See [the Gateway API docs for details][doc]. /// /// [doc]: https://radix-babylon-gateway-api.redoc.ly/#operation/EntityNonFungiblesPage - pub(crate) async fn state_entity_page_non_fungibles( + pub async fn state_entity_page_non_fungibles( &self, request: StateEntityPageNonFungiblesRequest, ) -> Result> { @@ -58,7 +58,7 @@ impl GatewayClient { /// /// [doc]: https://radix-babylon-gateway-api.redoc.ly/#operation/EntityNonFungibleResourceVaultPage #[allow(dead_code)] - pub(crate) async fn state_entity_page_non_fungible_vaults( + pub async fn state_entity_page_non_fungible_vaults( &self, request: StateEntityPageNonFungibleVaultsRequest, ) -> Result< @@ -80,7 +80,7 @@ impl GatewayClient { /// /// [doc]: https://radix-babylon-gateway-api.redoc.ly/#operation/EntityNonFungibleIdsPage #[allow(dead_code)] - pub(crate) async fn state_entity_page_non_fungible_vault_ids( + pub async fn state_entity_page_non_fungible_vault_ids( &self, request: StateEntityPageNonFungibleVaultIdsRequest, ) -> Result> { @@ -97,7 +97,7 @@ impl GatewayClient { /// See [the Gateway API docs for details][doc]. /// /// [doc]: https://radix-babylon-gateway-api.redoc.ly/#operation/AccountResourcePreferencesPage - pub(crate) async fn account_page_resource_preferences( + pub async fn account_page_resource_preferences( &self, request: AccountPageResourcePreferencesRequest, ) -> Result> { @@ -112,7 +112,7 @@ impl GatewayClient { /// See [the Gateway API docs for details][doc]. /// /// [doc]: https://radix-babylon-gateway-api.redoc.ly/#operation/AccountAuthorizedDepositorsPage - pub(crate) async fn account_page_authorized_depositors( + pub async fn account_page_authorized_depositors( &self, request: AccountPageAuthorizedDepositorsRequest, ) -> Result> { @@ -129,7 +129,7 @@ impl GatewayClient { /// See [the Gateway API docs for details][doc]. /// /// [doc]: https://radix-babylon-gateway-api.redoc.ly/#operation/NonFungibleLocation - pub(crate) async fn state_non_fungible_location( + pub async fn state_non_fungible_location( &self, request: StateNonFungibleLocationRequest, ) -> Result { diff --git a/crates/sargon/src/gateway_api/endpoints/status_endpoints.rs b/crates/gateway-client-and-api/src/endpoints/status_endpoints.rs similarity index 81% rename from crates/sargon/src/gateway_api/endpoints/status_endpoints.rs rename to crates/gateway-client-and-api/src/endpoints/status_endpoints.rs index fcddffc0f..4dcf19297 100644 --- a/crates/sargon/src/gateway_api/endpoints/status_endpoints.rs +++ b/crates/gateway-client-and-api/src/endpoints/status_endpoints.rs @@ -8,7 +8,7 @@ impl GatewayClient { /// See [the Gateway API docs for details][doc]. /// /// [doc]: https://radix-babylon-gateway-api.redoc.ly/#operation/GatewayStatus - pub(crate) async fn gateway_status(&self) -> Result { + pub async fn gateway_status(&self) -> Result { self.post_empty("status/gateway-status", res_id).await } } diff --git a/crates/sargon/src/gateway_api/endpoints/transaction_endpoints.rs b/crates/gateway-client-and-api/src/endpoints/transaction_endpoints.rs similarity index 90% rename from crates/sargon/src/gateway_api/endpoints/transaction_endpoints.rs rename to crates/gateway-client-and-api/src/endpoints/transaction_endpoints.rs index caa52ff68..28b97d88c 100644 --- a/crates/sargon/src/gateway_api/endpoints/transaction_endpoints.rs +++ b/crates/gateway-client-and-api/src/endpoints/transaction_endpoints.rs @@ -8,7 +8,7 @@ impl GatewayClient { /// See [the Gateway API docs for details][doc]. /// /// [doc]: https://radix-babylon-gateway-api.redoc.ly/#operation/TransactionConstruction - pub(crate) async fn transaction_construction(&self) -> Result { + pub async fn transaction_construction(&self) -> Result { self.post_empty( "transaction/construction", |response: TransactionConstructionResponse| { @@ -26,7 +26,7 @@ impl GatewayClient { /// See [the Gateway API docs for details][doc]. /// /// [doc]: https://radix-babylon-gateway-api.redoc.ly/#operation/TransactionPreview - pub(crate) async fn transaction_preview( + pub async fn transaction_preview( &self, request: TransactionPreviewRequest, ) -> Result { @@ -41,7 +41,7 @@ impl GatewayClient { /// See [the Gateway API docs for details][doc]. /// /// [doc]: https://radix-babylon-gateway-api.redoc.ly/#operation/TransactionPreviewV2 - pub(crate) async fn transaction_preview_v2( + pub async fn transaction_preview_v2( &self, request: TransactionPreviewRequestV2, ) -> Result { @@ -53,7 +53,7 @@ impl GatewayClient { /// See [the Gateway API docs for details][doc]. /// /// [doc]: https://radix-babylon-gateway-api.redoc.ly/#operation/TransactionSubmit - pub(crate) async fn transaction_submit( + pub async fn transaction_submit( &self, request: TransactionSubmitRequest, ) -> Result { @@ -65,7 +65,7 @@ impl GatewayClient { /// See [the Gateway API docs for details][doc]. /// /// [doc]: https://radix-babylon-gateway-api.redoc.ly/#operation/TransactionStatus - pub(crate) async fn transaction_status( + pub async fn transaction_status( &self, request: TransactionStatusRequest, ) -> Result { @@ -79,7 +79,7 @@ impl GatewayClient { /// See [the Gateway API docs for details][doc]. /// /// [doc]: https://radix-babylon-gateway-api.redoc.ly/#operation/TransactionSubintentStatus - pub(crate) async fn subintent_status( + pub async fn subintent_status( &self, request: SubintentStatusRequest, ) -> Result { diff --git a/crates/gateway-client-and-api/src/lib.rs b/crates/gateway-client-and-api/src/lib.rs new file mode 100644 index 000000000..dcb924c71 --- /dev/null +++ b/crates/gateway-client-and-api/src/lib.rs @@ -0,0 +1,18 @@ +mod assert_network_request; +mod client; +mod endpoints; +mod methods; + +pub mod prelude { + pub use crate::assert_network_request::*; + pub use crate::client::*; + + pub use gateway_models::prelude::*; + pub use http_client::prelude::*; + pub use sargon_drivers::prelude::*; + pub use sargon_transaction_models::prelude::*; + + pub use serde::{Deserialize, Serialize}; +} + +pub use prelude::*; diff --git a/crates/sargon/src/gateway_api/methods/mod.rs b/crates/gateway-client-and-api/src/methods/mod.rs similarity index 80% rename from crates/sargon/src/gateway_api/methods/mod.rs rename to crates/gateway-client-and-api/src/methods/mod.rs index 9a1da603f..c32e889c6 100644 --- a/crates/sargon/src/gateway_api/methods/mod.rs +++ b/crates/gateway-client-and-api/src/methods/mod.rs @@ -6,7 +6,3 @@ mod page_methods; mod state_methods; mod transaction_methods; - -pub use page_methods::*; -pub use state_methods::*; -pub use transaction_methods::*; diff --git a/crates/sargon/src/gateway_api/methods/page_methods.rs b/crates/gateway-client-and-api/src/methods/page_methods.rs similarity index 99% rename from crates/sargon/src/gateway_api/methods/page_methods.rs rename to crates/gateway-client-and-api/src/methods/page_methods.rs index 9b2efb344..bdb8659da 100644 --- a/crates/sargon/src/gateway_api/methods/page_methods.rs +++ b/crates/gateway-client-and-api/src/methods/page_methods.rs @@ -38,8 +38,9 @@ impl GatewayClient { #[cfg(test)] mod tests { + use sargon_profile_gateway::prelude::Gateway; + use crate::prelude::*; - use actix_rt::time::timeout; #[allow(clippy::upper_case_acronyms)] type SUT = GatewayClient; diff --git a/crates/sargon/src/gateway_api/methods/state_methods.rs b/crates/gateway-client-and-api/src/methods/state_methods.rs similarity index 99% rename from crates/sargon/src/gateway_api/methods/state_methods.rs rename to crates/gateway-client-and-api/src/methods/state_methods.rs index b837bbe0d..703814acc 100644 --- a/crates/sargon/src/gateway_api/methods/state_methods.rs +++ b/crates/gateway-client-and-api/src/methods/state_methods.rs @@ -1,5 +1,7 @@ use crate::prelude::*; +use radix_common::prelude::ACCOUNT_OWNER_BADGE as SCRYPTO_ACCOUNT_OWNER_BADGE; + impl GatewayClient { /// Fetched the XRD balance of account of `address`, returns `None` if /// it has no balance. @@ -410,7 +412,7 @@ impl GatewayClient { #[cfg(test)] mod fetch_all_resources_tests { use crate::prelude::*; - use actix_rt::time::timeout; + use sargon_profile_gateway::prelude::Gateway; #[allow(clippy::upper_case_acronyms)] type SUT = GatewayClient; @@ -681,7 +683,7 @@ mod fetch_all_resources_tests { #[cfg(test)] mod filter_transferable_tests { use crate::prelude::*; - use actix_rt::time::timeout; + use sargon_profile_gateway::prelude::Gateway; #[allow(clippy::upper_case_acronyms)] type SUT = GatewayClient; diff --git a/crates/sargon/src/gateway_api/methods/transaction_methods.rs b/crates/gateway-client-and-api/src/methods/transaction_methods.rs similarity index 96% rename from crates/sargon/src/gateway_api/methods/transaction_methods.rs rename to crates/gateway-client-and-api/src/methods/transaction_methods.rs index 597c45cee..ff878e0a0 100644 --- a/crates/sargon/src/gateway_api/methods/transaction_methods.rs +++ b/crates/gateway-client-and-api/src/methods/transaction_methods.rs @@ -1,5 +1,4 @@ use crate::prelude::*; -use radix_engine_toolkit_common::receipt::SerializableToolkitTransactionReceipt; impl GatewayClient { /// Returns the current `Epoch` of the Radix Network of the provided gateway. diff --git a/crates/gateway-models/Cargo.toml b/crates/gateway-models/Cargo.toml new file mode 100644 index 000000000..4c5e270ef --- /dev/null +++ b/crates/gateway-models/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "gateway-models" +version = "1.1.99" +edition = "2021" +build = "build.rs" + +[dependencies] +# === SARGON CRATES === +sargon-core-assert-json = { path = "../sargon-core-assert-json" } +sargon-core = { path = "../sargon-core" } +sargon-addresses = { path = "../sargon-addresses" } +sargon-transaction-models = { path = "../sargon-transaction-models" } + +# === RADIX DEPENDENCIES === +radix-engine-toolkit-common = { workspace = true } +radix-transactions = { workspace = true } +radix-engine-interface = { workspace = true } + +# === EXTERNAL DEPENDENCIES === +derive_more = { workspace = true } +serde = { workspace = true } diff --git a/crates/gateway-models/build.rs b/crates/gateway-models/build.rs new file mode 100644 index 000000000..f0df0eba9 --- /dev/null +++ b/crates/gateway-models/build.rs @@ -0,0 +1,14 @@ +use std::env; +use std::path::Path; + +pub fn main() { + // Paths for reading fixtures used by tests + let fixtures_path = Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures"); + println!("cargo:rustc-env=FIXTURES={}/", fixtures_path.display()); + + let fixtures_models_path = fixtures_path.join("models"); + println!( + "cargo:rustc-env=FIXTURES_MODELS_GW={}/", + fixtures_models_path.display() + ); +} diff --git a/crates/sargon/fixtures/models/gateway/state/request_entity_details__single_account_no_assets.json b/crates/gateway-models/fixtures/models/state/request_entity_details__single_account_no_assets.json similarity index 100% rename from crates/sargon/fixtures/models/gateway/state/request_entity_details__single_account_no_assets.json rename to crates/gateway-models/fixtures/models/state/request_entity_details__single_account_no_assets.json diff --git a/crates/sargon/fixtures/models/gateway/state/request_entity_details__single_resource.json b/crates/gateway-models/fixtures/models/state/request_entity_details__single_resource.json similarity index 100% rename from crates/sargon/fixtures/models/gateway/state/request_entity_details__single_resource.json rename to crates/gateway-models/fixtures/models/state/request_entity_details__single_resource.json diff --git a/crates/sargon/fixtures/models/gateway/state/request_entity_details__two_accounts.json b/crates/gateway-models/fixtures/models/state/request_entity_details__two_accounts.json similarity index 100% rename from crates/sargon/fixtures/models/gateway/state/request_entity_details__two_accounts.json rename to crates/gateway-models/fixtures/models/state/request_entity_details__two_accounts.json diff --git a/crates/sargon/fixtures/models/gateway/state/response_entity_details__single_account_many_nfts_and_fungibles.json b/crates/gateway-models/fixtures/models/state/response_entity_details__single_account_many_nfts_and_fungibles.json similarity index 100% rename from crates/sargon/fixtures/models/gateway/state/response_entity_details__single_account_many_nfts_and_fungibles.json rename to crates/gateway-models/fixtures/models/state/response_entity_details__single_account_many_nfts_and_fungibles.json diff --git a/crates/sargon/fixtures/models/gateway/state/response_entity_details__single_account_no_assets.json b/crates/gateway-models/fixtures/models/state/response_entity_details__single_account_no_assets.json similarity index 100% rename from crates/sargon/fixtures/models/gateway/state/response_entity_details__single_account_no_assets.json rename to crates/gateway-models/fixtures/models/state/response_entity_details__single_account_no_assets.json diff --git a/crates/sargon/fixtures/models/gateway/state/response_entity_details__single_resource.json b/crates/gateway-models/fixtures/models/state/response_entity_details__single_resource.json similarity index 100% rename from crates/sargon/fixtures/models/gateway/state/response_entity_details__single_resource.json rename to crates/gateway-models/fixtures/models/state/response_entity_details__single_resource.json diff --git a/crates/sargon/fixtures/models/gateway/state/response_entity_details__single_resource_no_metadata.json b/crates/gateway-models/fixtures/models/state/response_entity_details__single_resource_no_metadata.json similarity index 100% rename from crates/sargon/fixtures/models/gateway/state/response_entity_details__single_resource_no_metadata.json rename to crates/gateway-models/fixtures/models/state/response_entity_details__single_resource_no_metadata.json diff --git a/crates/sargon/fixtures/models/gateway/state/response_entity_details__two_accounts.json b/crates/gateway-models/fixtures/models/state/response_entity_details__two_accounts.json similarity index 100% rename from crates/sargon/fixtures/models/gateway/state/response_entity_details__two_accounts.json rename to crates/gateway-models/fixtures/models/state/response_entity_details__two_accounts.json diff --git a/crates/sargon/fixtures/models/gateway/state/response_entity_details_details__fungible_resource.json b/crates/gateway-models/fixtures/models/state/response_entity_details_details__fungible_resource.json similarity index 100% rename from crates/sargon/fixtures/models/gateway/state/response_entity_details_details__fungible_resource.json rename to crates/gateway-models/fixtures/models/state/response_entity_details_details__fungible_resource.json diff --git a/crates/sargon/fixtures/models/gateway/state/response_entity_details_details__non_fungible_resource.json b/crates/gateway-models/fixtures/models/state/response_entity_details_details__non_fungible_resource.json similarity index 100% rename from crates/sargon/fixtures/models/gateway/state/response_entity_details_details__non_fungible_resource.json rename to crates/gateway-models/fixtures/models/state/response_entity_details_details__non_fungible_resource.json diff --git a/crates/sargon/fixtures/models/gateway/transaction/request_preview.json b/crates/gateway-models/fixtures/models/transaction/request_preview.json similarity index 100% rename from crates/sargon/fixtures/models/gateway/transaction/request_preview.json rename to crates/gateway-models/fixtures/models/transaction/request_preview.json diff --git a/crates/sargon/fixtures/models/gateway/transaction/request_status.json b/crates/gateway-models/fixtures/models/transaction/request_status.json similarity index 100% rename from crates/sargon/fixtures/models/gateway/transaction/request_status.json rename to crates/gateway-models/fixtures/models/transaction/request_status.json diff --git a/crates/sargon/fixtures/models/gateway/transaction/request_submit.json b/crates/gateway-models/fixtures/models/transaction/request_submit.json similarity index 100% rename from crates/sargon/fixtures/models/gateway/transaction/request_submit.json rename to crates/gateway-models/fixtures/models/transaction/request_submit.json diff --git a/crates/sargon/fixtures/models/gateway/transaction/response_construction.json b/crates/gateway-models/fixtures/models/transaction/response_construction.json similarity index 100% rename from crates/sargon/fixtures/models/gateway/transaction/response_construction.json rename to crates/gateway-models/fixtures/models/transaction/response_construction.json diff --git a/crates/sargon/fixtures/models/gateway/transaction/response_preview.json b/crates/gateway-models/fixtures/models/transaction/response_preview.json similarity index 100% rename from crates/sargon/fixtures/models/gateway/transaction/response_preview.json rename to crates/gateway-models/fixtures/models/transaction/response_preview.json diff --git a/crates/sargon/fixtures/models/gateway/transaction/response_status__committed_success.json b/crates/gateway-models/fixtures/models/transaction/response_status__committed_success.json similarity index 100% rename from crates/sargon/fixtures/models/gateway/transaction/response_status__committed_success.json rename to crates/gateway-models/fixtures/models/transaction/response_status__committed_success.json diff --git a/crates/sargon/fixtures/models/gateway/transaction/response_status__pending.json b/crates/gateway-models/fixtures/models/transaction/response_status__pending.json similarity index 100% rename from crates/sargon/fixtures/models/gateway/transaction/response_status__pending.json rename to crates/gateway-models/fixtures/models/transaction/response_status__pending.json diff --git a/crates/sargon/fixtures/models/gateway/transaction/response_submit.json b/crates/gateway-models/fixtures/models/transaction/response_submit.json similarity index 100% rename from crates/sargon/fixtures/models/gateway/transaction/response_submit.json rename to crates/gateway-models/fixtures/models/transaction/response_submit.json diff --git a/crates/gateway-models/src/lib.rs b/crates/gateway-models/src/lib.rs new file mode 100644 index 000000000..f631fa112 --- /dev/null +++ b/crates/gateway-models/src/lib.rs @@ -0,0 +1,66 @@ +mod types; + +pub mod prelude { + pub use crate::types::*; + + pub use sargon_addresses::prelude::*; + pub use sargon_core::prelude::*; + pub(crate) use sargon_transaction_models::prelude::*; + + pub use radix_engine_toolkit_common::receipt::SerializableToolkitTransactionReceipt as ScryptoSerializableToolkitTransactionReceipt; + + pub use radix_transactions::{ + builder::{ + ManifestNameRegistrar as ScryptoManifestNameRegistrar, + NewManifestBucket as ScryptoNewManifestBucket, + PartialTransactionV2Builder as ScryptoPartialTransactionV2Builder, + ResolvableArguments as ScryptoResolvableArguments, + TransactionV2Builder as ScryptoTransactionV2Builder, + }, + model::{ + BlobV1 as ScryptoBlob, BlobsV1 as ScryptoBlobs, + ChildSubintentSpecifier as ScryptoChildSubintentSpecifier, + ChildSubintentSpecifiersV2 as ScryptoChildSubintentSpecifiers, + InstructionV1 as ScryptoInstruction, + InstructionV2 as ScryptoInstructionV2, + InstructionsV1 as ScryptoInstructions, + InstructionsV2 as ScryptoInstructionsV2, + IntentCoreV2 as ScryptoIntentCoreV2, + IntentHash as ScryptoIntentHash, + IntentHeaderV2 as ScryptoIntentHeaderV2, + IntentSignatureV1 as ScryptoIntentSignature, + IntentSignaturesV1 as ScryptoIntentSignatures, + IntentSignaturesV2 as ScryptoIntentSignaturesV2, + IntentV1 as ScryptoIntent, + IsTransactionHashWithStaticHrp as ScryptoIsTransactionHashWithStaticHrp, + MessageContentsV1 as ScryptoMessageContents, + MessageV1 as ScryptoMessage, MessageV2 as ScryptoMessageV2, + NonRootSubintentSignaturesV2 as ScryptoNonRootSubintentSignatures, + NonRootSubintentsV2 as ScryptoNonRootSubintents, + NotarizedTransactionV1 as ScryptoNotarizedTransaction, + NotarySignatureV1 as ScryptoNotarySignature, + PartialTransactionV2 as ScryptoPartialTransaction, + PlaintextMessageV1 as ScryptoPlaintextMessage, + SignedIntentV1 as ScryptoSignedIntent, + SignedPartialTransactionV2 as ScryptoSignedPartialTransaction, + SignedTransactionIntentHash as ScryptoSignedTransactionIntentHash, + SubintentHash as ScryptoSubintentHash, + SubintentV2 as ScryptoSubintent, + TransactionHashBech32Decoder as ScryptoTransactionHashBech32Decoder, + TransactionHashBech32Encoder as ScryptoTransactionHashBech32Encoder, + TransactionHeaderV1 as ScryptoTransactionHeader, + TransactionHeaderV2 as ScryptoTransactionHeaderV2, + TransactionIntentHash as ScryptoTransactionIntentHash, + }, + prelude::{ + SubintentManifestV2 as ScryptoSubintentManifestV2, + SubintentManifestV2Builder as ScryptoSubintentManifestV2Builder, + TransactionManifestV1 as ScryptoTransactionManifest, + TransactionManifestV1Builder as ScryptoTransactionManifestBuilder, + TransactionManifestV2 as ScryptoTransactionManifestV2, + TransactionManifestV2Builder as ScryptoTransactionManifestV2Builder, + }, + }; +} + +pub use prelude::*; diff --git a/crates/sargon/src/gateway_api/models/types/mod.rs b/crates/gateway-models/src/types/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/mod.rs rename to crates/gateway-models/src/types/mod.rs diff --git a/crates/sargon/src/gateway_api/models/types/request/gw_public_key.rs b/crates/gateway-models/src/types/request/gw_public_key.rs similarity index 82% rename from crates/sargon/src/gateway_api/models/types/request/gw_public_key.rs rename to crates/gateway-models/src/types/request/gw_public_key.rs index 4ce5105da..3059210f5 100644 --- a/crates/sargon/src/gateway_api/models/types/request/gw_public_key.rs +++ b/crates/gateway-models/src/types/request/gw_public_key.rs @@ -1,7 +1,7 @@ use crate::prelude::*; #[derive(Clone, Debug, PartialEq, Eq, EnumAsInner)] -pub(crate) enum GWPublicKey { +pub enum GWPublicKey { Secp256k1(Secp256k1PublicKey), Ed25519(Ed25519PublicKey), } diff --git a/crates/sargon/src/gateway_api/models/logic/request/gw_public_key.rs b/crates/gateway-models/src/types/request/gw_public_key_serde.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/logic/request/gw_public_key.rs rename to crates/gateway-models/src/types/request/gw_public_key_serde.rs diff --git a/crates/sargon/src/gateway_api/models/types/request/ledger_state_selector.rs b/crates/gateway-models/src/types/request/ledger_state_selector.rs similarity index 94% rename from crates/sargon/src/gateway_api/models/types/request/ledger_state_selector.rs rename to crates/gateway-models/src/types/request/ledger_state_selector.rs index 9b90b7c3c..998a0eaae 100644 --- a/crates/sargon/src/gateway_api/models/types/request/ledger_state_selector.rs +++ b/crates/gateway-models/src/types/request/ledger_state_selector.rs @@ -4,19 +4,19 @@ use crate::prelude::*; pub struct LedgerStateSelector { /// If provided, the latest ledger state lower than or equal to the given state version is returned. #[serde(skip_serializing_if = "Option::is_none")] - pub(crate) state_version: Option, + pub state_version: Option, /// If provided, the latest ledger state lower than or equal to the given round timestamp is returned. #[serde(skip_serializing_if = "Option::is_none")] - pub(crate) timestamp: Option, + pub timestamp: Option, /// If provided, the ledger state lower than or equal to the given epoch at round 0 is returned. #[serde(skip_serializing_if = "Option::is_none")] - pub(crate) epoch: Option, + pub epoch: Option, /// If provided must be accompanied with epoch, the ledger state lower than or equal to the given epoch and round is returned. #[serde(skip_serializing_if = "Option::is_none")] - pub(crate) round: Option, + pub round: Option, } impl LedgerStateSelector { diff --git a/crates/sargon/src/gateway_api/models/types/request/mod.rs b/crates/gateway-models/src/types/request/mod.rs similarity index 87% rename from crates/sargon/src/gateway_api/models/types/request/mod.rs rename to crates/gateway-models/src/types/request/mod.rs index 15f9db821..fb1531dc5 100644 --- a/crates/sargon/src/gateway_api/models/types/request/mod.rs +++ b/crates/gateway-models/src/types/request/mod.rs @@ -1,4 +1,5 @@ mod gw_public_key; +mod gw_public_key_serde; mod ledger_state_selector; mod state; mod transaction; diff --git a/crates/sargon/src/gateway_api/models/types/request/state/account/mod.rs b/crates/gateway-models/src/types/request/state/account/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/request/state/account/mod.rs rename to crates/gateway-models/src/types/request/state/account/mod.rs diff --git a/crates/sargon/src/gateway_api/models/types/request/state/account/page/authorized_depositors.rs b/crates/gateway-models/src/types/request/state/account/page/authorized_depositors.rs similarity index 87% rename from crates/sargon/src/gateway_api/models/types/request/state/account/page/authorized_depositors.rs rename to crates/gateway-models/src/types/request/state/account/page/authorized_depositors.rs index 634ea64ee..5d1645f3f 100644 --- a/crates/sargon/src/gateway_api/models/types/request/state/account/page/authorized_depositors.rs +++ b/crates/gateway-models/src/types/request/state/account/page/authorized_depositors.rs @@ -3,21 +3,21 @@ use crate::prelude::*; #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct AccountPageAuthorizedDepositorsRequest { /// Bech32m-encoded human readable version of the address. - pub(crate) account_address: AccountAddress, + pub account_address: AccountAddress, /// This allows for a request to be made against a historic state. If a constraint is specified, /// the Gateway will resolve the request against the ledger state at that time. /// If not specified, requests will be made with respect to the top of the committed ledger. #[serde(skip_serializing_if = "Option::is_none")] - pub(crate) at_ledger_state: Option, + pub at_ledger_state: Option, /// This cursor allows forward pagination, by providing the cursor from the previous request. #[serde(skip_serializing_if = "Option::is_none")] - pub(crate) cursor: Option, + pub cursor: Option, /// The page size requested. #[serde(skip_serializing_if = "Option::is_none")] - pub(crate) limit_per_page: Option, + pub limit_per_page: Option, } impl AccountPageAuthorizedDepositorsRequest { diff --git a/crates/sargon/src/gateway_api/models/types/request/state/account/page/mod.rs b/crates/gateway-models/src/types/request/state/account/page/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/request/state/account/page/mod.rs rename to crates/gateway-models/src/types/request/state/account/page/mod.rs diff --git a/crates/sargon/src/gateway_api/models/types/request/state/account/page/resource_preferences.rs b/crates/gateway-models/src/types/request/state/account/page/resource_preferences.rs similarity index 87% rename from crates/sargon/src/gateway_api/models/types/request/state/account/page/resource_preferences.rs rename to crates/gateway-models/src/types/request/state/account/page/resource_preferences.rs index 49edbce2c..ca7b2a4df 100644 --- a/crates/sargon/src/gateway_api/models/types/request/state/account/page/resource_preferences.rs +++ b/crates/gateway-models/src/types/request/state/account/page/resource_preferences.rs @@ -3,21 +3,21 @@ use crate::prelude::*; #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct AccountPageResourcePreferencesRequest { /// Bech32m-encoded human readable version of the address. - pub(crate) account_address: AccountAddress, + pub account_address: AccountAddress, /// This allows for a request to be made against a historic state. If a constraint is specified, /// the Gateway will resolve the request against the ledger state at that time. /// If not specified, requests will be made with respect to the top of the committed ledger. #[serde(skip_serializing_if = "Option::is_none")] - pub(crate) at_ledger_state: Option, + pub at_ledger_state: Option, /// This cursor allows forward pagination, by providing the cursor from the previous request. #[serde(skip_serializing_if = "Option::is_none")] - pub(crate) cursor: Option, + pub cursor: Option, /// The page size requested. #[serde(skip_serializing_if = "Option::is_none")] - pub(crate) limit_per_page: Option, + pub limit_per_page: Option, } impl AccountPageResourcePreferencesRequest { diff --git a/crates/sargon/src/gateway_api/models/types/request/state/entity/details/mod.rs b/crates/gateway-models/src/types/request/state/entity/details/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/request/state/entity/details/mod.rs rename to crates/gateway-models/src/types/request/state/entity/details/mod.rs diff --git a/crates/sargon/src/gateway_api/models/types/request/state/entity/details/opt_ins.rs b/crates/gateway-models/src/types/request/state/entity/details/opt_ins.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/request/state/entity/details/opt_ins.rs rename to crates/gateway-models/src/types/request/state/entity/details/opt_ins.rs diff --git a/crates/sargon/src/gateway_api/models/types/request/state/entity/details/request.rs b/crates/gateway-models/src/types/request/state/entity/details/request.rs similarity index 54% rename from crates/sargon/src/gateway_api/models/types/request/state/entity/details/request.rs rename to crates/gateway-models/src/types/request/state/entity/details/request.rs index 3f8ff1aa8..94b6ff46b 100644 --- a/crates/sargon/src/gateway_api/models/types/request/state/entity/details/request.rs +++ b/crates/gateway-models/src/types/request/state/entity/details/request.rs @@ -10,17 +10,17 @@ use crate::prelude::*; )] pub struct StateEntityDetailsRequest { /// The addresses of the entities for which details are requested. Limited 20 items max. - pub(crate) addresses: Vec

, + pub addresses: Vec
, /// This allows for a request to be made against a historic state. If a constraint is specified, /// the Gateway will resolve the request against the ledger state at that time. /// If not specified, requests will be made with respect to the top of the committed ledger. #[serde(skip_serializing_if = "Option::is_none")] - pub(crate) at_ledger_state: Option, + pub at_ledger_state: Option, /// The opt-ins for the request. #[serde(skip_serializing_if = "Option::is_none")] - pub(crate) opt_ins: Option, + pub opt_ins: Option, } impl StateEntityDetailsRequest { @@ -54,3 +54,41 @@ impl StateEntityDetailsRequest { ) } } + +#[cfg(test)] +mod tests { + use super::*; + + #[allow(clippy::upper_case_acronyms)] + type SUT = StateEntityDetailsRequest; + + #[test] + fn json_request_entity_details_single_account_no_assets() { + let _ = fixture_and_json::(include_str!(concat!( + env!("FIXTURES_MODELS_GW"), + "state/request_entity_details__single_account_no_assets.json" + ))) + .unwrap(); + // assert_json_value_eq_after_roundtrip(&sut, json) // FIXME: Once fully implemented + } + + #[test] + fn json_request_entity_details_single_resource() { + let _ = fixture_and_json::(include_str!(concat!( + env!("FIXTURES_MODELS_GW"), + "state/request_entity_details__single_resource.json" + ))) + .unwrap(); + // assert_json_value_eq_after_roundtrip(&sut, json) // FIXME: Once fully implemented + } + + #[test] + fn json_request_entity_details_two_accounts() { + let _ = fixture_and_json::(include_str!(concat!( + env!("FIXTURES_MODELS_GW"), + "state/request_entity_details__two_accounts.json" + ))) + .unwrap(); + // assert_json_value_eq_after_roundtrip(&sut, json) // FIXME: Once fully implemented + } +} diff --git a/crates/sargon/src/gateway_api/models/types/request/state/entity/mod.rs b/crates/gateway-models/src/types/request/state/entity/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/request/state/entity/mod.rs rename to crates/gateway-models/src/types/request/state/entity/mod.rs diff --git a/crates/sargon/src/gateway_api/models/types/request/state/entity/page/fungibles.rs b/crates/gateway-models/src/types/request/state/entity/page/fungibles.rs similarity index 87% rename from crates/sargon/src/gateway_api/models/types/request/state/entity/page/fungibles.rs rename to crates/gateway-models/src/types/request/state/entity/page/fungibles.rs index 13f782740..78d1886d8 100644 --- a/crates/sargon/src/gateway_api/models/types/request/state/entity/page/fungibles.rs +++ b/crates/gateway-models/src/types/request/state/entity/page/fungibles.rs @@ -3,21 +3,21 @@ use crate::prelude::*; #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct StateEntityPageFungiblesRequest { /// Bech32m-encoded human readable version of the address. - pub(crate) address: Address, + pub address: Address, /// This allows for a request to be made against a historic state. If a constraint is specified, /// the Gateway will resolve the request against the ledger state at that time. /// If not specified, requests will be made with respect to the top of the committed ledger. #[serde(skip_serializing_if = "Option::is_none")] - pub(crate) at_ledger_state: Option, + pub at_ledger_state: Option, /// This cursor allows forward pagination, by providing the cursor from the previous request. #[serde(skip_serializing_if = "Option::is_none")] - pub(crate) cursor: Option, + pub cursor: Option, /// The page size requested. #[serde(skip_serializing_if = "Option::is_none")] - pub(crate) limit_per_page: Option, + pub limit_per_page: Option, } impl StateEntityPageFungiblesRequest { diff --git a/crates/sargon/src/gateway_api/models/types/request/state/entity/page/mod.rs b/crates/gateway-models/src/types/request/state/entity/page/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/request/state/entity/page/mod.rs rename to crates/gateway-models/src/types/request/state/entity/page/mod.rs diff --git a/crates/sargon/src/gateway_api/models/types/request/state/entity/page/non_fungible_vault_ids.rs b/crates/gateway-models/src/types/request/state/entity/page/non_fungible_vault_ids.rs similarity index 84% rename from crates/sargon/src/gateway_api/models/types/request/state/entity/page/non_fungible_vault_ids.rs rename to crates/gateway-models/src/types/request/state/entity/page/non_fungible_vault_ids.rs index 63cd47ce4..9a8d86163 100644 --- a/crates/sargon/src/gateway_api/models/types/request/state/entity/page/non_fungible_vault_ids.rs +++ b/crates/gateway-models/src/types/request/state/entity/page/non_fungible_vault_ids.rs @@ -3,27 +3,27 @@ use crate::prelude::*; #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct StateEntityPageNonFungibleVaultIdsRequest { /// Bech32m-encoded human readable version of the address. - pub(crate) address: Address, + pub address: Address, /// Bech32m-encoded human readable version of the address. - pub(crate) vault_address: VaultAddress, + pub vault_address: VaultAddress, /// Bech32m-encoded human readable version of the address. - pub(crate) resource_address: ResourceAddress, + pub resource_address: ResourceAddress, /// This allows for a request to be made against a historic state. If a constraint is specified, /// the Gateway will resolve the request against the ledger state at that time. /// If not specified, requests will be made with respect to the top of the committed ledger. #[serde(skip_serializing_if = "Option::is_none")] - pub(crate) at_ledger_state: Option, + pub at_ledger_state: Option, /// This cursor allows forward pagination, by providing the cursor from the previous request. #[serde(skip_serializing_if = "Option::is_none")] - pub(crate) cursor: Option, + pub cursor: Option, /// The page size requested. #[serde(skip_serializing_if = "Option::is_none")] - pub(crate) limit_per_page: Option, + pub limit_per_page: Option, } impl StateEntityPageNonFungibleVaultIdsRequest { diff --git a/crates/sargon/src/gateway_api/models/types/request/state/entity/page/non_fungible_vaults.rs b/crates/gateway-models/src/types/request/state/entity/page/non_fungible_vaults.rs similarity index 84% rename from crates/sargon/src/gateway_api/models/types/request/state/entity/page/non_fungible_vaults.rs rename to crates/gateway-models/src/types/request/state/entity/page/non_fungible_vaults.rs index a91460fcd..e2fc99333 100644 --- a/crates/sargon/src/gateway_api/models/types/request/state/entity/page/non_fungible_vaults.rs +++ b/crates/gateway-models/src/types/request/state/entity/page/non_fungible_vaults.rs @@ -3,27 +3,27 @@ use crate::prelude::*; #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct StateEntityPageNonFungibleVaultsRequest { /// Bech32m-encoded human readable version of the address. - pub(crate) address: Address, + pub address: Address, /// Bech32m-encoded human readable version of the address. - pub(crate) resource_address: ResourceAddress, + pub resource_address: ResourceAddress, /// This allows for a request to be made against a historic state. If a constraint is specified, /// the Gateway will resolve the request against the ledger state at that time. /// If not specified, requests will be made with respect to the top of the committed ledger. #[serde(skip_serializing_if = "Option::is_none")] - pub(crate) at_ledger_state: Option, + pub at_ledger_state: Option, /// This cursor allows forward pagination, by providing the cursor from the previous request. #[serde(skip_serializing_if = "Option::is_none")] - pub(crate) cursor: Option, + pub cursor: Option, /// The page size requested. #[serde(skip_serializing_if = "Option::is_none")] - pub(crate) limit_per_page: Option, + pub limit_per_page: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub(crate) opt_ins: Option, + pub opt_ins: Option, } impl StateEntityPageNonFungibleVaultsRequest { @@ -51,7 +51,7 @@ pub struct StateEntityNonFungibleResourceVaultsPageOptIns { /// if set to `true`, first page of non fungible ids are returned for each /// non fungible resource, with cursor which can be later used at /// `/state/entity/page/non_fungible-vault/ids` endpoint. - pub(crate) non_fungible_include_nfids: Option, + pub non_fungible_include_nfids: Option, } impl StateEntityNonFungibleResourceVaultsPageOptIns { diff --git a/crates/sargon/src/gateway_api/models/types/request/state/entity/page/non_fungibles.rs b/crates/gateway-models/src/types/request/state/entity/page/non_fungibles.rs similarity index 87% rename from crates/sargon/src/gateway_api/models/types/request/state/entity/page/non_fungibles.rs rename to crates/gateway-models/src/types/request/state/entity/page/non_fungibles.rs index 779ce9bcd..25d973c8f 100644 --- a/crates/sargon/src/gateway_api/models/types/request/state/entity/page/non_fungibles.rs +++ b/crates/gateway-models/src/types/request/state/entity/page/non_fungibles.rs @@ -3,21 +3,21 @@ use crate::prelude::*; #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct StateEntityPageNonFungiblesRequest { /// Bech32m-encoded human readable version of the address. - pub(crate) address: Address, + pub address: Address, /// This allows for a request to be made against a historic state. If a constraint is specified, /// the Gateway will resolve the request against the ledger state at that time. /// If not specified, requests will be made with respect to the top of the committed ledger. #[serde(skip_serializing_if = "Option::is_none")] - pub(crate) at_ledger_state: Option, + pub at_ledger_state: Option, /// This cursor allows forward pagination, by providing the cursor from the previous request. #[serde(skip_serializing_if = "Option::is_none")] - pub(crate) cursor: Option, + pub cursor: Option, /// The page size requested. #[serde(skip_serializing_if = "Option::is_none")] - pub(crate) limit_per_page: Option, + pub limit_per_page: Option, } impl StateEntityPageNonFungiblesRequest { diff --git a/crates/sargon/src/gateway_api/models/types/request/state/mod.rs b/crates/gateway-models/src/types/request/state/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/request/state/mod.rs rename to crates/gateway-models/src/types/request/state/mod.rs diff --git a/crates/sargon/src/gateway_api/models/types/request/state/non_fungible/location.rs b/crates/gateway-models/src/types/request/state/non_fungible/location.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/request/state/non_fungible/location.rs rename to crates/gateway-models/src/types/request/state/non_fungible/location.rs diff --git a/crates/sargon/src/gateway_api/models/types/request/state/non_fungible/mod.rs b/crates/gateway-models/src/types/request/state/non_fungible/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/request/state/non_fungible/mod.rs rename to crates/gateway-models/src/types/request/state/non_fungible/mod.rs diff --git a/crates/sargon/src/gateway_api/models/types/request/transaction/mod.rs b/crates/gateway-models/src/types/request/transaction/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/request/transaction/mod.rs rename to crates/gateway-models/src/types/request/transaction/mod.rs diff --git a/crates/sargon/src/gateway_api/models/logic/request/transaction/preview/mod.rs b/crates/gateway-models/src/types/request/transaction/preview/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/logic/request/transaction/preview/mod.rs rename to crates/gateway-models/src/types/request/transaction/preview/mod.rs diff --git a/crates/sargon/src/gateway_api/models/logic/request/transaction/preview/opt_ins.rs b/crates/gateway-models/src/types/request/transaction/preview/opt_ins.rs similarity index 60% rename from crates/sargon/src/gateway_api/models/logic/request/transaction/preview/opt_ins.rs rename to crates/gateway-models/src/types/request/transaction/preview/opt_ins.rs index 947820cb5..f8a0f36b4 100644 --- a/crates/sargon/src/gateway_api/models/logic/request/transaction/preview/opt_ins.rs +++ b/crates/gateway-models/src/types/request/transaction/preview/opt_ins.rs @@ -1,5 +1,19 @@ use crate::prelude::*; +#[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Serialize, + Deserialize, /* Deserialize so we can test roundtrip of JSON vectors */ +)] +pub struct TransactionPreviewRequestOptIns { + /** This flag controls whether the preview response will include a Radix Engine Toolkit serializable receipt or not. */ + pub radix_engine_toolkit_receipt: bool, +} + impl TransactionPreviewRequestOptIns { pub fn new(radix_engine_toolkit_receipt: bool) -> Self { Self { diff --git a/crates/sargon/src/gateway_api/models/logic/request/transaction/preview/opt_ins_v2.rs b/crates/gateway-models/src/types/request/transaction/preview/opt_ins_v2.rs similarity index 52% rename from crates/sargon/src/gateway_api/models/logic/request/transaction/preview/opt_ins_v2.rs rename to crates/gateway-models/src/types/request/transaction/preview/opt_ins_v2.rs index 298e6a039..0c3db4b99 100644 --- a/crates/sargon/src/gateway_api/models/logic/request/transaction/preview/opt_ins_v2.rs +++ b/crates/gateway-models/src/types/request/transaction/preview/opt_ins_v2.rs @@ -1,5 +1,34 @@ use crate::prelude::*; +#[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Serialize, + Deserialize, /* Deserialize so we can test roundtrip of JSON vectors */ +)] +pub struct TransactionPreviewRequestOptInsV2 { + /** + * This flag controls whether the preview response will include a Core API receipt or not. + * If not provided, this defaults to false and no core api receipt is provided in the response. + */ + pub core_api_receipt: bool, + + /** + * This flag controls whether the preview response will include a Radix Engine Toolkit serializable receipt or not. + * If not provided, this defaults to false and no toolkit receipt is provided in the response. + */ + pub radix_engine_toolkit_receipt: bool, + + /** + * This flag controls whether the preview response will include execution logs. + * If not provided, this defaults to false and no logs will be provided in the response. + */ + pub logs: bool, +} + impl TransactionPreviewRequestOptInsV2 { pub fn new( core_api_receipt: bool, diff --git a/crates/sargon/src/gateway_api/models/logic/request/transaction/preview/request_flags.rs b/crates/gateway-models/src/types/request/transaction/preview/request_flags.rs similarity index 74% rename from crates/sargon/src/gateway_api/models/logic/request/transaction/preview/request_flags.rs rename to crates/gateway-models/src/types/request/transaction/preview/request_flags.rs index 20f6b374b..5bc69fc03 100644 --- a/crates/sargon/src/gateway_api/models/logic/request/transaction/preview/request_flags.rs +++ b/crates/gateway-models/src/types/request/transaction/preview/request_flags.rs @@ -1,5 +1,25 @@ +use sargon_core::decl_bool_type; + use crate::prelude::*; +#[derive( + Clone, + Debug, + PartialEq, + Eq, + Serialize, + Deserialize, /* Deserialize so we can test roundtrip of JSON vectors */ +)] +pub struct TransactionPreviewRequestFlags { + pub use_free_credit: UseFreeCredit, + pub assume_all_signature_proofs: AssumeAllSignatureProofs, + pub skip_epoch_check: SkipEpochCheck, +} + +decl_bool_type!(UseFreeCredit, true); +decl_bool_type!(AssumeAllSignatureProofs, false); +decl_bool_type!(SkipEpochCheck, false); + impl TransactionPreviewRequestFlags { pub fn new( use_free_credit: UseFreeCredit, diff --git a/crates/sargon/src/gateway_api/models/logic/request/transaction/preview/transaction_preview.rs b/crates/gateway-models/src/types/request/transaction/preview/transaction_preview.rs similarity index 71% rename from crates/sargon/src/gateway_api/models/logic/request/transaction/preview/transaction_preview.rs rename to crates/gateway-models/src/types/request/transaction/preview/transaction_preview.rs index c54df1c63..7832fe4e5 100644 --- a/crates/sargon/src/gateway_api/models/logic/request/transaction/preview/transaction_preview.rs +++ b/crates/gateway-models/src/types/request/transaction/preview/transaction_preview.rs @@ -1,5 +1,46 @@ use crate::prelude::*; +#[derive( + Serialize, + Deserialize, /* Deserialize so we can test roundtrip of JSON vectors */ + Clone, + Debug, + PartialEq, + Eq, +)] +pub struct TransactionPreviewRequest { + /** A text-representation of a transaction manifest */ + pub manifest: String, + + /** An array of hex-encoded blob data (optional) */ + pub blobs_hex: Option>, + + /** An integer between `0` and `10^10`, marking the epoch at which the transaction starts being valid */ + pub start_epoch_inclusive: u64, + + /** An integer between `0` and `10^10`, marking the epoch at which the transaction is no longer valid */ + pub end_epoch_exclusive: u64, + + pub notary_public_key: Option, + + /** Whether the notary should count as a signatory (optional, default false) */ + pub notary_is_signatory: bool, + + /** An integer between `0` and `65535`, giving the validator tip as a percentage amount. A value of `1` corresponds to 1% of the fee. */ + pub tip_percentage: u16, + + /** A decimal-string-encoded integer between `0` and `2^32 - 1`, used to ensure the transaction intent is unique. */ + pub nonce: u32, + + /** A list of public keys to be used as transaction signers */ + pub signer_public_keys: Vec, + + pub flags: TransactionPreviewRequestFlags, + + /** A set of flags to configure the response of the transaction preview. */ + pub opt_ins: TransactionPreviewRequestOptIns, +} + impl TransactionPreviewRequest { pub fn new_transaction_analysis( manifest: TransactionManifest, diff --git a/crates/sargon/src/gateway_api/models/logic/request/transaction/preview/transaction_preview_v2.rs b/crates/gateway-models/src/types/request/transaction/preview/transaction_preview_v2.rs similarity index 67% rename from crates/sargon/src/gateway_api/models/logic/request/transaction/preview/transaction_preview_v2.rs rename to crates/gateway-models/src/types/request/transaction/preview/transaction_preview_v2.rs index 0aacce9ff..cf0804167 100644 --- a/crates/sargon/src/gateway_api/models/logic/request/transaction/preview/transaction_preview_v2.rs +++ b/crates/gateway-models/src/types/request/transaction/preview/transaction_preview_v2.rs @@ -1,5 +1,52 @@ +use radix_transactions::model::TransactionPayload as _; + use crate::prelude::*; -use radix_transactions::model::TransactionPayload; + +#[derive( + Serialize, + Deserialize, /* Deserialize so we can test roundtrip of JSON vectors */ + Clone, + Debug, + PartialEq, + Eq, +)] +pub struct TransactionPreviewRequestV2 { + /** + * A hex-encoded, compiled RawPreviewTransaction. + */ + pub preview_transaction: PreviewTransactionV2, + + pub flags: TransactionPreviewRequestFlags, + + /** A set of flags to configure the response of the transaction preview. */ + pub opt_ins: TransactionPreviewRequestOptInsV2, +} + +#[derive( + Serialize, + Deserialize, /* Deserialize so we can test roundtrip of JSON vectors */ + Clone, + Debug, + PartialEq, + Eq, +)] +pub struct PreviewTransactionV2 { + #[serde(rename = "type")] + pub transaction_type: PreviewTransactionTypeV2, + pub preview_transaction_hex: String, +} + +#[derive( + Serialize, + Deserialize, /* Deserialize so we can test roundtrip of JSON vectors */ + Clone, + Debug, + PartialEq, + Eq, +)] +pub enum PreviewTransactionTypeV2 { + Compiled, +} impl TransactionPreviewRequestV2 { pub fn new_with_encoded_preview(encoded_preview: String) -> Self { diff --git a/crates/sargon/src/gateway_api/models/types/request/transaction/status/mod.rs b/crates/gateway-models/src/types/request/transaction/status/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/request/transaction/status/mod.rs rename to crates/gateway-models/src/types/request/transaction/status/mod.rs diff --git a/crates/sargon/src/gateway_api/models/types/request/transaction/status/subintent_status.rs b/crates/gateway-models/src/types/request/transaction/status/subintent_status.rs similarity index 87% rename from crates/sargon/src/gateway_api/models/types/request/transaction/status/subintent_status.rs rename to crates/gateway-models/src/types/request/transaction/status/subintent_status.rs index d2d40f77f..494da8301 100644 --- a/crates/sargon/src/gateway_api/models/types/request/transaction/status/subintent_status.rs +++ b/crates/gateway-models/src/types/request/transaction/status/subintent_status.rs @@ -3,7 +3,7 @@ use crate::prelude::*; #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct SubintentStatusRequest { /// Bech32m-encoded hash. - pub(crate) subintent_hash: String, + pub subintent_hash: String, } impl SubintentStatusRequest { diff --git a/crates/sargon/src/gateway_api/models/types/request/transaction/status/transaction_status.rs b/crates/gateway-models/src/types/request/transaction/status/transaction_status.rs similarity index 88% rename from crates/sargon/src/gateway_api/models/types/request/transaction/status/transaction_status.rs rename to crates/gateway-models/src/types/request/transaction/status/transaction_status.rs index 6ed4eaba0..f837718c1 100644 --- a/crates/sargon/src/gateway_api/models/types/request/transaction/status/transaction_status.rs +++ b/crates/gateway-models/src/types/request/transaction/status/transaction_status.rs @@ -3,7 +3,7 @@ use crate::prelude::*; #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct TransactionStatusRequest { /// Bech32m-encoded hash. - pub(crate) intent_hash: String, + pub intent_hash: String, } impl TransactionStatusRequest { diff --git a/crates/sargon/src/gateway_api/models/logic/request/transaction/submit/mod.rs b/crates/gateway-models/src/types/request/transaction/submit/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/logic/request/transaction/submit/mod.rs rename to crates/gateway-models/src/types/request/transaction/submit/mod.rs diff --git a/crates/sargon/src/gateway_api/models/logic/request/transaction/submit/transaction_submit.rs b/crates/gateway-models/src/types/request/transaction/submit/transaction_submit.rs similarity index 67% rename from crates/sargon/src/gateway_api/models/logic/request/transaction/submit/transaction_submit.rs rename to crates/gateway-models/src/types/request/transaction/submit/transaction_submit.rs index 30b6fe108..67faa18c4 100644 --- a/crates/sargon/src/gateway_api/models/logic/request/transaction/submit/transaction_submit.rs +++ b/crates/gateway-models/src/types/request/transaction/submit/transaction_submit.rs @@ -1,5 +1,18 @@ use crate::prelude::*; +#[derive( + Clone, + Debug, + PartialEq, + Eq, + Serialize, + Deserialize, /* Deserialize so we can test roundtrip of JSON vectors */ +)] +pub struct TransactionSubmitRequest { + /** Hex-encoded notarized transaction payload which can be submitted. */ + pub notarized_transaction_hex: String, +} + impl TransactionSubmitRequest { pub fn new(notarized_transaction: NotarizedTransaction) -> Self { let compiled = notarized_transaction.compile(); diff --git a/crates/sargon/src/gateway_api/models/types/response/ledger_state.rs b/crates/gateway-models/src/types/response/ledger_state.rs similarity index 86% rename from crates/sargon/src/gateway_api/models/types/response/ledger_state.rs rename to crates/gateway-models/src/types/response/ledger_state.rs index f3a65ad84..a771fae77 100644 --- a/crates/sargon/src/gateway_api/models/types/response/ledger_state.rs +++ b/crates/gateway-models/src/types/response/ledger_state.rs @@ -26,6 +26,20 @@ pub struct LedgerState { pub round: u64, } +impl LedgerState { + /// For tests + /// A sample used to facilitate unit tests. + pub fn sample_stokenet() -> Self { + Self { + network: NetworkID::Stokenet.logical_name(), + state_version: 80577579, + proposer_round_timestamp: "2024-10-07T15:41:07.259Z".to_string(), + epoch: 41965, + round: 894, + } + } +} + impl LedgerState { pub fn new( network: impl Into, diff --git a/crates/sargon/src/gateway_api/models/types/response/mod.rs b/crates/gateway-models/src/types/response/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/mod.rs rename to crates/gateway-models/src/types/response/mod.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/page_response.rs b/crates/gateway-models/src/types/response/page_response.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/page_response.rs rename to crates/gateway-models/src/types/response/page_response.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/account/mod.rs b/crates/gateway-models/src/types/response/state/account/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/account/mod.rs rename to crates/gateway-models/src/types/response/state/account/mod.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/account/page/authorized_depositor.rs b/crates/gateway-models/src/types/response/state/account/page/authorized_depositor.rs similarity index 54% rename from crates/sargon/src/gateway_api/models/types/response/state/account/page/authorized_depositor.rs rename to crates/gateway-models/src/types/response/state/account/page/authorized_depositor.rs index 17631a051..0c2784569 100644 --- a/crates/sargon/src/gateway_api/models/types/response/state/account/page/authorized_depositor.rs +++ b/crates/gateway-models/src/types/response/state/account/page/authorized_depositor.rs @@ -1,5 +1,7 @@ use crate::prelude::*; +use radix_engine_interface::blueprints::account::AccountRemoveAuthorizedDepositorInput as ScryptoAccountRemoveAuthorizedDepositorInput; + #[derive(Deserialize, Serialize, Clone, PartialEq, Eq, Debug)] #[serde(tag = "badge_type")] pub enum AccountAuthorizedDepositor { @@ -12,6 +14,46 @@ pub enum AccountAuthorizedDepositor { }, } +impl TryFrom + for ScryptoAccountRemoveAuthorizedDepositorInput +{ + type Error = CommonError; + fn try_from(value: AccountAuthorizedDepositor) -> Result { + let resource_or_non_fungible = ResourceOrNonFungible::try_from(value)?; + Ok(resource_or_non_fungible.into()) + } +} + +impl TryFrom for ResourceOrNonFungible { + type Error = CommonError; + fn try_from(value: AccountAuthorizedDepositor) -> Result { + match value { + AccountAuthorizedDepositor::ResourceBadge { resource_address } => { + Ok(Self::Resource { + value: resource_address, + }) + } + AccountAuthorizedDepositor::NonFungibleBadge { + resource_address, + non_fungible_id, + } => { + if let Ok(non_fungible_id) = + NonFungibleLocalId::from_str(&non_fungible_id) + { + Ok(Self::NonFungible { + value: NonFungibleGlobalId::new_unchecked( + resource_address, + non_fungible_id, + ), + }) + } else { + Err(CommonError::InvalidNonFungibleLocalIDString) + } + } + } + } +} + impl HasSampleValues for AccountAuthorizedDepositor { fn sample() -> Self { Self::ResourceBadge { diff --git a/crates/sargon/src/gateway_api/models/types/response/state/account/page/mod.rs b/crates/gateway-models/src/types/response/state/account/page/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/account/page/mod.rs rename to crates/gateway-models/src/types/response/state/account/page/mod.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/account/page/resource_preference.rs b/crates/gateway-models/src/types/response/state/account/page/resource_preference.rs similarity index 83% rename from crates/sargon/src/gateway_api/models/types/response/state/account/page/resource_preference.rs rename to crates/gateway-models/src/types/response/state/account/page/resource_preference.rs index 9943146b7..5cd975a18 100644 --- a/crates/sargon/src/gateway_api/models/types/response/state/account/page/resource_preference.rs +++ b/crates/gateway-models/src/types/response/state/account/page/resource_preference.rs @@ -1,5 +1,7 @@ use crate::prelude::*; +use radix_engine_interface::blueprints::account::AccountRemoveResourcePreferenceInput as ScryptoAccountRemoveResourcePreferenceInput; + #[derive(Deserialize, Serialize, Clone, PartialEq, Eq, Debug)] pub struct AccountResourcePreference { pub resource_address: ResourceAddress, @@ -7,6 +9,16 @@ pub struct AccountResourcePreference { pub status: AccountResourcePreferenceRule, } +impl From + for ScryptoAccountRemoveResourcePreferenceInput +{ + fn from(value: AccountResourcePreference) -> Self { + Self { + resource_address: value.resource_address.into(), + } + } +} + #[derive(Deserialize, Serialize, Clone, PartialEq, Eq, Debug)] pub enum AccountResourcePreferenceRule { Allowed, diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/details/item.rs b/crates/gateway-models/src/types/response/state/entity/details/details/item.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/entity/details/details/item.rs rename to crates/gateway-models/src/types/response/state/entity/details/details/item.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/details/item_component.rs b/crates/gateway-models/src/types/response/state/entity/details/details/item_component.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/entity/details/details/item_component.rs rename to crates/gateway-models/src/types/response/state/entity/details/details/item_component.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/details/item_fungible_resource.rs b/crates/gateway-models/src/types/response/state/entity/details/details/item_fungible_resource.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/entity/details/details/item_fungible_resource.rs rename to crates/gateway-models/src/types/response/state/entity/details/details/item_fungible_resource.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/details/item_non_fungible_resource.rs b/crates/gateway-models/src/types/response/state/entity/details/details/item_non_fungible_resource.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/entity/details/details/item_non_fungible_resource.rs rename to crates/gateway-models/src/types/response/state/entity/details/details/item_non_fungible_resource.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/details/item_package.rs b/crates/gateway-models/src/types/response/state/entity/details/details/item_package.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/entity/details/details/item_package.rs rename to crates/gateway-models/src/types/response/state/entity/details/details/item_package.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/details/mod.rs b/crates/gateway-models/src/types/response/state/entity/details/details/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/entity/details/details/mod.rs rename to crates/gateway-models/src/types/response/state/entity/details/details/mod.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/details/role_assignments/assignment.rs b/crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/assignment.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/entity/details/details/role_assignments/assignment.rs rename to crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/assignment.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/details/role_assignments/collection.rs b/crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/collection.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/entity/details/details/role_assignments/collection.rs rename to crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/collection.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/details/role_assignments/entry.rs b/crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/entry.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/entity/details/details/role_assignments/entry.rs rename to crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/entry.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/details/role_assignments/explicit_rule.rs b/crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/explicit_rule.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/entity/details/details/role_assignments/explicit_rule.rs rename to crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/explicit_rule.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/details/role_assignments/mod.rs b/crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/entity/details/details/role_assignments/mod.rs rename to crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/mod.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/details/role_assignments/module.rs b/crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/module.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/entity/details/details/role_assignments/module.rs rename to crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/module.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/details/role_assignments/owner.rs b/crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/owner.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/entity/details/details/role_assignments/owner.rs rename to crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/owner.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/details/role_assignments/resolution.rs b/crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/resolution.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/entity/details/details/role_assignments/resolution.rs rename to crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/resolution.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/details/role_assignments/role_key.rs b/crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/role_key.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/entity/details/details/role_assignments/role_key.rs rename to crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/role_key.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/fungible/collection.rs b/crates/gateway-models/src/types/response/state/entity/details/fungible/collection.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/entity/details/fungible/collection.rs rename to crates/gateway-models/src/types/response/state/entity/details/fungible/collection.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/fungible/collection_item.rs b/crates/gateway-models/src/types/response/state/entity/details/fungible/collection_item.rs new file mode 100644 index 000000000..b697cc5b8 --- /dev/null +++ b/crates/gateway-models/src/types/response/state/entity/details/fungible/collection_item.rs @@ -0,0 +1,74 @@ +use crate::prelude::*; + +#[derive( + Deserialize, + Serialize, /* Serialize so we can test roundtrip of JSON vectors */ + Clone, + PartialEq, + Eq, + Debug, + EnumAsInner, +)] +#[serde(untagged)] +pub enum FungibleResourcesCollectionItem { + Global(FungibleResourcesCollectionItemGloballyAggregated), +} + +impl HasSampleValues for FungibleResourcesCollectionItem { + fn sample() -> Self { + Self::Global(FungibleResourcesCollectionItemGloballyAggregated::sample()) + } + + fn sample_other() -> Self { + Self::Global( + FungibleResourcesCollectionItemGloballyAggregated::sample_other(), + ) + } +} + +impl FungibleResourcesCollectionItem { + pub fn resource_address(&self) -> ResourceAddress { + match self { + Self::Global(item) => item.resource_address, + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[allow(clippy::upper_case_acronyms)] + type SUT = FungibleResourcesCollectionItem; + + #[test] + fn inequality() { + let resource_address = ResourceAddress::sample(); + let sut = + SUT::Global(FungibleResourcesCollectionItemGloballyAggregated { + amount: Decimal192::zero(), + resource_address, + }); + assert_eq!(sut.resource_address(), resource_address); + } +} + +#[cfg(test)] +mod address_tests { + use crate::prelude::*; + + #[allow(clippy::upper_case_acronyms)] + type SUT = FetchResourcesOutput; + + #[test] + fn resource_addresses() { + let fungible = FungibleResourcesCollectionItem::sample(); + let non_fungible = NonFungibleResourcesCollectionItem::sample(); + let sut = SUT::new([fungible.clone()], [non_fungible.clone()]); + + assert_eq!( + sut.resource_addresses(), + vec![fungible.resource_address(), non_fungible.resource_address()] + ); + } +} diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/fungible/collection_item_global.rs b/crates/gateway-models/src/types/response/state/entity/details/fungible/collection_item_global.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/entity/details/fungible/collection_item_global.rs rename to crates/gateway-models/src/types/response/state/entity/details/fungible/collection_item_global.rs diff --git a/crates/sargon/src/gateway_api/models/logic/response/state/entity/details/fungible/mod.rs b/crates/gateway-models/src/types/response/state/entity/details/fungible/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/logic/response/state/entity/details/fungible/mod.rs rename to crates/gateway-models/src/types/response/state/entity/details/fungible/mod.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/metadata/collection.rs b/crates/gateway-models/src/types/response/state/entity/details/metadata/collection.rs similarity index 98% rename from crates/sargon/src/gateway_api/models/types/response/state/entity/details/metadata/collection.rs rename to crates/gateway-models/src/types/response/state/entity/details/metadata/collection.rs index ecd346b98..bb1d00568 100644 --- a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/metadata/collection.rs +++ b/crates/gateway-models/src/types/response/state/entity/details/metadata/collection.rs @@ -10,7 +10,6 @@ impl EntityMetadataCollection { EntityMetadataCollection { items } } - #[cfg(test)] pub fn empty() -> EntityMetadataCollection { EntityMetadataCollection::new(vec![]) } diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/metadata/item.rs b/crates/gateway-models/src/types/response/state/entity/details/metadata/item.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/entity/details/metadata/item.rs rename to crates/gateway-models/src/types/response/state/entity/details/metadata/item.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/metadata/item_value.rs b/crates/gateway-models/src/types/response/state/entity/details/metadata/item_value.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/entity/details/metadata/item_value.rs rename to crates/gateway-models/src/types/response/state/entity/details/metadata/item_value.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/metadata/mod.rs b/crates/gateway-models/src/types/response/state/entity/details/metadata/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/entity/details/metadata/mod.rs rename to crates/gateway-models/src/types/response/state/entity/details/metadata/mod.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/metadata/typed_value.rs b/crates/gateway-models/src/types/response/state/entity/details/metadata/typed_value.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/entity/details/metadata/typed_value.rs rename to crates/gateway-models/src/types/response/state/entity/details/metadata/typed_value.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/mod.rs b/crates/gateway-models/src/types/response/state/entity/details/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/entity/details/mod.rs rename to crates/gateway-models/src/types/response/state/entity/details/mod.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/non_fungible/collection.rs b/crates/gateway-models/src/types/response/state/entity/details/non_fungible/collection.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/entity/details/non_fungible/collection.rs rename to crates/gateway-models/src/types/response/state/entity/details/non_fungible/collection.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/non_fungible/collection_item.rs b/crates/gateway-models/src/types/response/state/entity/details/non_fungible/collection_item.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/entity/details/non_fungible/collection_item.rs rename to crates/gateway-models/src/types/response/state/entity/details/non_fungible/collection_item.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/non_fungible/collection_item_global.rs b/crates/gateway-models/src/types/response/state/entity/details/non_fungible/collection_item_global.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/entity/details/non_fungible/collection_item_global.rs rename to crates/gateway-models/src/types/response/state/entity/details/non_fungible/collection_item_global.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/fungible/mod.rs b/crates/gateway-models/src/types/response/state/entity/details/non_fungible/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/entity/details/fungible/mod.rs rename to crates/gateway-models/src/types/response/state/entity/details/non_fungible/mod.rs diff --git a/crates/sargon/src/gateway_api/models/logic/response/state/entity/details/state_entity_details_response.rs b/crates/gateway-models/src/types/response/state/entity/details/response.rs similarity index 80% rename from crates/sargon/src/gateway_api/models/logic/response/state/entity/details/state_entity_details_response.rs rename to crates/gateway-models/src/types/response/state/entity/details/response.rs index 64326e105..9acd6d1dd 100644 --- a/crates/sargon/src/gateway_api/models/logic/response/state/entity/details/state_entity_details_response.rs +++ b/crates/gateway-models/src/types/response/state/entity/details/response.rs @@ -1,5 +1,25 @@ use crate::prelude::*; +/// The response a call to the REST Endpoint: +/// `https://mainnet.radixdlt.com/state/entity/details` +/// +/// Which contains token balances of an account. +#[derive( + Deserialize, + Serialize, /* Serialize so we can test roundtrip of JSON vectors */ + Clone, + PartialEq, + Eq, + Debug, +)] +pub struct StateEntityDetailsResponse { + /// The ledger state against which the response was generated. + pub ledger_state: Option, + + /// The details for the requested entities. + pub items: Vec, +} + impl StateEntityDetailsResponse { pub fn new( ledger_state: impl Into>, diff --git a/crates/sargon/src/gateway_api/models/logic/response/state/entity/details/state_entity_details_response_item.rs b/crates/gateway-models/src/types/response/state/entity/details/response_item.rs similarity index 55% rename from crates/sargon/src/gateway_api/models/logic/response/state/entity/details/state_entity_details_response_item.rs rename to crates/gateway-models/src/types/response/state/entity/details/response_item.rs index b602625f5..807d349d6 100644 --- a/crates/sargon/src/gateway_api/models/logic/response/state/entity/details/state_entity_details_response_item.rs +++ b/crates/gateway-models/src/types/response/state/entity/details/response_item.rs @@ -1,5 +1,48 @@ use crate::prelude::*; +#[derive( + Deserialize, + Serialize, /* Serialize so we can test roundtrip of JSON vectors */ + Clone, + PartialEq, + Eq, + Debug, +)] +pub struct StateEntityDetailsResponseItem { + /// Bech32m-encoded human readable version of the address. + pub address: Address, + + /// Fungible resources collection. + pub fungible_resources: Option, + + /// Non-fungible resources collection. + pub non_fungible_resources: Option, + + /// Entity metadata collection. + pub metadata: EntityMetadataCollection, + + /// More details of this entity. + pub details: Option, +} + +impl StateEntityDetailsResponseItem { + pub fn new( + address: Address, + fungible_resources: impl Into>, + non_fungible_resources: impl Into>, + metadata: EntityMetadataCollection, + details: impl Into>, + ) -> StateEntityDetailsResponseItem { + StateEntityDetailsResponseItem { + address, + fungible_resources: fungible_resources.into(), + non_fungible_resources: non_fungible_resources.into(), + metadata, + details: details.into(), + } + } +} + impl StateEntityDetailsResponseItem { pub fn can_be_transferred(&self) -> bool { let Some(details) = &self.details else { diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/mod.rs b/crates/gateway-models/src/types/response/state/entity/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/entity/mod.rs rename to crates/gateway-models/src/types/response/state/entity/mod.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/page/mod.rs b/crates/gateway-models/src/types/response/state/entity/page/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/entity/page/mod.rs rename to crates/gateway-models/src/types/response/state/entity/page/mod.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/page/non_fungible_vault_item.rs b/crates/gateway-models/src/types/response/state/entity/page/non_fungible_vault_item.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/entity/page/non_fungible_vault_item.rs rename to crates/gateway-models/src/types/response/state/entity/page/non_fungible_vault_item.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/mod.rs b/crates/gateway-models/src/types/response/state/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/mod.rs rename to crates/gateway-models/src/types/response/state/mod.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/non_fungible/location.rs b/crates/gateway-models/src/types/response/state/non_fungible/location.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/non_fungible/location.rs rename to crates/gateway-models/src/types/response/state/non_fungible/location.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/state/non_fungible/mod.rs b/crates/gateway-models/src/types/response/state/non_fungible/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/state/non_fungible/mod.rs rename to crates/gateway-models/src/types/response/state/non_fungible/mod.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/status/gateway_status.rs b/crates/gateway-models/src/types/response/status/gateway_status.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/status/gateway_status.rs rename to crates/gateway-models/src/types/response/status/gateway_status.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/status/mod.rs b/crates/gateway-models/src/types/response/status/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/status/mod.rs rename to crates/gateway-models/src/types/response/status/mod.rs diff --git a/crates/sargon/src/gateway_api/models/logic/response/transaction/construction/mod.rs b/crates/gateway-models/src/types/response/transaction/construction/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/logic/response/transaction/construction/mod.rs rename to crates/gateway-models/src/types/response/transaction/construction/mod.rs diff --git a/crates/sargon/src/gateway_api/models/logic/response/transaction/construction/transaction_construction_response.rs b/crates/gateway-models/src/types/response/transaction/construction/transaction_construction_response.rs similarity index 66% rename from crates/sargon/src/gateway_api/models/logic/response/transaction/construction/transaction_construction_response.rs rename to crates/gateway-models/src/types/response/transaction/construction/transaction_construction_response.rs index 40888dab5..b6ede7b95 100644 --- a/crates/sargon/src/gateway_api/models/logic/response/transaction/construction/transaction_construction_response.rs +++ b/crates/gateway-models/src/types/response/transaction/construction/transaction_construction_response.rs @@ -1,5 +1,17 @@ use crate::prelude::*; +#[derive( + Deserialize, + Serialize, /* Serialize so we can test roundtrip of JSON vectors */ + Clone, + PartialEq, + Eq, + Debug, +)] +pub struct TransactionConstructionResponse { + pub ledger_state: LedgerState, +} + #[cfg(test)] mod tests { use super::*; diff --git a/crates/sargon/src/gateway_api/models/logic/response/transaction/mod.rs b/crates/gateway-models/src/types/response/transaction/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/logic/response/transaction/mod.rs rename to crates/gateway-models/src/types/response/transaction/mod.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/transaction/preview/logs_inner.rs b/crates/gateway-models/src/types/response/transaction/preview/logs_inner.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/transaction/preview/logs_inner.rs rename to crates/gateway-models/src/types/response/transaction/preview/logs_inner.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/transaction/preview/mod.rs b/crates/gateway-models/src/types/response/transaction/preview/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/transaction/preview/mod.rs rename to crates/gateway-models/src/types/response/transaction/preview/mod.rs diff --git a/crates/sargon/src/gateway_api/models/logic/response/transaction/preview/transaction_preview_response.rs b/crates/gateway-models/src/types/response/transaction/preview/transaction_preview_response.rs similarity index 51% rename from crates/sargon/src/gateway_api/models/logic/response/transaction/preview/transaction_preview_response.rs rename to crates/gateway-models/src/types/response/transaction/preview/transaction_preview_response.rs index f98d18eef..e6a16fa19 100644 --- a/crates/sargon/src/gateway_api/models/logic/response/transaction/preview/transaction_preview_response.rs +++ b/crates/gateway-models/src/types/response/transaction/preview/transaction_preview_response.rs @@ -1,5 +1,22 @@ use crate::prelude::*; +#[derive( + Deserialize, + Serialize, /* Serialize so we can test roundtrip of JSON vectors */ + Clone, + PartialEq, + Eq, + Debug, +)] +pub struct TransactionPreviewResponse { + /** Hex-encoded binary blob. */ + pub encoded_receipt: String, + pub radix_engine_toolkit_receipt: + Option, + pub logs: Vec, + pub receipt: TransactionReceipt, +} + #[cfg(test)] mod tests { use super::*; diff --git a/crates/sargon/src/gateway_api/models/types/response/transaction/preview/transaction_preview_response_v2.rs b/crates/gateway-models/src/types/response/transaction/preview/transaction_preview_response_v2.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/transaction/preview/transaction_preview_response_v2.rs rename to crates/gateway-models/src/types/response/transaction/preview/transaction_preview_response_v2.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/transaction/preview/transaction_receipt.rs b/crates/gateway-models/src/types/response/transaction/preview/transaction_receipt.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/transaction/preview/transaction_receipt.rs rename to crates/gateway-models/src/types/response/transaction/preview/transaction_receipt.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/transaction/preview/transaction_receipt_status.rs b/crates/gateway-models/src/types/response/transaction/preview/transaction_receipt_status.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/transaction/preview/transaction_receipt_status.rs rename to crates/gateway-models/src/types/response/transaction/preview/transaction_receipt_status.rs diff --git a/crates/sargon/src/gateway_api/models/types/response/transaction/status/mod.rs b/crates/gateway-models/src/types/response/transaction/status/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/transaction/status/mod.rs rename to crates/gateway-models/src/types/response/transaction/status/mod.rs diff --git a/crates/sargon/src/gateway_api/models/logic/response/transaction/status/payload_item.rs b/crates/gateway-models/src/types/response/transaction/status/payload_item.rs similarity index 91% rename from crates/sargon/src/gateway_api/models/logic/response/transaction/status/payload_item.rs rename to crates/gateway-models/src/types/response/transaction/status/payload_item.rs index 71bb953ca..0c9c8df85 100644 --- a/crates/sargon/src/gateway_api/models/logic/response/transaction/status/payload_item.rs +++ b/crates/gateway-models/src/types/response/transaction/status/payload_item.rs @@ -1,5 +1,10 @@ use crate::prelude::*; +#[derive(Deserialize, Serialize, Clone, PartialEq, Eq, Debug)] +pub struct TransactionStatusResponsePayloadItem { + pub payload_status: Option, +} + impl HasSampleValues for TransactionStatusResponsePayloadItem { fn sample() -> Self { Self::sample_pending() diff --git a/crates/sargon/src/gateway_api/models/types/response/transaction/status/payload_status.rs b/crates/gateway-models/src/types/response/transaction/status/payload_status.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/transaction/status/payload_status.rs rename to crates/gateway-models/src/types/response/transaction/status/payload_status.rs diff --git a/crates/sargon/src/gateway_api/models/logic/response/transaction/status/transaction_status.rs b/crates/gateway-models/src/types/response/transaction/status/transaction_status.rs similarity index 89% rename from crates/sargon/src/gateway_api/models/logic/response/transaction/status/transaction_status.rs rename to crates/gateway-models/src/types/response/transaction/status/transaction_status.rs index f1c915cda..723abb5f5 100644 --- a/crates/sargon/src/gateway_api/models/logic/response/transaction/status/transaction_status.rs +++ b/crates/gateway-models/src/types/response/transaction/status/transaction_status.rs @@ -1,5 +1,12 @@ use crate::prelude::*; +#[derive(Deserialize, Serialize, Clone, PartialEq, Eq, Debug)] +pub struct TransactionStatusResponse { + pub ledger_state: LedgerState, + pub known_payloads: Vec, + pub error_message: Option, +} + impl TransactionStatusResponse { pub fn new( known_payloads: impl IntoIterator< @@ -16,32 +23,37 @@ impl TransactionStatusResponse { } } -#[cfg(test)] impl TransactionStatusResponse { // Helper functions to create sample responses + /// For tests pub fn sample_empty() -> Self { Self::success([]) } + /// For tests pub fn sample_unknown() -> Self { Self::success([TransactionStatusResponsePayloadItem::sample_unknown()]) } + /// For tests pub fn sample_pending() -> Self { Self::success([TransactionStatusResponsePayloadItem::sample_pending()]) } + /// For tests pub fn sample_commit_pending_outcome_unknown() -> Self { Self::success([TransactionStatusResponsePayloadItem::sample_commit_pending_outcome_unknown()]) } + /// For tests pub fn sample_committed_success() -> Self { Self::success([ TransactionStatusResponsePayloadItem::sample_committed_success(), ]) } + /// For tests pub fn sample_committed_failure(error_message: Option) -> Self { Self::failure( [ @@ -52,10 +64,12 @@ impl TransactionStatusResponse { ) } + /// For tests pub fn sample_permanently_rejected(error_message: Option) -> Self { Self::failure([TransactionStatusResponsePayloadItem::sample_committed_permanently_rejected()], error_message) } + /// For tests pub fn sample_temporarily_rejected() -> Self { Self::failure([TransactionStatusResponsePayloadItem::sample_temporarily_rejected()], None) } diff --git a/crates/sargon/src/gateway_api/models/types/response/transaction/subintent_status/mod.rs b/crates/gateway-models/src/types/response/transaction/subintent_status/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/transaction/subintent_status/mod.rs rename to crates/gateway-models/src/types/response/transaction/subintent_status/mod.rs diff --git a/crates/gateway-models/src/types/response/transaction/subintent_status/response.rs b/crates/gateway-models/src/types/response/transaction/subintent_status/response.rs new file mode 100644 index 000000000..d2edb91d8 --- /dev/null +++ b/crates/gateway-models/src/types/response/transaction/subintent_status/response.rs @@ -0,0 +1,58 @@ +use crate::prelude::*; + +#[derive(Deserialize, Serialize, Clone, PartialEq, Eq, Debug)] +pub struct SubintentStatusResponse { + /// The ledger state against which the response was generated. Can be used to detect if the Network Gateway is returning up-to-date information. + pub ledger_state: LedgerState, + + /// The finalization status of this subintent. + /// Each subintent can only be successfully committed once, but unlike a transaction intent, + /// could be committed as a failure zero or more times first. + pub subintent_status: SubintentStatus, + + /// The Transaction ID in which the subintent was included. + /// This field is only present if the status is `CommittedSuccess` + pub finalized_at_transaction_intent_hash: Option, +} + +impl SubintentStatusResponse { + pub fn new( + ledger_state: LedgerState, + subintent_status: SubintentStatus, + finalized_at_transaction_intent_hash: Option, + ) -> Self { + Self { + ledger_state, + subintent_status, + finalized_at_transaction_intent_hash, + } + } +} + +/// === Helper functions to create sample responses === +impl SubintentStatusResponse { + /// For tests + pub fn sample_unknown() -> Self { + Self::new( + LedgerState::sample_stokenet(), + SubintentStatus::Unknown, + None, + ) + } + + /// For tests + pub fn sample_committed_success() -> Self { + Self::committed_success("txid_rdx1frcm6zzyfd08z0deu9x24sh64eccxeux4j2dv3dsqeuh9qsz4y6szm3ltd".to_owned()) + } + + /// For tests + pub fn committed_success( + finalized_at_transaction_intent_hash: impl Into>, + ) -> Self { + Self::new( + LedgerState::sample_stokenet(), + SubintentStatus::CommittedSuccess, + finalized_at_transaction_intent_hash.into(), + ) + } +} diff --git a/crates/sargon/src/gateway_api/models/types/response/transaction/subintent_status/status.rs b/crates/gateway-models/src/types/response/transaction/subintent_status/status.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/response/transaction/subintent_status/status.rs rename to crates/gateway-models/src/types/response/transaction/subintent_status/status.rs diff --git a/crates/sargon/src/gateway_api/models/logic/response/transaction/submit/mod.rs b/crates/gateway-models/src/types/response/transaction/submit/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/logic/response/transaction/submit/mod.rs rename to crates/gateway-models/src/types/response/transaction/submit/mod.rs diff --git a/crates/sargon/src/gateway_api/models/logic/response/transaction/submit/submit.rs b/crates/gateway-models/src/types/response/transaction/submit/submit.rs similarity index 61% rename from crates/sargon/src/gateway_api/models/logic/response/transaction/submit/submit.rs rename to crates/gateway-models/src/types/response/transaction/submit/submit.rs index cf0c30f21..871ee77c1 100644 --- a/crates/sargon/src/gateway_api/models/logic/response/transaction/submit/submit.rs +++ b/crates/gateway-models/src/types/response/transaction/submit/submit.rs @@ -1,5 +1,18 @@ use crate::prelude::*; +#[derive( + Deserialize, + Serialize, /* Serialize so we can test roundtrip of JSON vectors */ + Clone, + PartialEq, + Eq, + Debug, +)] +pub struct TransactionSubmitResponse { + /** Is true if the transaction is a duplicate of an existing pending transaction. */ + pub duplicate: bool, +} + #[cfg(test)] mod tests { use super::*; diff --git a/crates/sargon/src/gateway_api/models/types/support/fetch_resources_output.rs b/crates/gateway-models/src/types/support/fetch_resources_output.rs similarity index 65% rename from crates/sargon/src/gateway_api/models/types/support/fetch_resources_output.rs rename to crates/gateway-models/src/types/support/fetch_resources_output.rs index c9dbcf138..aa9c2f16a 100644 --- a/crates/sargon/src/gateway_api/models/types/support/fetch_resources_output.rs +++ b/crates/gateway-models/src/types/support/fetch_resources_output.rs @@ -32,23 +32,3 @@ impl FetchResourcesOutput { .collect() } } - -#[cfg(test)] -mod tests { - use crate::prelude::*; - - #[allow(clippy::upper_case_acronyms)] - type SUT = FetchResourcesOutput; - - #[test] - fn resource_addresses() { - let fungible = FungibleResourcesCollectionItem::sample(); - let non_fungible = NonFungibleResourcesCollectionItem::sample(); - let sut = SUT::new([fungible.clone()], [non_fungible.clone()]); - - assert_eq!( - sut.resource_addresses(), - vec![fungible.resource_address(), non_fungible.resource_address()] - ); - } -} diff --git a/crates/sargon/src/gateway_api/models/types/support/fetch_transferable_resources_output.rs b/crates/gateway-models/src/types/support/fetch_transferable_resources_output.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/support/fetch_transferable_resources_output.rs rename to crates/gateway-models/src/types/support/fetch_transferable_resources_output.rs diff --git a/crates/sargon/src/gateway_api/models/types/support/mod.rs b/crates/gateway-models/src/types/support/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/models/types/support/mod.rs rename to crates/gateway-models/src/types/support/mod.rs diff --git a/crates/http-client/Cargo.toml b/crates/http-client/Cargo.toml new file mode 100644 index 000000000..2bcb66169 --- /dev/null +++ b/crates/http-client/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "http-client" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +sargon-core = { path = "../sargon-core" } +sargon-drivers = { path = "../sargon-drivers" } + +# === RADIX DEPENDENCIES === + +# === EXTERNAL DEPENDENCIES === +reqwest = { workspace = true } +serde_json = { workspace = true } +serde = { workspace = true } + +[dev-dependencies] +actix-rt = { workspace = true } diff --git a/crates/http-client/src/http_client.rs b/crates/http-client/src/http_client.rs new file mode 100644 index 000000000..e4a30b09d --- /dev/null +++ b/crates/http-client/src/http_client.rs @@ -0,0 +1,75 @@ +use crate::prelude::*; + +/// A `HttpClient` needs a "network antenna" to be able to execute the +/// network requests - which is a trait that clients implement on the FFI side (iOS/Android). +#[derive(Debug)] +pub struct HttpClient { + /// An object implementing the `NetworkingDriver` traits, which iOS/Android + /// clients pass into the constructor of this GatewayClient, so that it can + /// execute network requests. + pub driver: Arc, +} + +impl HttpClient { + pub fn new(driver: Arc) -> Self { + Self { driver } + } +} + +impl HttpClient { + pub async fn execute_network_request( + &self, + request: NetworkRequest, + ) -> Result { + let response = self.driver.execute_network_request(request).await?; + + // Check for valid status code + if !(200..=299).contains(&response.status_code) { + return Err(CommonError::NetworkResponseBadCode { + code: response.status_code, + }); + } + + Ok(response.body) + } +} + +impl HttpClient { + fn model_from_response( + &self, + bytes: BagOfBytes, + ) -> Result + where + U: for<'a> Deserialize<'a>, + { + serde_json::from_slice::(&bytes).map_err(|_| { + CommonError::NetworkResponseJSONDeserialize { + into_type: type_name::(), + } + }) + } + + pub async fn execute_request_with_decoding( + &self, + request: NetworkRequest, + ) -> Result + where + U: for<'a> Deserialize<'a>, + { + let response = self.execute_network_request(request).await?; + self.model_from_response(response) + } + + pub async fn execute_request_with_map( + &self, + request: NetworkRequest, + map: F, + ) -> Result + where + U: for<'a> Deserialize<'a>, + F: Fn(U) -> Result, + { + let model = self.execute_request_with_decoding(request).await?; + map(model) + } +} diff --git a/crates/http-client/src/lib.rs b/crates/http-client/src/lib.rs new file mode 100644 index 000000000..6a7121c21 --- /dev/null +++ b/crates/http-client/src/lib.rs @@ -0,0 +1,10 @@ +mod http_client; + +pub mod prelude { + pub use crate::http_client::*; + + pub(crate) use sargon_core::prelude::*; + pub(crate) use sargon_drivers::prelude::*; +} + +pub use prelude::*; diff --git a/crates/identified-vec-of/Cargo.toml b/crates/identified-vec-of/Cargo.toml index 6dd5614fd..75472073a 100644 --- a/crates/identified-vec-of/Cargo.toml +++ b/crates/identified-vec-of/Cargo.toml @@ -1,17 +1,19 @@ [package] name = "identified-vec-of" -version = "1.2.1" +version = "1.1.99" edition = "2021" [dependencies] +# === SARGON CRATES === sargon-core-assert-json = { path = "../sargon-core-assert-json" } sargon-core-error = { path = "../sargon-core-error" } +# === RADIX DEPENDENCIES +radix-rust = { workspace = true } + +# === EXTERNAL DEPENDENCIES +derive_more = { workspace = true } +itertools = { workspace = true } paste = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } -derive_more = { workspace = true } -itertools = { workspace = true } - -# === RADIX DEPENDENCIES -radix-rust = { workspace = true } diff --git a/crates/next-derivation-index-ephemeral/Cargo.toml b/crates/next-derivation-index-ephemeral/Cargo.toml new file mode 100644 index 000000000..211c5bd30 --- /dev/null +++ b/crates/next-derivation-index-ephemeral/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "next-derivation-index-ephemeral" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +sargon-core-assert-json = { path = "../sargon-core-assert-json" } +sargon-core-error = { path = "../sargon-core-error" } +sargon-core = { path = "../sargon-core" } +sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } +sargon-factors = { path = "../sargon-factors" } +sargon-addresses = { path = "../sargon-addresses" } + +# === RADIX DEPENDENCIES +#None + +# === EXTERNAL DEPENDENCIES +enum-iterator = { workspace = true } +derive_more = { workspace = true } +serde = { workspace = true } +serde_with = { workspace = true } diff --git a/crates/sargon/src/factor_instances_provider/agnostic_paths/derivation_preset.rs b/crates/next-derivation-index-ephemeral/src/agnostic_paths/derivation_preset.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/agnostic_paths/derivation_preset.rs rename to crates/next-derivation-index-ephemeral/src/agnostic_paths/derivation_preset.rs diff --git a/crates/sargon/src/factor_instances_provider/agnostic_paths/index_agnostic_path.rs b/crates/next-derivation-index-ephemeral/src/agnostic_paths/index_agnostic_path.rs similarity index 99% rename from crates/sargon/src/factor_instances_provider/agnostic_paths/index_agnostic_path.rs rename to crates/next-derivation-index-ephemeral/src/agnostic_paths/index_agnostic_path.rs index dd5eead59..0024617f7 100644 --- a/crates/sargon/src/factor_instances_provider/agnostic_paths/index_agnostic_path.rs +++ b/crates/next-derivation-index-ephemeral/src/agnostic_paths/index_agnostic_path.rs @@ -1,7 +1,5 @@ use crate::prelude::*; -use super::quantities; - /// A DerivationPath which is not indexed. On a specific network. #[derive( Clone, diff --git a/crates/sargon/src/factor_instances_provider/agnostic_paths/mod.rs b/crates/next-derivation-index-ephemeral/src/agnostic_paths/mod.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/agnostic_paths/mod.rs rename to crates/next-derivation-index-ephemeral/src/agnostic_paths/mod.rs diff --git a/crates/sargon/src/factor_instances_provider/agnostic_paths/quantified_derivation_preset.rs b/crates/next-derivation-index-ephemeral/src/agnostic_paths/quantified_derivation_preset.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/agnostic_paths/quantified_derivation_preset.rs rename to crates/next-derivation-index-ephemeral/src/agnostic_paths/quantified_derivation_preset.rs diff --git a/crates/sargon/src/factor_instances_provider/agnostic_paths/quantities.rs b/crates/next-derivation-index-ephemeral/src/agnostic_paths/quantities.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/agnostic_paths/quantities.rs rename to crates/next-derivation-index-ephemeral/src/agnostic_paths/quantities.rs diff --git a/crates/next-derivation-index-ephemeral/src/lib.rs b/crates/next-derivation-index-ephemeral/src/lib.rs new file mode 100644 index 000000000..ea850973b --- /dev/null +++ b/crates/next-derivation-index-ephemeral/src/lib.rs @@ -0,0 +1,14 @@ +mod agnostic_paths; +mod next_derivation_entity_index_with_ephemeral_offsets; +mod next_derivation_entity_index_with_ephemeral_offsets_for_factor_source; + +pub mod prelude { + pub use crate::agnostic_paths::*; + pub use crate::next_derivation_entity_index_with_ephemeral_offsets::*; + pub use crate::next_derivation_entity_index_with_ephemeral_offsets_for_factor_source::*; + + pub(crate) use sargon_addresses::prelude::*; + pub(crate) use sargon_core::prelude::*; + pub(crate) use sargon_factors::prelude::*; + pub(crate) use sargon_hierarchical_deterministic::prelude::*; +} diff --git a/crates/sargon/src/factor_instances_provider/next_index_assigner/next_derivation_entity_index_with_ephemeral_offsets.rs b/crates/next-derivation-index-ephemeral/src/next_derivation_entity_index_with_ephemeral_offsets.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/next_index_assigner/next_derivation_entity_index_with_ephemeral_offsets.rs rename to crates/next-derivation-index-ephemeral/src/next_derivation_entity_index_with_ephemeral_offsets.rs diff --git a/crates/sargon/src/factor_instances_provider/next_index_assigner/next_derivation_entity_index_with_ephemeral_offsets_for_factor_source.rs b/crates/next-derivation-index-ephemeral/src/next_derivation_entity_index_with_ephemeral_offsets_for_factor_source.rs similarity index 97% rename from crates/sargon/src/factor_instances_provider/next_index_assigner/next_derivation_entity_index_with_ephemeral_offsets_for_factor_source.rs rename to crates/next-derivation-index-ephemeral/src/next_derivation_entity_index_with_ephemeral_offsets_for_factor_source.rs index 20860e27e..357e9ca31 100644 --- a/crates/sargon/src/factor_instances_provider/next_index_assigner/next_derivation_entity_index_with_ephemeral_offsets_for_factor_source.rs +++ b/crates/next-derivation-index-ephemeral/src/next_derivation_entity_index_with_ephemeral_offsets_for_factor_source.rs @@ -1,5 +1,3 @@ -use std::ops::{AddAssign, Index}; - use crate::prelude::*; /// Ephemeral / "Local" offsets, is a collection of counters with offset added diff --git a/crates/sargon-addresses/Cargo.toml b/crates/sargon-addresses/Cargo.toml index 4722d7b2b..533ee53c5 100644 --- a/crates/sargon-addresses/Cargo.toml +++ b/crates/sargon-addresses/Cargo.toml @@ -1,22 +1,22 @@ [package] name = "sargon-addresses" -version = "1.2.1" +version = "1.1.99" edition = "2021" [dependencies] +# === SARGON CRATES === sargon-core = { path = "../sargon-core" } sargon-factors = { path = "../sargon-factors" } sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } # ==== RADIX DEPENDENCIES ==== radix-common = { workspace = true } -radix-engine-interface = { workspace = true } radix-engine = { workspace = true } +radix-engine-interface = { workspace = true } +radix-engine-toolkit = { workspace = true } radix-rust = { workspace = true } radix-transactions = { workspace = true } -radix-engine-toolkit = { workspace = true } - # ==== EXTERNAL DEPENDENCIES ==== derive_more = { workspace = true } enum-iterator = { workspace = true } diff --git a/crates/sargon-addresses/src/address/account_address.rs b/crates/sargon-addresses/src/address/account_address.rs index a57665862..865b9f0a6 100644 --- a/crates/sargon-addresses/src/address/account_address.rs +++ b/crates/sargon-addresses/src/address/account_address.rs @@ -1,5 +1,7 @@ pub use crate::prelude::*; +pub type DappDefinitionAddress = AccountAddress; + decl_ret_wrapped_address!( /// Human readable address of an account. Always starts with `"account_"``, for example: /// diff --git a/crates/sargon-clients/Cargo.toml b/crates/sargon-clients/Cargo.toml new file mode 100644 index 000000000..9af540249 --- /dev/null +++ b/crates/sargon-clients/Cargo.toml @@ -0,0 +1,64 @@ +[package] +name = "sargon-clients" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +sargon-profile = { path = "../sargon-profile" } +sargon-profile-supporting-types = { path = "../sargon-profile-supporting-types" } +sargon-core = { path = "../sargon-core" } +sargon-factors-supporting-types = { path = "../sargon-factors-supporting-types" } +sargon-drivers = { path = "../sargon-drivers" } +http-client = { path = "../http-client" } +gateway-client-and-api = { path = "../gateway-client-and-api" } +sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } + +# === RADIX DEPENDENCIES === +radix-engine = { workspace = true } +radix-common = { workspace = true } +radix-common-derive = { workspace = true } +radix-engine-interface = { workspace = true } +radix-engine-toolkit = { workspace = true } +radix-engine-toolkit-common = { workspace = true } +radix-transactions = { workspace = true } +radix-rust = { workspace = true } +sbor = { workspace = true } + +# === EXTERNAL DEPENDENCIES === +aes-gcm = { workspace = true } +assert-json-diff = { workspace = true } +async-std = { workspace = true } +async-trait = { workspace = true } +base64 = { workspace = true } +camino = { workspace = true } +delegate = { workspace = true } +derive_more = { workspace = true } +enum-as-inner = { workspace = true } +enum-iterator = { workspace = true } +futures = { workspace = true } +hex = { workspace = true } +hkdf = { workspace = true } +iota-crypto = { workspace = true } +iso8601-timestamp = { workspace = true } +itertools = { workspace = true } +k256 = { workspace = true } +log = { workspace = true } +once_cell = { workspace = true } +paste = { workspace = true } +pretty_assertions = { workspace = true } +pretty_env_logger = { workspace = true } +rand = { workspace = true } +reqwest = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +serde_repr = { workspace = true } +serde_with = { workspace = true } +strum = { workspace = true } +thiserror = { workspace = true } +url = { workspace = true } +uuid = { workspace = true } +zeroize = { workspace = true } + +[dev-dependencies] +actix-rt = { workspace = true } diff --git a/crates/sargon/src/system/clients/README.md b/crates/sargon-clients/src/clients/README.md similarity index 100% rename from crates/sargon/src/system/clients/README.md rename to crates/sargon-clients/src/clients/README.md diff --git a/crates/sargon/src/system/clients/client/entropy_client/entropy_client.rs b/crates/sargon-clients/src/clients/client/entropy_client/entropy_client.rs similarity index 100% rename from crates/sargon/src/system/clients/client/entropy_client/entropy_client.rs rename to crates/sargon-clients/src/clients/client/entropy_client/entropy_client.rs diff --git a/crates/sargon/src/system/clients/client/entropy_client/mod.rs b/crates/sargon-clients/src/clients/client/entropy_client/mod.rs similarity index 100% rename from crates/sargon/src/system/clients/client/entropy_client/mod.rs rename to crates/sargon-clients/src/clients/client/entropy_client/mod.rs diff --git a/crates/sargon/src/system/clients/client/event_bus_client/event_bus_client.rs b/crates/sargon-clients/src/clients/client/event_bus_client/event_bus_client.rs similarity index 100% rename from crates/sargon/src/system/clients/client/event_bus_client/event_bus_client.rs rename to crates/sargon-clients/src/clients/client/event_bus_client/event_bus_client.rs diff --git a/crates/sargon/src/system/clients/client/event_bus_client/mod.rs b/crates/sargon-clients/src/clients/client/event_bus_client/mod.rs similarity index 100% rename from crates/sargon/src/system/clients/client/event_bus_client/mod.rs rename to crates/sargon-clients/src/clients/client/event_bus_client/mod.rs diff --git a/crates/sargon/src/factor_instances_provider/factor_instances_cache/factor_instances_cache.rs b/crates/sargon-clients/src/clients/client/factor_instances_cache_client/cache/factor_instances_cache.rs similarity index 92% rename from crates/sargon/src/factor_instances_provider/factor_instances_cache/factor_instances_cache.rs rename to crates/sargon-clients/src/clients/client/factor_instances_cache_client/cache/factor_instances_cache.rs index b935ce6af..043458a1e 100644 --- a/crates/sargon/src/factor_instances_provider/factor_instances_cache/factor_instances_cache.rs +++ b/crates/sargon-clients/src/clients/client/factor_instances_cache_client/cache/factor_instances_cache.rs @@ -1,7 +1,4 @@ -use std::{ - borrow::Borrow, - ops::{Add, Index}, -}; +use std::{borrow::Borrow, ops::Add}; use crate::prelude::*; @@ -97,7 +94,7 @@ pub struct FactorInstancesCache { map: RwLock, } -pub(super) type FICStorage = IndexMap< +pub type FICStorage = IndexMap< FactorSourceIDFromHash, IndexMap, >; @@ -395,97 +392,6 @@ impl FactorInstancesCache { } } -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct CacheInstancesAndRemainingQuantityToDerive { - pub instances_to_use_from_cache: FactorInstances, // if empty then this was not a requested derivation preset, but we are cache filling and found `quantity_to_derive` needed to fill cache. - pub quantity_to_derive: usize, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct CacheNotSatisfied { - /// PER DerivationPreset => PER FactorSourceID => CacheInstancesAndRemainingQuantityToDerive - pub cached_and_quantities_to_derive: IndexMap< - DerivationPreset, - IndexMap< - FactorSourceIDFromHash, - CacheInstancesAndRemainingQuantityToDerive, - >, - >, -} -impl CacheNotSatisfied { - fn map( - &self, - extract: impl Fn( - ( - FactorSourceIDFromHash, - CacheInstancesAndRemainingQuantityToDerive, - ), - ) -> Option<(FactorSourceIDFromHash, R)>, - ) -> IndexMap> { - self.cached_and_quantities_to_derive - .clone() - .into_iter() - .filter_map(|(preset, v)| { - let per_factor = v - .into_iter() - .filter_map(|(x, y)| extract((x, y))) - .collect::>(); - - if per_factor.is_empty() { - None - } else { - Some((preset, per_factor)) - } - }) - .collect() - } - - pub fn cached_instances_to_use( - &self, - ) -> InstancesPerDerivationPresetPerFactorSource { - self.map(|(x, y)| { - let instances = y.instances_to_use_from_cache; - if instances.is_empty() { - None - } else { - Some((x, instances)) - } - }) - } - - pub fn remaining_quantities_to_derive(&self) -> QuantitiesToDerive { - self.map(|(x, y)| { - if y.quantity_to_derive > 0 { - Some((x, y.quantity_to_derive)) - } else { - None - } - }) - } -} -pub type QuantitiesToDerive = - IndexMap>; - -pub type InstancesPerDerivationPresetPerFactorSource = IndexMap< - DerivationPreset, - IndexMap, ->; - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct CacheSatisfied { - /// PER DerivationPreset => PER FactorSourceID => FactorInstances - pub cached: IndexMap< - DerivationPreset, - IndexMap, - >, -} - -#[derive(Debug, Clone, PartialEq, Eq, enum_as_inner::EnumAsInner)] -pub enum CachedInstancesWithQuantitiesOutcome { - Satisfied(CacheSatisfied), - NotSatisfied(CacheNotSatisfied), -} - impl FactorInstancesCache { pub fn get_mono_factor( &self, @@ -604,7 +510,6 @@ impl FactorInstancesCache { } } -#[cfg(test)] impl FactorInstancesCache { pub fn get_poly_factor_with_quantities( &self, @@ -659,8 +564,6 @@ impl FactorInstancesCache { #[cfg(test)] mod tests { - use crate::factor_instances_provider::next_index_assigner; - use super::*; #[allow(clippy::upper_case_acronyms)] diff --git a/crates/sargon/src/factor_instances_provider/factor_instances_cache/keyed_instances.rs b/crates/sargon-clients/src/clients/client/factor_instances_cache_client/cache/keyed_instances.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/factor_instances_cache/keyed_instances.rs rename to crates/sargon-clients/src/clients/client/factor_instances_cache_client/cache/keyed_instances.rs diff --git a/crates/sargon/src/factor_instances_provider/factor_instances_cache/mod.rs b/crates/sargon-clients/src/clients/client/factor_instances_cache_client/cache/mod.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/factor_instances_cache/mod.rs rename to crates/sargon-clients/src/clients/client/factor_instances_cache_client/cache/mod.rs diff --git a/crates/sargon/src/factor_instances_provider/factor_instances_cache/serializable_cache/factor_instances_cache_snapshot.rs b/crates/sargon-clients/src/clients/client/factor_instances_cache_client/cache/serializable_cache/factor_instances_cache_snapshot.rs similarity index 96% rename from crates/sargon/src/factor_instances_provider/factor_instances_cache/serializable_cache/factor_instances_cache_snapshot.rs rename to crates/sargon-clients/src/clients/client/factor_instances_cache_client/cache/serializable_cache/factor_instances_cache_snapshot.rs index d2b06e9e7..e6c90d36d 100644 --- a/crates/sargon/src/factor_instances_provider/factor_instances_cache/serializable_cache/factor_instances_cache_snapshot.rs +++ b/crates/sargon-clients/src/clients/client/factor_instances_cache_client/cache/serializable_cache/factor_instances_cache_snapshot.rs @@ -1,6 +1,4 @@ -use crate::{ - factor_instances_provider::factor_instances_cache::FICStorage, prelude::*, -}; +use crate::prelude::*; pub type DenseKeyStorage = IndexMap< FactorSourceIDFromHashDenseKey, diff --git a/crates/sargon/src/factor_instances_provider/factor_instances_cache/serializable_cache/factor_source_id_from_hash_dense_key.rs b/crates/sargon-clients/src/clients/client/factor_instances_cache_client/cache/serializable_cache/factor_source_id_from_hash_dense_key.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/factor_instances_cache/serializable_cache/factor_source_id_from_hash_dense_key.rs rename to crates/sargon-clients/src/clients/client/factor_instances_cache_client/cache/serializable_cache/factor_source_id_from_hash_dense_key.rs diff --git a/crates/sargon/src/factor_instances_provider/factor_instances_cache/serializable_cache/mod.rs b/crates/sargon-clients/src/clients/client/factor_instances_cache_client/cache/serializable_cache/mod.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/factor_instances_cache/serializable_cache/mod.rs rename to crates/sargon-clients/src/clients/client/factor_instances_cache_client/cache/serializable_cache/mod.rs diff --git a/crates/sargon/src/system/clients/client/factor_instances_cache_client.rs b/crates/sargon-clients/src/clients/client/factor_instances_cache_client/client.rs similarity index 99% rename from crates/sargon/src/system/clients/client/factor_instances_cache_client.rs rename to crates/sargon-clients/src/clients/client/factor_instances_cache_client/client.rs index 63f3bda03..3dd543fcc 100644 --- a/crates/sargon/src/system/clients/client/factor_instances_cache_client.rs +++ b/crates/sargon-clients/src/clients/client/factor_instances_cache_client/client.rs @@ -89,13 +89,14 @@ impl FactorInstancesCacheClient { } } -#[cfg(test)] impl FactorInstancesCacheClient { + /// For tests pub async fn clear(&self) -> Result<()> { self.set_cache(FactorInstancesCacheSnapshot::default()) .await } + /// For tests pub async fn set_cache( &self, cache_snapshot: FactorInstancesCacheSnapshot, @@ -196,13 +197,12 @@ impl FactorInstancesCacheClient { } } -#[cfg(test)] impl FactorInstancesCacheClient { /// Returns enough instances to satisfy the requested quantity for each factor source, /// **OR LESS**, never more, and if less, it means we MUST derive more, and if we /// must derive more, this function returns the quantities to derive for each factor source, /// for each derivation preset, not only the originally requested one. - async fn get_poly_factor_with_quantities( + pub async fn get_poly_factor_with_quantities( &self, factor_source_ids: impl Borrow>, originally_requested_quantified_derivation_preset: impl Borrow< diff --git a/crates/sargon-clients/src/clients/client/factor_instances_cache_client/mod.rs b/crates/sargon-clients/src/clients/client/factor_instances_cache_client/mod.rs new file mode 100644 index 000000000..600fc6347 --- /dev/null +++ b/crates/sargon-clients/src/clients/client/factor_instances_cache_client/mod.rs @@ -0,0 +1,7 @@ +mod cache; +mod client; +mod models; + +pub use cache::*; +pub use client::*; +pub use models::*; diff --git a/crates/sargon-clients/src/clients/client/factor_instances_cache_client/models/mod.rs b/crates/sargon-clients/src/clients/client/factor_instances_cache_client/models/mod.rs new file mode 100644 index 000000000..42cf37cde --- /dev/null +++ b/crates/sargon-clients/src/clients/client/factor_instances_cache_client/models/mod.rs @@ -0,0 +1,3 @@ +mod outcome; + +pub use outcome::*; diff --git a/crates/sargon-clients/src/clients/client/factor_instances_cache_client/models/outcome.rs b/crates/sargon-clients/src/clients/client/factor_instances_cache_client/models/outcome.rs new file mode 100644 index 000000000..4bfa56108 --- /dev/null +++ b/crates/sargon-clients/src/clients/client/factor_instances_cache_client/models/outcome.rs @@ -0,0 +1,92 @@ +use crate::prelude::*; + +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct CacheInstancesAndRemainingQuantityToDerive { + pub instances_to_use_from_cache: FactorInstances, // if empty then this was not a requested derivation preset, but we are cache filling and found `quantity_to_derive` needed to fill cache. + pub quantity_to_derive: usize, +} + +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct CacheNotSatisfied { + /// PER DerivationPreset => PER FactorSourceID => CacheInstancesAndRemainingQuantityToDerive + pub cached_and_quantities_to_derive: IndexMap< + DerivationPreset, + IndexMap< + FactorSourceIDFromHash, + CacheInstancesAndRemainingQuantityToDerive, + >, + >, +} +impl CacheNotSatisfied { + fn map( + &self, + extract: impl Fn( + ( + FactorSourceIDFromHash, + CacheInstancesAndRemainingQuantityToDerive, + ), + ) -> Option<(FactorSourceIDFromHash, R)>, + ) -> IndexMap> { + self.cached_and_quantities_to_derive + .clone() + .into_iter() + .filter_map(|(preset, v)| { + let per_factor = v + .into_iter() + .filter_map(|(x, y)| extract((x, y))) + .collect::>(); + + if per_factor.is_empty() { + None + } else { + Some((preset, per_factor)) + } + }) + .collect() + } + + pub fn cached_instances_to_use( + &self, + ) -> InstancesPerDerivationPresetPerFactorSource { + self.map(|(x, y)| { + let instances = y.instances_to_use_from_cache; + if instances.is_empty() { + None + } else { + Some((x, instances)) + } + }) + } + + pub fn remaining_quantities_to_derive(&self) -> QuantitiesToDerive { + self.map(|(x, y)| { + if y.quantity_to_derive > 0 { + Some((x, y.quantity_to_derive)) + } else { + None + } + }) + } +} +pub type QuantitiesToDerive = + IndexMap>; + +pub type InstancesPerDerivationPresetPerFactorSource = IndexMap< + DerivationPreset, + IndexMap, +>; + +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct CacheSatisfied { + /// PER DerivationPreset => PER FactorSourceID => FactorInstances + pub cached: IndexMap< + DerivationPreset, + IndexMap, + >, +} + +#[derive(Debug, Clone, PartialEq, Eq, enum_as_inner::EnumAsInner)] +pub enum CachedInstancesWithQuantitiesOutcome { + Satisfied(CacheSatisfied), + NotSatisfied(CacheNotSatisfied), +} diff --git a/crates/sargon/src/system/clients/client/file_system_client/file_system_client.rs b/crates/sargon-clients/src/clients/client/file_system_client/file_system_client.rs similarity index 99% rename from crates/sargon/src/system/clients/client/file_system_client/file_system_client.rs rename to crates/sargon-clients/src/clients/client/file_system_client/file_system_client.rs index b6f2c6a02..153fd423f 100644 --- a/crates/sargon/src/system/clients/client/file_system_client/file_system_client.rs +++ b/crates/sargon-clients/src/clients/client/file_system_client/file_system_client.rs @@ -97,7 +97,6 @@ impl FileSystemClient { } } -#[cfg(test)] impl FileSystemClient { pub fn test() -> Self { Self::new(RustFileSystemDriver::new()) diff --git a/crates/sargon/src/system/clients/client/file_system_client/mod.rs b/crates/sargon-clients/src/clients/client/file_system_client/mod.rs similarity index 100% rename from crates/sargon/src/system/clients/client/file_system_client/mod.rs rename to crates/sargon-clients/src/clients/client/file_system_client/mod.rs diff --git a/crates/sargon/src/system/clients/client/host_info_client/host_info_client.rs b/crates/sargon-clients/src/clients/client/host_info_client/host_info_client.rs similarity index 90% rename from crates/sargon/src/system/clients/client/host_info_client/host_info_client.rs rename to crates/sargon-clients/src/clients/client/host_info_client/host_info_client.rs index 9e0db3fce..ef42d9938 100644 --- a/crates/sargon/src/system/clients/client/host_info_client/host_info_client.rs +++ b/crates/sargon-clients/src/clients/client/host_info_client/host_info_client.rs @@ -6,11 +6,11 @@ pub struct HostInfoClient { } impl HostInfoClient { - pub(crate) fn new(driver: Arc) -> Self { + pub fn new(driver: Arc) -> Self { Self { driver } } - pub(crate) async fn summary(&self) -> String { + pub async fn summary(&self) -> String { let host_model = self.driver.host_device_model().await; let host_os = self.driver.host_os().await; let host_app_version = self.driver.host_app_version().await; @@ -40,8 +40,6 @@ impl HostInfoClient { #[cfg(test)] mod tests { use super::*; - use actix_rt::time::timeout; - use std::{future::Future, time::Duration}; #[allow(clippy::upper_case_acronyms)] type SUT = HostInfoClient; diff --git a/crates/sargon/src/system/clients/client/host_info_client/mod.rs b/crates/sargon-clients/src/clients/client/host_info_client/mod.rs similarity index 100% rename from crates/sargon/src/system/clients/client/host_info_client/mod.rs rename to crates/sargon-clients/src/clients/client/host_info_client/mod.rs diff --git a/crates/sargon/src/system/clients/client/mod.rs b/crates/sargon-clients/src/clients/client/mod.rs similarity index 91% rename from crates/sargon/src/system/clients/client/mod.rs rename to crates/sargon-clients/src/clients/client/mod.rs index c47198918..7a954989d 100644 --- a/crates/sargon/src/system/clients/client/mod.rs +++ b/crates/sargon-clients/src/clients/client/mod.rs @@ -3,7 +3,6 @@ mod event_bus_client; mod factor_instances_cache_client; mod file_system_client; mod host_info_client; -mod http_client; mod profile_change_client; mod secure_storage_client; mod unsafe_storage_client; @@ -13,7 +12,6 @@ pub use event_bus_client::*; pub use factor_instances_cache_client::*; pub use file_system_client::*; pub use host_info_client::*; -pub use http_client::*; pub use profile_change_client::*; pub use secure_storage_client::*; pub use unsafe_storage_client::*; diff --git a/crates/sargon/src/system/clients/client/profile_change_client/mod.rs b/crates/sargon-clients/src/clients/client/profile_change_client/mod.rs similarity index 100% rename from crates/sargon/src/system/clients/client/profile_change_client/mod.rs rename to crates/sargon-clients/src/clients/client/profile_change_client/mod.rs diff --git a/crates/sargon/src/system/clients/client/profile_change_client/profile_change_client.rs b/crates/sargon-clients/src/clients/client/profile_change_client/profile_change_client.rs similarity index 100% rename from crates/sargon/src/system/clients/client/profile_change_client/profile_change_client.rs rename to crates/sargon-clients/src/clients/client/profile_change_client/profile_change_client.rs diff --git a/crates/sargon/src/system/clients/client/secure_storage_client/mod.rs b/crates/sargon-clients/src/clients/client/secure_storage_client/mod.rs similarity index 100% rename from crates/sargon/src/system/clients/client/secure_storage_client/mod.rs rename to crates/sargon-clients/src/clients/client/secure_storage_client/mod.rs diff --git a/crates/sargon/src/system/clients/client/secure_storage_client/secure_storage_client.rs b/crates/sargon-clients/src/clients/client/secure_storage_client/secure_storage_client.rs similarity index 94% rename from crates/sargon/src/system/clients/client/secure_storage_client/secure_storage_client.rs rename to crates/sargon-clients/src/clients/client/secure_storage_client/secure_storage_client.rs index 8498f1d0a..a367bf952 100644 --- a/crates/sargon/src/system/clients/client/secure_storage_client/secure_storage_client.rs +++ b/crates/sargon-clients/src/clients/client/secure_storage_client/secure_storage_client.rs @@ -14,10 +14,20 @@ pub struct SecureStorageClient { driver: Arc, } +#[async_trait::async_trait] +impl MnemonicLoading for SecureStorageClient { + async fn load_mnemonic( + &self, + id: FactorSourceIDFromHash, + ) -> Result { + self.load_mnemonic_with_passphrase(id).await + } +} + impl SecureStorageClient { /// Creates a new SecureStorageClient using an implementation of /// `SecureStorageDriver`. - pub(crate) fn new(driver: Arc) -> Self { + pub fn new(driver: Arc) -> Self { Self { driver } } } @@ -229,46 +239,13 @@ impl SecureStorageClient { } } -pub trait TestDerivationInteractorFromSecureStorageClient: Sized { - fn new( - always_fail: bool, - secure_storage_client: Arc, - ) -> Self; -} - -#[async_trait::async_trait] -impl MnemonicLoading for SecureStorageClient { - async fn load_mnemonic( - &self, - id: FactorSourceIDFromHash, - ) -> Result { - self.load_mnemonic_with_passphrase(id).await - } -} - -impl TestDerivationInteractorFromSecureStorageClient - for TestDerivationInteractor -{ - fn new( - always_fail: bool, - secure_storage_client: Arc, - ) -> Self { - Self::with_mnemonic_loading( - always_fail, - secure_storage_client as Arc, - ) - } -} - -#[cfg(test)] impl SecureStorageClient { - pub(crate) fn ephemeral( - ) -> (SecureStorageClient, Arc) { + pub fn ephemeral() -> (SecureStorageClient, Arc) { let storage = EphemeralSecureStorage::new(); (SecureStorageClient::new(storage.clone()), storage) } - pub(crate) fn always_fail() -> Self { + pub fn always_fail() -> Self { SecureStorageClient::new(Arc::new(AlwaysFailSecureStorage {})) } } diff --git a/crates/sargon/src/system/clients/client/unsafe_storage_client/mod.rs b/crates/sargon-clients/src/clients/client/unsafe_storage_client/mod.rs similarity index 100% rename from crates/sargon/src/system/clients/client/unsafe_storage_client/mod.rs rename to crates/sargon-clients/src/clients/client/unsafe_storage_client/mod.rs diff --git a/crates/sargon/src/system/clients/client/unsafe_storage_client/unsafe_storage_client.rs b/crates/sargon-clients/src/clients/client/unsafe_storage_client/unsafe_storage_client.rs similarity index 100% rename from crates/sargon/src/system/clients/client/unsafe_storage_client/unsafe_storage_client.rs rename to crates/sargon-clients/src/clients/client/unsafe_storage_client/unsafe_storage_client.rs diff --git a/crates/sargon/src/system/clients/clients.rs b/crates/sargon-clients/src/clients/clients.rs similarity index 94% rename from crates/sargon/src/system/clients/clients.rs rename to crates/sargon-clients/src/clients/clients.rs index bc705b186..333b34677 100644 --- a/crates/sargon/src/system/clients/clients.rs +++ b/crates/sargon-clients/src/clients/clients.rs @@ -1,3 +1,5 @@ +use std::sync::Arc; + use crate::prelude::*; #[derive(Debug)] @@ -42,8 +44,4 @@ impl Clients { factor_instances_cache, } } - - pub fn new(bios: Arc) -> Self { - Self::with_drivers(bios.drivers.clone()) - } } diff --git a/crates/sargon/src/system/clients/mod.rs b/crates/sargon-clients/src/clients/mod.rs similarity index 100% rename from crates/sargon/src/system/clients/mod.rs rename to crates/sargon-clients/src/clients/mod.rs diff --git a/crates/sargon-clients/src/lib.rs b/crates/sargon-clients/src/lib.rs new file mode 100644 index 000000000..996a3a6b6 --- /dev/null +++ b/crates/sargon-clients/src/lib.rs @@ -0,0 +1,14 @@ +mod clients; + +pub mod prelude { + pub use gateway_client_and_api::prelude::*; + pub use sargon_factors_supporting_types::prelude::*; + pub use sargon_profile::prelude::*; + pub use sargon_profile_supporting_types::prelude::*; + + pub use crate::clients::*; + + pub use std::sync::Arc; +} + +pub use prelude::*; diff --git a/crates/sargon-core-assert-json/Cargo.toml b/crates/sargon-core-assert-json/Cargo.toml index 522554d38..084528e93 100644 --- a/crates/sargon-core-assert-json/Cargo.toml +++ b/crates/sargon-core-assert-json/Cargo.toml @@ -1,14 +1,19 @@ [package] name = "sargon-core-assert-json" -version = "1.2.1" +version = "1.1.99" edition = "2021" [dependencies] +# === SARGON CRATES === sargon-core-error = { path = "../sargon-core-error" } +# === RADIX DEPENDENCIES === +# None + +# === EXTERNAL DEPENDENCIES === +assert-json-diff = { workspace = true } log = { workspace = true } pretty_assertions = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } thiserror = { workspace = true } -assert-json-diff = { workspace = true } diff --git a/crates/sargon-core-error/Cargo.toml b/crates/sargon-core-error/Cargo.toml index 2a14a2069..eb1946eb3 100644 --- a/crates/sargon-core-error/Cargo.toml +++ b/crates/sargon-core-error/Cargo.toml @@ -1,10 +1,15 @@ [package] name = "sargon-core-error" -version = "1.2.1" +version = "1.1.99" edition = "2021" [dependencies] +# === SARGON CRATES === -thiserror = { workspace = true } -serde_json = { workspace = true } + +# === RADIX DEPENDENCIES === + +# === EXTERNAL DEPENDENCIES === log = { workspace = true } +serde_json = { workspace = true } +thiserror = { workspace = true } diff --git a/crates/sargon-core-utils/Cargo.toml b/crates/sargon-core-utils/Cargo.toml index c2a9b2943..406e1a03c 100644 --- a/crates/sargon-core-utils/Cargo.toml +++ b/crates/sargon-core-utils/Cargo.toml @@ -1,11 +1,13 @@ [package] name = "sargon-core-utils" -version = "1.2.1" +version = "1.1.99" edition = "2021" [dependencies] +# === SARGON CRATES === sargon-core-error = { path = "../sargon-core-error" } +# === EXTERNAL DEPENDENCIES === iso8601-timestamp = { workspace = true } log = { workspace = true } pretty_assertions = { workspace = true } diff --git a/crates/sargon-core/Cargo.toml b/crates/sargon-core/Cargo.toml index 5fc6d69ae..08e570d86 100644 --- a/crates/sargon-core/Cargo.toml +++ b/crates/sargon-core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sargon-core" -version = "1.2.1" +version = "1.1.99" edition = "2021" [dependencies] @@ -15,37 +15,30 @@ radix-engine-interface = { workspace = true } radix-rust = { workspace = true } radix-transactions = { workspace = true } - # ==== EXTERNAL DEPENDENCIES ==== aes-gcm = { workspace = true } arraystring = { workspace = true } assert-json-diff = { workspace = true } delegate = { workspace = true } +derive_more = { workspace = true } enum-as-inner = { workspace = true } enum-iterator = { workspace = true } -hkdf = { workspace = true } hex = { workspace = true } -pretty_assertions = { workspace = true } -serde = { workspace = true } -serde_json = { workspace = true } -derive_more = { workspace = true } - - -itertools = { workspace = true } +hkdf = { workspace = true } iota-crypto = { workspace = true } +iso8601-timestamp = { workspace = true } +itertools = { workspace = true } k256 = { workspace = true } -rand = { workspace = true } log = { workspace = true } - - -serde_with = { workspace = true } - paste = { workspace = true } +pretty_assertions = { workspace = true } +rand = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } serde_repr = { workspace = true } -iso8601-timestamp = { workspace = true } -zeroize = { workspace = true } +serde_with = { workspace = true } strum = { workspace = true } -url = { workspace = true } thiserror = { workspace = true } - +url = { workspace = true } uuid = { workspace = true } +zeroize = { workspace = true } diff --git a/crates/sargon/src/factor_instances_provider/types/appendable_collection.rs b/crates/sargon-core/src/appendable_collection.rs similarity index 92% rename from crates/sargon/src/factor_instances_provider/types/appendable_collection.rs rename to crates/sargon-core/src/appendable_collection.rs index 117169660..4bb34a9d1 100644 --- a/crates/sargon/src/factor_instances_provider/types/appendable_collection.rs +++ b/crates/sargon-core/src/appendable_collection.rs @@ -49,14 +49,6 @@ impl AppendableCollection for IndexSet { } } -impl AppendableCollection for FactorInstances { - type Element = HierarchicalDeterministicFactorInstance; - - fn append>(&mut self, iter: T) { - self.extend(iter) - } -} - impl AppendableCollection for IndexMap where K: Eq + std::hash::Hash + Clone, diff --git a/crates/sargon-core/src/lib.rs b/crates/sargon-core/src/lib.rs index 911522c88..e0c8b2e95 100644 --- a/crates/sargon-core/src/lib.rs +++ b/crates/sargon-core/src/lib.rs @@ -3,11 +3,13 @@ #![feature(trivial_bounds)] #![allow(trivial_bounds)] +mod appendable_collection; mod encryption; mod has_sample_values; mod hash; mod image_url_utils; mod is_network_aware; +mod metadata; mod network_id; mod secure_random_bytes; mod types; @@ -24,11 +26,13 @@ pub mod prelude { pub use identified_vec_of::prelude::*; pub use sargon_core_utils::prelude::*; + pub use crate::appendable_collection::*; pub use crate::encryption::*; pub use crate::has_sample_values::*; pub use crate::hash::*; pub use crate::image_url_utils::*; pub use crate::is_network_aware::*; + pub use crate::metadata::*; pub use crate::network_id::*; pub use crate::secure_random_bytes::*; pub use crate::types::*; @@ -94,6 +98,11 @@ pub mod prelude { prelude::Instant as ScryptoInstant, }; + pub(crate) use radix_engine_interface::prelude::{ + MetadataValue as ScryptoMetadataValue, + ToMetadataEntry as ScryptoToMetadataEntry, + }; + pub use radix_engine_interface::prelude::Epoch as ScryptoEpoch; pub use radix_transactions::model::{ diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/metadata.rs b/crates/sargon-core/src/metadata.rs similarity index 99% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/metadata.rs rename to crates/sargon-core/src/metadata.rs index 50a3f3409..7e7c48884 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/metadata.rs +++ b/crates/sargon-core/src/metadata.rs @@ -1,5 +1,4 @@ use crate::prelude::*; -use strum::*; #[derive( Debug, diff --git a/crates/sargon-drivers/Cargo.toml b/crates/sargon-drivers/Cargo.toml new file mode 100644 index 000000000..9dc11c203 --- /dev/null +++ b/crates/sargon-drivers/Cargo.toml @@ -0,0 +1,61 @@ +[package] +name = "sargon-drivers" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +sargon-core = { path = "../sargon-core" } +sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } +sargon-addresses = { path = "../sargon-addresses" } +sargon-profile = { path = "../sargon-profile" } +sargon-profile-supporting-types = { path = "../sargon-profile-supporting-types" } + +# === RADIX DEPENDENCIES === +radix-engine = { workspace = true } +radix-common = { workspace = true } +radix-common-derive = { workspace = true } +radix-engine-interface = { workspace = true } +radix-engine-toolkit = { workspace = true } +radix-engine-toolkit-common = { workspace = true } +radix-transactions = { workspace = true } +radix-rust = { workspace = true } +sbor = { workspace = true } + +# === EXTERNAL DEPENDENCIES === +aes-gcm = { workspace = true } +assert-json-diff = { workspace = true } +async-std = { workspace = true } +async-trait = { workspace = true } +base64 = { workspace = true } +camino = { workspace = true } +delegate = { workspace = true } +derive_more = { workspace = true } +enum-as-inner = { workspace = true } +enum-iterator = { workspace = true } +futures = { workspace = true } +hex = { workspace = true } +hkdf = { workspace = true } +iota-crypto = { workspace = true } +iso8601-timestamp = { workspace = true } +itertools = { workspace = true } +k256 = { workspace = true } +log = { workspace = true } +once_cell = { workspace = true } +paste = { workspace = true } +pretty_assertions = { workspace = true } +pretty_env_logger = { workspace = true } +rand = { workspace = true } +reqwest = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +serde_repr = { workspace = true } +serde_with = { workspace = true } +strum = { workspace = true } +thiserror = { workspace = true } +url = { workspace = true } +uuid = { workspace = true } +zeroize = { workspace = true } + +[dev-dependencies] +actix-rt = { workspace = true } diff --git a/crates/sargon/src/system/drivers/README.md b/crates/sargon-drivers/src/drivers/README.md similarity index 100% rename from crates/sargon/src/system/drivers/README.md rename to crates/sargon-drivers/src/drivers/README.md diff --git a/crates/sargon/src/system/drivers/drivers.rs b/crates/sargon-drivers/src/drivers/drivers.rs similarity index 99% rename from crates/sargon/src/system/drivers/drivers.rs rename to crates/sargon-drivers/src/drivers/drivers.rs index 7e3ddd253..ff60a0694 100644 --- a/crates/sargon/src/system/drivers/drivers.rs +++ b/crates/sargon-drivers/src/drivers/drivers.rs @@ -40,7 +40,6 @@ impl Drivers { } } -#[cfg(test)] impl Drivers { fn file_system() -> Arc { #[cfg(test)] diff --git a/crates/sargon/src/system/drivers/entropy_provider_driver/entropy_provider_driver.rs b/crates/sargon-drivers/src/drivers/entropy_provider_driver/entropy_provider_driver.rs similarity index 100% rename from crates/sargon/src/system/drivers/entropy_provider_driver/entropy_provider_driver.rs rename to crates/sargon-drivers/src/drivers/entropy_provider_driver/entropy_provider_driver.rs diff --git a/crates/sargon/src/system/drivers/entropy_provider_driver/mod.rs b/crates/sargon-drivers/src/drivers/entropy_provider_driver/mod.rs similarity index 100% rename from crates/sargon/src/system/drivers/entropy_provider_driver/mod.rs rename to crates/sargon-drivers/src/drivers/entropy_provider_driver/mod.rs diff --git a/crates/sargon/src/system/drivers/entropy_provider_driver/support/mod.rs b/crates/sargon-drivers/src/drivers/entropy_provider_driver/support/mod.rs similarity index 100% rename from crates/sargon/src/system/drivers/entropy_provider_driver/support/mod.rs rename to crates/sargon-drivers/src/drivers/entropy_provider_driver/support/mod.rs diff --git a/crates/sargon/src/system/drivers/entropy_provider_driver/support/test/mod.rs b/crates/sargon-drivers/src/drivers/entropy_provider_driver/support/test/mod.rs similarity index 100% rename from crates/sargon/src/system/drivers/entropy_provider_driver/support/test/mod.rs rename to crates/sargon-drivers/src/drivers/entropy_provider_driver/support/test/mod.rs diff --git a/crates/sargon/src/system/drivers/entropy_provider_driver/support/test/rust_entropy_driver.rs b/crates/sargon-drivers/src/drivers/entropy_provider_driver/support/test/rust_entropy_driver.rs similarity index 100% rename from crates/sargon/src/system/drivers/entropy_provider_driver/support/test/rust_entropy_driver.rs rename to crates/sargon-drivers/src/drivers/entropy_provider_driver/support/test/rust_entropy_driver.rs diff --git a/crates/sargon/src/system/drivers/event_bus_driver/event_bus_driver.rs b/crates/sargon-drivers/src/drivers/event_bus_driver/event_bus_driver.rs similarity index 100% rename from crates/sargon/src/system/drivers/event_bus_driver/event_bus_driver.rs rename to crates/sargon-drivers/src/drivers/event_bus_driver/event_bus_driver.rs diff --git a/crates/sargon/src/system/drivers/event_bus_driver/mod.rs b/crates/sargon-drivers/src/drivers/event_bus_driver/mod.rs similarity index 100% rename from crates/sargon/src/system/drivers/event_bus_driver/mod.rs rename to crates/sargon-drivers/src/drivers/event_bus_driver/mod.rs diff --git a/crates/sargon/src/system/drivers/event_bus_driver/support/event.rs b/crates/sargon-drivers/src/drivers/event_bus_driver/support/event.rs similarity index 97% rename from crates/sargon/src/system/drivers/event_bus_driver/support/event.rs rename to crates/sargon-drivers/src/drivers/event_bus_driver/support/event.rs index ef3c1ee57..2191f55f4 100644 --- a/crates/sargon/src/system/drivers/event_bus_driver/support/event.rs +++ b/crates/sargon-drivers/src/drivers/event_bus_driver/support/event.rs @@ -1,7 +1,4 @@ use crate::prelude::*; -use crate::EventKind::{ - AccountUpdated, AccountsAdded, Booted, ProfileImported, ProfileSaved, -}; /// SargonOS event contain information about something of interest that has /// happened to the SargonOS, most prominently to the Profile. Host device diff --git a/crates/sargon/src/system/drivers/event_bus_driver/support/event_kind.rs b/crates/sargon-drivers/src/drivers/event_bus_driver/support/event_kind.rs similarity index 98% rename from crates/sargon/src/system/drivers/event_bus_driver/support/event_kind.rs rename to crates/sargon-drivers/src/drivers/event_bus_driver/support/event_kind.rs index 466096b1a..bbbe8c5eb 100644 --- a/crates/sargon/src/system/drivers/event_bus_driver/support/event_kind.rs +++ b/crates/sargon-drivers/src/drivers/event_bus_driver/support/event_kind.rs @@ -164,10 +164,6 @@ impl HasSampleValues for EventKind { #[cfg(test)] mod tests { use super::*; - use crate::EventKind::{ - AccountAdded, AccountUpdated, AccountsAdded, Booted, ProfileImported, - ProfileSaved, - }; #[allow(clippy::upper_case_acronyms)] type SUT = EventKind; diff --git a/crates/sargon/src/system/drivers/event_bus_driver/support/event_notification.rs b/crates/sargon-drivers/src/drivers/event_bus_driver/support/event_notification.rs similarity index 100% rename from crates/sargon/src/system/drivers/event_bus_driver/support/event_notification.rs rename to crates/sargon-drivers/src/drivers/event_bus_driver/support/event_notification.rs diff --git a/crates/sargon/src/system/drivers/event_bus_driver/support/event_profile_modified.rs b/crates/sargon-drivers/src/drivers/event_bus_driver/support/event_profile_modified.rs similarity index 72% rename from crates/sargon/src/system/drivers/event_bus_driver/support/event_profile_modified.rs rename to crates/sargon-drivers/src/drivers/event_bus_driver/support/event_profile_modified.rs index 230667172..ebb669832 100644 --- a/crates/sargon/src/system/drivers/event_bus_driver/support/event_profile_modified.rs +++ b/crates/sargon-drivers/src/drivers/event_bus_driver/support/event_profile_modified.rs @@ -69,6 +69,63 @@ impl HasEventKind for EventProfileModified { } } +pub trait IsProfileModifiedEvent { + fn profile_modified_event( + is_update: bool, + addresses: IndexSet
, + ) -> Option; +} + +impl IsProfileModifiedEvent for Account { + fn profile_modified_event( + is_update: bool, + addresses: IndexSet, + ) -> Option { + let address = addresses.iter().last().cloned()?; + let addresses = addresses.clone().into_iter().collect_vec(); + let is_many = addresses.len() > 1; + match (is_update, is_many) { + (true, true) => { + Some(EventProfileModified::AccountsUpdated { addresses }) + } + (false, true) => { + Some(EventProfileModified::AccountsAdded { addresses }) + } + (true, false) => { + Some(EventProfileModified::AccountUpdated { address }) + } + (false, false) => { + Some(EventProfileModified::AccountAdded { address }) + } + } + } +} + +impl IsProfileModifiedEvent for Persona { + fn profile_modified_event( + is_update: bool, + addresses: IndexSet, + ) -> Option { + let address = addresses.iter().last().cloned()?; + let addresses = addresses.clone().into_iter().collect_vec(); + let is_many = addresses.len() > 1; + match (is_update, is_many) { + (true, true) => { + Some(EventProfileModified::PersonasUpdated { addresses }) + } + (false, true) => { + Some(EventProfileModified::PersonasAdded { addresses }) + } + (true, false) => { + Some(EventProfileModified::PersonaUpdated { address }) + } + (false, false) => { + Some(EventProfileModified::PersonaAdded { address }) + } + } + } +} + impl HasSampleValues for EventProfileModified { fn sample() -> Self { Self::AccountAdded { diff --git a/crates/sargon/src/system/drivers/event_bus_driver/support/has_event_kind.rs b/crates/sargon-drivers/src/drivers/event_bus_driver/support/has_event_kind.rs similarity index 100% rename from crates/sargon/src/system/drivers/event_bus_driver/support/has_event_kind.rs rename to crates/sargon-drivers/src/drivers/event_bus_driver/support/has_event_kind.rs diff --git a/crates/sargon/src/system/drivers/event_bus_driver/support/mod.rs b/crates/sargon-drivers/src/drivers/event_bus_driver/support/mod.rs similarity index 100% rename from crates/sargon/src/system/drivers/event_bus_driver/support/mod.rs rename to crates/sargon-drivers/src/drivers/event_bus_driver/support/mod.rs diff --git a/crates/sargon/src/system/drivers/event_bus_driver/support/test/mod.rs b/crates/sargon-drivers/src/drivers/event_bus_driver/support/test/mod.rs similarity index 100% rename from crates/sargon/src/system/drivers/event_bus_driver/support/test/mod.rs rename to crates/sargon-drivers/src/drivers/event_bus_driver/support/test/mod.rs diff --git a/crates/sargon/src/system/drivers/event_bus_driver/support/test/rust_event_bus_driver.rs b/crates/sargon-drivers/src/drivers/event_bus_driver/support/test/rust_event_bus_driver.rs similarity index 100% rename from crates/sargon/src/system/drivers/event_bus_driver/support/test/rust_event_bus_driver.rs rename to crates/sargon-drivers/src/drivers/event_bus_driver/support/test/rust_event_bus_driver.rs diff --git a/crates/sargon/src/system/drivers/file_system_driver/file_system_driver.rs b/crates/sargon-drivers/src/drivers/file_system_driver/file_system_driver.rs similarity index 100% rename from crates/sargon/src/system/drivers/file_system_driver/file_system_driver.rs rename to crates/sargon-drivers/src/drivers/file_system_driver/file_system_driver.rs diff --git a/crates/sargon/src/system/drivers/file_system_driver/mod.rs b/crates/sargon-drivers/src/drivers/file_system_driver/mod.rs similarity index 100% rename from crates/sargon/src/system/drivers/file_system_driver/mod.rs rename to crates/sargon-drivers/src/drivers/file_system_driver/mod.rs diff --git a/crates/sargon/src/system/drivers/file_system_driver/support/mod.rs b/crates/sargon-drivers/src/drivers/file_system_driver/support/mod.rs similarity index 100% rename from crates/sargon/src/system/drivers/file_system_driver/support/mod.rs rename to crates/sargon-drivers/src/drivers/file_system_driver/support/mod.rs diff --git a/crates/sargon/src/system/drivers/file_system_driver/support/test/in_memory_file_system_driver.rs b/crates/sargon-drivers/src/drivers/file_system_driver/support/test/in_memory_file_system_driver.rs similarity index 98% rename from crates/sargon/src/system/drivers/file_system_driver/support/test/in_memory_file_system_driver.rs rename to crates/sargon-drivers/src/drivers/file_system_driver/support/test/in_memory_file_system_driver.rs index 4bf47bd7e..93561dab6 100644 --- a/crates/sargon/src/system/drivers/file_system_driver/support/test/in_memory_file_system_driver.rs +++ b/crates/sargon-drivers/src/drivers/file_system_driver/support/test/in_memory_file_system_driver.rs @@ -1,5 +1,3 @@ -use std::path::{Path, PathBuf}; - use crate::prelude::*; #[derive(Debug)] diff --git a/crates/sargon/src/system/drivers/file_system_driver/support/test/mod.rs b/crates/sargon-drivers/src/drivers/file_system_driver/support/test/mod.rs similarity index 100% rename from crates/sargon/src/system/drivers/file_system_driver/support/test/mod.rs rename to crates/sargon-drivers/src/drivers/file_system_driver/support/test/mod.rs diff --git a/crates/sargon/src/system/drivers/file_system_driver/support/test/rust_file_system_driver.rs b/crates/sargon-drivers/src/drivers/file_system_driver/support/test/rust_file_system_driver.rs similarity index 100% rename from crates/sargon/src/system/drivers/file_system_driver/support/test/rust_file_system_driver.rs rename to crates/sargon-drivers/src/drivers/file_system_driver/support/test/rust_file_system_driver.rs diff --git a/crates/sargon/src/system/drivers/host_info_driver/host_info_driver.rs b/crates/sargon-drivers/src/drivers/host_info_driver/host_info_driver.rs similarity index 100% rename from crates/sargon/src/system/drivers/host_info_driver/host_info_driver.rs rename to crates/sargon-drivers/src/drivers/host_info_driver/host_info_driver.rs diff --git a/crates/sargon/src/system/drivers/host_info_driver/mod.rs b/crates/sargon-drivers/src/drivers/host_info_driver/mod.rs similarity index 100% rename from crates/sargon/src/system/drivers/host_info_driver/mod.rs rename to crates/sargon-drivers/src/drivers/host_info_driver/mod.rs diff --git a/crates/sargon/src/system/drivers/host_info_driver/support/mod.rs b/crates/sargon-drivers/src/drivers/host_info_driver/support/mod.rs similarity index 100% rename from crates/sargon/src/system/drivers/host_info_driver/support/mod.rs rename to crates/sargon-drivers/src/drivers/host_info_driver/support/mod.rs diff --git a/crates/sargon/src/system/drivers/host_info_driver/support/test/mod.rs b/crates/sargon-drivers/src/drivers/host_info_driver/support/test/mod.rs similarity index 100% rename from crates/sargon/src/system/drivers/host_info_driver/support/test/mod.rs rename to crates/sargon-drivers/src/drivers/host_info_driver/support/test/mod.rs diff --git a/crates/sargon/src/system/drivers/host_info_driver/support/test/rust_host_info_driver.rs b/crates/sargon-drivers/src/drivers/host_info_driver/support/test/rust_host_info_driver.rs similarity index 100% rename from crates/sargon/src/system/drivers/host_info_driver/support/test/rust_host_info_driver.rs rename to crates/sargon-drivers/src/drivers/host_info_driver/support/test/rust_host_info_driver.rs diff --git a/crates/sargon/src/system/drivers/logging_driver/logging_driver.rs b/crates/sargon-drivers/src/drivers/logging_driver/logging_driver.rs similarity index 100% rename from crates/sargon/src/system/drivers/logging_driver/logging_driver.rs rename to crates/sargon-drivers/src/drivers/logging_driver/logging_driver.rs diff --git a/crates/sargon/src/system/drivers/logging_driver/mod.rs b/crates/sargon-drivers/src/drivers/logging_driver/mod.rs similarity index 100% rename from crates/sargon/src/system/drivers/logging_driver/mod.rs rename to crates/sargon-drivers/src/drivers/logging_driver/mod.rs diff --git a/crates/sargon/src/system/drivers/logging_driver/support/log_level.rs b/crates/sargon-drivers/src/drivers/logging_driver/support/log_level.rs similarity index 100% rename from crates/sargon/src/system/drivers/logging_driver/support/log_level.rs rename to crates/sargon-drivers/src/drivers/logging_driver/support/log_level.rs diff --git a/crates/sargon/src/system/drivers/logging_driver/support/mod.rs b/crates/sargon-drivers/src/drivers/logging_driver/support/mod.rs similarity index 100% rename from crates/sargon/src/system/drivers/logging_driver/support/mod.rs rename to crates/sargon-drivers/src/drivers/logging_driver/support/mod.rs diff --git a/crates/sargon/src/system/drivers/logging_driver/support/test/mod.rs b/crates/sargon-drivers/src/drivers/logging_driver/support/test/mod.rs similarity index 100% rename from crates/sargon/src/system/drivers/logging_driver/support/test/mod.rs rename to crates/sargon-drivers/src/drivers/logging_driver/support/test/mod.rs diff --git a/crates/sargon/src/system/drivers/logging_driver/support/test/rust_logging_driver.rs b/crates/sargon-drivers/src/drivers/logging_driver/support/test/rust_logging_driver.rs similarity index 100% rename from crates/sargon/src/system/drivers/logging_driver/support/test/rust_logging_driver.rs rename to crates/sargon-drivers/src/drivers/logging_driver/support/test/rust_logging_driver.rs diff --git a/crates/sargon/src/system/drivers/mod.rs b/crates/sargon-drivers/src/drivers/mod.rs similarity index 100% rename from crates/sargon/src/system/drivers/mod.rs rename to crates/sargon-drivers/src/drivers/mod.rs diff --git a/crates/sargon/src/system/drivers/networking_driver/mod.rs b/crates/sargon-drivers/src/drivers/networking_driver/mod.rs similarity index 100% rename from crates/sargon/src/system/drivers/networking_driver/mod.rs rename to crates/sargon-drivers/src/drivers/networking_driver/mod.rs diff --git a/crates/sargon/src/system/drivers/networking_driver/networking_driver.rs b/crates/sargon-drivers/src/drivers/networking_driver/networking_driver.rs similarity index 100% rename from crates/sargon/src/system/drivers/networking_driver/networking_driver.rs rename to crates/sargon-drivers/src/drivers/networking_driver/networking_driver.rs diff --git a/crates/sargon/src/system/drivers/networking_driver/support/mod.rs b/crates/sargon-drivers/src/drivers/networking_driver/support/mod.rs similarity index 98% rename from crates/sargon/src/system/drivers/networking_driver/support/mod.rs rename to crates/sargon-drivers/src/drivers/networking_driver/support/mod.rs index 554824921..62815b4ba 100644 --- a/crates/sargon/src/system/drivers/networking_driver/support/mod.rs +++ b/crates/sargon-drivers/src/drivers/networking_driver/support/mod.rs @@ -1,11 +1,9 @@ mod network_method; mod network_request; mod network_response; - mod test; pub use network_method::*; pub use network_request::*; pub use network_response::*; - pub use test::*; diff --git a/crates/sargon/src/system/drivers/networking_driver/support/network_method.rs b/crates/sargon-drivers/src/drivers/networking_driver/support/network_method.rs similarity index 100% rename from crates/sargon/src/system/drivers/networking_driver/support/network_method.rs rename to crates/sargon-drivers/src/drivers/networking_driver/support/network_method.rs diff --git a/crates/sargon/src/system/drivers/networking_driver/support/network_request.rs b/crates/sargon-drivers/src/drivers/networking_driver/support/network_request.rs similarity index 100% rename from crates/sargon/src/system/drivers/networking_driver/support/network_request.rs rename to crates/sargon-drivers/src/drivers/networking_driver/support/network_request.rs diff --git a/crates/sargon/src/system/drivers/networking_driver/support/network_response.rs b/crates/sargon-drivers/src/drivers/networking_driver/support/network_response.rs similarity index 100% rename from crates/sargon/src/system/drivers/networking_driver/support/network_response.rs rename to crates/sargon-drivers/src/drivers/networking_driver/support/network_response.rs diff --git a/crates/sargon/src/system/drivers/networking_driver/support/test/mock_networking_driver.rs b/crates/sargon-drivers/src/drivers/networking_driver/support/test/mock_networking_driver.rs similarity index 99% rename from crates/sargon/src/system/drivers/networking_driver/support/test/mock_networking_driver.rs rename to crates/sargon-drivers/src/drivers/networking_driver/support/test/mock_networking_driver.rs index 7ab6e88f8..34dedcc4c 100644 --- a/crates/sargon/src/system/drivers/networking_driver/support/test/mock_networking_driver.rs +++ b/crates/sargon-drivers/src/drivers/networking_driver/support/test/mock_networking_driver.rs @@ -1,5 +1,3 @@ -#![cfg(test)] - use crate::prelude::*; use std::sync::Mutex; diff --git a/crates/sargon/src/system/drivers/networking_driver/support/test/mod.rs b/crates/sargon-drivers/src/drivers/networking_driver/support/test/mod.rs similarity index 89% rename from crates/sargon/src/system/drivers/networking_driver/support/test/mod.rs rename to crates/sargon-drivers/src/drivers/networking_driver/support/test/mod.rs index b795e08c1..52cf972cf 100644 --- a/crates/sargon/src/system/drivers/networking_driver/support/test/mod.rs +++ b/crates/sargon-drivers/src/drivers/networking_driver/support/test/mod.rs @@ -1,8 +1,5 @@ -mod rust_networking_driver; - -pub use rust_networking_driver::*; - mod mock_networking_driver; +mod rust_networking_driver; -#[cfg(test)] pub use mock_networking_driver::*; +pub use rust_networking_driver::*; diff --git a/crates/sargon/src/system/drivers/networking_driver/support/test/rust_networking_driver.rs b/crates/sargon-drivers/src/drivers/networking_driver/support/test/rust_networking_driver.rs similarity index 100% rename from crates/sargon/src/system/drivers/networking_driver/support/test/rust_networking_driver.rs rename to crates/sargon-drivers/src/drivers/networking_driver/support/test/rust_networking_driver.rs diff --git a/crates/sargon/src/system/drivers/profile_change_driver/mod.rs b/crates/sargon-drivers/src/drivers/profile_change_driver/mod.rs similarity index 100% rename from crates/sargon/src/system/drivers/profile_change_driver/mod.rs rename to crates/sargon-drivers/src/drivers/profile_change_driver/mod.rs diff --git a/crates/sargon/src/system/drivers/profile_change_driver/profile_change_driver.rs b/crates/sargon-drivers/src/drivers/profile_change_driver/profile_change_driver.rs similarity index 100% rename from crates/sargon/src/system/drivers/profile_change_driver/profile_change_driver.rs rename to crates/sargon-drivers/src/drivers/profile_change_driver/profile_change_driver.rs diff --git a/crates/sargon/src/system/drivers/profile_change_driver/support/mod.rs b/crates/sargon-drivers/src/drivers/profile_change_driver/support/mod.rs similarity index 100% rename from crates/sargon/src/system/drivers/profile_change_driver/support/mod.rs rename to crates/sargon-drivers/src/drivers/profile_change_driver/support/mod.rs diff --git a/crates/sargon/src/system/drivers/profile_change_driver/support/test/mod.rs b/crates/sargon-drivers/src/drivers/profile_change_driver/support/test/mod.rs similarity index 73% rename from crates/sargon/src/system/drivers/profile_change_driver/support/test/mod.rs rename to crates/sargon-drivers/src/drivers/profile_change_driver/support/test/mod.rs index 977e16559..cea09a871 100644 --- a/crates/sargon/src/system/drivers/profile_change_driver/support/test/mod.rs +++ b/crates/sargon-drivers/src/drivers/profile_change_driver/support/test/mod.rs @@ -1,5 +1,3 @@ -#[cfg(test)] mod rust_profile_change_driver; -#[cfg(test)] pub use rust_profile_change_driver::*; diff --git a/crates/sargon/src/system/drivers/profile_change_driver/support/test/rust_profile_change_driver.rs b/crates/sargon-drivers/src/drivers/profile_change_driver/support/test/rust_profile_change_driver.rs similarity index 100% rename from crates/sargon/src/system/drivers/profile_change_driver/support/test/rust_profile_change_driver.rs rename to crates/sargon-drivers/src/drivers/profile_change_driver/support/test/rust_profile_change_driver.rs diff --git a/crates/sargon/src/system/drivers/secure_storage_driver/mod.rs b/crates/sargon-drivers/src/drivers/secure_storage_driver/mod.rs similarity index 100% rename from crates/sargon/src/system/drivers/secure_storage_driver/mod.rs rename to crates/sargon-drivers/src/drivers/secure_storage_driver/mod.rs diff --git a/crates/sargon/src/system/drivers/secure_storage_driver/secure_storage_driver.rs b/crates/sargon-drivers/src/drivers/secure_storage_driver/secure_storage_driver.rs similarity index 100% rename from crates/sargon/src/system/drivers/secure_storage_driver/secure_storage_driver.rs rename to crates/sargon-drivers/src/drivers/secure_storage_driver/secure_storage_driver.rs diff --git a/crates/sargon/src/system/drivers/secure_storage_driver/support/mod.rs b/crates/sargon-drivers/src/drivers/secure_storage_driver/support/mod.rs similarity index 100% rename from crates/sargon/src/system/drivers/secure_storage_driver/support/mod.rs rename to crates/sargon-drivers/src/drivers/secure_storage_driver/support/mod.rs diff --git a/crates/sargon/src/system/drivers/secure_storage_driver/support/secure_storage_access_error_kind.rs b/crates/sargon-drivers/src/drivers/secure_storage_driver/support/secure_storage_access_error_kind.rs similarity index 100% rename from crates/sargon/src/system/drivers/secure_storage_driver/support/secure_storage_access_error_kind.rs rename to crates/sargon-drivers/src/drivers/secure_storage_driver/support/secure_storage_access_error_kind.rs diff --git a/crates/sargon/src/system/drivers/secure_storage_driver/support/secure_storage_key.rs b/crates/sargon-drivers/src/drivers/secure_storage_driver/support/secure_storage_key.rs similarity index 98% rename from crates/sargon/src/system/drivers/secure_storage_driver/support/secure_storage_key.rs rename to crates/sargon-drivers/src/drivers/secure_storage_driver/support/secure_storage_key.rs index 563a8b821..4ea830816 100644 --- a/crates/sargon/src/system/drivers/secure_storage_driver/support/secure_storage_key.rs +++ b/crates/sargon-drivers/src/drivers/secure_storage_driver/support/secure_storage_key.rs @@ -58,7 +58,6 @@ impl Hash for SecureStorageKey { } impl SecureStorageKey { - #[cfg(not(tarpaulin_include))] // false negative pub fn identifier(&self) -> String { format!( "secure_storage_key_{}", diff --git a/crates/sargon/src/system/drivers/secure_storage_driver/support/test/ephemeral_secure_storage.rs b/crates/sargon-drivers/src/drivers/secure_storage_driver/support/test/ephemeral_secure_storage.rs similarity index 99% rename from crates/sargon/src/system/drivers/secure_storage_driver/support/test/ephemeral_secure_storage.rs rename to crates/sargon-drivers/src/drivers/secure_storage_driver/support/test/ephemeral_secure_storage.rs index c457e9664..4a65b3af2 100644 --- a/crates/sargon/src/system/drivers/secure_storage_driver/support/test/ephemeral_secure_storage.rs +++ b/crates/sargon-drivers/src/drivers/secure_storage_driver/support/test/ephemeral_secure_storage.rs @@ -1,5 +1,3 @@ -#![cfg(test)] - use crate::prelude::*; use std::sync::RwLock; diff --git a/crates/sargon/src/system/drivers/secure_storage_driver/support/test/fail_secure_storage.rs b/crates/sargon-drivers/src/drivers/secure_storage_driver/support/test/fail_secure_storage.rs similarity index 93% rename from crates/sargon/src/system/drivers/secure_storage_driver/support/test/fail_secure_storage.rs rename to crates/sargon-drivers/src/drivers/secure_storage_driver/support/test/fail_secure_storage.rs index 003738e41..adddc2f65 100644 --- a/crates/sargon/src/system/drivers/secure_storage_driver/support/test/fail_secure_storage.rs +++ b/crates/sargon-drivers/src/drivers/secure_storage_driver/support/test/fail_secure_storage.rs @@ -1,9 +1,7 @@ -#![cfg(test)] - use crate::prelude::*; #[derive(Debug)] -pub(crate) struct AlwaysFailSecureStorage {} +pub struct AlwaysFailSecureStorage {} #[async_trait::async_trait] impl SecureStorageDriver for AlwaysFailSecureStorage { diff --git a/crates/sargon/src/system/drivers/secure_storage_driver/support/test/mod.rs b/crates/sargon-drivers/src/drivers/secure_storage_driver/support/test/mod.rs similarity index 81% rename from crates/sargon/src/system/drivers/secure_storage_driver/support/test/mod.rs rename to crates/sargon-drivers/src/drivers/secure_storage_driver/support/test/mod.rs index 547109293..0b89f41bb 100644 --- a/crates/sargon/src/system/drivers/secure_storage_driver/support/test/mod.rs +++ b/crates/sargon-drivers/src/drivers/secure_storage_driver/support/test/mod.rs @@ -1,9 +1,5 @@ mod ephemeral_secure_storage; - -#[cfg(test)] -pub use ephemeral_secure_storage::*; - mod fail_secure_storage; -#[cfg(test)] +pub use ephemeral_secure_storage::*; pub use fail_secure_storage::*; diff --git a/crates/sargon/src/system/drivers/unsafe_storage_driver/mod.rs b/crates/sargon-drivers/src/drivers/unsafe_storage_driver/mod.rs similarity index 100% rename from crates/sargon/src/system/drivers/unsafe_storage_driver/mod.rs rename to crates/sargon-drivers/src/drivers/unsafe_storage_driver/mod.rs diff --git a/crates/sargon/src/system/drivers/unsafe_storage_driver/support/test/ephemeral_unsafe_storage.rs b/crates/sargon-drivers/src/drivers/unsafe_storage_driver/support/ephemeral_unsafe_storage.rs similarity index 100% rename from crates/sargon/src/system/drivers/unsafe_storage_driver/support/test/ephemeral_unsafe_storage.rs rename to crates/sargon-drivers/src/drivers/unsafe_storage_driver/support/ephemeral_unsafe_storage.rs diff --git a/crates/sargon/src/system/drivers/unsafe_storage_driver/support/test/mod.rs b/crates/sargon-drivers/src/drivers/unsafe_storage_driver/support/mod.rs similarity index 54% rename from crates/sargon/src/system/drivers/unsafe_storage_driver/support/test/mod.rs rename to crates/sargon-drivers/src/drivers/unsafe_storage_driver/support/mod.rs index a10d68eed..5c1a7cf02 100644 --- a/crates/sargon/src/system/drivers/unsafe_storage_driver/support/test/mod.rs +++ b/crates/sargon-drivers/src/drivers/unsafe_storage_driver/support/mod.rs @@ -1,4 +1,5 @@ -#[cfg(test)] mod ephemeral_unsafe_storage; -#[cfg(test)] +mod unsafe_storage_key; + pub use ephemeral_unsafe_storage::*; +pub use unsafe_storage_key::*; diff --git a/crates/sargon/src/system/drivers/unsafe_storage_driver/support/unsafe_storage_key.rs b/crates/sargon-drivers/src/drivers/unsafe_storage_driver/support/unsafe_storage_key.rs similarity index 100% rename from crates/sargon/src/system/drivers/unsafe_storage_driver/support/unsafe_storage_key.rs rename to crates/sargon-drivers/src/drivers/unsafe_storage_driver/support/unsafe_storage_key.rs diff --git a/crates/sargon/src/system/drivers/unsafe_storage_driver/unsafe_storage_driver.rs b/crates/sargon-drivers/src/drivers/unsafe_storage_driver/unsafe_storage_driver.rs similarity index 100% rename from crates/sargon/src/system/drivers/unsafe_storage_driver/unsafe_storage_driver.rs rename to crates/sargon-drivers/src/drivers/unsafe_storage_driver/unsafe_storage_driver.rs diff --git a/crates/sargon-drivers/src/lib.rs b/crates/sargon-drivers/src/lib.rs new file mode 100644 index 000000000..3644e690e --- /dev/null +++ b/crates/sargon-drivers/src/lib.rs @@ -0,0 +1,17 @@ +#![feature(let_chains)] + +mod drivers; + +pub mod prelude { + pub(crate) use sargon_addresses::prelude::*; + pub(crate) use sargon_core::prelude::*; + pub(crate) use sargon_hierarchical_deterministic::prelude::*; + pub(crate) use sargon_profile::prelude::*; + pub(crate) use sargon_profile_supporting_types::prelude::*; + + pub use crate::drivers::*; + + pub(crate) use enum_iterator::*; +} + +pub use prelude::*; diff --git a/crates/sargon-factor-instances-provider/Cargo.toml b/crates/sargon-factor-instances-provider/Cargo.toml new file mode 100644 index 000000000..e0b1b269a --- /dev/null +++ b/crates/sargon-factor-instances-provider/Cargo.toml @@ -0,0 +1,60 @@ +[package] +name = "sargon-factor-instances-provider" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +identified-vec-of = { path = "../identified-vec-of" } +sargon-core-assert-json = { path = "../sargon-core-assert-json" } +sargon-core-utils = { path = "../sargon-core-utils" } +sargon-core-error = { path = "../sargon-core-error" } +sargon-core = { path = "../sargon-core" } +sargon-factors = { path = "../sargon-factors" } +sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } +sargon-keys-collector = { path = "../sargon-keys-collector" } +sargon-addresses = { path = "../sargon-addresses" } +sargon-profile = { path = "../sargon-profile" } +sargon-profile-logic = { path = "../sargon-profile-logic" } +sargon-clients = { path = "../sargon-clients" } +sargon-profile-supporting-types = { path = "../sargon-profile-supporting-types" } +next-derivation-index-ephemeral = { path = "../next-derivation-index-ephemeral" } + +# ==== RADIX DEPENDENCIES ==== +radix-common = { workspace = true } +radix-engine-interface = { workspace = true } +radix-rust = { workspace = true } +radix-transactions = { workspace = true } + +# ==== EXTERNAL DEPENDENCIES ==== +aes-gcm = { workspace = true } +arraystring = { workspace = true } +assert-json-diff = { workspace = true } +async-trait = { workspace = true } +delegate = { workspace = true } +derive_more = { workspace = true } +enum-as-inner = { workspace = true } +enum-iterator = { workspace = true } +futures = { workspace = true } +hex = { workspace = true } +hkdf = { workspace = true } +iota-crypto = { workspace = true } +iso8601-timestamp = { workspace = true } +itertools = { workspace = true } +k256 = { workspace = true } +log = { workspace = true } +paste = { workspace = true } +pretty_assertions = { workspace = true } +rand = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +serde_repr = { workspace = true } +serde_with = { workspace = true } +strum = { workspace = true } +thiserror = { workspace = true } +url = { workspace = true } +uuid = { workspace = true } +zeroize = { workspace = true } + +[dev-dependencies] +actix-rt = { workspace = true } diff --git a/crates/sargon-factor-instances-provider/src/lib.rs b/crates/sargon-factor-instances-provider/src/lib.rs new file mode 100644 index 000000000..45e19cb41 --- /dev/null +++ b/crates/sargon-factor-instances-provider/src/lib.rs @@ -0,0 +1,17 @@ +mod next_index_assigner; +mod provider; +mod types; + +pub mod prelude { + pub(crate) use identified_vec_of::prelude::*; + pub(crate) use sargon_addresses::prelude::*; + pub(crate) use sargon_clients::prelude::*; + pub(crate) use sargon_keys_collector::prelude::*; + pub(crate) use sargon_profile_logic::prelude::*; + + pub use crate::next_index_assigner::*; + pub use crate::provider::*; + pub use crate::types::*; +} + +pub use prelude::*; diff --git a/crates/sargon/src/factor_instances_provider/next_index_assigner/mod.rs b/crates/sargon-factor-instances-provider/src/next_index_assigner/mod.rs similarity index 55% rename from crates/sargon/src/factor_instances_provider/next_index_assigner/mod.rs rename to crates/sargon-factor-instances-provider/src/next_index_assigner/mod.rs index a687d9d3e..ea56ed523 100644 --- a/crates/sargon/src/factor_instances_provider/next_index_assigner/mod.rs +++ b/crates/sargon-factor-instances-provider/src/next_index_assigner/mod.rs @@ -1,11 +1,7 @@ mod next_derivation_entity_index_assigner; mod next_derivation_entity_index_cache_analyzing_assigner; mod next_derivation_entity_index_profile_analyzing_assigner; -mod next_derivation_entity_index_with_ephemeral_offsets; -mod next_derivation_entity_index_with_ephemeral_offsets_for_factor_source; pub use next_derivation_entity_index_assigner::*; pub use next_derivation_entity_index_cache_analyzing_assigner::*; pub use next_derivation_entity_index_profile_analyzing_assigner::*; -pub use next_derivation_entity_index_with_ephemeral_offsets::*; -pub use next_derivation_entity_index_with_ephemeral_offsets_for_factor_source::*; diff --git a/crates/sargon/src/factor_instances_provider/next_index_assigner/next_derivation_entity_index_assigner.rs b/crates/sargon-factor-instances-provider/src/next_index_assigner/next_derivation_entity_index_assigner.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/next_index_assigner/next_derivation_entity_index_assigner.rs rename to crates/sargon-factor-instances-provider/src/next_index_assigner/next_derivation_entity_index_assigner.rs diff --git a/crates/sargon/src/factor_instances_provider/next_index_assigner/next_derivation_entity_index_cache_analyzing_assigner.rs b/crates/sargon-factor-instances-provider/src/next_index_assigner/next_derivation_entity_index_cache_analyzing_assigner.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/next_index_assigner/next_derivation_entity_index_cache_analyzing_assigner.rs rename to crates/sargon-factor-instances-provider/src/next_index_assigner/next_derivation_entity_index_cache_analyzing_assigner.rs diff --git a/crates/sargon/src/factor_instances_provider/next_index_assigner/next_derivation_entity_index_profile_analyzing_assigner.rs b/crates/sargon-factor-instances-provider/src/next_index_assigner/next_derivation_entity_index_profile_analyzing_assigner.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/next_index_assigner/next_derivation_entity_index_profile_analyzing_assigner.rs rename to crates/sargon-factor-instances-provider/src/next_index_assigner/next_derivation_entity_index_profile_analyzing_assigner.rs diff --git a/crates/sargon/src/factor_instances_provider/provider/factor_instances_provider.rs b/crates/sargon-factor-instances-provider/src/provider/factor_instances_provider.rs similarity index 99% rename from crates/sargon/src/factor_instances_provider/provider/factor_instances_provider.rs rename to crates/sargon-factor-instances-provider/src/provider/factor_instances_provider.rs index 47e6f9195..d6502dad8 100644 --- a/crates/sargon/src/factor_instances_provider/provider/factor_instances_provider.rs +++ b/crates/sargon-factor-instances-provider/src/provider/factor_instances_provider.rs @@ -1,5 +1,4 @@ use crate::prelude::*; -use crate::{factor_instances_provider::next_index_assigner, prelude::*}; /// A coordinator between a cache, an optional profile and the KeysCollector. /// diff --git a/crates/sargon/src/factor_instances_provider/provider/instances_in_cache_consumer.rs b/crates/sargon-factor-instances-provider/src/provider/instances_in_cache_consumer.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/provider/instances_in_cache_consumer.rs rename to crates/sargon-factor-instances-provider/src/provider/instances_in_cache_consumer.rs diff --git a/crates/sargon/src/factor_instances_provider/provider/mod.rs b/crates/sargon-factor-instances-provider/src/provider/mod.rs similarity index 80% rename from crates/sargon/src/factor_instances_provider/provider/mod.rs rename to crates/sargon-factor-instances-provider/src/provider/mod.rs index 56fd8aa8a..0e5b42020 100644 --- a/crates/sargon/src/factor_instances_provider/provider/mod.rs +++ b/crates/sargon-factor-instances-provider/src/provider/mod.rs @@ -3,9 +3,6 @@ mod instances_in_cache_consumer; mod outcome; mod provider_adopters; -#[cfg(test)] -mod factor_instances_provider_unit_tests; - pub use factor_instances_provider::*; pub use instances_in_cache_consumer::*; pub use outcome::*; diff --git a/crates/sargon/src/factor_instances_provider/provider/outcome/factor_instances_provider_outcome.rs b/crates/sargon-factor-instances-provider/src/provider/outcome/factor_instances_provider_outcome.rs similarity index 96% rename from crates/sargon/src/factor_instances_provider/provider/outcome/factor_instances_provider_outcome.rs rename to crates/sargon-factor-instances-provider/src/provider/outcome/factor_instances_provider_outcome.rs index 5bcac12a2..bd0a834d1 100644 --- a/crates/sargon/src/factor_instances_provider/provider/outcome/factor_instances_provider_outcome.rs +++ b/crates/sargon-factor-instances-provider/src/provider/outcome/factor_instances_provider_outcome.rs @@ -63,8 +63,8 @@ impl From } } -#[cfg(test)] impl FactorInstancesProviderOutcome { + /// For tests pub fn newly_derived_instances_from_all_factor_sources( &self, ) -> FactorInstances { @@ -78,14 +78,17 @@ impl FactorInstancesProviderOutcome { .collect() } + /// For tests pub fn total_number_of_newly_derived_instances(&self) -> usize { self.newly_derived_instances_from_all_factor_sources().len() } + /// For tests pub fn derived_any_new_instance_for_any_factor_source(&self) -> bool { self.total_number_of_newly_derived_instances() > 0 } + /// For tests pub fn instances_found_in_cache_from_all_factor_sources( &self, ) -> FactorInstances { @@ -99,11 +102,13 @@ impl FactorInstancesProviderOutcome { .collect() } + /// For tests pub fn total_number_of_instances_found_in_cache(&self) -> usize { self.instances_found_in_cache_from_all_factor_sources() .len() } + /// For tests pub fn found_any_instances_in_cache_for_any_factor_source(&self) -> bool { self.total_number_of_instances_found_in_cache() > 0 } diff --git a/crates/sargon/src/factor_instances_provider/provider/outcome/factor_instances_provider_outcome_for_factor.rs b/crates/sargon-factor-instances-provider/src/provider/outcome/factor_instances_provider_outcome_for_factor.rs similarity index 93% rename from crates/sargon/src/factor_instances_provider/provider/outcome/factor_instances_provider_outcome_for_factor.rs rename to crates/sargon-factor-instances-provider/src/provider/outcome/factor_instances_provider_outcome_for_factor.rs index 0fb61992a..3230c2197 100644 --- a/crates/sargon/src/factor_instances_provider/provider/outcome/factor_instances_provider_outcome_for_factor.rs +++ b/crates/sargon-factor-instances-provider/src/provider/outcome/factor_instances_provider_outcome_for_factor.rs @@ -27,7 +27,6 @@ pub struct FactorInstancesProviderOutcomeForFactor { /// Might be empty /// /// Useful for unit tests. - #[cfg(test)] pub debug_was_cached: FactorInstances, /// FactorInstances which were found in the cache before the operation was @@ -38,7 +37,6 @@ pub struct FactorInstancesProviderOutcomeForFactor { /// Useful for unit tests. /// /// Might overlap with `to_use_directly` - #[cfg(test)] pub debug_found_in_cache: FactorInstances, /// FactorInstances which were derived. @@ -48,7 +46,6 @@ pub struct FactorInstancesProviderOutcomeForFactor { /// Useful for unit tests. /// /// Might overlap with `debug_was_cached` and `to_use_directly` - #[cfg(test)] pub debug_was_derived: FactorInstances, } @@ -82,24 +79,14 @@ impl From for FactorInstancesProviderOutcomeForFactor { fn from(value: InternalFactorInstancesProviderOutcomeForFactor) -> Self { - #[cfg(test)] - let _self = Self { + Self { hidden: HiddenConstructor, factor_source_id: value.factor_source_id, to_use_directly: value.to_use_directly, debug_was_cached: value.to_cache, debug_found_in_cache: value.found_in_cache, debug_was_derived: value.newly_derived, - }; - - #[cfg(not(test))] - let _self = Self { - hidden: HiddenConstructor, - factor_source_id: value.factor_source_id, - to_use_directly: value.to_use_directly, - }; - - _self + } } } diff --git a/crates/sargon/src/factor_instances_provider/provider/outcome/internal_factor_instances_provider_outcome.rs b/crates/sargon-factor-instances-provider/src/provider/outcome/internal_factor_instances_provider_outcome.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/provider/outcome/internal_factor_instances_provider_outcome.rs rename to crates/sargon-factor-instances-provider/src/provider/outcome/internal_factor_instances_provider_outcome.rs diff --git a/crates/sargon/src/factor_instances_provider/provider/outcome/internal_factor_instances_provider_outcome_for_factor.rs b/crates/sargon-factor-instances-provider/src/provider/outcome/internal_factor_instances_provider_outcome_for_factor.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/provider/outcome/internal_factor_instances_provider_outcome_for_factor.rs rename to crates/sargon-factor-instances-provider/src/provider/outcome/internal_factor_instances_provider_outcome_for_factor.rs diff --git a/crates/sargon/src/factor_instances_provider/provider/outcome/mod.rs b/crates/sargon-factor-instances-provider/src/provider/outcome/mod.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/provider/outcome/mod.rs rename to crates/sargon-factor-instances-provider/src/provider/outcome/mod.rs diff --git a/crates/sargon/src/factor_instances_provider/provider/provider_adopters/cache_filler.rs b/crates/sargon-factor-instances-provider/src/provider/provider_adopters/cache_filler.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/provider/provider_adopters/cache_filler.rs rename to crates/sargon-factor-instances-provider/src/provider/provider_adopters/cache_filler.rs diff --git a/crates/sargon/src/factor_instances_provider/provider/provider_adopters/mod.rs b/crates/sargon-factor-instances-provider/src/provider/provider_adopters/mod.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/provider/provider_adopters/mod.rs rename to crates/sargon-factor-instances-provider/src/provider/provider_adopters/mod.rs diff --git a/crates/sargon/src/factor_instances_provider/provider/provider_adopters/securify_entity_factor_instances_provider.rs b/crates/sargon-factor-instances-provider/src/provider/provider_adopters/securify_entity_factor_instances_provider.rs similarity index 77% rename from crates/sargon/src/factor_instances_provider/provider/provider_adopters/securify_entity_factor_instances_provider.rs rename to crates/sargon-factor-instances-provider/src/provider/provider_adopters/securify_entity_factor_instances_provider.rs index 513b7b750..fa92c3d0c 100644 --- a/crates/sargon/src/factor_instances_provider/provider/provider_adopters/securify_entity_factor_instances_provider.rs +++ b/crates/sargon-factor-instances-provider/src/provider/provider_adopters/securify_entity_factor_instances_provider.rs @@ -1,5 +1,3 @@ -use std::collections::HashSet; - use crate::prelude::*; pub struct SecurifyEntityFactorInstancesProvider; @@ -273,88 +271,4 @@ mod tests { .await .unwrap(); } - - #[actix_rt::test] - async fn securify_accounts_and_personas_with_override_factor() { - // this is mostly a soundness test for the two functions `for_persona_mfa` and `for_account_mfa` - // using `os` to create a profile, and BDFS because I'm lazy. - // We might in fact remove `for_persona_mfa` and `for_account_mfa` - // and only use the `for_entity_mfa` function... but we have these to get code coverage. - let (os, bdfs) = SargonOS::with_bdfs().await; - - let (batman, derivation_outcome) = os - .create_and_save_new_mainnet_persona_with_derivation_outcome( - "Batman", - ) - .await - .unwrap(); - assert!(derivation_outcome.debug_was_derived.is_empty()); - - let (alice, derivation_outcome) = os - .create_and_save_new_mainnet_account_with_derivation_outcome( - "alice", - ) - .await - .unwrap(); - assert!(derivation_outcome.debug_was_derived.is_empty()); - - os.add_factor_source(FactorSource::sample_ledger()) - .await - .unwrap(); - os.add_factor_source(FactorSource::sample_password()) - .await - .unwrap(); - let factor_sources = &os.profile().unwrap().factor_sources; - let matrix_ids = MatrixTemplate::config_1_4() - .materialize(factor_sources.items()) - .unwrap(); - - let matrix_0 = - MatrixOfFactorSources::new(matrix_ids, factor_sources).unwrap(); - - let shield_0 = SecurityStructureOfFactorSources::new( - DisplayName::sample(), - matrix_0, - bdfs.clone(), - ); - - let cache_client = Arc::new(os.clients.factor_instances_cache.clone()); - let profile = Arc::new(os.profile().unwrap()); - let derivation_interactors = os.keys_derivation_interactor(); - - let (instances_in_cache_consumer, outcome) = - SUT::securifying_unsecurified( - cache_client.clone(), - profile, - shield_0.clone(), - IndexSet::from_iter([ - AddressOfAccountOrPersona::from(alice.address()), - AddressOfAccountOrPersona::from(batman.address()), - ]), - derivation_interactors.clone(), - ) - .await - .unwrap(); - - assert_eq!(outcome.per_derivation_preset.len(), 4); - - // don't forget to consume - instances_in_cache_consumer.consume().await.unwrap(); - - let account_outcome = outcome - .get_derivation_preset_for_factor( - DerivationPreset::AccountMfa, - &bdfs.id_from_hash(), - ) - .unwrap(); - assert_eq!(account_outcome.to_use_directly.len(), 1); - - let persona_outcome = outcome - .get_derivation_preset_for_factor( - DerivationPreset::AccountMfa, - &bdfs.id_from_hash(), - ) - .unwrap(); - assert_eq!(persona_outcome.to_use_directly.len(), 1); - } } diff --git a/crates/sargon/src/factor_instances_provider/provider/provider_adopters/virtual_entity_creating_instance_provider.rs b/crates/sargon-factor-instances-provider/src/provider/provider_adopters/virtual_entity_creating_instance_provider.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/provider/provider_adopters/virtual_entity_creating_instance_provider.rs rename to crates/sargon-factor-instances-provider/src/provider/provider_adopters/virtual_entity_creating_instance_provider.rs diff --git a/crates/sargon-factor-instances-provider/src/types/mod.rs b/crates/sargon-factor-instances-provider/src/types/mod.rs new file mode 100644 index 000000000..dbd16a90f --- /dev/null +++ b/crates/sargon-factor-instances-provider/src/types/mod.rs @@ -0,0 +1,3 @@ +mod test_derivation_interactor_from_secure_storage_client; + +pub use test_derivation_interactor_from_secure_storage_client::*; diff --git a/crates/sargon-factor-instances-provider/src/types/test_derivation_interactor_from_secure_storage_client.rs b/crates/sargon-factor-instances-provider/src/types/test_derivation_interactor_from_secure_storage_client.rs new file mode 100644 index 000000000..939bd147a --- /dev/null +++ b/crates/sargon-factor-instances-provider/src/types/test_derivation_interactor_from_secure_storage_client.rs @@ -0,0 +1,22 @@ +use crate::prelude::*; + +pub trait TestDerivationInteractorFromSecureStorageClient: Sized { + fn new( + always_fail: bool, + secure_storage_client: Arc, + ) -> Self; +} + +impl TestDerivationInteractorFromSecureStorageClient + for TestDerivationInteractor +{ + fn new( + always_fail: bool, + secure_storage_client: Arc, + ) -> Self { + Self::with_mnemonic_loading( + always_fail, + secure_storage_client as Arc, + ) + } +} diff --git a/crates/sargon-factors-supporting-types/Cargo.toml b/crates/sargon-factors-supporting-types/Cargo.toml new file mode 100644 index 000000000..b37d2c5b7 --- /dev/null +++ b/crates/sargon-factors-supporting-types/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "sargon-factors-supporting-types" +version = "1.1.99" +edition = "2021" + +[dependencies] +# ==== INTERNAL DEPENDENCIES ==== +identified-vec-of = { path = "../identified-vec-of" } +sargon-core = { path = "../sargon-core" } +sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } +sargon-factors = { path = "../sargon-factors" } + + +# === RADIX DEPENDENCIES === +# None + +# === EXTERNAL DEPENDENCIES === +async-trait = { workspace = true } diff --git a/crates/sargon-factors-supporting-types/src/lib.rs b/crates/sargon-factors-supporting-types/src/lib.rs new file mode 100644 index 000000000..95951ab18 --- /dev/null +++ b/crates/sargon-factors-supporting-types/src/lib.rs @@ -0,0 +1,11 @@ +mod mnemonic_loading; + +pub mod prelude { + pub use crate::mnemonic_loading::*; + + pub(crate) use sargon_core::prelude::*; + pub(crate) use sargon_factors::prelude::*; + pub(crate) use sargon_hierarchical_deterministic::prelude::*; +} + +pub use prelude::*; diff --git a/crates/sargon-factors-supporting-types/src/mnemonic_loading.rs b/crates/sargon-factors-supporting-types/src/mnemonic_loading.rs new file mode 100644 index 000000000..e4c1b00eb --- /dev/null +++ b/crates/sargon-factors-supporting-types/src/mnemonic_loading.rs @@ -0,0 +1,22 @@ +use crate::prelude::*; + +#[async_trait::async_trait] +pub trait MnemonicLoading: std::fmt::Debug + Send + Sync { + async fn load_mnemonic( + &self, + id: FactorSourceIDFromHash, + ) -> Result; +} + +#[derive(Debug, Default, Clone)] +pub struct FailingMnemonicLoader; + +#[async_trait::async_trait] +impl MnemonicLoading for FailingMnemonicLoader { + async fn load_mnemonic( + &self, + _id: FactorSourceIDFromHash, + ) -> Result { + Err(CommonError::Unknown) + } +} diff --git a/crates/sargon-factors/Cargo.toml b/crates/sargon-factors/Cargo.toml index 00a4d8a64..5eee724f3 100644 --- a/crates/sargon-factors/Cargo.toml +++ b/crates/sargon-factors/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sargon-factors" -version = "1.2.1" +version = "1.1.99" edition = "2021" build = "build.rs" @@ -10,55 +10,40 @@ identified-vec-of = { path = "../identified-vec-of" } sargon-core = { path = "../sargon-core" } sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } - # ==== RADIX DEPENDENCIES ==== radix-common = { workspace = true } radix-engine-interface = { workspace = true } radix-rust = { workspace = true } radix-transactions = { workspace = true } - # ==== EXTERNAL DEPENDENCIES ==== arraystring = { workspace = true } assert-json-diff = { workspace = true } +bip39 = { workspace = true } delegate = { workspace = true } +derive_more = { workspace = true } enum-as-inner = { workspace = true } enum-iterator = { workspace = true } -hkdf = { workspace = true } hex = { workspace = true } -pretty_assertions = { workspace = true } -serde = { workspace = true } -serde_json = { workspace = true } -derive_more = { workspace = true } -once_cell = { workspace = true } - - -itertools = { workspace = true } +hkdf = { workspace = true } iota-crypto = { workspace = true } +iso8601-timestamp = { workspace = true } +itertools = { workspace = true } k256 = { workspace = true } -rand = { workspace = true } log = { workspace = true } - - -serde_with = { workspace = true } - +once_cell = { workspace = true } paste = { workspace = true } +pretty_assertions = { workspace = true } +rand = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } serde_repr = { workspace = true } -iso8601-timestamp = { workspace = true } -zeroize = { workspace = true } +serde_with = { workspace = true } strum = { workspace = true } -url = { workspace = true } thiserror = { workspace = true } - +url = { workspace = true } uuid = { workspace = true } - -# bip39 = "2.0.0" -bip39 = { git = "https://github.com/rust-bitcoin/rust-bip39", rev = "a30760beac21d595b2bda376df4f4e6bf029bcc5", features = [ - "serde", - "zeroize", - "french", -] } +zeroize = { workspace = true } [build-dependencies] - cargo_toml = { workspace = true } diff --git a/crates/sargon-factors/src/factor_instance/factor_instances.rs b/crates/sargon-factors/src/factor_instance/factor_instances.rs index 17f90edc7..ea1c2bdb1 100644 --- a/crates/sargon-factors/src/factor_instance/factor_instances.rs +++ b/crates/sargon-factors/src/factor_instance/factor_instances.rs @@ -15,6 +15,14 @@ pub struct FactorInstances { factor_instances: IndexSet, } +impl AppendableCollection for FactorInstances { + type Element = HierarchicalDeterministicFactorInstance; + + fn append>(&mut self, iter: T) { + self.extend(iter) + } +} + impl FactorInstances { pub fn extend( &mut self, diff --git a/crates/sargon-factors/src/hierarchical_deterministic_factor_instance.rs b/crates/sargon-factors/src/hierarchical_deterministic_factor_instance.rs index c2e225eb6..c074254c7 100644 --- a/crates/sargon-factors/src/hierarchical_deterministic_factor_instance.rs +++ b/crates/sargon-factors/src/hierarchical_deterministic_factor_instance.rs @@ -6,6 +6,19 @@ pub struct HierarchicalDeterministicFactorInstance { pub public_key: HierarchicalDeterministicPublicKey, } +/// A trait for types which reference a factor source. +pub trait FactorSourceReferencing: + std::hash::Hash + PartialEq + Eq + Clone +{ + fn factor_source_id(&self) -> FactorSourceIDFromHash; +} + +impl FactorSourceReferencing for HierarchicalDeterministicFactorInstance { + fn factor_source_id(&self) -> FactorSourceIDFromHash { + self.factor_source_id + } +} + impl HasEntityKindObjectSafe for HierarchicalDeterministicFactorInstance { fn get_entity_kind(&self) -> CAP26EntityKind { self.public_key.derivation_path.get_entity_kind() diff --git a/crates/sargon-hierarchical-deterministic/Cargo.toml b/crates/sargon-hierarchical-deterministic/Cargo.toml index d32008ca3..9b3967e13 100644 --- a/crates/sargon-hierarchical-deterministic/Cargo.toml +++ b/crates/sargon-hierarchical-deterministic/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sargon-hierarchical-deterministic" -version = "1.2.1" +version = "1.1.99" edition = "2021" [dependencies] @@ -16,39 +16,27 @@ radix-transactions = { workspace = true } # ==== EXTERNAL DEPENDENCIES ==== assert-json-diff = { workspace = true } +bip39 = { workspace = true } delegate = { workspace = true } +derive_more = { workspace = true } enum-as-inner = { workspace = true } enum-iterator = { workspace = true } -hkdf = { workspace = true } hex = { workspace = true } -pretty_assertions = { workspace = true } -serde = { workspace = true } -serde_json = { workspace = true } -derive_more = { workspace = true } - - -itertools = { workspace = true } +hkdf = { workspace = true } iota-crypto = { workspace = true } +iso8601-timestamp = { workspace = true } +itertools = { workspace = true } k256 = { workspace = true } -rand = { workspace = true } log = { workspace = true } - - -serde_with = { workspace = true } - paste = { workspace = true } +pretty_assertions = { workspace = true } +rand = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } serde_repr = { workspace = true } -iso8601-timestamp = { workspace = true } -zeroize = { workspace = true } +serde_with = { workspace = true } strum = { workspace = true } -url = { workspace = true } thiserror = { workspace = true } - +url = { workspace = true } uuid = { workspace = true } - -# bip39 = "2.0.0" -bip39 = { git = "https://github.com/rust-bitcoin/rust-bip39", rev = "a30760beac21d595b2bda376df4f4e6bf029bcc5", features = [ - "serde", - "zeroize", - "french", -] } +zeroize = { workspace = true } diff --git a/crates/sargon-keys-collector/Cargo.toml b/crates/sargon-keys-collector/Cargo.toml index c1cf8ffcc..6bd8abeba 100644 --- a/crates/sargon-keys-collector/Cargo.toml +++ b/crates/sargon-keys-collector/Cargo.toml @@ -1,14 +1,20 @@ [package] name = "sargon-keys-collector" -version = "1.2.1" +version = "1.1.99" edition = "2021" [dependencies] +# === SARGON CRATES === sargon-core = { path = "../sargon-core" } sargon-factors = { path = "../sargon-factors" } sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } sargon-addresses = { path = "../sargon-addresses" } +sargon-factors-supporting-types = { path = "../sargon-factors-supporting-types" } +# === RADIX DEPENDENCIES === +# None + +# === EXTERNAL DEPENDENCIES === actix-rt = { workspace = true } async-trait = { workspace = true } derive_more = { workspace = true } diff --git a/crates/sargon-keys-collector/src/derivation_testing/test_keys_collector/test_derivation_interactor.rs b/crates/sargon-keys-collector/src/derivation_testing/test_keys_collector/test_derivation_interactor.rs index b5d0f4931..87ea637f8 100644 --- a/crates/sargon-keys-collector/src/derivation_testing/test_keys_collector/test_derivation_interactor.rs +++ b/crates/sargon-keys-collector/src/derivation_testing/test_keys_collector/test_derivation_interactor.rs @@ -6,27 +6,6 @@ use std::{ use crate::prelude::*; -#[async_trait::async_trait] -pub trait MnemonicLoading: Debug + Send + Sync { - async fn load_mnemonic( - &self, - id: FactorSourceIDFromHash, - ) -> Result; -} - -#[derive(Debug, Default, Clone)] -pub struct FailingMnemonicLoader; - -#[async_trait::async_trait] -impl MnemonicLoading for FailingMnemonicLoader { - async fn load_mnemonic( - &self, - _id: FactorSourceIDFromHash, - ) -> Result { - Err(CommonError::Unknown) - } -} - /// A type impl KeyDerivationInteractor suitable for tests. /// /// Uses Sample values of MnemonicWithPassphrase for derivation, or looks up the mnemonic diff --git a/crates/sargon-keys-collector/src/lib.rs b/crates/sargon-keys-collector/src/lib.rs index ca4042739..66bdb1307 100644 --- a/crates/sargon-keys-collector/src/lib.rs +++ b/crates/sargon-keys-collector/src/lib.rs @@ -16,6 +16,7 @@ pub mod prelude { pub(crate) use sargon_addresses::prelude::*; pub(crate) use sargon_core::prelude::*; pub(crate) use sargon_factors::prelude::*; + pub(crate) use sargon_factors_supporting_types::prelude::*; pub(crate) use sargon_hierarchical_deterministic::prelude::*; pub use crate::collector::*; diff --git a/crates/sargon-manifests/Cargo.toml b/crates/sargon-manifests/Cargo.toml new file mode 100644 index 000000000..b0402edcb --- /dev/null +++ b/crates/sargon-manifests/Cargo.toml @@ -0,0 +1,59 @@ +[package] +name = "sargon-manifests" +version = "1.1.99" +edition = "2021" +build = "build.rs" + +[dependencies] +# === SARGON CRATES === +sargon-core = { path = "../sargon-core" } +sargon-core-utils = { path = "../sargon-core-utils" } +identified-vec-of = { path = "../identified-vec-of" } +sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } +sargon-factors = { path = "../sargon-factors" } +sargon-addresses = { path = "../sargon-addresses" } +sargon-transaction-models = { path = "../sargon-transaction-models" } +gateway-models = { path = "../gateway-models" } +sargon-profile = { path = "../sargon-profile" } + +# === RADIX DEPENDENCIES === +radix-common = { workspace = true } +radix-common-derive = { workspace = true } +radix-engine = { workspace = true } +radix-engine-interface = { workspace = true } +radix-engine-toolkit = { workspace = true } +radix-engine-toolkit-common = { workspace = true } +radix-rust = { workspace = true } +radix-transactions = { workspace = true } +sbor = { workspace = true } + +# === EXTERNAL DEPENDENCIES === +assert-json-diff = { workspace = true } +async-trait = { workspace = true } +cargo_toml = { workspace = true } +delegate = { workspace = true } +derive_more = { workspace = true } +enum-as-inner = { workspace = true } +enum-iterator = { workspace = true } +hex = { workspace = true } +iota-crypto = { workspace = true } +iso8601-timestamp = { workspace = true } +itertools = { workspace = true } +k256 = { workspace = true } +log = { workspace = true } +once_cell = { workspace = true } +paste = { workspace = true } +pretty_assertions = { workspace = true } +rand = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +serde_repr = { workspace = true } +serde_with = { workspace = true } +strum = { workspace = true } +thiserror = { workspace = true } +url = { workspace = true } +uuid = { workspace = true } +zeroize = { workspace = true } + +[build-dependencies] +cargo_toml = { workspace = true } diff --git a/crates/sargon-manifests/build.rs b/crates/sargon-manifests/build.rs new file mode 100644 index 000000000..ed5052f36 --- /dev/null +++ b/crates/sargon-manifests/build.rs @@ -0,0 +1,50 @@ +use cargo_toml::{Dependency, Manifest}; +use std::env; +use std::path::Path; + +pub fn main() { + // Paths for reading fixtures used by tests + let fixtures_path = Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures"); + println!("cargo:rustc-env=FIXTURES={}/", fixtures_path.display()); + + let fixtures_tx_path = fixtures_path.join("transaction"); + println!( + "cargo:rustc-env=FIXTURES_TX={}/", + fixtures_tx_path.display() + ); + + let manifest_path = + Path::new(env!("CARGO_MANIFEST_DIR")).join("Cargo.toml"); + + let manifest = Manifest::from_path(manifest_path).expect("Can't panic"); + let dependencies = manifest.dependencies; + + let set_dep_env = |key: &str| { + let dependency = dependencies.get(key).expect("Can't panic"); + let env_var_value = match dependency { + Dependency::Simple(version) => format!("version={version}"), + Dependency::Inherited(_) => { + panic!("Inherited dependency is not supported") + } + Dependency::Detailed(detailed) => { + if let Some(ref version) = detailed.version { + format!("version={version}") + } else if let Some(ref branch) = detailed.branch { + format!("branch={branch}") + } else if let Some(ref tag) = detailed.tag { + format!("tag={tag}") + } else if let Some(ref rev) = detailed.rev { + format!("rev={rev}") + } else { + panic!("Can't find version of {key} dependency") + } + } + }; + let env_var = + format!("{}_DEPENDENCY={}", key.to_uppercase(), env_var_value); + println!("cargo:rustc-env={}", env_var); + }; + + set_dep_env("radix-engine"); + set_dep_env("radix-engine-toolkit"); +} diff --git a/crates/sargon/fixtures/transaction/account_locker_claim.rtm b/crates/sargon-manifests/fixtures/transaction/account_locker_claim.rtm similarity index 100% rename from crates/sargon/fixtures/transaction/account_locker_claim.rtm rename to crates/sargon-manifests/fixtures/transaction/account_locker_claim.rtm diff --git a/crates/sargon/fixtures/transaction/account_locker_claim_max_nft_items.rtm b/crates/sargon-manifests/fixtures/transaction/account_locker_claim_max_nft_items.rtm similarity index 100% rename from crates/sargon/fixtures/transaction/account_locker_claim_max_nft_items.rtm rename to crates/sargon-manifests/fixtures/transaction/account_locker_claim_max_nft_items.rtm diff --git a/crates/sargon/fixtures/transaction/create_3_nft_collections.rtm b/crates/sargon-manifests/fixtures/transaction/create_3_nft_collections.rtm similarity index 100% rename from crates/sargon/fixtures/transaction/create_3_nft_collections.rtm rename to crates/sargon-manifests/fixtures/transaction/create_3_nft_collections.rtm diff --git a/crates/sargon/fixtures/transaction/create_access_controller_for_account.rtm b/crates/sargon-manifests/fixtures/transaction/create_access_controller_for_account.rtm similarity index 100% rename from crates/sargon/fixtures/transaction/create_access_controller_for_account.rtm rename to crates/sargon-manifests/fixtures/transaction/create_access_controller_for_account.rtm diff --git a/crates/sargon/fixtures/transaction/create_access_controller_for_persona.rtm b/crates/sargon-manifests/fixtures/transaction/create_access_controller_for_persona.rtm similarity index 100% rename from crates/sargon/fixtures/transaction/create_access_controller_for_persona.rtm rename to crates/sargon-manifests/fixtures/transaction/create_access_controller_for_persona.rtm diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/bucket.rs b/crates/sargon-manifests/src/bucket.rs similarity index 85% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/bucket.rs rename to crates/sargon-manifests/src/bucket.rs index 6f25ebf81..276fef4e0 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/bucket.rs +++ b/crates/sargon-manifests/src/bucket.rs @@ -1,8 +1,5 @@ // only used here... -use radix_rust::{ - labelled_resolvable_with_identity_impl, LabelResolver, LabelledResolvable, - LabelledResolveFrom, -}; +use radix_rust::{LabelResolver, LabelledResolvable, LabelledResolveFrom}; use crate::prelude::*; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/bucket_factory.rs b/crates/sargon-manifests/src/bucket_factory.rs similarity index 96% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/bucket_factory.rs rename to crates/sargon-manifests/src/bucket_factory.rs index aa1de65a7..53b81da05 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/bucket_factory.rs +++ b/crates/sargon-manifests/src/bucket_factory.rs @@ -1,4 +1,4 @@ -use crate::prelude::*; +use crate::bucket::Bucket; #[derive(Default)] pub(crate) struct BucketFactory { diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/delete_account/delete_account_transfer.rs b/crates/sargon-manifests/src/delete_account/delete_account_transfer.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/delete_account/delete_account_transfer.rs rename to crates/sargon-manifests/src/delete_account/delete_account_transfer.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/delete_account/delete_account_transfers.rs b/crates/sargon-manifests/src/delete_account/delete_account_transfers.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/delete_account/delete_account_transfers.rs rename to crates/sargon-manifests/src/delete_account/delete_account_transfers.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/delete_account/manifest_delete_account.rs b/crates/sargon-manifests/src/delete_account/manifest_delete_account.rs similarity index 94% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/delete_account/manifest_delete_account.rs rename to crates/sargon-manifests/src/delete_account/manifest_delete_account.rs index f5f548329..99077007a 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/delete_account/manifest_delete_account.rs +++ b/crates/sargon-manifests/src/delete_account/manifest_delete_account.rs @@ -1,17 +1,30 @@ use crate::prelude::*; +use bucket_factory::BucketFactory; use radix_engine_interface::blueprints::account::{ AccountRemoveAuthorizedDepositorInput as ScryptoAccountRemoveAuthorizedDepositorInput, AccountRemoveResourcePreferenceInput as ScryptoAccountRemoveResourcePreferenceInput, AccountSetResourcePreferenceInput as ScryptoAccountSetResourcePreferenceInput, - ResourcePreference as ScryptoResourcePreference, ACCOUNT_REMOVE_AUTHORIZED_DEPOSITOR_IDENT, ACCOUNT_REMOVE_RESOURCE_PREFERENCE_IDENT, ACCOUNT_SECURIFY_IDENT, ACCOUNT_SET_DEFAULT_DEPOSIT_RULE_IDENT, ACCOUNT_SET_RESOURCE_PREFERENCE_IDENT, }; -impl TransactionManifest { - pub fn delete_account( +pub trait ManifestForAccountDeletion { + fn delete_account( + account_address: &AccountAddress, + account_transfers: impl Into>, + resource_preferences_to_be_removed: Vec< + ScryptoAccountRemoveResourcePreferenceInput, + >, + authorized_depositors_to_be_removed: Vec< + ScryptoAccountRemoveAuthorizedDepositorInput, + >, + ) -> Self; +} + +impl ManifestForAccountDeletion for TransactionManifest { + fn delete_account( account_address: &AccountAddress, account_transfers: impl Into>, resource_preferences_to_be_removed: Vec< diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/delete_account/mod.rs b/crates/sargon-manifests/src/delete_account/mod.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/delete_account/mod.rs rename to crates/sargon-manifests/src/delete_account/mod.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/mod.rs b/crates/sargon-manifests/src/high_level/mod.rs similarity index 71% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/mod.rs rename to crates/sargon-manifests/src/high_level/mod.rs index 62b9f4875..73a76cc15 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/mod.rs +++ b/crates/sargon-manifests/src/high_level/mod.rs @@ -1,7 +1,5 @@ -mod manifest_building; mod sargon_specific_types; mod token_definition_metadata; -pub use manifest_building::*; pub use sargon_specific_types::*; pub use token_definition_metadata::*; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/account_locker/account_locker_claimable_resource.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/account_locker/account_locker_claimable_resource.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/account_locker/account_locker_claimable_resource.rs rename to crates/sargon-manifests/src/high_level/sargon_specific_types/account_locker/account_locker_claimable_resource.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/account_locker/mod.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/account_locker/mod.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/account_locker/mod.rs rename to crates/sargon-manifests/src/high_level/sargon_specific_types/account_locker/mod.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/mod.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/mod.rs similarity index 58% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/mod.rs rename to crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/mod.rs index 2235168c5..1abd5ac33 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/mod.rs +++ b/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/mod.rs @@ -1,9 +1,9 @@ -mod account_or_address_of; +mod owned_or_third_party_account_address; mod per_asset; mod per_recipient; mod transfer_types; -pub use account_or_address_of::*; +pub use owned_or_third_party_account_address::*; pub use per_asset::*; pub use per_recipient::*; pub use transfer_types::*; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/account_or_address_of.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/owned_or_third_party_account_address.rs similarity index 52% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/account_or_address_of.rs rename to crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/owned_or_third_party_account_address.rs index 4ec8acee9..15678cec7 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/account_or_address_of.rs +++ b/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/owned_or_third_party_account_address.rs @@ -1,60 +1,55 @@ use crate::prelude::*; #[derive(Clone, Debug, PartialEq, Eq, Hash)] -#[allow(clippy::large_enum_variant)] -pub enum AccountOrAddressOf { - ProfileAccount { value: Account }, - AddressOfExternalAccount { value: AccountAddress }, +pub enum OwnedOrThirdPartyAccountAddress { + OwnedAccount { value: AccountAddress }, + ThirdPartyAccount { value: AccountAddress }, } -impl From for AccountOrAddressOf { - fn from(value: Account) -> Self { - Self::ProfileAccount { value } - } -} - -impl From for AccountOrAddressOf { - fn from(value: AccountAddress) -> Self { - Self::AddressOfExternalAccount { value } - } -} +// impl From for OwnedOrThirdPartyAccountAddress { +// fn from(value: AccountAddress) -> Self { +// Self::ThirdPartyAccount { value } +// } +// } -impl AccountOrAddressOf { +impl OwnedOrThirdPartyAccountAddress { pub fn account_address(&self) -> &AccountAddress { match self { - AccountOrAddressOf::ProfileAccount { value } => &value.address, - AccountOrAddressOf::AddressOfExternalAccount { value } => value, + OwnedOrThirdPartyAccountAddress::OwnedAccount { value } => value, + OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { value } => { + value + } } } } -impl AccountOrAddressOf { +impl OwnedOrThirdPartyAccountAddress { pub(crate) fn sample_mainnet() -> Self { - Self::ProfileAccount { - value: Account::sample_mainnet_bob(), + Self::OwnedAccount { + value: AccountAddress::from_str("account_rdx12y02nen8zjrq0k0nku98shjq7n05kvl3j9m5d3a6cpduqwzgmenjq7").unwrap(), } } pub(crate) fn sample_mainnet_other() -> Self { - Self::AddressOfExternalAccount { + Self::ThirdPartyAccount { value: AccountAddress::sample_mainnet_other(), } } pub(crate) fn sample_stokenet() -> Self { - Self::ProfileAccount { - value: Account::sample_stokenet_nadia(), + Self::OwnedAccount { + value: AccountAddress::from_str("account_tdx_2_128jx5fmru80v38a7hun8tdhajf2exef756c92tfg4atwl3y4pqn48m").unwrap(), } } pub(crate) fn sample_stokenet_other() -> Self { - Self::AddressOfExternalAccount { + Self::ThirdPartyAccount { value: AccountAddress::sample_stokenet_other(), } } } -impl HasSampleValues for AccountOrAddressOf { +impl HasSampleValues for OwnedOrThirdPartyAccountAddress { fn sample() -> Self { Self::sample_mainnet() } @@ -69,7 +64,7 @@ mod tests { use super::*; #[allow(clippy::upper_case_acronyms)] - type SUT = AccountOrAddressOf; + type SUT = OwnedOrThirdPartyAccountAddress; #[test] fn equality() { @@ -101,16 +96,16 @@ mod tests { ) } - #[test] - fn from_account() { - let acc = Account::sample(); - let exp = &acc.clone().address; - assert_eq!(SUT::from(acc).account_address(), exp) - } - - #[test] - fn from_address() { - let exp = &AccountAddress::sample(); - assert_eq!(SUT::from(*exp).account_address(), exp) - } + // #[test] + // fn from_account() { + // let acc = Account::sample(); + // let exp = &acc.clone().address; + // assert_eq!(SUT::from(acc).account_address(), exp) + // } + + // #[test] + // fn from_address() { + // let exp = &AccountAddress::sample(); + // assert_eq!(SUT::from(*exp).account_address(), exp) + // } } diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/mod.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/mod.rs similarity index 82% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/mod.rs rename to crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/mod.rs index 56764b3ba..eaca04a4f 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/mod.rs +++ b/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/mod.rs @@ -6,8 +6,6 @@ mod per_asset_transfers_of_fungible_resource; mod per_asset_transfers_of_non_fungible_resource; pub use per_asset_fungible_resource::*; -pub use per_asset_fungible_transfer::*; -pub use per_asset_non_fungible_transfer::*; pub use per_asset_transfers::*; pub use per_asset_transfers_of_fungible_resource::*; pub use per_asset_transfers_of_non_fungible_resource::*; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_fungible_resource.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_fungible_resource.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_fungible_resource.rs rename to crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_fungible_resource.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_fungible_transfer.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_fungible_transfer.rs similarity index 76% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_fungible_transfer.rs rename to crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_fungible_transfer.rs index b2e9608e3..eb3e415af 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_fungible_transfer.rs +++ b/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_fungible_transfer.rs @@ -2,7 +2,7 @@ use crate::prelude::*; impl PerAssetFungibleTransfer { pub fn new( - recipient: impl Into, + recipient: impl Into, use_try_deposit_or_abort: bool, amount: impl Into, ) -> Self { @@ -21,11 +21,17 @@ impl PerAssetFungibleTransfer { } } -impl From<(&AccountOrAddressOf, PerRecipientFungibleTransfer)> - for PerAssetFungibleTransfer +impl + From<( + &OwnedOrThirdPartyAccountAddress, + PerRecipientFungibleTransfer, + )> for PerAssetFungibleTransfer { fn from( - value: (&AccountOrAddressOf, PerRecipientFungibleTransfer), + value: ( + &OwnedOrThirdPartyAccountAddress, + PerRecipientFungibleTransfer, + ), ) -> Self { let (recipient, transfer) = value; Self::new( @@ -49,16 +55,14 @@ impl HasSampleValues for PerAssetFungibleTransfer { impl PerAssetFungibleTransfer { pub(crate) fn sample_mainnet() -> Self { Self::new( - AccountOrAddressOf::ProfileAccount { - value: Account::sample_mainnet_carol(), - }, + OwnedOrThirdPartyAccountAddress::OwnedAccount { value: AccountAddress::from_str("account_rdx129akrrsd9ctuphe99lesa8cf6auc5vqwdd2lu0ej6csncnuw9eedgv").unwrap() }, true, Decimal192::from_str("237.13372718281828").unwrap(), ) } pub(crate) fn sample_mainnet_other() -> Self { - Self::new(AccountOrAddressOf::AddressOfExternalAccount { + Self::new(OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { value: AccountAddress::from_str("account_rdx12y02nen8zjrq0k0nku98shjq7n05kvl3j9m5d3a6cpduqwzgmenjq7").unwrap() }, true, @@ -67,8 +71,8 @@ impl PerAssetFungibleTransfer { pub(crate) fn sample_stokenet() -> Self { Self::new( - AccountOrAddressOf::ProfileAccount { - value: Account::sample_stokenet_olivia(), + OwnedOrThirdPartyAccountAddress::OwnedAccount { + value: AccountAddress::from_str("account_tdx_2_12xvlee7xtg7dx599yv69tzkpeqzn4wr2nlnn3gpsm0zu0v9luqdpnp").unwrap(), }, true, Decimal192::from_str("42.311415").unwrap(), @@ -76,7 +80,7 @@ impl PerAssetFungibleTransfer { } pub(crate) fn sample_stokenet_other() -> Self { - Self::new(AccountOrAddressOf::AddressOfExternalAccount { + Self::new(OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { value: AccountAddress::from_str("account_tdx_2_1288efhmjt8kzce77par4ex997x2zgnlv5qqv9ltpxqg7ur0xpqm6gk").unwrap() }, true, diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_non_fungible_transfer.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_non_fungible_transfer.rs similarity index 79% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_non_fungible_transfer.rs rename to crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_non_fungible_transfer.rs index 0e097cb5a..68ea7c53a 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_non_fungible_transfer.rs +++ b/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_non_fungible_transfer.rs @@ -2,7 +2,7 @@ use crate::prelude::*; impl PerAssetNonFungibleTransfer { pub fn new( - recipient: impl Into, + recipient: impl Into, use_try_deposit_or_abort: bool, non_fungible_local_ids: impl IntoIterator, ) -> Self { @@ -24,11 +24,17 @@ impl PerAssetNonFungibleTransfer { } } -impl From<(&AccountOrAddressOf, PerRecipientNonFungibleTransfer)> - for PerAssetNonFungibleTransfer +impl + From<( + &OwnedOrThirdPartyAccountAddress, + PerRecipientNonFungibleTransfer, + )> for PerAssetNonFungibleTransfer { fn from( - value: (&AccountOrAddressOf, PerRecipientNonFungibleTransfer), + value: ( + &OwnedOrThirdPartyAccountAddress, + PerRecipientNonFungibleTransfer, + ), ) -> Self { let (recipient, non_fungibles) = value; Self::new( @@ -42,8 +48,8 @@ impl From<(&AccountOrAddressOf, PerRecipientNonFungibleTransfer)> impl PerAssetNonFungibleTransfer { pub(crate) fn sample_mainnet() -> Self { Self::new( - AccountOrAddressOf::ProfileAccount { - value: Account::sample_mainnet_carol(), + OwnedOrThirdPartyAccountAddress::OwnedAccount { + value: AccountAddress::from_str("account_rdx129akrrsd9ctuphe99lesa8cf6auc5vqwdd2lu0ej6csncnuw9eedgv").unwrap(), }, true, [ @@ -55,7 +61,7 @@ impl PerAssetNonFungibleTransfer { pub(crate) fn sample_mainnet_other() -> Self { Self::new( - AccountOrAddressOf::AddressOfExternalAccount { + OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { value: AccountAddress::from_str("account_rdx12y02nen8zjrq0k0nku98shjq7n05kvl3j9m5d3a6cpduqwzgmenjq7").unwrap() }, true, @@ -65,8 +71,8 @@ impl PerAssetNonFungibleTransfer { pub(crate) fn sample_stokenet() -> Self { Self::new( - AccountOrAddressOf::ProfileAccount { - value: Account::sample_stokenet_nadia(), + OwnedOrThirdPartyAccountAddress::OwnedAccount { + value: AccountAddress::from_str("account_tdx_2_128jx5fmru80v38a7hun8tdhajf2exef756c92tfg4atwl3y4pqn48m").unwrap(), }, true, [ @@ -78,7 +84,7 @@ impl PerAssetNonFungibleTransfer { pub(crate) fn sample_stokenet_other() -> Self { Self::new( - AccountOrAddressOf::AddressOfExternalAccount { + OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { value: AccountAddress::from_str("account_tdx_2_1288efhmjt8kzce77par4ex997x2zgnlv5qqv9ltpxqg7ur0xpqm6gk").unwrap() }, true, diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers.rs rename to crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers_of_fungible_resource.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers_of_fungible_resource.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers_of_fungible_resource.rs rename to crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers_of_fungible_resource.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers_of_non_fungible_resource.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers_of_non_fungible_resource.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers_of_non_fungible_resource.rs rename to crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers_of_non_fungible_resource.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/mod.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/mod.rs similarity index 71% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/mod.rs rename to crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/mod.rs index 9927c2f43..c89be841b 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/mod.rs +++ b/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/mod.rs @@ -5,5 +5,3 @@ mod per_recipient_non_fungibles_transfer; pub use per_recipient_asset_transfer::*; pub use per_recipient_asset_transfers::*; -pub use per_recipient_fungible_transfer::*; -pub use per_recipient_non_fungibles_transfer::*; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfer.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfer.rs similarity index 89% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfer.rs rename to crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfer.rs index 399415c46..ec11e10b8 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfer.rs +++ b/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfer.rs @@ -2,14 +2,14 @@ use crate::prelude::*; #[derive(Clone, Debug, PartialEq, Eq, Hash)] pub struct PerRecipientAssetTransfer { - pub recipient: AccountOrAddressOf, + pub recipient: OwnedOrThirdPartyAccountAddress, pub fungibles: Vec, pub non_fungibles: Vec, } impl PerRecipientAssetTransfer { pub fn new( - recipient: impl Into, + recipient: impl Into, fungibles: impl IntoIterator, non_fungibles: impl IntoIterator, ) -> Self { @@ -25,7 +25,7 @@ impl PerRecipientAssetTransfer { impl PerRecipientAssetTransfer { pub(crate) fn sample_mainnet() -> Self { Self::new( - AccountOrAddressOf::sample_mainnet(), + OwnedOrThirdPartyAccountAddress::sample_mainnet(), [ PerRecipientFungibleTransfer::sample_mainnet(), PerRecipientFungibleTransfer::sample_mainnet_other(), @@ -39,7 +39,7 @@ impl PerRecipientAssetTransfer { pub(crate) fn sample_mainnet_other() -> Self { Self::new( - AccountOrAddressOf::sample_mainnet_other(), + OwnedOrThirdPartyAccountAddress::sample_mainnet_other(), [PerRecipientFungibleTransfer::sample_mainnet_other()], [PerRecipientNonFungibleTransfer::sample_mainnet_other()], ) @@ -47,7 +47,7 @@ impl PerRecipientAssetTransfer { pub(crate) fn sample_stokenet() -> Self { Self::new( - AccountOrAddressOf::sample_stokenet(), + OwnedOrThirdPartyAccountAddress::sample_stokenet(), [ PerRecipientFungibleTransfer::sample_stokenet(), PerRecipientFungibleTransfer::sample_stokenet_other(), @@ -61,7 +61,7 @@ impl PerRecipientAssetTransfer { pub(crate) fn sample_stokenet_other() -> Self { Self::new( - AccountOrAddressOf::sample_stokenet_other(), + OwnedOrThirdPartyAccountAddress::sample_stokenet_other(), [PerRecipientFungibleTransfer::sample_stokenet_other()], [PerRecipientNonFungibleTransfer::sample_stokenet_other()], ) diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfers.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfers.rs similarity index 87% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfers.rs rename to crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfers.rs index b64897a60..0c6378cb5 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfers.rs +++ b/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfers.rs @@ -61,7 +61,7 @@ impl HasSampleValues for PerRecipientAssetTransfers { Self::new( AccountAddress::sample_mainnet(), [PerRecipientAssetTransfer::new( - Account::sample_mainnet_carol(), + OwnedOrThirdPartyAccountAddress::OwnedAccount { value: AccountAddress::from_str("account_rdx129akrrsd9ctuphe99lesa8cf6auc5vqwdd2lu0ej6csncnuw9eedgv").unwrap() }, [PerRecipientFungibleTransfer::new( ResourceAddress::sample_mainnet_xrd(), Decimal192::from_str("237.13372718281828").unwrap(), @@ -76,7 +76,8 @@ impl HasSampleValues for PerRecipientAssetTransfers { ], ), PerRecipientAssetTransfer::new( - AccountAddress::from_str("account_rdx12y02nen8zjrq0k0nku98shjq7n05kvl3j9m5d3a6cpduqwzgmenjq7").unwrap(), + OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { value: AccountAddress::from_str("account_rdx12y02nen8zjrq0k0nku98shjq7n05kvl3j9m5d3a6cpduqwzgmenjq7").unwrap() } + , [PerRecipientFungibleTransfer::new( ResourceAddress::sample_mainnet_xrd(), Decimal192::from_str("987654.1234").unwrap(), @@ -115,7 +116,9 @@ impl HasSampleValues for PerRecipientAssetTransfers { sender, [ PerRecipientAssetTransfer::new( - recip0, + OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { + value: recip0, + }, [ PerRecipientFungibleTransfer::new(fung_0, 30, true, 18), PerRecipientFungibleTransfer::new(fung_1, 3, true, 18), @@ -140,7 +143,9 @@ impl HasSampleValues for PerRecipientAssetTransfers { ], ), PerRecipientAssetTransfer::new( - recip1, + OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { + value: recip1, + }, [ PerRecipientFungibleTransfer::new(fung_0, 50, true, 18), PerRecipientFungibleTransfer::new(fung_1, 5, true, 18), @@ -301,15 +306,19 @@ mod tests { PerAssetTransfersOfFungibleResource::new( PerAssetFungibleResource::new(fung_0, 18), [ - PerAssetFungibleTransfer::new(recip0, true, 30), - PerAssetFungibleTransfer::new(recip1, true, 50), + PerAssetFungibleTransfer::new(OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { + value: recip0 }, true, 30), + PerAssetFungibleTransfer::new(OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { + value: recip1 }, true, 50), ], ), PerAssetTransfersOfFungibleResource::new( PerAssetFungibleResource::new(fung_1, 18), [ - PerAssetFungibleTransfer::new(recip0, true, 3), - PerAssetFungibleTransfer::new(recip1, true, 5), + PerAssetFungibleTransfer::new(OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { + value: recip0 }, true, 3), + PerAssetFungibleTransfer::new(OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { + value: recip1 }, true, 5), ], ), ], @@ -318,7 +327,8 @@ mod tests { nft_c0, [ PerAssetNonFungibleTransfer::new( - recip0, + OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { + value: recip0 }, true, [ NonFungibleLocalId::integer(40), @@ -326,7 +336,8 @@ mod tests { ], ), PerAssetNonFungibleTransfer::new( - recip1, + OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { + value: recip1}, true, [ NonFungibleLocalId::integer(34), @@ -339,7 +350,8 @@ mod tests { nft_c1, [ PerAssetNonFungibleTransfer::new( - recip0, + OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { + value: recip0}, true, [ NonFungibleLocalId::integer(21), @@ -347,7 +359,8 @@ mod tests { ], ), PerAssetNonFungibleTransfer::new( - recip1, + OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { + value: recip1}, true, [ NonFungibleLocalId::integer(15), diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_fungible_transfer.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_fungible_transfer.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_fungible_transfer.rs rename to crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_fungible_transfer.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_non_fungibles_transfer.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_non_fungibles_transfer.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_non_fungibles_transfer.rs rename to crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_non_fungibles_transfer.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/transfer_types.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/transfer_types.rs similarity index 92% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/transfer_types.rs rename to crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/transfer_types.rs index 1b4d47bf4..5d3f2f995 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/transfer_types.rs +++ b/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/transfer_types.rs @@ -18,7 +18,7 @@ macro_rules! decl_transfer_of { /// If `true` the `try_deposit_batch_or_abort` method will be used instead of `deposit`, /// typically wallets sets this to try if and only if the recipient is a self-owned account - /// (`AccountOrAddressOf::ProfileAccount`) controlled by a DeviceFactorSource thy have + /// (`OwnedOrThirdPartyAccountAddress::OwnedAccount`) controlled by a DeviceFactorSource thy have /// access to and which third party deposit setting's `DepositRule` is `AcceptKnown` and /// which resource is known (`resource_address` is owned or has been owned before). pub use_try_deposit_or_abort: bool, @@ -47,13 +47,13 @@ macro_rules! decl_per_asset_transfer_of { $struct_name, $($fields)* /// The account or account address to send the tokens to. - pub recipient: AccountOrAddressOf, + pub recipient: OwnedOrThirdPartyAccountAddress, ); paste! { impl [< PerAsset $struct_name Transfer>] { - pub(crate) fn deposit_instruction(&self, builder: ScryptoTransactionManifestBuilder, bucket: &Bucket) -> ScryptoTransactionManifestBuilder { + pub(crate) fn deposit_instruction(&self, builder: ScryptoTransactionManifestBuilder, bucket: &crate::bucket::Bucket) -> ScryptoTransactionManifestBuilder { if self.use_try_deposit_or_abort { return builder.try_deposit_or_abort( diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/build_information/dependency_information.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/build_information/dependency_information.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/build_information/dependency_information.rs rename to crates/sargon-manifests/src/high_level/sargon_specific_types/build_information/dependency_information.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/build_information/mod.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/build_information/mod.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/build_information/mod.rs rename to crates/sargon-manifests/src/high_level/sargon_specific_types/build_information/mod.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/build_information/sargon_build_information.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/build_information/sargon_build_information.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/build_information/sargon_build_information.rs rename to crates/sargon-manifests/src/high_level/sargon_specific_types/build_information/sargon_build_information.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/build_information/sargon_dependencies.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/build_information/sargon_dependencies.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/build_information/sargon_dependencies.rs rename to crates/sargon-manifests/src/high_level/sargon_specific_types/build_information/sargon_dependencies.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/mod.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/mod.rs similarity index 75% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/mod.rs rename to crates/sargon-manifests/src/high_level/sargon_specific_types/mod.rs index f34302f1e..571658124 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/mod.rs +++ b/crates/sargon-manifests/src/high_level/sargon_specific_types/mod.rs @@ -1,7 +1,6 @@ mod account_locker; mod assets_transfers; mod build_information; -mod manifest_encountered_component_address; mod stake_claim; mod transaction; mod transaction_guarantee; @@ -13,5 +12,4 @@ pub use stake_claim::*; pub use transaction_guarantee::*; pub use account_locker::*; -pub use manifest_encountered_component_address::*; pub use transaction::*; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/stake_claim.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/stake_claim.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/stake_claim.rs rename to crates/sargon-manifests/src/high_level/sargon_specific_types/stake_claim.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction/mod.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/transaction/mod.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction/mod.rs rename to crates/sargon-manifests/src/high_level/sargon_specific_types/transaction/mod.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction/transaction_status.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/transaction/transaction_status.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction/transaction_status.rs rename to crates/sargon-manifests/src/high_level/sargon_specific_types/transaction/transaction_status.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction/transaction_status_reason.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/transaction/transaction_status_reason.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction/transaction_status_reason.rs rename to crates/sargon-manifests/src/high_level/sargon_specific_types/transaction/transaction_status_reason.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction_guarantee.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/transaction_guarantee.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction_guarantee.rs rename to crates/sargon-manifests/src/high_level/sargon_specific_types/transaction_guarantee.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/token_definition_metadata.rs b/crates/sargon-manifests/src/high_level/token_definition_metadata.rs similarity index 99% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/token_definition_metadata.rs rename to crates/sargon-manifests/src/high_level/token_definition_metadata.rs index 77df20b59..1fe3a15d0 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/token_definition_metadata.rs +++ b/crates/sargon-manifests/src/high_level/token_definition_metadata.rs @@ -1,5 +1,4 @@ use crate::prelude::*; -use radix_common::prelude::NodeId; use radix_common::time::Instant; use radix_common::types::GlobalAddress; use radix_engine_interface::prelude::UncheckedOrigin; diff --git a/crates/sargon-manifests/src/lib.rs b/crates/sargon-manifests/src/lib.rs new file mode 100644 index 000000000..4deefd671 --- /dev/null +++ b/crates/sargon-manifests/src/lib.rs @@ -0,0 +1,154 @@ +mod bucket; +mod bucket_factory; +mod delete_account; +mod high_level; +mod manifest_account_locker; +mod manifest_assets_transfers; +mod manifests; +mod manifests_access_controller; +mod manifests_create_tokens; +mod modify_manifest; +mod third_party_deposit_update; + +pub mod prelude { + pub use gateway_models::prelude::*; + pub use sargon_factors::prelude::*; + pub use sargon_hierarchical_deterministic::prelude::*; + pub use sargon_profile::prelude::*; + + pub(crate) use crate::bucket_factory; + + pub use crate::delete_account::*; + pub use crate::high_level::*; + pub use crate::manifest_account_locker::*; + pub use crate::manifest_assets_transfers::*; + pub use crate::manifests::*; + pub use crate::manifests_access_controller::*; + pub use crate::manifests_create_tokens::*; + pub use crate::modify_manifest::*; + pub use crate::third_party_deposit_update::*; + + pub use std::str::FromStr; + + pub(crate) use radix_common::{ + math::Decimal as ScryptoDecimal192, + prelude::{ + ACCOUNT_OWNER_BADGE as SCRYPTO_ACCOUNT_OWNER_BADGE, + IDENTITY_OWNER_BADGE as SCRYPTO_IDENTITY_OWNER_BADGE, + }, + ManifestSbor as ScryptoManifestSbor, ScryptoSbor, + }; + + pub(crate) use radix_engine_interface::prelude::{ + AccessRule as ScryptoAccessRule, + FungibleResourceRoles as ScryptoFungibleResourceRoles, + MetadataInit as ScryptoMetadataInit, + MetadataValue as ScryptoMetadataValue, + ModuleConfig as ScryptoModuleConfig, + NonFungibleResourceRoles as ScryptoNonFungibleResourceRoles, + OwnerRole as ScryptoOwnerRole, + RoleAssignmentInit as ScryptoRoleAssignmentInit, + ToMetadataEntry as ScryptoToMetadataEntry, + UncheckedUrl as ScryptoUncheckedUrl, + }; + + pub use radix_engine_toolkit::{ + functions::{ + transaction_v1::{ + instructions::extract_addresses as RET_ins_extract_addresses, + intent::{ + from_payload_bytes as RET_intent_from_payload_bytes, + hash as ret_hash_intent, + to_payload_bytes as RET_intent_to_payload_bytes, + }, + manifest::{ + from_payload_bytes as RET_from_payload_bytes_manifest_v1, + statically_analyze_and_validate as RET_statically_analyze_and_validate, + to_payload_bytes as RET_to_payload_bytes_manifest_v1, + }, + notarized_transaction::{ + from_payload_bytes as RET_decompile_notarize_tx, + to_payload_bytes as RET_compile_notarized_tx, + }, + signed_intent::hash as RET_signed_intent_hash, + }, + transaction_v2::{ + instructions::extract_addresses as RET_ins_extract_addresses_v2, + notarized_transaction::{ + from_payload_bytes as RET_decompile_notarize_tx_v2, + to_payload_bytes as RET_compile_notarized_tx_v2, + }, + signed_partial_transaction::{ + from_payload_bytes as RET_decompile_signed_partial_tx, + to_payload_bytes as RET_compile_signed_partial_tx, + }, + signed_transaction_intent::hash as RET_signed_intent_hash_v2, + subintent::{ + from_payload_bytes as RET_subintent_from_payload_bytes, + hash as ret_hash_subintent, + to_payload_bytes as RET_subintent_to_payload_bytes, + }, + subintent_manifest::{ + as_enclosed as RET_subintent_manifest_as_enclosed, + from_payload_bytes as RET_from_payload_bytes_subintent_manifest, + statically_analyze_and_validate as RET_statically_analyze_and_validate_subintent_manifest, + to_payload_bytes as RET_to_payload_bytes_subintent_manifest, + }, + transaction_intent::{ + hash as ret_hash_transaction_intent_v2, + to_payload_bytes as RET_transaction_intent_to_payload_bytes_v2, + }, + transaction_manifest::{ + dynamically_analyze as RET_dynamically_analyze_v2, + from_payload_bytes as RET_from_payload_bytes_manifest_v2, + statically_analyze_and_validate as RET_statically_analyze_and_validate_v2, + to_payload_bytes as RET_to_payload_bytes_manifest_v2, + }, + }, + }, + models::{ + canonical_address_types::{ + CanonicalAccessControllerAddress as RetAccessControllerAddress, + CanonicalAccountAddress as RetAccountAddress, + CanonicalAddress as RetIsAddressTrait, + CanonicalComponentAddress as RetComponentAddress, + CanonicalIdentityAddress as RetIdentityAddress, + CanonicalLockerAddress as RetLockerAddress, + CanonicalPackageAddress as RetPackageAddress, + CanonicalPoolAddress as RetPoolAddress, + CanonicalResourceAddress as RetResourceAddress, + CanonicalValidatorAddress as RetValidatorAddress, + CanonicalVaultAddress as RetVaultAddress, + }, + node_id::TypedNodeId as RetTypedNodeId, + }, + transaction_types::{ + DetailedManifestClass as RetDetailedManifestClass, + DynamicAnalysis as RetDynamicAnalysis, FeeSummary as RetFeeSummary, + FungibleResourceIndicator as RetFungibleResourceIndicator, + ManifestClass as RetManifestClass, NewEntities as RetNewEntities, + NonFungibleResourceIndicator as RetNonFungibleResourceIndicator, + Operation as RetOperation, Predicted as RetPredicted, + ReservedInstruction as RetReservedInstruction, + ResourceIndicator as RetResourceIndicator, + StaticAnalysisWithResourceMovements as RetStaticAnalysisWithResourceMovements, + TrackedPoolContribution as RetTrackedPoolContribution, + TrackedPoolRedemption as RetTrackedPoolRedemption, + TrackedValidatorClaim as RetTrackedValidatorClaim, + TrackedValidatorStake as RetTrackedValidatorStake, + TransactionTypesError as RetTransactionTypesError, + Update as RetUpdate, + }, + }; + + pub(crate) use radix_engine_interface::blueprints::{ + access_controller::RuleSet as ScryptoRuleSet, + account::{ + DefaultDepositRule as ScryptoDefaultDepositRule, + ACCOUNT_SECURIFY_IDENT as SCRYPTO_ACCOUNT_SECURIFY_IDENT, + }, + identity::IDENTITY_SECURIFY_IDENT as SCRYPTO_IDENTITY_SECURIFY_IDENT, + }; +} + +pub use prelude::*; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/manifest_account_locker.rs b/crates/sargon-manifests/src/manifest_account_locker.rs similarity index 90% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/manifest_account_locker.rs rename to crates/sargon-manifests/src/manifest_account_locker.rs index bef36f393..422ca3dd4 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/manifest_account_locker.rs +++ b/crates/sargon-manifests/src/manifest_account_locker.rs @@ -1,12 +1,22 @@ use crate::prelude::*; -use radix_common::prelude::ManifestExpression; -use radix_engine_interface::blueprints::locker::{ - ACCOUNT_LOCKER_CLAIM_IDENT, ACCOUNT_LOCKER_CLAIM_NON_FUNGIBLES_IDENT, -}; -use std::cmp::min; - -impl TransactionManifest { - pub fn account_locker_claim( +use bucket_factory::BucketFactory; +use radix_engine_interface::blueprints::locker::ACCOUNT_LOCKER_CLAIM_IDENT; + +pub trait ManifestForAccountLockerClaim: Sized { + fn account_locker_claim( + locker_address: &LockerAddress, + claimant: &AccountAddress, + claimable_resources: Vec, + ) -> Self; + + fn build_claimable_batch( + claimable_resources: Vec, + max_size: u64, + ) -> IndexSet; +} + +impl ManifestForAccountLockerClaim for TransactionManifest { + fn account_locker_claim( locker_address: &LockerAddress, claimant: &AccountAddress, claimable_resources: Vec, diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/manifest_assets_transfers.rs b/crates/sargon-manifests/src/manifest_assets_transfers.rs similarity index 96% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/manifest_assets_transfers.rs rename to crates/sargon-manifests/src/manifest_assets_transfers.rs index 9c1f10acb..a31048cf8 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/manifest_assets_transfers.rs +++ b/crates/sargon-manifests/src/manifest_assets_transfers.rs @@ -1,17 +1,24 @@ +use bucket_factory::BucketFactory; + use crate::prelude::*; -impl TransactionManifest { +pub trait TransactionManifestAssetTransfers: Sized { + fn per_asset_transfers(transfers: PerAssetTransfers) + -> TransactionManifest; + /// Uses `per_asset_transfers` after having transposed the `PerRecipientAssetTransfers` /// into `PerAssetTransfers`. We always use `PerAssetTransfers` when building the manifest /// since it is more efficient (allows a single withdraw per resource) => fewer instruction => /// cheaper TX fee for user. - pub fn per_recipient_transfers( + fn per_recipient_transfers( transfers: PerRecipientAssetTransfers, - ) -> Self { + ) -> TransactionManifest { Self::per_asset_transfers(transfers.transpose()) } +} - pub fn per_asset_transfers(transfers: PerAssetTransfers) -> Self { +impl TransactionManifestAssetTransfers for TransactionManifest { + fn per_asset_transfers(transfers: PerAssetTransfers) -> Self { let mut builder = ScryptoTransactionManifestBuilder::new(); let bucket_factory = BucketFactory::default(); let from_account = &transfers.from_account; @@ -89,7 +96,9 @@ mod tests { let transfers = PerRecipientAssetTransfers::new( AccountAddress::sample_mainnet(), [PerRecipientAssetTransfer::new( - AccountAddress::sample_mainnet_other(), + OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { + value: AccountAddress::sample_mainnet_other(), + }, [PerRecipientFungibleTransfer::new( ResourceAddress::sample_mainnet_candy(), 1337, diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/manifests.rs b/crates/sargon-manifests/src/manifests.rs similarity index 90% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/manifests.rs rename to crates/sargon-manifests/src/manifests.rs index 3c2c04596..dbcd8020d 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/manifests.rs +++ b/crates/sargon-manifests/src/manifests.rs @@ -1,10 +1,19 @@ +use bucket_factory::BucketFactory; + use crate::prelude::*; -impl TransactionManifest { - pub fn faucet( +pub trait TransactionManifestFaucet: Sized { + fn faucet( + include_lock_fee_instruction: bool, + address_of_receiving_account: &AccountAddress, + ) -> TransactionManifest; +} + +impl TransactionManifestFaucet for TransactionManifest { + fn faucet( include_lock_fee_instruction: bool, address_of_receiving_account: &AccountAddress, - ) -> Self { + ) -> TransactionManifest { let mut builder = ScryptoTransactionManifestBuilder::new(); if include_lock_fee_instruction { @@ -23,10 +32,32 @@ impl TransactionManifest { address_of_receiving_account.network_id(), ) } +} + +pub trait TransactionManifestMetadataSetting: Sized { + fn set_metadata( + address: &A, + key: MetadataKey, + value: impl ScryptoToMetadataEntry, + ) -> TransactionManifest + where + A: IntoScryptoAddress; + + fn set_metadata_on_builder( + address: &A, + key: MetadataKey, + value: impl ScryptoToMetadataEntry, + builder: ScryptoTransactionManifestBuilder, + ) -> ScryptoTransactionManifestBuilder + where + A: IntoScryptoAddress, + { + builder.set_metadata(address.scrypto(), key, value) + } - pub fn marking_account_as_dapp_definition_type( + fn marking_account_as_dapp_definition_type( account_address: &AccountAddress, - ) -> Self { + ) -> TransactionManifest { Self::set_metadata( account_address, MetadataKey::AccountType, @@ -34,10 +65,10 @@ impl TransactionManifest { ) } - pub fn set_owner_keys_hashes( + fn set_owner_keys_hashes( address_of_account_or_persona: &AddressOfAccountOrPersona, owner_key_hashes: Vec, - ) -> Self { + ) -> TransactionManifest { let builder = Self::set_owner_keys_hashes_on_builder( address_of_account_or_persona, owner_key_hashes, @@ -49,7 +80,7 @@ impl TransactionManifest { ) } - pub fn set_owner_keys_hashes_on_builder( + fn set_owner_keys_hashes_on_builder( address_of_account_or_persona: &AddressOfAccountOrPersona, owner_key_hashes: Vec, builder: ScryptoTransactionManifestBuilder, @@ -79,11 +110,39 @@ impl TransactionManifest { .map(ScryptoNonFungibleLocalId::from), ) } +} - pub fn stake_claims( +impl TransactionManifestMetadataSetting for TransactionManifest { + fn set_metadata( + address: &A, + key: MetadataKey, + value: impl ScryptoToMetadataEntry, + ) -> TransactionManifest + where + A: IntoScryptoAddress, + { + let builder = Self::set_metadata_on_builder( + address, + key, + value, + ScryptoTransactionManifestBuilder::new(), + ); + TransactionManifest::sargon_built(builder, address.network_id()) + } +} + +pub trait TransactionManifestStakeClaim: Sized { + fn stake_claims( + owner: &AccountAddress, + stake_claims: Vec, + ) -> TransactionManifest; +} + +impl TransactionManifestStakeClaim for TransactionManifest { + fn stake_claims( owner: &AccountAddress, stake_claims: Vec, - ) -> Self { + ) -> TransactionManifest { let account_address = owner; let network_id = account_address.network_id(); if stake_claims @@ -134,42 +193,10 @@ impl TransactionManifest { } } -impl TransactionManifest { - fn set_metadata( - address: &A, - key: MetadataKey, - value: impl ScryptoToMetadataEntry, - ) -> Self - where - A: IntoScryptoAddress, - { - let builder = Self::set_metadata_on_builder( - address, - key, - value, - ScryptoTransactionManifestBuilder::new(), - ); - TransactionManifest::sargon_built(builder, address.network_id()) - } - - fn set_metadata_on_builder( - address: &A, - key: MetadataKey, - value: impl ScryptoToMetadataEntry, - builder: ScryptoTransactionManifestBuilder, - ) -> ScryptoTransactionManifestBuilder - where - A: IntoScryptoAddress, - { - builder.set_metadata(address.scrypto(), key, value) - } -} - #[cfg(test)] mod tests { use super::*; use pretty_assertions::{assert_eq, assert_ne}; - use rand::Rng; #[allow(clippy::upper_case_acronyms)] type SUT = TransactionManifest; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/manifests_access_controller.rs b/crates/sargon-manifests/src/manifests_access_controller.rs similarity index 94% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/manifests_access_controller.rs rename to crates/sargon-manifests/src/manifests_access_controller.rs index 54a0dee25..7c59d5f63 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/manifests_access_controller.rs +++ b/crates/sargon-manifests/src/manifests_access_controller.rs @@ -1,12 +1,17 @@ -use radix_engine_interface::blueprints::access_controller::AccessControllerCreateManifestInput as ScryptoAccessControllerCreateManifestInput; +use bucket_factory::BucketFactory; use crate::prelude::*; -impl TransactionManifest { - pub fn securify_unsecurified_entity( +pub trait TransactionManifestSecurifyEntity: Sized { + fn _securify_unsecurified_entity( + entity_address: AddressOfAccountOrPersona, + security_structure_of_factor_instances: SecurityStructureOfFactorInstances, + ) -> Result; + + fn securify_unsecurified_entity( entity: E, security_structure_of_factor_instances: SecurityStructureOfFactorInstances, - ) -> Result { + ) -> Result { let Ok(unsecurified) = entity.security_state().into_unsecured() else { return Err(CommonError::CannotSecurifyEntityItIsAlreadySecurifiedAccordingToProfile); }; @@ -22,7 +27,9 @@ impl TransactionManifest { security_structure_of_factor_instances, ) } +} +impl TransactionManifestSecurifyEntity for TransactionManifest { fn _securify_unsecurified_entity( entity_address: AddressOfAccountOrPersona, security_structure_of_factor_instances: SecurityStructureOfFactorInstances, diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/manifests_create_tokens.rs b/crates/sargon-manifests/src/manifests_create_tokens.rs similarity index 93% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/manifests_create_tokens.rs rename to crates/sargon-manifests/src/manifests_create_tokens.rs index eeb3fd195..ca2cb1fe9 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/manifests_create_tokens.rs +++ b/crates/sargon-manifests/src/manifests_create_tokens.rs @@ -1,19 +1,75 @@ use crate::prelude::*; -impl TransactionManifest { - pub fn create_fungible_token(address_of_owner: &AccountAddress) -> Self { - Self::create_fungible_token_with_metadata( +pub trait TransactionManifestTokenCreating { + fn create_fungible_token_with_metadata_without_deposit( + builder: ScryptoTransactionManifestBuilder, + initial_supply: Decimal192, + metadata: TokenDefinitionMetadata, + ) -> ScryptoTransactionManifestBuilder; + + fn create_non_fungible_tokens( + address_of_owner: &AccountAddress, + collection_count: u16, + initial_supply: T, + ) -> TransactionManifest + where + T: Clone + IntoIterator, + V: ScryptoManifestEncode + ScryptoNonFungibleData; + + fn create_fungible_token( + address_of_owner: &AccountAddress, + ) -> TransactionManifest; + + fn create_non_fungible_tokens_collections( + address_of_owner: &AccountAddress, + collection_count: u16, + nfts_per_collection: u64, + ) -> TransactionManifest { + Self::create_non_fungible_tokens_collections_with_local_id_fn( address_of_owner, - 21_000_000.into(), - TokenDefinitionMetadata::sample(), + collection_count, + nfts_per_collection, + |i| NonFungibleLocalId::Integer { value: i }, + ) + } + + fn create_non_fungible_tokens_collections_with_local_id_fn( + address_of_owner: &AccountAddress, + collection_count: u16, + nfts_per_collection: u64, + local_id: F, + ) -> TransactionManifest + where + F: Fn(u64) -> NonFungibleLocalId; + + fn create_single_nft_collection( + address_of_owner: &AccountAddress, + nfts_per_collection: u64, + ) -> TransactionManifest { + Self::create_non_fungible_tokens_collections( + address_of_owner, + 1, + nfts_per_collection, ) } - pub fn create_fungible_token_with_metadata( + fn create_multiple_nft_collections( + address_of_owner: &AccountAddress, + collection_count: u16, + nfts_per_collection: u64, + ) -> TransactionManifest { + Self::create_non_fungible_tokens_collections( + address_of_owner, + collection_count, + nfts_per_collection, + ) + } + + fn create_fungible_token_with_metadata( address_of_owner: &AccountAddress, initial_supply: Decimal192, metadata: TokenDefinitionMetadata, - ) -> Self { + ) -> TransactionManifest { let mut builder = ScryptoTransactionManifestBuilder::new(); builder = Self::create_fungible_token_with_metadata_without_deposit( builder, @@ -31,43 +87,23 @@ impl TransactionManifest { ) } - pub fn create_single_nft_collection( - address_of_owner: &AccountAddress, - nfts_per_collection: u64, - ) -> Self { - Self::create_non_fungible_tokens_collections( - address_of_owner, - 1, - nfts_per_collection, - ) - } - - pub fn create_multiple_nft_collections( + fn create_multiple_fungible_tokens( address_of_owner: &AccountAddress, - collection_count: u16, - nfts_per_collection: u64, - ) -> Self { - Self::create_non_fungible_tokens_collections( - address_of_owner, - collection_count, - nfts_per_collection, - ) - } + count: impl Into>, + ) -> TransactionManifest; +} - fn create_non_fungible_tokens_collections( +impl TransactionManifestTokenCreating for TransactionManifest { + fn create_fungible_token( address_of_owner: &AccountAddress, - collection_count: u16, - nfts_per_collection: u64, - ) -> Self { - Self::create_non_fungible_tokens_collections_with_local_id_fn( + ) -> TransactionManifest { + Self::create_fungible_token_with_metadata( address_of_owner, - collection_count, - nfts_per_collection, - |i| NonFungibleLocalId::Integer { value: i }, + 21_000_000.into(), + TokenDefinitionMetadata::sample(), ) } - #[cfg(not(tarpaulin_include))] // false negative, tested fn create_non_fungible_tokens_collections_with_local_id_fn( address_of_owner: &AccountAddress, collection_count: u16, @@ -85,7 +121,6 @@ impl TransactionManifest { ) } - #[cfg(not(tarpaulin_include))] // false negative, tested fn create_non_fungible_tokens( address_of_owner: &AccountAddress, collection_count: u16, @@ -138,7 +173,7 @@ impl TransactionManifest { ) } - pub fn create_fungible_token_with_metadata_without_deposit( + fn create_fungible_token_with_metadata_without_deposit( builder: ScryptoTransactionManifestBuilder, initial_supply: Decimal192, metadata: TokenDefinitionMetadata, @@ -161,7 +196,7 @@ impl TransactionManifest { /// # Panics /// Panics if `address_of_owner` is on `Mainnet`, use a testnet instead. /// Panics if `count` is zero or is greater than the number of token metadata defined in `sample_resource_definition_metadata` (25) - pub fn create_multiple_fungible_tokens( + fn create_multiple_fungible_tokens( address_of_owner: &AccountAddress, count: impl Into>, ) -> TransactionManifest { @@ -218,7 +253,7 @@ impl TransactionManifest { } impl TokenDefinitionMetadata { - pub(crate) fn for_nft_collection(index: U11) -> Self { + pub fn for_nft_collection(index: U11) -> Self { let word = bip39_word_by_index(index.clone()).word; let name = capitalize(word.clone()); let base_url = "https://image-service-test-images.s3.eu-west-2.amazonaws.com/wallet_test_images/"; @@ -283,8 +318,7 @@ impl ScryptoNonFungibleData for NonFungibleTokenData { #[cfg(test)] mod tests { use crate::prelude::*; - use pretty_assertions::{assert_eq, assert_ne}; - use rand::Rng; + use pretty_assertions::assert_eq; #[allow(clippy::upper_case_acronyms)] type SUT = TransactionManifest; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/modify_manifest.rs b/crates/sargon-manifests/src/modify_manifest.rs similarity index 97% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/modify_manifest.rs rename to crates/sargon-manifests/src/modify_manifest.rs index 3e8e1e48e..7bf2ade90 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/modify_manifest.rs +++ b/crates/sargon-manifests/src/modify_manifest.rs @@ -52,10 +52,46 @@ where instruction[0].clone() } -impl TransactionManifest { +pub trait TransactionManifestModifying: Sized { + fn modify_add_guarantees( + self, + guarantees: I, + ) -> Result + where + I: IntoIterator; + + fn modify_add_guarantees_vec( + self, + guarantees: Vec, + ) -> Result { + self.modify_add_guarantees(guarantees) + } + + fn modify_add_lock_fee( + self, + address_of_fee_payer: &AccountAddress, + fee: Option, + ) -> Self { + let fee = fee.unwrap_or(default_fee()); + let instruction = single(|b| b.lock_fee(address_of_fee_payer, fee)); + self.prepend_instruction(instruction) + } + + fn prepend_instruction(self, instruction: ScryptoInstruction) -> Self { + self.insert_instruction(InstructionPosition::First, instruction) + } + + fn insert_instruction( + self, + position: InstructionPosition, + instruction: ScryptoInstruction, + ) -> Self; +} + +impl TransactionManifestModifying for TransactionManifest { /// Modifies `manifest` by inserting transaction "guarantees", which is the wallet /// term for `assert_worktop_contains`. - pub fn modify_add_guarantees( + fn modify_add_guarantees( self, guarantees: I, ) -> Result @@ -112,27 +148,6 @@ impl TransactionManifest { Ok(manifest) } - pub fn modify_add_guarantees_vec( - self, - guarantees: Vec, - ) -> Result { - self.modify_add_guarantees(guarantees) - } - - pub fn modify_add_lock_fee( - self, - address_of_fee_payer: &AccountAddress, - fee: Option, - ) -> Self { - let fee = fee.unwrap_or(default_fee()); - let instruction = single(|b| b.lock_fee(address_of_fee_payer, fee)); - self.prepend_instruction(instruction) - } - - fn prepend_instruction(self, instruction: ScryptoInstruction) -> Self { - self.insert_instruction(InstructionPosition::First, instruction) - } - fn insert_instruction( self, position: InstructionPosition, @@ -159,14 +174,13 @@ impl TransactionManifest { } } -enum InstructionPosition { +pub enum InstructionPosition { First, At(u64), } #[cfg(test)] mod tests { - use radix_engine_interface::blueprints::account::AccountLockFeeInput; use radix_transactions::manifest::{AssertWorktopContains, DropAllProofs}; use super::*; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/sample_resource_definition_metadata.json b/crates/sargon-manifests/src/sample_resource_definition_metadata.json similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/sample_resource_definition_metadata.json rename to crates/sargon-manifests/src/sample_resource_definition_metadata.json diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/third_party_deposit_update/manifest_third_party_deposit_update.rs b/crates/sargon-manifests/src/third_party_deposit_update/manifest_third_party_deposit_update.rs similarity index 93% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/third_party_deposit_update/manifest_third_party_deposit_update.rs rename to crates/sargon-manifests/src/third_party_deposit_update/manifest_third_party_deposit_update.rs index 938169401..b0c92cc7e 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/third_party_deposit_update/manifest_third_party_deposit_update.rs +++ b/crates/sargon-manifests/src/third_party_deposit_update/manifest_third_party_deposit_update.rs @@ -8,20 +8,27 @@ use radix_engine_interface::blueprints::account::{ ACCOUNT_SET_RESOURCE_PREFERENCE_IDENT, }; -impl TransactionManifest { - pub fn third_party_deposit_update( +pub trait TransactionManifestThirdPartyDepositUpdating: Sized { + fn third_party_deposit_update_by_delta( + owner: &AccountAddress, + delta: ThirdPartyDepositsDelta, + ) -> TransactionManifest; + + fn third_party_deposit_update( owner: &AccountAddress, from: ThirdPartyDeposits, to: ThirdPartyDeposits, - ) -> Self { + ) -> TransactionManifest { let delta = ThirdPartyDepositsDelta::new(from, to); Self::third_party_deposit_update_by_delta(owner, delta) } +} - pub fn third_party_deposit_update_by_delta( +impl TransactionManifestThirdPartyDepositUpdating for TransactionManifest { + fn third_party_deposit_update_by_delta( owner: &AccountAddress, delta: ThirdPartyDepositsDelta, - ) -> Self { + ) -> TransactionManifest { let mut builder = ScryptoTransactionManifestBuilder::new(); if let Some(deposit_rule) = delta.deposit_rule { diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/third_party_deposit_update/mod.rs b/crates/sargon-manifests/src/third_party_deposit_update/mod.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/third_party_deposit_update/mod.rs rename to crates/sargon-manifests/src/third_party_deposit_update/mod.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/third_party_deposit_update/third_party_deposits_delta.rs b/crates/sargon-manifests/src/third_party_deposit_update/third_party_deposits_delta.rs similarity index 94% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/third_party_deposit_update/third_party_deposits_delta.rs rename to crates/sargon-manifests/src/third_party_deposit_update/third_party_deposits_delta.rs index d37e3e042..37f4bec2b 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/third_party_deposit_update/third_party_deposits_delta.rs +++ b/crates/sargon-manifests/src/third_party_deposit_update/third_party_deposits_delta.rs @@ -3,7 +3,6 @@ use crate::prelude::*; use radix_engine_interface::blueprints::account::{ AccountAddAuthorizedDepositorInput as ScryptoAccountAddAuthorizedDepositorInput, AccountRemoveAuthorizedDepositorInput as ScryptoAccountRemoveAuthorizedDepositorInput, - AccountRemoveResourcePreferenceInput as ScryptoAccountRemoveResourcePreferenceInput, AccountSetResourcePreferenceInput as ScryptoAccountSetResourcePreferenceInput, }; @@ -99,34 +98,6 @@ impl ThirdPartyDepositsDelta { } } -impl From for ScryptoAccountSetResourcePreferenceInput { - fn from(value: AssetException) -> Self { - Self { - resource_address: value.address.into(), - resource_preference: value.exception_rule.into(), - } - } -} - -impl From for ScryptoManifestValue { - fn from(value: AssetException) -> Self { - ScryptoManifestValue::from(value.address) - } -} - -impl From for ScryptoResourcePreference { - fn from(value: DepositAddressExceptionRule) -> Self { - match value { - DepositAddressExceptionRule::Allow => { - ScryptoResourcePreference::Allowed - } - DepositAddressExceptionRule::Deny => { - ScryptoResourcePreference::Disallowed - } - } - } -} - impl HasSampleValues for ThirdPartyDepositsDelta { fn sample() -> Self { Self::new( @@ -147,6 +118,8 @@ impl HasSampleValues for ThirdPartyDepositsDelta { mod tests { use super::*; + use radix_engine_interface::blueprints::account::AccountRemoveResourcePreferenceInput as ScryptoAccountRemoveResourcePreferenceInput; + #[allow(clippy::upper_case_acronyms)] type SUT = ThirdPartyDepositsDelta; diff --git a/crates/sargon-profile-app-preferences/Cargo.toml b/crates/sargon-profile-app-preferences/Cargo.toml new file mode 100644 index 000000000..32da16d33 --- /dev/null +++ b/crates/sargon-profile-app-preferences/Cargo.toml @@ -0,0 +1,62 @@ +[package] +name = "sargon-profile-app-preferences" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === INTERNAL DEPENDENCIES === +sargon-core = { path = "../sargon-core" } +identified-vec-of = { path = "../identified-vec-of" } +sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } +sargon-factors = { path = "../sargon-factors" } +sargon-keys-collector = { path = "../sargon-keys-collector" } +sargon-addresses = { path = "../sargon-addresses" } +sargon-transaction-models = { path = "../sargon-transaction-models" } +sargon-profile-gateway = { path = "../sargon-profile-gateway" } +sargon-profile-security-structures = { path = "../sargon-profile-security-structures" } + +# === RADIX DEPENDENCIES === +radix-common = { workspace = true } +radix-common-derive = { workspace = true } +radix-engine = { workspace = true } +radix-engine-interface = { workspace = true } +radix-engine-toolkit = { workspace = true } +radix-engine-toolkit-common = { workspace = true } +radix-rust = { workspace = true } +radix-transactions = { workspace = true } +sbor = { workspace = true } + +# === EXTERNAL DEPENDENCIES === +aes-gcm = { workspace = true } +assert-json-diff = { workspace = true } +async-std = { workspace = true } +async-trait = { workspace = true } +base64 = { workspace = true } +camino = { workspace = true } +delegate = { workspace = true } +derive_more = { workspace = true } +enum-as-inner = { workspace = true } +enum-iterator = { workspace = true } +futures = { workspace = true } +hex = { workspace = true } +hkdf = { workspace = true } +iota-crypto = { workspace = true } +iso8601-timestamp = { workspace = true } +itertools = { workspace = true } +k256 = { workspace = true } +log = { workspace = true } +once_cell = { workspace = true } +paste = { workspace = true } +pretty_assertions = { workspace = true } +pretty_env_logger = { workspace = true } +rand = { workspace = true } +reqwest = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +serde_repr = { workspace = true } +serde_with = { workspace = true } +strum = { workspace = true } +thiserror = { workspace = true } +url = { workspace = true } +uuid = { workspace = true } +zeroize = { workspace = true } diff --git a/crates/sargon/src/profile/v100/app_preferences/app_display_settings/app_display_settings.rs b/crates/sargon-profile-app-preferences/src/app_display_settings/app_display_settings.rs similarity index 100% rename from crates/sargon/src/profile/v100/app_preferences/app_display_settings/app_display_settings.rs rename to crates/sargon-profile-app-preferences/src/app_display_settings/app_display_settings.rs diff --git a/crates/sargon/src/profile/v100/app_preferences/app_display_settings/fiat_currency.rs b/crates/sargon-profile-app-preferences/src/app_display_settings/fiat_currency.rs similarity index 100% rename from crates/sargon/src/profile/v100/app_preferences/app_display_settings/fiat_currency.rs rename to crates/sargon-profile-app-preferences/src/app_display_settings/fiat_currency.rs diff --git a/crates/sargon/src/profile/v100/app_preferences/app_display_settings/mod.rs b/crates/sargon-profile-app-preferences/src/app_display_settings/mod.rs similarity index 100% rename from crates/sargon/src/profile/v100/app_preferences/app_display_settings/mod.rs rename to crates/sargon-profile-app-preferences/src/app_display_settings/mod.rs diff --git a/crates/sargon/src/profile/v100/app_preferences/app_preferences.rs b/crates/sargon-profile-app-preferences/src/app_preferences.rs similarity index 100% rename from crates/sargon/src/profile/v100/app_preferences/app_preferences.rs rename to crates/sargon-profile-app-preferences/src/app_preferences.rs diff --git a/crates/sargon-profile-app-preferences/src/lib.rs b/crates/sargon-profile-app-preferences/src/lib.rs new file mode 100644 index 000000000..769ec8458 --- /dev/null +++ b/crates/sargon-profile-app-preferences/src/lib.rs @@ -0,0 +1,14 @@ +mod app_display_settings; +mod app_preferences; +mod security; +mod transaction_preferences; + +pub mod prelude { + pub use crate::app_display_settings::*; + pub use crate::app_preferences::*; + pub use crate::security::*; + pub use crate::transaction_preferences::*; + + pub use sargon_profile_gateway::prelude::*; + pub use sargon_profile_security_structures::prelude::*; +} diff --git a/crates/sargon/src/profile/v100/app_preferences/security.rs b/crates/sargon-profile-app-preferences/src/security.rs similarity index 100% rename from crates/sargon/src/profile/v100/app_preferences/security.rs rename to crates/sargon-profile-app-preferences/src/security.rs diff --git a/crates/sargon/src/profile/v100/app_preferences/transaction_preferences.rs b/crates/sargon-profile-app-preferences/src/transaction_preferences.rs similarity index 100% rename from crates/sargon/src/profile/v100/app_preferences/transaction_preferences.rs rename to crates/sargon-profile-app-preferences/src/transaction_preferences.rs diff --git a/crates/sargon-profile-gateway/Cargo.toml b/crates/sargon-profile-gateway/Cargo.toml new file mode 100644 index 000000000..8c7616236 --- /dev/null +++ b/crates/sargon-profile-gateway/Cargo.toml @@ -0,0 +1,60 @@ +[package] +name = "sargon-profile-gateway" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === INTERNAL DEPENDENCIES === +sargon-core = { path = "../sargon-core" } +identified-vec-of = { path = "../identified-vec-of" } +sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } +sargon-factors = { path = "../sargon-factors" } +sargon-keys-collector = { path = "../sargon-keys-collector" } +sargon-addresses = { path = "../sargon-addresses" } +sargon-transaction-models = { path = "../sargon-transaction-models" } + +# === RADIX DEPENDENCIES === +radix-common = { workspace = true } +radix-common-derive = { workspace = true } +radix-engine = { workspace = true } +radix-engine-interface = { workspace = true } +radix-engine-toolkit = { workspace = true } +radix-engine-toolkit-common = { workspace = true } +radix-rust = { workspace = true } +radix-transactions = { workspace = true } +sbor = { workspace = true } + +# === EXTERNAL DEPENDENCIES === +aes-gcm = { workspace = true } +assert-json-diff = { workspace = true } +async-std = { workspace = true } +async-trait = { workspace = true } +base64 = { workspace = true } +camino = { workspace = true } +delegate = { workspace = true } +derive_more = { workspace = true } +enum-as-inner = { workspace = true } +enum-iterator = { workspace = true } +futures = { workspace = true } +hex = { workspace = true } +hkdf = { workspace = true } +iota-crypto = { workspace = true } +iso8601-timestamp = { workspace = true } +itertools = { workspace = true } +k256 = { workspace = true } +log = { workspace = true } +once_cell = { workspace = true } +paste = { workspace = true } +pretty_assertions = { workspace = true } +pretty_env_logger = { workspace = true } +rand = { workspace = true } +reqwest = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +serde_repr = { workspace = true } +serde_with = { workspace = true } +strum = { workspace = true } +thiserror = { workspace = true } +url = { workspace = true } +uuid = { workspace = true } +zeroize = { workspace = true } diff --git a/crates/sargon/src/profile/v100/app_preferences/gateways/gateway.rs b/crates/sargon-profile-gateway/src/gateway.rs similarity index 98% rename from crates/sargon/src/profile/v100/app_preferences/gateways/gateway.rs rename to crates/sargon-profile-gateway/src/gateway.rs index 07bdc181c..60c1690ff 100644 --- a/crates/sargon/src/profile/v100/app_preferences/gateways/gateway.rs +++ b/crates/sargon-profile-gateway/src/gateway.rs @@ -1,7 +1,6 @@ use sargon_core::parse_url; use crate::prelude::*; -use std::ops::Deref; /// A gateway to some Radix Network, which is a high level REST API which clients (wallets) can /// consume in order to query asset balances and submit transactions. @@ -69,7 +68,7 @@ impl Gateway { } impl Gateway { - pub(crate) fn declare(url: &str, id: NetworkID) -> Self { + pub fn declare(url: &str, id: NetworkID) -> Self { Self::new(url.to_string(), id).expect("Valid").clone() } } diff --git a/crates/sargon-profile-gateway/src/lib.rs b/crates/sargon-profile-gateway/src/lib.rs new file mode 100644 index 000000000..7740fdc76 --- /dev/null +++ b/crates/sargon-profile-gateway/src/lib.rs @@ -0,0 +1,13 @@ +mod gateway; +mod network_definition; +mod saved_gateways; + +pub mod prelude { + pub use crate::gateway::*; + pub use crate::network_definition::*; + pub use crate::saved_gateways::*; + + pub(crate) use sargon_core::prelude::*; +} + +pub use prelude::*; diff --git a/crates/sargon/src/profile/v100/app_preferences/gateways/network_definition.rs b/crates/sargon-profile-gateway/src/network_definition.rs similarity index 99% rename from crates/sargon/src/profile/v100/app_preferences/gateways/network_definition.rs rename to crates/sargon-profile-gateway/src/network_definition.rs index 02f8571ce..5ae9af1ab 100644 --- a/crates/sargon/src/profile/v100/app_preferences/gateways/network_definition.rs +++ b/crates/sargon-profile-gateway/src/network_definition.rs @@ -1,7 +1,5 @@ use crate::prelude::*; -use crate::NetworkID::{self, *}; - /// A version of the Radix Network, for a NetworkID with an identifier (name) and display description (display name) #[derive( Serialize, @@ -45,6 +43,8 @@ impl NetworkDefinition { } } +use sargon_core::NetworkID; +use NetworkID::*; impl NetworkDefinition { /// The Radix mainnet, the "real" Network on which all launched Dapps and /// assets with any real value resides. diff --git a/crates/sargon/src/profile/v100/app_preferences/gateways/saved_gateways.rs b/crates/sargon-profile-gateway/src/saved_gateways.rs similarity index 74% rename from crates/sargon/src/profile/v100/app_preferences/gateways/saved_gateways.rs rename to crates/sargon-profile-gateway/src/saved_gateways.rs index 427e225e8..f6bf7d15c 100644 --- a/crates/sargon/src/profile/v100/app_preferences/gateways/saved_gateways.rs +++ b/crates/sargon-profile-gateway/src/saved_gateways.rs @@ -1,3 +1,5 @@ +use sargon_core::decl_identified_vec_of; + use crate::prelude::*; decl_identified_vec_of!( @@ -40,7 +42,6 @@ impl SavedGateways { } impl Serialize for SavedGateways { - #[cfg(not(tarpaulin_include))] // false negative fn serialize( &self, serializer: S, @@ -56,7 +57,6 @@ impl Serialize for SavedGateways { } impl<'de> Deserialize<'de> for SavedGateways { - #[cfg(not(tarpaulin_include))] // false negative fn deserialize>( deserializer: D, ) -> Result { @@ -163,23 +163,6 @@ mod tests { assert_ne!(SUT::sample(), SUT::sample_other()); } - #[test] - fn append() { - let mut sut = SUT::sample(); - assert!(!sut.append(Gateway::mainnet())); - assert!(!sut.append(Gateway::stokenet())); - assert_eq!(sut, SUT::sample()); - assert!(sut.append(Gateway::kisharnet())); - assert_eq!( - sut, - SUT::new_with_other( - Gateway::mainnet(), - [Gateway::stokenet(), Gateway::kisharnet()] - ) - .unwrap() - ); - } - #[test] fn new_throw_gateways_discrepancy_other_should_not_contain_current() { assert_eq!( @@ -188,17 +171,6 @@ mod tests { ); } - #[test] - fn change_current_to_current() { - let mut sut = SUT::default(); - assert_eq!(sut.current.network.id, NetworkID::Mainnet); - assert_eq!( - sut.change_current(Gateway::mainnet()), - ChangeGatewayOutcome::NoChange - ); - assert_eq!(sut.current.network.id, NetworkID::Mainnet); - } - #[test] fn len() { let sut = SUT::new_with_other( @@ -244,61 +216,6 @@ mod tests { ) } - #[test] - fn deserialize_from_json_ignore_repetitions() { - let json = r#" - { - "current": "https://rcnet-v3.radixdlt.com/", - "saved": [ - { - "network": - { - "name": "zabanet", - "id": 14, - "displayDescription": "RCnet-V3 (Test Network)" - }, - "url": "https://rcnet-v3.radixdlt.com/" - }, - { - "network": - { - "name": "mainnet", - "id": 1, - "displayDescription": "Mainnet" - }, - "url": "https://mainnet.radixdlt.com/" - }, - { - "network": - { - "name": "stokenet", - "id": 2, - "displayDescription": "Stokenet" - }, - "url": "https://babylon-stokenet-gateway.radixdlt.com/" - }, - { - "network": - { - "name": "different", - "id": 11, - "displayDescription": "All differs but Url is the same than stokenet" - }, - "url": "https://babylon-stokenet-gateway.radixdlt.com/" - } - ] - } - "#; - - let sut = serde_json::from_str::(json).unwrap(); - - let mut expected = SUT::new(Gateway::rcnet()); - expected.append(Gateway::mainnet()); - expected.append(Gateway::stokenet()); - - assert_eq!(sut, expected); - } - #[test] fn deserialize_from_json_with_different_description_treats_both_gateways_as_wellknown( ) { diff --git a/crates/sargon-profile-logic/Cargo.toml b/crates/sargon-profile-logic/Cargo.toml new file mode 100644 index 000000000..f1a52e238 --- /dev/null +++ b/crates/sargon-profile-logic/Cargo.toml @@ -0,0 +1,32 @@ +[package] +name = "sargon-profile-logic" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +sargon-core = { path = "../sargon-core" } +identified-vec-of = { path = "../identified-vec-of" } +sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } +sargon-factors = { path = "../sargon-factors" } +sargon-addresses = { path = "../sargon-addresses" } +sargon-profile = { path = "../sargon-profile" } +sargon-profile-supporting-types = { path = "../sargon-profile-supporting-types" } + +# === RADIX DEPENDENCIES === +radix-common = { workspace = true } +radix-common-derive = { workspace = true } +radix-engine = { workspace = true } +radix-engine-interface = { workspace = true } +radix-engine-toolkit = { workspace = true } +radix-engine-toolkit-common = { workspace = true } +radix-rust = { workspace = true } +radix-transactions = { workspace = true } +sbor = { workspace = true } + +# === EXTERNAL DEPENDENCIES === +derive_more = { workspace = true } +itertools = { workspace = true } +pretty_assertions = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } diff --git a/crates/sargon-profile-logic/src/lib.rs b/crates/sargon-profile-logic/src/lib.rs new file mode 100644 index 000000000..fd9201baf --- /dev/null +++ b/crates/sargon-profile-logic/src/lib.rs @@ -0,0 +1,13 @@ +mod logic; +mod tests; + +pub mod prelude { + pub use crate::logic::*; + + pub use sargon_profile::prelude::*; + pub use sargon_profile_supporting_types::prelude::*; + + pub use itertools::*; +} + +pub use prelude::*; diff --git a/crates/sargon/src/profile/logic/account/account_visibility.rs b/crates/sargon-profile-logic/src/logic/account/account_visibility.rs similarity index 86% rename from crates/sargon/src/profile/logic/account/account_visibility.rs rename to crates/sargon-profile-logic/src/logic/account/account_visibility.rs index 9b116bd87..905a4ea6e 100644 --- a/crates/sargon/src/profile/logic/account/account_visibility.rs +++ b/crates/sargon-profile-logic/src/logic/account/account_visibility.rs @@ -1,13 +1,18 @@ use crate::prelude::*; -impl Account { +pub trait AccountVisibility { + fn mark_as_hidden(&mut self); + fn mark_as_tombstoned(&mut self); +} + +impl AccountVisibility for Account { /// Marks the account as hidden - pub fn mark_as_hidden(&mut self) { + fn mark_as_hidden(&mut self) { self.flags.insert_flag(EntityFlag::HiddenByUser); } /// Marks the account as tombstoned - pub fn mark_as_tombstoned(&mut self) { + fn mark_as_tombstoned(&mut self) { self.flags.insert_flag(EntityFlag::TombstonedByUser); self.flags.remove_flag(&EntityFlag::HiddenByUser); } diff --git a/crates/sargon/src/profile/logic/account/accounts_visibility.rs b/crates/sargon-profile-logic/src/logic/account/accounts_visibility.rs similarity index 100% rename from crates/sargon/src/profile/logic/account/accounts_visibility.rs rename to crates/sargon-profile-logic/src/logic/account/accounts_visibility.rs diff --git a/crates/sargon/src/profile/logic/account/mod.rs b/crates/sargon-profile-logic/src/logic/account/mod.rs similarity index 82% rename from crates/sargon/src/profile/logic/account/mod.rs rename to crates/sargon-profile-logic/src/logic/account/mod.rs index c19bc7be8..342a81de5 100644 --- a/crates/sargon/src/profile/logic/account/mod.rs +++ b/crates/sargon-profile-logic/src/logic/account/mod.rs @@ -1,11 +1,9 @@ mod account_visibility; mod accounts_visibility; -mod create_account; mod query_accounts; mod query_security_structures; pub use account_visibility::*; pub use accounts_visibility::*; -pub use create_account::*; pub use query_accounts::*; pub use query_security_structures::*; diff --git a/crates/sargon/src/profile/logic/account/query_accounts.rs b/crates/sargon-profile-logic/src/logic/account/query_accounts.rs similarity index 56% rename from crates/sargon/src/profile/logic/account/query_accounts.rs rename to crates/sargon-profile-logic/src/logic/account/query_accounts.rs index 37e244ff7..ea05aaabc 100644 --- a/crates/sargon/src/profile/logic/account/query_accounts.rs +++ b/crates/sargon-profile-logic/src/logic/account/query_accounts.rs @@ -1,44 +1,27 @@ use crate::prelude::*; -impl Profile { - /// Returns the non-hidden accounts on the current network, empty if no accounts - /// on the network - pub fn accounts_on_current_network(&self) -> Result { - self.current_network().map(|n| n.accounts.visible()) - } - - /// Returns the hidden accounts on the current network, empty if no hidden accounts - /// on the network - pub fn hidden_accounts_on_current_network(&self) -> Result { - self.current_network().map(|n| n.accounts.hidden()) - } +pub trait ProfileAccountsOnAllNetworksIncludingHidden { + fn accounts_on_all_networks_including_hidden(&self) -> Accounts; +} +impl ProfileAccountsOnAllNetworksIncludingHidden for Profile { /// Returns **ALL** accounts - including hidden/deleted ones, on **ALL** networks. - pub fn accounts_on_all_networks_including_hidden(&self) -> Accounts { + fn accounts_on_all_networks_including_hidden(&self) -> Accounts { self.networks .iter() .flat_map(|n| n.accounts.clone().into_iter()) .collect::() } +} - /// Returns the non-hidden accounts on the current network as `AccountForDisplay` - pub fn accounts_for_display_on_current_network( - &self, - ) -> Result { - self.accounts_on_current_network().map(|accounts| { - accounts - .iter() - .map(AccountForDisplay::from) - .collect::() - }) - } +pub trait ProfileAccountByAddress { + fn account_by_address(&self, address: AccountAddress) -> Result; +} +impl ProfileAccountByAddress for Profile { /// Looks up the account by account address, returns Err if the account is /// unknown, will return a hidden, or tombstoned account if queried for. - pub fn account_by_address( - &self, - address: AccountAddress, - ) -> Result { + fn account_by_address(&self, address: AccountAddress) -> Result { for network in self.networks.iter() { if let Some(account) = network.accounts.get_id(address) { return Ok(account.clone()); @@ -46,8 +29,17 @@ impl Profile { } Err(CommonError::UnknownAccount) } +} + +pub trait ProfileEntityByAddress { + fn entity_by_address( + &self, + entity_address: AddressOfAccountOrPersona, + ) -> Result; +} - pub fn entity_by_address( +impl ProfileEntityByAddress for Profile { + fn entity_by_address( &self, entity_address: AddressOfAccountOrPersona, ) -> Result { @@ -60,22 +52,17 @@ impl Profile { CommonError::UnknownPersona }) } +} - pub fn get_entities_of_kind_on_network_in_key_space( +pub trait ProfileEntitiesOfKindOnNetworkInKeySpace { + fn get_entities_of_kind_on_network_in_key_space( &self, entity_kind: CAP26EntityKind, network_id: NetworkID, key_space: KeySpace, - ) -> IndexSet { - self.networks - .get_id(network_id) - .map(|n| { - n.get_entities_of_kind_in_key_space(entity_kind, key_space) - }) - .unwrap_or_default() - } + ) -> IndexSet; - pub fn get_unsecurified_entities_of_kind_on_network( + fn get_unsecurified_entities_of_kind_on_network( &self, entity_kind: CAP26EntityKind, network_id: NetworkID, @@ -84,7 +71,7 @@ impl Profile { entity_kind, network_id, // We don't support unhardened paths really. CAP26 dictates all path components are hardened. - // And all out BIP44 LIKE paths from Olymlia are (contrary to BIP44) in fact hardened + // And all out BIP44 LIKE paths from Olympia are (contrary to BIP44) in fact hardened KeySpace::Unsecurified { is_hardened: true }, ) .into_iter() @@ -102,7 +89,7 @@ impl Profile { .collect() } - pub fn unsecurified_accounts_on_network( + fn unsecurified_accounts_on_network( &self, network_id: NetworkID, ) -> IndexSet { @@ -112,7 +99,7 @@ impl Profile { ) } - pub fn get_securified_entities_of_kind_on_network< + fn get_securified_entities_of_kind_on_network< E: IsSecurifiedEntity + HasEntityKind + TryFrom, >( &self, @@ -128,12 +115,91 @@ impl Profile { .collect() } - pub fn securified_accounts_on_network( + fn securified_accounts_on_network( &self, network_id: NetworkID, ) -> IndexSet { self.get_securified_entities_of_kind_on_network(network_id) } + + fn unsecurified_personas_on_network( + &self, + network_id: NetworkID, + ) -> IndexSet { + self.get_unsecurified_entities_of_kind_on_network( + CAP26EntityKind::Identity, + network_id, + ) + } + + fn securified_personas_on_network( + &self, + network_id: NetworkID, + ) -> IndexSet { + self.get_securified_entities_of_kind_on_network(network_id) + } + + /// Returns the non-hidden personas on the current network, empty if no personas + /// on the network + fn personas_on_current_network(&self) -> Result; + + /// Returns the hidden personas on the current network, empty if no hidden personas + /// on the network + fn hidden_personas_on_current_network(&self) -> Result; + + /// Returns **ALL** personas - including hidden/deleted ones, on **ALL** networks. + fn personas_on_all_networks_including_hidden(&self) -> Personas; + + /// Looks up the persona by identity address, returns Err if the persona is + /// unknown, will return a hidden persona if queried for. + fn persona_by_address(&self, address: IdentityAddress) -> Result; +} + +impl ProfileEntitiesOfKindOnNetworkInKeySpace for Profile { + /// Returns the non-hidden personas on the current network, empty if no personas + /// on the network + fn personas_on_current_network(&self) -> Result { + self.current_network().map(|n| n.personas.non_hidden()) + } + + /// Returns the hidden personas on the current network, empty if no hidden personas + /// on the network + fn hidden_personas_on_current_network(&self) -> Result { + self.current_network().map(|n| n.personas.hidden()) + } + + /// Returns **ALL** personas - including hidden/deleted ones, on **ALL** networks. + fn personas_on_all_networks_including_hidden(&self) -> Personas { + self.networks + .iter() + .flat_map(|n| n.personas.clone().into_iter()) + .collect::() + } + + /// Looks up the persona by identity address, returns Err if the persona is + /// unknown, will return a hidden persona if queried for. + fn persona_by_address(&self, address: IdentityAddress) -> Result { + for network in self.networks.iter() { + if let Some(persona) = network.personas.get_id(address) { + return Ok(persona.clone()); + } + } + Err(CommonError::UnknownPersona) + } + + fn get_entities_of_kind_on_network_in_key_space( + &self, + entity_kind: CAP26EntityKind, + network_id: NetworkID, + key_space: KeySpace, + ) -> IndexSet { + self.networks + .get_id(network_id) + .map(|n| { + n.get_entities_of_kind_in_key_space(entity_kind, key_space) + }) + .unwrap_or_default() + } } #[cfg(test)] diff --git a/crates/sargon/src/profile/logic/account/query_security_structures.rs b/crates/sargon-profile-logic/src/logic/account/query_security_structures.rs similarity index 89% rename from crates/sargon/src/profile/logic/account/query_security_structures.rs rename to crates/sargon-profile-logic/src/logic/account/query_security_structures.rs index 04b96c3d7..363d32585 100644 --- a/crates/sargon/src/profile/logic/account/query_security_structures.rs +++ b/crates/sargon-profile-logic/src/logic/account/query_security_structures.rs @@ -18,10 +18,16 @@ impl HasSampleValues for SecurityStructuresOfFactorSources { } } -impl Profile { +pub trait ProfileSecurityStructuresOfFactorSources { + fn security_structures_of_factor_sources( + &self, + ) -> Result; +} + +impl ProfileSecurityStructuresOfFactorSources for Profile { /// Returns all the SecurityStructuresOfFactorSources, /// by trying to map FactorSourceID level -> FactorSource Level - pub fn security_structures_of_factor_sources( + fn security_structures_of_factor_sources( &self, ) -> Result { self.app_preferences @@ -38,14 +44,20 @@ impl Profile { } } -impl Profile { +pub trait ProfileSecurityShieldPrerequisitesStatus { + fn security_shield_prerequisites_status( + &self, + ) -> SecurityShieldPrerequisitesStatus; +} + +impl ProfileSecurityShieldPrerequisitesStatus for Profile { /// Returns the status of the prerequisites for building a Security Shield. /// /// According to [definition][doc], a Security Shield can be built if the user has, asides from /// the Identity factor, "2 or more factors, one of which must be Hardware" /// /// [doc]: https://radixdlt.atlassian.net/wiki/spaces/AT/pages/3758063620/MFA+Rules+for+Factors+and+Security+Shields#Factor-Prerequisites - pub fn security_shield_prerequisites_status( + fn security_shield_prerequisites_status( &self, ) -> SecurityShieldPrerequisitesStatus { let factor_source_ids = self diff --git a/crates/sargon-profile-logic/src/logic/authorized_dapps_logic.rs b/crates/sargon-profile-logic/src/logic/authorized_dapps_logic.rs new file mode 100644 index 000000000..95fc8eced --- /dev/null +++ b/crates/sargon-profile-logic/src/logic/authorized_dapps_logic.rs @@ -0,0 +1,29 @@ +use crate::prelude::*; + +pub trait ReferencedAccountRemoving { + fn remove_referenced_account(&mut self, account_address: &AccountAddress); +} + +impl ReferencedAccountRemoving for AuthorizedDapps { + /// Remove referenced account from all the dApps + fn remove_referenced_account(&mut self, account_address: &AccountAddress) { + self.update_all_with(|dapp| { + dapp.remove_referenced_account(account_address); + }) + } +} + +pub trait AuthorizedDappUpdating { + /// Removes the referenced account for this dApp + fn remove_referenced_account(&mut self, account_address: &AccountAddress); +} + +impl AuthorizedDappUpdating for AuthorizedDapp { + /// Removes the referenced account for this dApp + fn remove_referenced_account(&mut self, account_address: &AccountAddress) { + self.references_to_authorized_personas + .update_all_with(|persona| { + persona.remove_shared_account(account_address); + }); + } +} diff --git a/crates/sargon/src/profile/logic/gateway/current_gateway.rs b/crates/sargon-profile-logic/src/logic/gateway/current_gateway.rs similarity index 51% rename from crates/sargon/src/profile/logic/gateway/current_gateway.rs rename to crates/sargon-profile-logic/src/logic/gateway/current_gateway.rs index 6dad37b51..47b80b45d 100644 --- a/crates/sargon/src/profile/logic/gateway/current_gateway.rs +++ b/crates/sargon-profile-logic/src/logic/gateway/current_gateway.rs @@ -1,22 +1,56 @@ use crate::prelude::*; -impl Profile { +pub trait ProfileCurrentGateway { + fn current_gateway(&self) -> Gateway; + + /// The NetworkID currently being used, dependent on `current` gateway in + /// AppPreferences + fn current_network_id(&self) -> NetworkID { + self.current_gateway().network.id + } +} + +impl ProfileCurrentGateway for Profile { /// Returns the `current` gateway in AppPreferences, used by host clients to /// know the NetworkID currently being used. - pub fn current_gateway(&self) -> Gateway { + fn current_gateway(&self) -> Gateway { self.app_preferences.gateways.current.clone() } +} - /// The NetworkID currently being used, dependent on `current` gateway in - /// AppPreferences - pub fn current_network_id(&self) -> NetworkID { - self.current_gateway().network.id +pub trait ProfileCurrentNetwork { + fn current_network(&self) -> Result<&ProfileNetwork>; + + /// Returns the non-hidden accounts on the current network, empty if no accounts + /// on the network + fn accounts_on_current_network(&self) -> Result { + self.current_network().map(|n| n.accounts.visible()) + } + + /// Returns the non-hidden accounts on the current network as `AccountForDisplay` + fn accounts_for_display_on_current_network( + &self, + ) -> Result { + self.accounts_on_current_network().map(|accounts| { + accounts + .iter() + .map(AccountForDisplay::from) + .collect::() + }) + } + + /// Returns the hidden accounts on the current network, empty if no hidden accounts + /// on the network + fn hidden_accounts_on_current_network(&self) -> Result { + self.current_network().map(|n| n.accounts.hidden()) } +} +impl ProfileCurrentNetwork for Profile { /// The ProfileNetwork of the currently used Network dependent on the `current` /// Gateway set in AppPreferences. This affects which Accounts users see in /// "Home screen" in wallet apps. - pub fn current_network(&self) -> Result<&ProfileNetwork> { + fn current_network(&self) -> Result<&ProfileNetwork> { let current_network_id = self.current_network_id(); self.networks.get_id(current_network_id).ok_or( CommonError::NoNetworkInProfile { @@ -56,11 +90,15 @@ impl HasSampleValues for ChangeGatewayOutcome { } } -impl SavedGateways { +pub trait SavedGatewaysChangeCurrent { + fn change_current(&mut self, to: Gateway) -> ChangeGatewayOutcome; +} + +impl SavedGatewaysChangeCurrent for SavedGateways { /// Changes the current Gateway to `to`, if it is not already the current. If `to` is /// not a new Gateway, it will be removed from. Returns `Ok(false)` if `to` was already /// the `current`, returns `Ok(true)` if `to` was not already `current`. - pub fn change_current(&mut self, to: Gateway) -> ChangeGatewayOutcome { + fn change_current(&mut self, to: Gateway) -> ChangeGatewayOutcome { if self.current == to { return ChangeGatewayOutcome::NoChange; } @@ -75,6 +113,11 @@ impl SavedGateways { self.current = to; ChangeGatewayOutcome::DidChange { is_new } } +} + +pub trait SavedGatewaysAppend { + fn append_to_other(&mut self, gateway: Gateway, is_switching: bool) + -> bool; /// Appends `gateway` to the `other` list if `gateway` not equals `current`, /// without changing the `current` Gateway. @@ -82,10 +125,12 @@ impl SavedGateways { /// If `other` was new then `(true, index_of_new)` is returned. /// /// - Returns: `true` if it was added, `false` if it was already present (noop) - pub fn append(&mut self, gateway: Gateway) -> bool { + fn append(&mut self, gateway: Gateway) -> bool { self.append_to_other(gateway, false) } +} +impl SavedGatewaysAppend for SavedGateways { fn append_to_other( &mut self, gateway: Gateway, @@ -143,4 +188,87 @@ mod tests { }; let _ = impossible.change_current(Gateway::stokenet()); } + + #[test] + fn change_current_to_current() { + let mut sut = SUT::default(); + assert_eq!(sut.current.network.id, NetworkID::Mainnet); + assert_eq!( + sut.change_current(Gateway::mainnet()), + ChangeGatewayOutcome::NoChange + ); + assert_eq!(sut.current.network.id, NetworkID::Mainnet); + } + + #[test] + fn append() { + let mut sut = SUT::sample(); + assert!(!sut.append(Gateway::mainnet())); + assert!(!sut.append(Gateway::stokenet())); + assert_eq!(sut, SUT::sample()); + assert!(sut.append(Gateway::kisharnet())); + assert_eq!( + sut, + SUT::new_with_other( + Gateway::mainnet(), + [Gateway::stokenet(), Gateway::kisharnet()] + ) + .unwrap() + ); + } + + #[test] + fn deserialize_from_json_ignore_repetitions() { + let json = r#" + { + "current": "https://rcnet-v3.radixdlt.com/", + "saved": [ + { + "network": + { + "name": "zabanet", + "id": 14, + "displayDescription": "RCnet-V3 (Test Network)" + }, + "url": "https://rcnet-v3.radixdlt.com/" + }, + { + "network": + { + "name": "mainnet", + "id": 1, + "displayDescription": "Mainnet" + }, + "url": "https://mainnet.radixdlt.com/" + }, + { + "network": + { + "name": "stokenet", + "id": 2, + "displayDescription": "Stokenet" + }, + "url": "https://babylon-stokenet-gateway.radixdlt.com/" + }, + { + "network": + { + "name": "different", + "id": 11, + "displayDescription": "All differs but Url is the same than stokenet" + }, + "url": "https://babylon-stokenet-gateway.radixdlt.com/" + } + ] + } + "#; + + let sut = serde_json::from_str::(json).unwrap(); + + let mut expected = SUT::new(Gateway::rcnet()); + expected.append(Gateway::mainnet()); + expected.append(Gateway::stokenet()); + + assert_eq!(sut, expected); + } } diff --git a/crates/sargon/src/profile/logic/gateway/mod.rs b/crates/sargon-profile-logic/src/logic/gateway/mod.rs similarity index 100% rename from crates/sargon/src/profile/logic/gateway/mod.rs rename to crates/sargon-profile-logic/src/logic/gateway/mod.rs diff --git a/crates/sargon-profile-logic/src/logic/instances_deriving_with_factor_sources.rs b/crates/sargon-profile-logic/src/logic/instances_deriving_with_factor_sources.rs new file mode 100644 index 000000000..cc8c28e1c --- /dev/null +++ b/crates/sargon-profile-logic/src/logic/instances_deriving_with_factor_sources.rs @@ -0,0 +1,77 @@ +// use crate::prelude::*; + +// trait InstancesDerivingWithFactorSources { +// fn derive_instances_for_factor_sources( +// network_id: NetworkID, +// quantity_per_factor: usize, +// derivation_presets: impl IntoIterator, +// sources: impl IntoIterator, +// ) -> IndexMap; +// } + +// impl InstancesDerivingWithFactorSources for MnemonicWithPassphrase { +// fn derive_instances_for_factor_sources( +// network_id: NetworkID, +// quantity_per_factor: usize, +// derivation_presets: impl IntoIterator, +// sources: impl IntoIterator, +// ) -> IndexMap { +// let next_index_assigner = NextDerivationEntityIndexAssigner::new( +// network_id, +// None, +// FactorInstancesCache::default(), +// ); + +// let derivation_presets = +// derivation_presets.into_iter().collect::>(); + +// sources +// .into_iter() +// .map(|fs| { +// let fsid = fs.id_from_hash(); +// let mwp = fsid.sample_associated_mnemonic(); + +// let paths = derivation_presets +// .clone() +// .into_iter() +// .map(|dp| (dp, quantity_per_factor)) +// .collect::>(); + +// let paths = paths +// .into_iter() +// .flat_map(|(derivation_preset, qty)| { +// // `qty` many paths +// (0..qty) +// .map(|_| { +// let index_agnostic_path = derivation_preset +// .index_agnostic_path_on_network(network_id); + +// next_index_assigner +// .next(fsid, index_agnostic_path) +// .map(|index| { +// DerivationPath::from_index_agnostic_path_and_component( +// index_agnostic_path, +// index, +// ) +// }) +// .unwrap() +// }) +// .collect::>() +// }) +// .collect::>(); + +// let instances = mwp +// .derive_public_keys(paths) +// .into_iter() +// .map(|public_key| { +// HierarchicalDeterministicFactorInstance::new( +// fsid, public_key, +// ) +// }) +// .collect::(); + +// (fsid, instances) +// }) +// .collect::>() +// } +// } diff --git a/crates/sargon/src/profile/logic/mod.rs b/crates/sargon-profile-logic/src/logic/mod.rs similarity index 66% rename from crates/sargon/src/profile/logic/mod.rs rename to crates/sargon-profile-logic/src/logic/mod.rs index 226511858..399864882 100644 --- a/crates/sargon/src/profile/logic/mod.rs +++ b/crates/sargon-profile-logic/src/logic/mod.rs @@ -1,17 +1,20 @@ mod account; -mod create_entity; +mod authorized_dapps_logic; mod gateway; +mod instances_deriving_with_factor_sources; mod persona; mod profile_header; mod profile_network; mod profile_networks; +mod profile_update; mod query_factor_sources; pub use account::*; -pub use create_entity::*; +pub use authorized_dapps_logic::*; pub use gateway::*; pub use persona::*; pub use profile_header::*; pub use profile_network::*; pub use profile_networks::*; +pub use profile_update::*; pub use query_factor_sources::*; diff --git a/crates/sargon/src/profile/logic/persona/mod.rs b/crates/sargon-profile-logic/src/logic/persona/mod.rs similarity index 77% rename from crates/sargon/src/profile/logic/persona/mod.rs rename to crates/sargon-profile-logic/src/logic/persona/mod.rs index 7d3338368..48b18bbe2 100644 --- a/crates/sargon/src/profile/logic/persona/mod.rs +++ b/crates/sargon-profile-logic/src/logic/persona/mod.rs @@ -1,9 +1,7 @@ -mod create_persona; mod persona_data_ids; mod query_personas; mod shared_persona_data_ids; -pub use create_persona::*; pub use persona_data_ids::*; pub use query_personas::*; pub use shared_persona_data_ids::*; diff --git a/crates/sargon/src/profile/logic/persona/persona_data_ids.rs b/crates/sargon-profile-logic/src/logic/persona/persona_data_ids.rs similarity index 62% rename from crates/sargon/src/profile/logic/persona/persona_data_ids.rs rename to crates/sargon-profile-logic/src/logic/persona/persona_data_ids.rs index 1a69b0be8..88f8899b4 100644 --- a/crates/sargon/src/profile/logic/persona/persona_data_ids.rs +++ b/crates/sargon-profile-logic/src/logic/persona/persona_data_ids.rs @@ -2,8 +2,12 @@ use radix_rust::prelude::IndexSet; use crate::prelude::*; -impl PersonaData { - pub fn ids_of_entries(&self) -> IndexSet { +pub trait PersonaDataIdsOfEntries { + fn ids_of_entries(&self) -> IndexSet; +} + +impl PersonaDataIdsOfEntries for PersonaData { + fn ids_of_entries(&self) -> IndexSet { let mut full_ids = IndexSet::::new(); if let Some(name) = &self.name { let _ = full_ids.insert(name.id); diff --git a/crates/sargon/src/profile/logic/persona/query_personas.rs b/crates/sargon-profile-logic/src/logic/persona/query_personas.rs similarity index 57% rename from crates/sargon/src/profile/logic/persona/query_personas.rs rename to crates/sargon-profile-logic/src/logic/persona/query_personas.rs index 209c8d707..4ed4395f7 100644 --- a/crates/sargon/src/profile/logic/persona/query_personas.rs +++ b/crates/sargon-profile-logic/src/logic/persona/query_personas.rs @@ -18,59 +18,6 @@ impl PersonasVisibility for Personas { } } -impl Profile { - pub fn unsecurified_personas_on_network( - &self, - network_id: NetworkID, - ) -> IndexSet { - self.get_unsecurified_entities_of_kind_on_network( - CAP26EntityKind::Identity, - network_id, - ) - } - - pub fn securified_personas_on_network( - &self, - network_id: NetworkID, - ) -> IndexSet { - self.get_securified_entities_of_kind_on_network(network_id) - } - - /// Returns the non-hidden personas on the current network, empty if no personas - /// on the network - pub fn personas_on_current_network(&self) -> Result { - self.current_network().map(|n| n.personas.non_hidden()) - } - - /// Returns the hidden personas on the current network, empty if no hidden personas - /// on the network - pub fn hidden_personas_on_current_network(&self) -> Result { - self.current_network().map(|n| n.personas.hidden()) - } - - /// Returns **ALL** personas - including hidden/deleted ones, on **ALL** networks. - pub fn personas_on_all_networks_including_hidden(&self) -> Personas { - self.networks - .iter() - .flat_map(|n| n.personas.clone().into_iter()) - .collect::() - } - - /// Looks up the persona by identity address, returns Err if the persona is - /// unknown, will return a hidden persona if queried for. - pub fn persona_by_address( - &self, - address: IdentityAddress, - ) -> Result { - for network in self.networks.iter() { - if let Some(persona) = network.personas.get_id(address) { - return Ok(persona.clone()); - } - } - Err(CommonError::UnknownPersona) - } -} - #[cfg(test)] mod personas_tests { use super::*; diff --git a/crates/sargon/src/profile/logic/persona/shared_persona_data_ids.rs b/crates/sargon-profile-logic/src/logic/persona/shared_persona_data_ids.rs similarity index 68% rename from crates/sargon/src/profile/logic/persona/shared_persona_data_ids.rs rename to crates/sargon-profile-logic/src/logic/persona/shared_persona_data_ids.rs index 79fa17eab..a2c45d83f 100644 --- a/crates/sargon/src/profile/logic/persona/shared_persona_data_ids.rs +++ b/crates/sargon-profile-logic/src/logic/persona/shared_persona_data_ids.rs @@ -1,8 +1,12 @@ use crate::prelude::*; use radix_rust::prelude::IndexSet; -impl SharedPersonaData { - pub fn ids_of_entries(&self) -> IndexSet { +pub trait SharedPersonaDataIdsOfEntries { + fn ids_of_entries(&self) -> IndexSet; +} + +impl SharedPersonaDataIdsOfEntries for SharedPersonaData { + fn ids_of_entries(&self) -> IndexSet { let mut full_ids = IndexSet::::new(); if let Some(name) = &self.name { let _ = full_ids.insert(*name); diff --git a/crates/sargon/src/profile/logic/profile_header.rs b/crates/sargon-profile-logic/src/logic/profile_header.rs similarity index 77% rename from crates/sargon/src/profile/logic/profile_header.rs rename to crates/sargon-profile-logic/src/logic/profile_header.rs index f019da25b..806877d8b 100644 --- a/crates/sargon/src/profile/logic/profile_header.rs +++ b/crates/sargon-profile-logic/src/logic/profile_header.rs @@ -1,9 +1,17 @@ use crate::prelude::*; -impl Header { +pub trait HeaderUpdating { + fn update( + &mut self, + content_hint: ContentHint, + maybe_device_info: impl Into>, + ); +} + +impl HeaderUpdating for Header { /// Updates `last_modified`, `content_hint` and also `last_used_on_device` if /// it was specified. - pub fn update( + fn update( &mut self, content_hint: ContentHint, maybe_device_info: impl Into>, @@ -16,10 +24,17 @@ impl Header { } } -impl Profile { +pub trait ProfileHeaderUpdating { + fn update_header( + &mut self, + maybe_device_info: impl Into>, + ); +} + +impl ProfileHeaderUpdating for Profile { /// Updates the header's fields: `last_modified`, `content_hint` and also /// `last_used_on_device` if it was specified. - pub fn update_header( + fn update_header( &mut self, maybe_device_info: impl Into>, ) { diff --git a/crates/sargon/src/profile/logic/profile_network/mod.rs b/crates/sargon-profile-logic/src/logic/profile_network/mod.rs similarity index 100% rename from crates/sargon/src/profile/logic/profile_network/mod.rs rename to crates/sargon-profile-logic/src/logic/profile_network/mod.rs diff --git a/crates/sargon/src/profile/logic/profile_network/profile_network_details.rs b/crates/sargon-profile-logic/src/logic/profile_network/profile_network_details.rs similarity index 91% rename from crates/sargon/src/profile/logic/profile_network/profile_network_details.rs rename to crates/sargon-profile-logic/src/logic/profile_network/profile_network_details.rs index ff40b9aa0..f98154353 100644 --- a/crates/sargon/src/profile/logic/profile_network/profile_network_details.rs +++ b/crates/sargon-profile-logic/src/logic/profile_network/profile_network_details.rs @@ -1,6 +1,26 @@ use crate::prelude::*; -impl AuthorizedPersonaSimple { +pub trait AuthorizedPersonaSimpleQueryState { + fn accounts_for_display( + &self, + non_hidden_accounts: &Accounts, + ) -> Result>; + + fn pick_persona_data_from_full( + &self, + full: &PersonaData, + ) -> Result; + + fn persona_from(&self, non_hidden_personas: &Personas) -> Result; + + fn detailed( + &self, + non_hidden_personas: &Personas, + non_hidden_accounts: &Accounts, + ) -> Result; +} + +impl AuthorizedPersonaSimpleQueryState for AuthorizedPersonaSimple { fn accounts_for_display( &self, non_hidden_accounts: &Accounts, @@ -129,8 +149,17 @@ impl AuthorizedPersonaSimple { } } -impl ProfileNetwork { - pub fn details_for_authorized_dapp( +pub trait ProfileNetworkDetailsForAuthorizedDapp: + ProfileNetworkEntitiesQuerying +{ + fn details_for_authorized_dapp( + &self, + dapp: &AuthorizedDapp, + ) -> Result; +} + +impl ProfileNetworkDetailsForAuthorizedDapp for ProfileNetwork { + fn details_for_authorized_dapp( &self, dapp: &AuthorizedDapp, ) -> Result { diff --git a/crates/sargon/src/profile/logic/profile_network/profile_network_entities_linked_to_factor_source.rs b/crates/sargon-profile-logic/src/logic/profile_network/profile_network_entities_linked_to_factor_source.rs similarity index 89% rename from crates/sargon/src/profile/logic/profile_network/profile_network_entities_linked_to_factor_source.rs rename to crates/sargon-profile-logic/src/logic/profile_network/profile_network_entities_linked_to_factor_source.rs index 974174be0..364050f89 100644 --- a/crates/sargon/src/profile/logic/profile_network/profile_network_entities_linked_to_factor_source.rs +++ b/crates/sargon-profile-logic/src/logic/profile_network/profile_network_entities_linked_to_factor_source.rs @@ -1,8 +1,16 @@ use crate::prelude::*; -impl ProfileNetwork { +pub trait ProfileNetworkQueryEntitiesLinkedToFactorSource { + fn entities_linked_to_factor_source( + &self, + factor_source: FactorSource, + integrity: FactorSourceIntegrity, + ) -> Result; +} + +impl ProfileNetworkQueryEntitiesLinkedToFactorSource for ProfileNetwork { /// Returns the entities linked to a given `FactorSource` on the current `ProfileNetwork`. - pub fn entities_linked_to_factor_source( + fn entities_linked_to_factor_source( &self, factor_source: FactorSource, integrity: FactorSourceIntegrity, diff --git a/crates/sargon/src/profile/logic/profile_network/profile_network_get_entities.rs b/crates/sargon-profile-logic/src/logic/profile_network/profile_network_get_entities.rs similarity index 81% rename from crates/sargon/src/profile/logic/profile_network/profile_network_get_entities.rs rename to crates/sargon-profile-logic/src/logic/profile_network/profile_network_get_entities.rs index 844d3889b..60dda83dd 100644 --- a/crates/sargon/src/profile/logic/profile_network/profile_network_get_entities.rs +++ b/crates/sargon-profile-logic/src/logic/profile_network/profile_network_get_entities.rs @@ -1,43 +1,16 @@ use crate::prelude::*; -impl ProfileNetwork { - pub fn accounts_non_hidden(&self) -> Accounts { - self.accounts.visible() - } - - pub fn accounts_hidden(&self) -> Accounts { - self.accounts.hidden() - } - - pub fn personas_non_hidden(&self) -> Personas { - self.personas.non_hidden() - } - - pub fn personas_hidden(&self) -> Personas { - self.personas.hidden() - } - - pub fn get_entities_erased( +pub trait ProfileNetworkEntitiesQuerying { + fn accounts_non_hidden(&self) -> Accounts; + fn accounts_hidden(&self) -> Accounts; + fn personas_non_hidden(&self) -> Personas; + fn personas_hidden(&self) -> Personas; + fn get_entities_erased( &self, entity_kind: CAP26EntityKind, - ) -> IndexSet { - match entity_kind { - CAP26EntityKind::Account => self - .accounts - .items() - .into_iter() - .map(AccountOrPersona::from) - .collect::>(), - CAP26EntityKind::Identity => self - .personas - .items() - .into_iter() - .map(AccountOrPersona::from) - .collect::>(), - } - } + ) -> IndexSet; - pub fn get_entities_of_kind_in_key_space( + fn get_entities_of_kind_in_key_space( &self, entity_kind: CAP26EntityKind, key_space: KeySpace, @@ -48,7 +21,7 @@ impl ProfileNetwork { .collect() } - pub fn entity_by_address( + fn entity_by_address( &self, entity_address: &AddressOfAccountOrPersona, ) -> Option { @@ -61,7 +34,7 @@ impl ProfileNetwork { entities.first().cloned() } - pub fn contains_entity_by_address( + fn contains_entity_by_address( &self, entity_address: &AddressOfAccountOrPersona, ) -> bool { @@ -69,6 +42,44 @@ impl ProfileNetwork { } } +impl ProfileNetworkEntitiesQuerying for ProfileNetwork { + fn accounts_non_hidden(&self) -> Accounts { + self.accounts.visible() + } + + fn accounts_hidden(&self) -> Accounts { + self.accounts.hidden() + } + + fn personas_non_hidden(&self) -> Personas { + self.personas.non_hidden() + } + + fn personas_hidden(&self) -> Personas { + self.personas.hidden() + } + + fn get_entities_erased( + &self, + entity_kind: CAP26EntityKind, + ) -> IndexSet { + match entity_kind { + CAP26EntityKind::Account => self + .accounts + .items() + .into_iter() + .map(AccountOrPersona::from) + .collect::>(), + CAP26EntityKind::Identity => self + .personas + .items() + .into_iter() + .map(AccountOrPersona::from) + .collect::>(), + } + } +} + #[cfg(test)] mod tests { use super::*; diff --git a/crates/sargon-profile-logic/src/logic/profile_networks.rs b/crates/sargon-profile-logic/src/logic/profile_networks.rs new file mode 100644 index 000000000..e9f0087a8 --- /dev/null +++ b/crates/sargon-profile-logic/src/logic/profile_networks.rs @@ -0,0 +1,403 @@ +use crate::prelude::*; + +pub trait ProfileHasAnyAccountOnAnyNetwork { + /// If the user has **any** accounts on any network at all, including hidden + /// accounts. This can be used by host devices to prompt user to create their + /// first account or not, e.g. if user starts app after fresh install, the + /// SargonOS will create an "empty" Profile and BDFS and save it, before user + /// has had the chance to create their first account. If the user force quits + /// the app and then restart it, the app can still prompt user to create their + /// first account - as if no force-restart happened. + fn has_any_account_on_any_network(&self) -> bool; + + fn contains_entity_by_address( + &self, + entity_address: &AddressOfAccountOrPersona, + ) -> bool; +} + +impl ProfileHasAnyAccountOnAnyNetwork for Profile { + /// If the user has **any** accounts on any network at all, including hidden + /// accounts. This can be used by host devices to prompt user to create their + /// first account or not, e.g. if user starts app after fresh install, the + /// SargonOS will create an "empty" Profile and BDFS and save it, before user + /// has had the chance to create their first account. If the user force quits + /// the app and then restart it, the app can still prompt user to create their + /// first account - as if no force-restart happened. + fn has_any_account_on_any_network(&self) -> bool { + self.networks.iter().any(|n| !n.accounts.is_empty()) + } + + fn contains_entity_by_address( + &self, + entity_address: &AddressOfAccountOrPersona, + ) -> bool { + self.networks.iter().any(|n: ProfileNetwork| { + n.contains_entity_by_address(entity_address) + }) + } +} +pub trait EntityOnNetworkHandling { + fn get_account(&self, address: &AccountAddress) -> Option; + fn get_persona(&self, address: &IdentityAddress) -> Option; + fn update_entities( + &mut self, + updated_entities: IdentifiedVecOf, + ) -> Result<()>; + fn update_entities_erased( + &mut self, + updated_entities: IdentifiedVecOf, + ) -> Result<()>; + + fn update_account( + &mut self, + address: &AccountAddress, + mutate: F, + ) -> Option + where + F: FnMut(&mut Account); + + fn hide_account(&mut self, account_address: &AccountAddress) -> bool; + + fn tombstone_account(&mut self, account_address: &AccountAddress) -> bool; + + /// Tombstones the accounts + fn tombstone_accounts(&mut self, account_addresses: &Vec) { + for account_address in account_addresses { + self.tombstone_account(account_address); + } + } + + fn update_persona( + &mut self, + address: &IdentityAddress, + mutate: F, + ) -> Option + where + F: FnMut(&mut Persona); +} + +impl EntityOnNetworkHandling for ProfileNetworks { + fn get_account(&self, address: &AccountAddress) -> Option { + self.get_id(address.network_id()) + .and_then(|n| n.accounts.get_id(address)) + .cloned() + } + + fn get_persona(&self, address: &IdentityAddress) -> Option { + self.get_id(address.network_id()) + .and_then(|n| n.personas.get_id(address)) + .cloned() + } + + fn update_entities( + &mut self, + updated_entities: IdentifiedVecOf, + ) -> Result<()> { + self.update_entities_erased( + updated_entities.into_iter().map(Into::into).collect(), + ) + } + + fn update_entities_erased( + &mut self, + updated_entities: IdentifiedVecOf, + ) -> Result<()> { + let network = + updated_entities.assert_elements_not_empty_and_on_same_network()?; + self.try_try_update_with(&network, |n| { + n.update_entities_erased(updated_entities.clone()) + }) + } + + /// Returns a clone of the updated account if found, else None. + fn update_account( + &mut self, + address: &AccountAddress, + mut mutate: F, + ) -> Option + where + F: FnMut(&mut Account), + { + self.update_with(address.network_id(), |n| { + _ = n.update_account(address, |a| mutate(a)) + }); + self.get_account(address) + } + + /// Hides the account associated with the `account_address` + fn hide_account(&mut self, account_address: &AccountAddress) -> bool { + self.update_with(account_address.network_id(), |n| { + n.hide_account(account_address); + }) + } + + /// Tombstones the account associated with the `account_address` + fn tombstone_account(&mut self, account_address: &AccountAddress) -> bool { + self.update_with(account_address.network_id(), |n| { + n.tombstone_account(account_address); + }) + } + + /// Returns a clone of the updated persona if found, else None. + fn update_persona( + &mut self, + address: &IdentityAddress, + mut mutate: F, + ) -> Option + where + F: FnMut(&mut Persona), + { + self.update_with(address.network_id(), |n| { + _ = n.update_persona(address, |a| mutate(a)) + }); + self.get_persona(address) + } +} + +pub trait ProfileNetworkEntitiesUpdating { + fn update_entities_erased( + &mut self, + updated_entities: IdentifiedVecOf, + ) -> Result<()>; + + fn update_entities( + &mut self, + updated_entities: IdentifiedVecOf, + ) -> Result<()> { + self.update_entities_erased( + updated_entities.into_iter().map(Into::into).collect(), + ) + } +} + +impl ProfileNetworkEntitiesUpdating for ProfileNetwork { + fn update_entities_erased( + &mut self, + updated_entities: IdentifiedVecOf, + ) -> Result<()> { + for entity in updated_entities { + match entity { + AccountOrPersona::AccountEntity(account) => self + .accounts + .try_update_with(&account.id(), |a| *a = account.clone()) + .map_err(|_| CommonError::UnknownAccount), + AccountOrPersona::PersonaEntity(persona) => self + .personas + .try_update_with(&persona.id(), |p| *p = persona.clone()) + .map_err(|_| CommonError::UnknownPersona), + }?; + } + Ok(()) + } +} + +pub trait ProfileNetworkAccountUpdating { + /// Returns a clone of the updated account if found, else None. + fn update_account( + &mut self, + address: &AccountAddress, + mutate: F, + ) -> Option + where + F: FnMut(&mut Account); + + /// Hides the account associated with the `account_address` + fn hide_account( + &mut self, + account_address: &AccountAddress, + ) -> Option; + + /// Tombstones the account associated with the `account_address` + fn tombstone_account( + &mut self, + account_address: &AccountAddress, + ) -> Option; +} + +impl ProfileNetworkAccountUpdating for ProfileNetwork { + /// Returns a clone of the updated account if found, else None. + fn update_account( + &mut self, + address: &AccountAddress, + mutate: F, + ) -> Option + where + F: FnMut(&mut Account), + { + if self.accounts.update_with(address, mutate) { + self.accounts.get_id(address).cloned() + } else { + None + } + } + + /// Hides the account associated with the `account_address` + fn hide_account( + &mut self, + account_address: &AccountAddress, + ) -> Option { + let account = self.update_account(account_address, |account| { + account.mark_as_hidden(); + }); + self.authorized_dapps + .remove_referenced_account(account_address); + account + } + + /// Tombstones the account associated with the `account_address` + fn tombstone_account( + &mut self, + account_address: &AccountAddress, + ) -> Option { + let account = self.update_account(account_address, |account| { + account.mark_as_tombstoned(); + }); + self.authorized_dapps + .remove_referenced_account(account_address); + account + } +} + +pub trait ProfileNetworkPersonaUpdating { + fn update_persona( + &mut self, + address: &IdentityAddress, + mutate: F, + ) -> Option + where + F: FnMut(&mut Persona); +} + +impl ProfileNetworkPersonaUpdating for ProfileNetwork { + /// Returns a clone of the updated persona if found, else None. + fn update_persona( + &mut self, + address: &IdentityAddress, + mutate: F, + ) -> Option + where + F: FnMut(&mut Persona), + { + if self.personas.update_with(address, mutate) { + self.personas.get_id(address).cloned() + } else { + None + } + } +} + +#[cfg(test)] +mod profile_network_tests { + + use super::*; + + #[allow(clippy::upper_case_acronyms)] + type SUT = ProfileNetworks; + + #[test] + fn update_account_unknown_account() { + let mut sut = SUT::sample(); + let id = &NetworkID::Mainnet; + let account_address = Account::sample_mainnet_carol().address; + assert_eq!( + sut.get_id(id).unwrap().accounts.get_id(account_address), + None + ); + + assert!(sut + .update_account(&account_address, |a| { + a.display_name = DisplayName::new("will fail").unwrap() + }) + .is_none()); + + // Assert unchanged + assert_eq!(sut, SUT::sample()); + } + + #[test] + fn update_account_unknown_network() { + let mut sut = SUT::sample(); + let id = &NetworkID::Mainnet; + let account_address = Account::sample_nebunet().address; + assert_eq!( + sut.get_id(id).unwrap().accounts.get_id(account_address), + None + ); + + assert!(sut + .update_account(&account_address, |a| { + a.display_name = DisplayName::new("will fail").unwrap() + }) + .is_none()); + + // Assert unchanged + assert_eq!(sut, SUT::sample()); + } + + #[test] + fn update_account() { + let mut sut = SUT::sample(); + let id = &NetworkID::Mainnet; + let account_address = Account::sample().address; + assert_eq!( + sut.get_id(id) + .unwrap() + .accounts + .get_id(account_address) + .unwrap() + .display_name + .value(), + "Alice" + ); + + sut.update_account(&account_address, |a| { + a.display_name = DisplayName::new("Stella").unwrap() + }); + + assert_eq!( + sut.get_id(id) + .unwrap() + .accounts + .get_id(account_address) + .unwrap() + .display_name + .value(), + "Stella" + ); + } +} + +#[cfg(test)] +mod profile_tests { + use super::*; + + #[allow(clippy::upper_case_acronyms)] + type SUT = Profile; + + #[test] + fn test_empty_profile_has_any_account_on_any_network_is_false() { + let sut = + SUT::new(Mnemonic::sample(), HostId::sample(), HostInfo::sample()); + assert!(!sut.has_any_account_on_any_network()); + } + + #[test] + fn test_sample_profile_has_any_account_on_any_network() { + assert!(SUT::sample().has_any_account_on_any_network()); + assert!(SUT::sample_other().has_any_account_on_any_network()); + } + + #[test] + fn new_from_main_bdfs_with_accounts() { + let accounts = Accounts::sample_mainnet(); + let profile = SUT::from_device_factor_source( + DeviceFactorSource::sample(), + HostId::sample(), + HostInfo::sample(), + Some(accounts), + ); + + assert!(profile.has_any_account_on_any_network()) + } +} diff --git a/crates/sargon-profile-logic/src/logic/profile_update.rs b/crates/sargon-profile-logic/src/logic/profile_update.rs new file mode 100644 index 000000000..e77db21dd --- /dev/null +++ b/crates/sargon-profile-logic/src/logic/profile_update.rs @@ -0,0 +1,518 @@ +use crate::prelude::*; + +pub trait ProfileDiagnosticsFactorInstances { + // TODO: Sometimes later it would be nice to remove this method + // and only use `diagnostics_for_factor_instances_valid_with_handler` and then + // send a handler from SargonOS which has access to some new driver which + // can use Swift Issue Reporting API: + // https://github.com/pointfreeco/swift-issue-reporting + // which will cause execution to halt with a runtime issue, which will be great + // for debugging and finding issues! + // Maybe android host can raise an exception..? + fn diagnostics_for_factor_instances_valid(&self) { + self.diagnostics_for_factor_instances_valid_with_handler(|_| {}); + } + + fn diagnostics_for_factor_instances_valid_with_handler( + &self, + on_duplicate: impl FnMut(DuplicateInstances), + ); +} + +impl ProfileDiagnosticsFactorInstances for Profile { + fn diagnostics_for_factor_instances_valid_with_handler( + &self, + mut on_duplicate: impl FnMut(DuplicateInstances), + ) { + let Some(duplicate_instances) = self.check_for_duplicated_instances() + else { + return; + }; + + error!("Duplicated FactorInstances found {:?}", duplicate_instances); + on_duplicate(duplicate_instances); + } +} + +pub trait ProfileAllEntitiesOnAllNetworks { + /// Returns ALL entities on ALL network, both account and persona, mixed. + /// Including hidden/deleted entities. + fn all_entities_on_all_networks(&self) -> IndexSet; + + /// Returns ALL FactorInstances for ALL Personas and Accounts on ALL networks as keys + /// and their factor instances as values. + fn instances_of_each_entity_on_all_networks( + &self, + ) -> IndexMap> { + self.all_entities_on_all_networks() + .into_iter() + .map(|e| (e.clone(), e.unique_all_factor_instances())) + .collect() + } +} + +impl ProfileAllEntitiesOnAllNetworks for Profile { + /// Returns ALL entities on ALL network, both account and persona, mixed. + /// Including hidden/deleted entities. + fn all_entities_on_all_networks(&self) -> IndexSet { + self.networks + .iter() + .flat_map(|n| { + let mut entities = IndexSet::::new(); + entities.extend(n.accounts.erased()); + entities.extend(n.personas.erased()); + entities + }) + .collect::>() + } +} + +pub trait ProfileAssertNewFactorInstancesNotUsed: + ProfileAllEntitiesOnAllNetworks +{ + fn find_all_duplicate_instances_matching_against( + &self, + against: IndexMap>, + ) -> IdentifiedVecOf; + + /// Checks ALL FactorInstances for ALL Personas and Accounts on ALL networks, + /// returns `Some(DuplicateInstances)`` if the same + /// FactorInstances is used between any entity. + fn check_for_duplicated_instances(&self) -> Option { + let whole_profile = self.instances_of_each_entity_on_all_networks(); + self.find_all_duplicate_instances_matching_against(whole_profile) + .into_iter() + .next() + } + + fn assert_new_factor_instances_not_already_used_erased( + &self, + entities: impl IntoIterator, + ) -> Result<()> { + let instances_of_new_entities = entities + .into_iter() + .map(|e| (e.clone(), e.unique_all_factor_instances())) + .collect::>>(); + + let Some(duplicate_instances) = self + .find_all_duplicate_instances_matching_against( + instances_of_new_entities, + ) + .into_iter() + .next() + else { + return Ok(()); + }; + + Err(duplicate_instances.into_error()) + } + + /// Like `check_for_duplicated_instances` but does not check all entities in profile against + /// all entities in profile, instead checks `instances_of_new_entities` against all entities + /// in profile. Also this is throwing. + fn assert_new_factor_instances_not_already_used< + E: Into + + Clone + + std::fmt::Debug + + std::cmp::Eq + + Identifiable, + >( + &self, + entities: impl IntoIterator, + ) -> Result<()> { + let entities = entities + .into_iter() + .map(Into::::into) + .collect::>(); + + self.assert_new_factor_instances_not_already_used_erased(entities) + } +} + +impl ProfileAssertNewFactorInstancesNotUsed for Profile { + /// Returns a list of `DuplicateInstances` where the same `FactorInstance` is used between + /// entities in this profile, matched against `against`. + fn find_all_duplicate_instances_matching_against( + &self, + against: IndexMap>, + ) -> IdentifiedVecOf { + let mut instances_per_entity = + self.instances_of_each_entity_on_all_networks(); + + let mut duplicates = IdentifiedVecOf::::new(); + + let mut check = + |entity: AccountOrPersona, to_check: IndexSet| { + for (e, existing) in instances_per_entity.iter() { + // We don't want to compare an entity against itself + if e.address() == entity.address() { + continue; + } + let intersection = existing + .intersection(&to_check) + .collect::>(); + + intersection.into_iter().for_each(|duplicate| { + let duplicate = DuplicateInstances { + entity1: e.clone(), + entity2: entity.clone(), + factor_instance: (*duplicate).clone(), + }; + duplicates.insert(duplicate); + }); + } + instances_per_entity.insert(entity.clone(), to_check); + }; + + for (entity, instances) in against { + check(entity, instances) + } + + duplicates + } +} + +pub trait ProfileEntitiesUpdating { + fn update_entities_erased( + &mut self, + updated_entities: IdentifiedVecOf, + ) -> Result<()>; + + fn update_entities( + &mut self, + updated_entities: IdentifiedVecOf, + ) -> Result<()> { + self.update_entities_erased( + updated_entities.into_iter().map(Into::into).collect(), + ) + } + + /// Returns a clone of the updated account if found, else None. + fn update_account( + &mut self, + address: &AccountAddress, + mutate: F, + ) -> Option + where + F: FnMut(&mut Account); + + /// Returns a clone of the updated persona if found, else None. + fn update_persona( + &mut self, + address: &IdentityAddress, + mutate: F, + ) -> Option + where + F: FnMut(&mut Persona); +} + +impl ProfileEntitiesUpdating for Profile { + fn update_entities_erased( + &mut self, + updated_entities: IdentifiedVecOf, + ) -> Result<()> { + self.networks.update_entities_erased(updated_entities) + } + + /// Returns a clone of the updated account if found, else None. + fn update_account( + &mut self, + address: &AccountAddress, + mutate: F, + ) -> Option + where + F: FnMut(&mut Account), + { + self.networks.update_account(address, mutate) + } + + /// Returns a clone of the updated persona if found, else None. + fn update_persona( + &mut self, + address: &IdentityAddress, + mutate: F, + ) -> Option + where + F: FnMut(&mut Persona), + { + self.networks.update_persona(address, mutate) + } +} + +pub trait ProfileFactorSourceUpdating { + fn update_any_factor_source( + &mut self, + factor_source_id: &FactorSourceID, + mutate: F, + ) -> Result<()> + where + F: FnMut(&mut FactorSource); + + fn update_factor_source( + &mut self, + factor_source_id: &FactorSourceID, + mutate: M, + ) -> Result + where + S: IsFactorSource, + M: FnMut(S) -> Result; + + fn update_any_factor_source_common( + &mut self, + factor_source_id: &FactorSourceID, + mut mutate: F, + ) -> Result<()> + where + F: FnMut(&mut FactorSourceCommon), + { + self.update_any_factor_source(factor_source_id, |fs| { + let mut common = fs.common_properties(); + mutate(&mut common); + fs.set_common_properties(common); + }) + } + + fn update_last_used_of_factor_source( + &mut self, + id: &FactorSourceID, + ) -> Result<()> { + self.update_any_factor_source_common(id, |common| { + common.last_used_on = now(); + }) + } + + fn update_factor_source_remove_flag_main( + &mut self, + id: &FactorSourceID, + ) -> Result<()> { + self.update_any_factor_source_common(id, |common| { + common.flags.remove_id(&FactorSourceFlag::Main); + }) + } +} + +impl ProfileFactorSourceUpdating for Profile { + fn update_factor_source( + &mut self, + factor_source_id: &FactorSourceID, + mut mutate: M, + ) -> Result + where + S: IsFactorSource, + M: FnMut(S) -> Result, + { + self.factor_sources + .maybe_update_with(factor_source_id, |f| { + S::try_from(f.clone()) + .map_err(|_| CommonError::CastFactorSourceWrongKind { + expected: S::kind().to_string(), + found: f.factor_source_kind().to_string(), + }) + .and_then(|element| { + mutate(element).map(|modified| modified.into()) + }) + }) + } + + fn update_any_factor_source( + &mut self, + factor_source_id: &FactorSourceID, + mutate: F, + ) -> Result<()> + where + F: FnMut(&mut FactorSource), + { + self.factor_sources + .try_update_with(factor_source_id, mutate) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[allow(clippy::upper_case_acronyms)] + type SUT = Profile; + + #[test] + fn update_factor_source_not_update_when_factor_source_not_found() { + let mut sut = SUT::sample(); + let wrong_id: &FactorSourceID = + &LedgerHardwareWalletFactorSource::sample_other().id.into(); + + assert_eq!( + sut.update_factor_source( + wrong_id, + |lfs: LedgerHardwareWalletFactorSource| { Ok(lfs) } + ), + Ok(false) + ); + } + + #[test] + fn change_supported_curve_of_factor_source() { + let mut sut = SUT::sample(); + let id: &FactorSourceID = &DeviceFactorSource::sample().id.into(); + assert!(sut.factor_sources.contains_id(FactorSourceID::from( + DeviceFactorSource::sample().id + ))); + + assert_eq!( + sut.factor_sources + .get_id(id) + .unwrap() + .as_device() + .unwrap() + .common + .crypto_parameters + .supported_curves + .items(), + [SLIP10Curve::Curve25519] + ); + + assert_eq!( + sut.update_factor_source(id, |mut dfs: DeviceFactorSource| { + dfs.common.crypto_parameters = + FactorSourceCryptoParameters::babylon_olympia_compatible(); + Ok(dfs) + }), + Ok(true) + ); + + // test failure + assert_eq!( + sut.update_factor_source(id, |_: DeviceFactorSource| { + Err(CommonError::UpdateFactorSourceMutateFailed) + }), + Err(CommonError::UpdateFactorSourceMutateFailed) + ); + + assert_eq!( + sut.factor_sources + .get_id(id) + .unwrap() + .as_device() + .unwrap() + .common + .crypto_parameters + .supported_curves + .items(), + [SLIP10Curve::Curve25519, SLIP10Curve::Secp256k1] + ); + } + + #[test] + fn add_supported_curve_to_factor_source_failure_cast_wrong_factor_source_kind( + ) { + let mut sut = SUT::sample(); + let id: &FactorSourceID = &DeviceFactorSource::sample().id.into(); + + assert!(sut.factor_sources.contains_id(FactorSourceID::from( + DeviceFactorSource::sample().id + ))); + + assert_eq!( + sut.factor_sources + .get_id(id) + .unwrap() + .as_device() + .unwrap() + .common + .crypto_parameters + .supported_curves + .items(), + [SLIP10Curve::Curve25519] + ); + + assert_eq!( + sut.update_factor_source( + id, + |mut lfs: LedgerHardwareWalletFactorSource| { + lfs.common.crypto_parameters = + FactorSourceCryptoParameters::babylon_olympia_compatible(); + Ok(lfs) + } + ), + Err(CommonError::CastFactorSourceWrongKind { + expected: FactorSourceKind::LedgerHQHardwareWallet.to_string(), + found: FactorSourceKind::Device.to_string() + }) + ); + + // Remains unchanged + assert_eq!( + sut.factor_sources + .get_id(id) + .unwrap() + .as_device() + .unwrap() + .common + .crypto_parameters + .supported_curves + .items(), + [SLIP10Curve::Curve25519] + ); + } + + #[test] + fn update_name_of_accounts() { + let mut sut = SUT::sample(); + let account = sut + .networks + .get_id(NetworkID::Mainnet) + .unwrap() + .accounts + .get_at_index(0) + .unwrap() + .clone(); + + assert_eq!(account.display_name.value(), "Alice"); + assert!(sut + .update_account(&account.address, |a| a.display_name = + DisplayName::new("Bob").unwrap()) + .is_some()); + + assert_eq!( + sut.networks + .get_id(NetworkID::Mainnet) + .unwrap() + .accounts + .get_at_index(0) + .unwrap() + .display_name + .value(), + "Bob" + ); + } + + #[test] + fn update_name_of_persona() { + let mut sut = SUT::sample(); + let persona = sut + .networks + .get_id(NetworkID::Mainnet) + .unwrap() + .personas + .get_at_index(0) + .unwrap() + .clone(); + + assert_eq!(persona.display_name.value(), "Satoshi"); + assert!(sut + .update_persona(&persona.address, |a| a.display_name = + DisplayName::new("Batman").unwrap()) + .is_some()); + + assert_eq!( + sut.networks + .get_id(NetworkID::Mainnet) + .unwrap() + .personas + .get_at_index(0) + .unwrap() + .display_name + .value(), + "Batman" + ); + } +} diff --git a/crates/sargon/src/profile/logic/query_factor_sources.rs b/crates/sargon-profile-logic/src/logic/query_factor_sources.rs similarity index 87% rename from crates/sargon/src/profile/logic/query_factor_sources.rs rename to crates/sargon-profile-logic/src/logic/query_factor_sources.rs index 3bdf51960..76b6845e5 100644 --- a/crates/sargon/src/profile/logic/query_factor_sources.rs +++ b/crates/sargon-profile-logic/src/logic/query_factor_sources.rs @@ -1,45 +1,23 @@ use crate::prelude::*; -impl Profile { - #[cfg(not(tarpaulin_include))] // false negative - pub fn factor_source_by_id( +pub trait ProfileFactorSourceQuerying { + fn factor_source_by_id( &self, id: impl Into, ) -> Result where - F: IsFactorSource, - { - let id = id.into(); - self.factor_sources - .get_id(id) - .ok_or(CommonError::ProfileDoesNotContainFactorSourceWithID { - bad_value: id.to_string(), - }) - .and_then(|f| { - f.clone().try_into().map_err(|_| { - CommonError::CastFactorSourceWrongKind { - expected: ::kind().to_string(), - found: f.factor_source_kind().to_string(), - } - }) - }) - } + F: IsFactorSource; - pub fn device_factor_source_by_id( + fn device_factor_source_by_id( &self, id: &FactorSourceIDFromHash, ) -> Result { self.factor_source_by_id(*id) } - pub fn device_factor_sources(&self) -> Vec { - self.factor_sources - .iter() - .filter_map(|f| f.as_device().cloned()) - .collect_vec() - } + fn device_factor_sources(&self) -> Vec; - pub fn bdfs(&self) -> DeviceFactorSource { + fn bdfs(&self) -> DeviceFactorSource { let device_factor_sources = self.device_factor_sources(); let explicit_main = device_factor_sources .clone() @@ -63,8 +41,43 @@ impl Profile { } } -impl Profile { - pub fn sample_no_device_factor_source() -> Self { +impl ProfileFactorSourceQuerying for Profile { + fn factor_source_by_id(&self, id: impl Into) -> Result + where + F: IsFactorSource, + { + let id = id.into(); + self.factor_sources + .get_id(id) + .ok_or(CommonError::ProfileDoesNotContainFactorSourceWithID { + bad_value: id.to_string(), + }) + .and_then(|f| { + f.clone().try_into().map_err(|_| { + CommonError::CastFactorSourceWrongKind { + expected: ::kind().to_string(), + found: f.factor_source_kind().to_string(), + } + }) + }) + } + + fn device_factor_sources(&self) -> Vec { + self.factor_sources + .iter() + .filter_map(|f| f.as_device().cloned()) + .collect_vec() + } +} + +pub trait ProfileSampleValuesWithSpecificFactorSources: Sized { + fn sample_no_device_factor_source() -> Self; + fn sample_no_babylon_device_factor_source() -> Self; + fn sample_no_factor_source_explicitly_marked_as_main() -> Self; +} + +impl ProfileSampleValuesWithSpecificFactorSources for Profile { + fn sample_no_device_factor_source() -> Self { let networks = ProfileNetworks::sample(); let mut header = Header::sample(); header.content_hint = networks.content_hint(); @@ -76,7 +89,7 @@ impl Profile { ) } - pub fn sample_no_babylon_device_factor_source() -> Self { + fn sample_no_babylon_device_factor_source() -> Self { let networks = ProfileNetworks::sample(); let mut header = Header::sample(); header.content_hint = networks.content_hint(); @@ -90,7 +103,7 @@ impl Profile { ) } - pub fn sample_no_factor_source_explicitly_marked_as_main() -> Self { + fn sample_no_factor_source_explicitly_marked_as_main() -> Self { let mut profile = Profile::sample(); let main_factors = profile diff --git a/crates/sargon-profile-logic/src/tests/matrix_of_factor_instances_index_agnostic.rs b/crates/sargon-profile-logic/src/tests/matrix_of_factor_instances_index_agnostic.rs new file mode 100644 index 000000000..391556793 --- /dev/null +++ b/crates/sargon-profile-logic/src/tests/matrix_of_factor_instances_index_agnostic.rs @@ -0,0 +1,73 @@ +#![cfg(test)] + +use crate::prelude::*; + +#[allow(clippy::upper_case_acronyms)] +type SUT = MatrixOfFactorInstances; + +#[test] +fn wrong_entity_kind() { + let invalid = unsafe { + SUT::unbuilt_with_roles_and_days( + PrimaryRoleWithFactorInstances::unbuilt_with_factors(0, [ + HierarchicalDeterministicFactorInstance::sample_mainnet_entity_device_factor_fs_0_securified_at_index( + CAP26EntityKind::Account, + 0, + ).into(), HierarchicalDeterministicFactorInstance::sample_mainnet_entity_device_factor_fs_0_securified_at_index( + CAP26EntityKind::Identity, // <--- Wrong entity kind + 1, + ).into()], []), + RecoveryRoleWithFactorInstances::unbuilt_with_factors( + 0, + [], + [], + ), + ConfirmationRoleWithFactorInstances::unbuilt_with_factors( + 0, + [], + [], + ), + 1, + ) + }; + let res = invalid.index_agnostic_path_of_all_tx_signing_factor_instances(); + assert!(matches!( + res, + Err(CommonError::WrongEntityKindOfInFactorInstancesPath) + )); +} + +#[test] +fn wrong_key_kind() { + let invalid = unsafe { + SUT::unbuilt_with_roles_and_days( + PrimaryRoleWithFactorInstances::unbuilt_with_factors(0, [ + HierarchicalDeterministicFactorInstance::sample_mainnet_entity_device_factor_fs_0_securified_at_index( + CAP26EntityKind::Account, + 0, + ).into(), + HierarchicalDeterministicFactorInstance::sample_with_key_kind_entity_kind_on_network_and_hardened_index( + NetworkID::Mainnet, + CAP26KeyKind::AuthenticationSigning, // <-- Wrong key kind + CAP26EntityKind::Account, + SecurifiedU30::ZERO + ).into()], []), + RecoveryRoleWithFactorInstances::unbuilt_with_factors( + 0, + [], + [], + ), + ConfirmationRoleWithFactorInstances::unbuilt_with_factors( + 0, + [], + [], + ), + 1, + ) + }; + let res = invalid.index_agnostic_path_of_all_tx_signing_factor_instances(); + assert!(matches!( + res, + Err(CommonError::WrongKeyKindOfTransactionSigningFactorInstance) + )); +} diff --git a/crates/sargon-profile-logic/src/tests/mod.rs b/crates/sargon-profile-logic/src/tests/mod.rs new file mode 100644 index 000000000..c04a8ac10 --- /dev/null +++ b/crates/sargon-profile-logic/src/tests/mod.rs @@ -0,0 +1 @@ +mod matrix_of_factor_instances_index_agnostic; diff --git a/crates/sargon-profile-security-structures/Cargo.toml b/crates/sargon-profile-security-structures/Cargo.toml new file mode 100644 index 000000000..fa0bb3ef0 --- /dev/null +++ b/crates/sargon-profile-security-structures/Cargo.toml @@ -0,0 +1,59 @@ +[package] +name = "sargon-profile-security-structures" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === INTERNAL DEPENDENCIES === +sargon-core = { path = "../sargon-core" } +identified-vec-of = { path = "../identified-vec-of" } +sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } +sargon-factors = { path = "../sargon-factors" } +sargon-addresses = { path = "../sargon-addresses" } +next-derivation-index-ephemeral = { path = "../next-derivation-index-ephemeral" } + +# === RADIX DEPENDENCIES === +radix-common = { workspace = true } +radix-common-derive = { workspace = true } +radix-engine = { workspace = true } +radix-engine-interface = { workspace = true } +radix-engine-toolkit = { workspace = true } +radix-engine-toolkit-common = { workspace = true } +radix-rust = { workspace = true } +radix-transactions = { workspace = true } +sbor = { workspace = true } + +# === EXTERNAL DEPENDENCIES === +aes-gcm = { workspace = true } +assert-json-diff = { workspace = true } +async-std = { workspace = true } +async-trait = { workspace = true } +base64 = { workspace = true } +camino = { workspace = true } +delegate = { workspace = true } +derive_more = { workspace = true } +enum-as-inner = { workspace = true } +enum-iterator = { workspace = true } +futures = { workspace = true } +hex = { workspace = true } +hkdf = { workspace = true } +iota-crypto = { workspace = true } +iso8601-timestamp = { workspace = true } +itertools = { workspace = true } +k256 = { workspace = true } +log = { workspace = true } +once_cell = { workspace = true } +paste = { workspace = true } +pretty_assertions = { workspace = true } +pretty_env_logger = { workspace = true } +rand = { workspace = true } +reqwest = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +serde_repr = { workspace = true } +serde_with = { workspace = true } +strum = { workspace = true } +thiserror = { workspace = true } +url = { workspace = true } +uuid = { workspace = true } +zeroize = { workspace = true } diff --git a/crates/sargon/src/signing/petition_types/factor_list_kind.rs b/crates/sargon-profile-security-structures/src/factor_list_kind.rs similarity index 80% rename from crates/sargon/src/signing/petition_types/factor_list_kind.rs rename to crates/sargon-profile-security-structures/src/factor_list_kind.rs index acbc6e709..8f349f49e 100644 --- a/crates/sargon/src/signing/petition_types/factor_list_kind.rs +++ b/crates/sargon-profile-security-structures/src/factor_list_kind.rs @@ -1,6 +1,6 @@ /// A kind of factor list, either threshold, or override kind. #[derive(PartialEq, Eq, Clone, Copy, Debug)] -pub(crate) enum FactorListKind { +pub enum FactorListKind { Threshold, Override, } diff --git a/crates/sargon-profile-security-structures/src/lib.rs b/crates/sargon-profile-security-structures/src/lib.rs new file mode 100644 index 000000000..9f12ddcc8 --- /dev/null +++ b/crates/sargon-profile-security-structures/src/lib.rs @@ -0,0 +1,30 @@ +#![allow(incomplete_features)] +#![feature(generic_const_exprs)] +#![feature(let_chains)] + +mod factor_list_kind; +mod role_kind; +mod roles_matrices_structures; + +pub mod prelude { + pub use crate::factor_list_kind::*; + pub use crate::role_kind::*; + pub use crate::roles_matrices_structures::*; + + pub use next_derivation_index_ephemeral::prelude::*; + pub use sargon_addresses::prelude::*; + pub use sargon_core::prelude::*; + pub use sargon_factors::prelude::*; + pub use sargon_hierarchical_deterministic::prelude::*; + + pub(crate) use radix_engine_interface::prelude::{ + AccessRule as ScryptoAccessRule, + BasicRequirement as ScryptoBasicRequirement, + CompositeRequirement as ScryptoCompositeRequirement, + }; + + pub(crate) use radix_engine_interface::blueprints::{ + access_controller::RuleSet as ScryptoRuleSet, + resource::ResourceOrNonFungible as ScryptoResourceOrNonFungible, + }; +} diff --git a/crates/sargon/src/signing/petition_types/role_kind.rs b/crates/sargon-profile-security-structures/src/role_kind.rs similarity index 100% rename from crates/sargon/src/signing/petition_types/role_kind.rs rename to crates/sargon-profile-security-structures/src/role_kind.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/automatic_shield_builder/auto_build_outcome_for_testing.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/automatic_shield_builder/auto_build_outcome_for_testing.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/automatic_shield_builder/auto_build_outcome_for_testing.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/automatic_shield_builder/auto_build_outcome_for_testing.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/automatic_shield_builder/automatic_shield_builder.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/automatic_shield_builder/automatic_shield_builder.rs similarity index 99% rename from crates/sargon/src/profile/mfa/security_structures/automatic_shield_builder/automatic_shield_builder.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/automatic_shield_builder/automatic_shield_builder.rs index 450095e6a..c2c8d1eec 100644 --- a/crates/sargon/src/profile/mfa/security_structures/automatic_shield_builder/automatic_shield_builder.rs +++ b/crates/sargon-profile-security-structures/src/roles_matrices_structures/automatic_shield_builder/automatic_shield_builder.rs @@ -437,9 +437,6 @@ impl SecurityShieldBuilder { #[cfg(test)] mod tests { - use std::sync::Mutex; - - use async_std::future::ready; use indexmap::IndexSet; use super::*; diff --git a/crates/sargon/src/profile/mfa/security_structures/automatic_shield_builder/factor_selector.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/automatic_shield_builder/factor_selector.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/automatic_shield_builder/factor_selector.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/automatic_shield_builder/factor_selector.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/automatic_shield_builder/mod.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/automatic_shield_builder/mod.rs similarity index 83% rename from crates/sargon/src/profile/mfa/security_structures/automatic_shield_builder/mod.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/automatic_shield_builder/mod.rs index e8cfebb4d..d34081397 100644 --- a/crates/sargon/src/profile/mfa/security_structures/automatic_shield_builder/mod.rs +++ b/crates/sargon-profile-security-structures/src/roles_matrices_structures/automatic_shield_builder/mod.rs @@ -6,5 +6,4 @@ mod proto_shield; mod quantity; pub use auto_build_outcome_for_testing::*; -pub(crate) use automatic_shield_builder::*; pub use factor_selector::*; diff --git a/crates/sargon/src/profile/mfa/security_structures/automatic_shield_builder/proto_shield.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/automatic_shield_builder/proto_shield.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/automatic_shield_builder/proto_shield.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/automatic_shield_builder/proto_shield.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/automatic_shield_builder/quantity.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/automatic_shield_builder/quantity.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/automatic_shield_builder/quantity.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/automatic_shield_builder/quantity.rs diff --git a/crates/sargon/src/types/samples/general_role_with_hd_factor_instance_samples.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/general_role_with_hd_factor_instance_samples.rs similarity index 91% rename from crates/sargon/src/types/samples/general_role_with_hd_factor_instance_samples.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/general_role_with_hd_factor_instance_samples.rs index 6764a2eb1..8f07c9d6c 100644 --- a/crates/sargon/src/types/samples/general_role_with_hd_factor_instance_samples.rs +++ b/crates/sargon-profile-security-structures/src/roles_matrices_structures/general_role_with_hd_factor_instance_samples.rs @@ -3,7 +3,7 @@ use crate::prelude::*; impl GeneralRoleWithHierarchicalDeterministicFactorInstances { /// Primary Role /// Securified { Single Threshold only } - pub(crate) fn r2(fi: F) -> Self + pub fn r2(fi: F) -> Self where F: Fn( FactorSourceIDFromHash, @@ -17,7 +17,7 @@ impl GeneralRoleWithHierarchicalDeterministicFactorInstances { /// Primary Role /// Securified { Single Override only } - pub(crate) fn r3(fi: F) -> Self + pub fn r3(fi: F) -> Self where F: Fn( FactorSourceIDFromHash, @@ -31,7 +31,7 @@ impl GeneralRoleWithHierarchicalDeterministicFactorInstances { /// Primary Role /// Securified { Threshold factors only #3 } - pub(crate) fn r4(fi: F) -> Self + pub fn r4(fi: F) -> Self where F: Fn( FactorSourceIDFromHash, @@ -49,7 +49,7 @@ impl GeneralRoleWithHierarchicalDeterministicFactorInstances { /// Primary Role /// Securified { Override factors only #2 } - pub(crate) fn r5(fi: F) -> Self + pub fn r5(fi: F) -> Self where F: Fn( FactorSourceIDFromHash, @@ -67,7 +67,7 @@ impl GeneralRoleWithHierarchicalDeterministicFactorInstances { /// Primary Role /// Securified { Threshold #3 and Override factors #2 } - pub(crate) fn r6(fi: F) -> Self + pub fn r6(fi: F) -> Self where F: Fn( FactorSourceIDFromHash, @@ -85,7 +85,7 @@ impl GeneralRoleWithHierarchicalDeterministicFactorInstances { /// Primary Role /// Securified { Threshold only # 5/5 } - pub(crate) fn r7(fi: F) -> Self + pub fn r7(fi: F) -> Self where F: Fn( FactorSourceIDFromHash, @@ -110,7 +110,7 @@ impl GeneralRoleWithHierarchicalDeterministicFactorInstances { /// Primary Role /// Securified { Threshold 1/1 and Override factors #1 } - pub(crate) fn r8(fi: F) -> Self + pub fn r8(fi: F) -> Self where F: Fn( FactorSourceIDFromHash, diff --git a/crates/sargon/src/profile/mfa/security_structures/has_role_kind.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/has_role_kind.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/has_role_kind.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/has_role_kind.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/matrices/abstract_matrix_builder_or_built.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/abstract_matrix_builder_or_built.rs similarity index 76% rename from crates/sargon/src/profile/mfa/security_structures/matrices/abstract_matrix_builder_or_built.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/abstract_matrix_builder_or_built.rs index 534dbd244..70bb418d4 100644 --- a/crates/sargon/src/profile/mfa/security_structures/matrices/abstract_matrix_builder_or_built.rs +++ b/crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/abstract_matrix_builder_or_built.rs @@ -47,6 +47,48 @@ impl { pub const DEFAULT_NUMBER_OF_DAYS_UNTIL_AUTO_CONFIRM: u16 = 14; + /// # Safety + /// Rust memory safe, but marked "unsafe" since it might allow for unsafe + /// SecurityShields. + pub unsafe fn set_primary_role( + &mut self, + primary_role: AbstractRoleBuilderOrBuilt< + { ROLE_PRIMARY }, + MODE_OF_ROLE, + FACTOR, + >, + ) { + self.primary_role = primary_role + } + + /// # Safety + /// Rust memory safe, but marked "unsafe" since it might allow for unsafe + /// SecurityShields. + pub unsafe fn set_recovery_role( + &mut self, + recovery_role: AbstractRoleBuilderOrBuilt< + { ROLE_RECOVERY }, + MODE_OF_ROLE, + FACTOR, + >, + ) { + self.recovery_role = recovery_role + } + + /// # Safety + /// Rust memory safe, but marked "unsafe" since it might allow for unsafe + /// SecurityShields. + pub unsafe fn set_confirmation_role( + &mut self, + confirmation_role: AbstractRoleBuilderOrBuilt< + { ROLE_CONFIRMATION }, + MODE_OF_ROLE, + FACTOR, + >, + ) { + self.confirmation_role = confirmation_role + } + /// # Safety /// Rust memory safe, but marked "unsafe" since it might allow for instantiation /// of unsafe - as in application **unsecure** - MatrixOfFactors, which might diff --git a/crates/sargon/src/profile/mfa/security_structures/matrices/builder/error.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/builder/error.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/matrices/builder/error.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/builder/error.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/matrices/builder/matrix_builder.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/builder/matrix_builder.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/matrices/builder/matrix_builder.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/builder/matrix_builder.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/matrices/builder/matrix_builder_unit_tests.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/builder/matrix_builder_unit_tests.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/matrices/builder/matrix_builder_unit_tests.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/builder/matrix_builder_unit_tests.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/matrices/builder/matrix_template.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/builder/matrix_template.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/matrices/builder/matrix_template.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/builder/matrix_template.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/matrices/builder/mod.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/builder/mod.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/matrices/builder/mod.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/builder/mod.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/matrices/matrix_of_factor_instances.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/matrix_of_factor_instances.rs similarity index 86% rename from crates/sargon/src/profile/mfa/security_structures/matrices/matrix_of_factor_instances.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/matrix_of_factor_instances.rs index e0e877a58..60f4e88a9 100644 --- a/crates/sargon/src/profile/mfa/security_structures/matrices/matrix_of_factor_instances.rs +++ b/crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/matrix_of_factor_instances.rs @@ -9,7 +9,26 @@ impl MatrixOfFactorInstances { MINUTES_PER_DAY * timed_recovery_in_days } } + +impl HasFactorInstances for MatrixOfFactorInstances { + fn unique_tx_signing_factor_instances(&self) -> IndexSet { + let mut set = IndexSet::new(); + set.extend(self.primary_role.all_factors().into_iter().cloned()); + set.extend(self.recovery_role.all_factors().into_iter().cloned()); + set.extend(self.confirmation_role.all_factors().into_iter().cloned()); + set + } +} + pub trait HasFactorInstances { + fn unique_tx_signing_factor_instances(&self) -> IndexSet; + + /// Override this method for types which has an authentication signing factor + /// instance, e.g. `SecurityStructureOfFactorInstances`. + fn unique_all_factor_instances(&self) -> IndexSet { + self.unique_tx_signing_factor_instances() + } + fn assert_has_entity_kind( &self, entity_kind_of_entity: CAP26EntityKind, @@ -65,14 +84,6 @@ pub trait HasFactorInstances { Ok(index_agnostic_path) } - fn unique_tx_signing_factor_instances(&self) -> IndexSet; - - /// Override this method for types which has an authentication signing factor - /// instance, e.g. `SecurityStructureOfFactorInstances`. - fn unique_all_factor_instances(&self) -> IndexSet { - self.unique_tx_signing_factor_instances() - } - /// Returns whether the entity is linked to the given factor source. fn is_linked_to_factor_source(&self, factor_source: FactorSource) -> bool { self.unique_all_factor_instances().iter().any(|factor| { @@ -81,17 +92,32 @@ pub trait HasFactorInstances { } } -impl HasFactorInstances for MatrixOfFactorInstances { - fn unique_tx_signing_factor_instances(&self) -> IndexSet { - let mut set = IndexSet::new(); - set.extend(self.primary_role.all_factors().into_iter().cloned()); - set.extend(self.recovery_role.all_factors().into_iter().cloned()); - set.extend(self.confirmation_role.all_factors().into_iter().cloned()); - set +impl MatrixOfFactorInstances { + fn sample_from_matrix_of_sources( + matrix_of_sources: MatrixOfFactorSources, + entity_kind: CAP26EntityKind, + ) -> Self { + let mut consuming_instances = + MnemonicWithPassphrase::derive_instances_for_factor_sources( + NetworkID::Mainnet, + 1, + [if entity_kind == CAP26EntityKind::Account { + DerivationPreset::AccountMfa + } else { + DerivationPreset::IdentityMfa + }], + matrix_of_sources.all_factors().into_iter().cloned(), + ); + + Self::fulfilling_matrix_of_factor_sources_with_instances( + &mut consuming_instances, + matrix_of_sources.clone(), + ) + .unwrap() } } -trait InstancesDerivingWithFactorSources { +trait InstancesDeriving { fn derive_instances_for_factor_sources( network_id: NetworkID, quantity_per_factor: usize, @@ -100,22 +126,19 @@ trait InstancesDerivingWithFactorSources { ) -> IndexMap; } -impl InstancesDerivingWithFactorSources for MnemonicWithPassphrase { +impl InstancesDeriving for MnemonicWithPassphrase { fn derive_instances_for_factor_sources( network_id: NetworkID, quantity_per_factor: usize, derivation_presets: impl IntoIterator, sources: impl IntoIterator, ) -> IndexMap { - let next_index_assigner = NextDerivationEntityIndexAssigner::new( - network_id, - None, - FactorInstancesCache::default(), - ); - let derivation_presets = derivation_presets.into_iter().collect::>(); + let next_index_assigner = + NextDerivationEntityIndexWithEphemeralOffsets::default(); + sources .into_iter() .map(|fs| { @@ -138,12 +161,9 @@ impl InstancesDerivingWithFactorSources for MnemonicWithPassphrase { .index_agnostic_path_on_network(network_id); next_index_assigner - .next(fsid, index_agnostic_path) + .reserve(fsid, index_agnostic_path) .map(|index| { - DerivationPath::from_index_agnostic_path_and_component( - index_agnostic_path, - index, - ) + DerivationPath::from_index_agnostic_path_and_component(index_agnostic_path, index) }) .unwrap() }) @@ -167,31 +187,6 @@ impl InstancesDerivingWithFactorSources for MnemonicWithPassphrase { } } -impl MatrixOfFactorInstances { - fn sample_from_matrix_of_sources( - matrix_of_sources: MatrixOfFactorSources, - entity_kind: CAP26EntityKind, - ) -> Self { - let mut consuming_instances = - MnemonicWithPassphrase::derive_instances_for_factor_sources( - NetworkID::Mainnet, - 1, - [if entity_kind == CAP26EntityKind::Account { - DerivationPreset::AccountMfa - } else { - DerivationPreset::IdentityMfa - }], - matrix_of_sources.all_factors().into_iter().cloned(), - ); - - Self::fulfilling_matrix_of_factor_sources_with_instances( - &mut consuming_instances, - matrix_of_sources.clone(), - ) - .unwrap() - } -} - impl HasSampleValues for MatrixOfFactorInstances { /// Account fn sample() -> Self { @@ -388,76 +383,6 @@ mod tests { Err(CommonError::NoTransactionSigningFactorInstance) )); } - - #[test] - fn wrong_entity_kind() { - let invalid = unsafe { - SUT::unbuilt_with_roles_and_days( - PrimaryRoleWithFactorInstances::unbuilt_with_factors(0, [ - HierarchicalDeterministicFactorInstance::sample_mainnet_entity_device_factor_fs_0_securified_at_index( - CAP26EntityKind::Account, - 0, - ).into(), HierarchicalDeterministicFactorInstance::sample_mainnet_entity_device_factor_fs_0_securified_at_index( - CAP26EntityKind::Identity, // <--- Wrong entity kind - 1, - ).into()], []), - RecoveryRoleWithFactorInstances::unbuilt_with_factors( - 0, - [], - [], - ), - ConfirmationRoleWithFactorInstances::unbuilt_with_factors( - 0, - [], - [], - ), - 1, - ) - }; - let res = - invalid.index_agnostic_path_of_all_tx_signing_factor_instances(); - assert!(matches!( - res, - Err(CommonError::WrongEntityKindOfInFactorInstancesPath) - )); - } - - #[test] - fn wrong_key_kind() { - let invalid = unsafe { - SUT::unbuilt_with_roles_and_days( - PrimaryRoleWithFactorInstances::unbuilt_with_factors(0, [ - HierarchicalDeterministicFactorInstance::sample_mainnet_entity_device_factor_fs_0_securified_at_index( - CAP26EntityKind::Account, - 0, - ).into(), - HierarchicalDeterministicFactorInstance::sample_with_key_kind_entity_kind_on_network_and_hardened_index( - NetworkID::Mainnet, - CAP26KeyKind::AuthenticationSigning, // <-- Wrong key kind - CAP26EntityKind::Account, - SecurifiedU30::ZERO - ).into()], []), - RecoveryRoleWithFactorInstances::unbuilt_with_factors( - 0, - [], - [], - ), - ConfirmationRoleWithFactorInstances::unbuilt_with_factors( - 0, - [], - [], - ), - 1, - ) - }; - let res = - invalid.index_agnostic_path_of_all_tx_signing_factor_instances(); - assert!(matches!( - res, - Err(CommonError::WrongKeyKindOfTransactionSigningFactorInstance) - )); - } - #[test] fn err_if_empty_instance_found_for_factor_source() { assert!(matches!( diff --git a/crates/sargon/src/profile/mfa/security_structures/matrices/matrix_of_factor_source_ids.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/matrix_of_factor_source_ids.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/matrices/matrix_of_factor_source_ids.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/matrix_of_factor_source_ids.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/matrices/matrix_of_factor_sources.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/matrix_of_factor_sources.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/matrices/matrix_of_factor_sources.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/matrix_of_factor_sources.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/matrices/mod.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/mod.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/matrices/mod.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/mod.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/mod.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/mod.rs similarity index 93% rename from crates/sargon/src/profile/mfa/security_structures/mod.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/mod.rs index b915d8b26..7749a6b92 100644 --- a/crates/sargon/src/profile/mfa/security_structures/mod.rs +++ b/crates/sargon-profile-security-structures/src/roles_matrices_structures/mod.rs @@ -1,4 +1,5 @@ mod automatic_shield_builder; +mod general_role_with_hd_factor_instance_samples; mod has_role_kind; mod matrices; mod roles; diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/abstract_role_builder_or_built.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/abstract_role_builder_or_built.rs similarity index 97% rename from crates/sargon/src/profile/mfa/security_structures/roles/abstract_role_builder_or_built.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/abstract_role_builder_or_built.rs index 70008c2d6..bb066f0a1 100644 --- a/crates/sargon/src/profile/mfa/security_structures/roles/abstract_role_builder_or_built.rs +++ b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/abstract_role_builder_or_built.rs @@ -1,5 +1,3 @@ -use std::marker::PhantomData; - use serde::{Deserialize, Serialize}; use crate::prelude::*; @@ -85,7 +83,7 @@ impl .any(|x| x != KeySpace::Securified) { return Err( - crate::CommonError::IndexUnsecurifiedExpectedSecurified, + CommonError::IndexUnsecurifiedExpectedSecurified, ); } Ok(()) @@ -106,7 +104,7 @@ impl } } - pub(crate) fn with_factors( + pub fn with_factors( threshold: u8, threshold_factors: impl IntoIterator, override_factors: impl IntoIterator, diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/builder/confirmation_roles_builder_unit_tests.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/builder/confirmation_roles_builder_unit_tests.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/roles/builder/confirmation_roles_builder_unit_tests.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/builder/confirmation_roles_builder_unit_tests.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/builder/mod.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/builder/mod.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/roles/builder/mod.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/builder/mod.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/builder/primary_roles_builder_unit_tests.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/builder/primary_roles_builder_unit_tests.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/roles/builder/primary_roles_builder_unit_tests.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/builder/primary_roles_builder_unit_tests.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/builder/recovery_roles_builder_unit_tests.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/builder/recovery_roles_builder_unit_tests.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/roles/builder/recovery_roles_builder_unit_tests.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/builder/recovery_roles_builder_unit_tests.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/builder/roles_builder.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/builder/roles_builder.rs similarity index 99% rename from crates/sargon/src/profile/mfa/security_structures/roles/builder/roles_builder.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/builder/roles_builder.rs index c3a651f1d..b78a0da66 100644 --- a/crates/sargon/src/profile/mfa/security_structures/roles/builder/roles_builder.rs +++ b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/builder/roles_builder.rs @@ -754,7 +754,6 @@ impl RoleBuilder { Ok(()) } - #[cfg(not(tarpaulin_include))] // false negative fn validation_for_addition_of_factor_source_of_kind_to_override_for_recovery( &self, factor_source_kind: FactorSourceKind, @@ -780,7 +779,6 @@ impl RoleBuilder { } } - #[cfg(not(tarpaulin_include))] // false negative fn validation_for_addition_of_factor_source_of_kind_to_override_for_confirmation( &self, factor_source_kind: FactorSourceKind, diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/builder/roles_builder_unit_tests.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/builder/roles_builder_unit_tests.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/roles/builder/roles_builder_unit_tests.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/builder/roles_builder_unit_tests.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_instance_level/confirmation_role_with_factor_instances.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/confirmation_role_with_factor_instances.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_instance_level/confirmation_role_with_factor_instances.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/confirmation_role_with_factor_instances.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_instance_level/general_role_with_hierarchical_deterministic_factor_instances.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/general_role_with_hierarchical_deterministic_factor_instances.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_instance_level/general_role_with_hierarchical_deterministic_factor_instances.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/general_role_with_hierarchical_deterministic_factor_instances.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_instance_level/mod.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/mod.rs similarity index 85% rename from crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_instance_level/mod.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/mod.rs index 5624c37f6..eaa7dab0c 100644 --- a/crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_instance_level/mod.rs +++ b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/mod.rs @@ -9,5 +9,4 @@ pub use confirmation_role_with_factor_instances::*; pub use general_role_with_hierarchical_deterministic_factor_instances::*; pub use primary_role_with_factor_instances::*; pub use recovery_role_with_factor_instances::*; -pub use role_into_scrypto_access_rule::*; -pub use role_with_factor_instances::*; +pub(crate) use role_with_factor_instances::*; diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_instance_level/primary_role_with_factor_instances.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/primary_role_with_factor_instances.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_instance_level/primary_role_with_factor_instances.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/primary_role_with_factor_instances.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_instance_level/recovery_role_with_factor_instances.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/recovery_role_with_factor_instances.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_instance_level/recovery_role_with_factor_instances.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/recovery_role_with_factor_instances.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_instance_level/role_into_scrypto_access_rule.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/role_into_scrypto_access_rule.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_instance_level/role_into_scrypto_access_rule.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/role_into_scrypto_access_rule.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_instance_level/role_with_factor_instances.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/role_with_factor_instances.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_instance_level/role_with_factor_instances.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/role_with_factor_instances.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_source_id_level/confirmation_role_with_factor_source_ids.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/confirmation_role_with_factor_source_ids.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_source_id_level/confirmation_role_with_factor_source_ids.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/confirmation_role_with_factor_source_ids.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_source_id_level/mod.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/mod.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_source_id_level/mod.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/mod.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_source_id_level/primary_role_with_factor_source_ids.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/primary_role_with_factor_source_ids.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_source_id_level/primary_role_with_factor_source_ids.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/primary_role_with_factor_source_ids.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_source_id_level/recovery_role_with_factor_source_ids.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/recovery_role_with_factor_source_ids.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_source_id_level/recovery_role_with_factor_source_ids.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/recovery_role_with_factor_source_ids.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_source_id_level/roles_with_factor_ids.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/roles_with_factor_ids.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_source_id_level/roles_with_factor_ids.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/roles_with_factor_ids.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_source_kind_level/mod.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_kind_level/mod.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_source_kind_level/mod.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_kind_level/mod.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_source_kind_level/role_template.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_kind_level/role_template.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_source_kind_level/role_template.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_kind_level/role_template.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_source_level/confirmation_role_with_factor_sources.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/confirmation_role_with_factor_sources.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_source_level/confirmation_role_with_factor_sources.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/confirmation_role_with_factor_sources.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_source_level/mod.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/mod.rs similarity index 86% rename from crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_source_level/mod.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/mod.rs index b629e2284..5d55c8468 100644 --- a/crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_source_level/mod.rs +++ b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/mod.rs @@ -6,4 +6,4 @@ mod roles_with_factor_sources; pub use confirmation_role_with_factor_sources::*; pub use primary_role_with_factor_sources::*; pub use recovery_role_with_factor_sources::*; -pub use roles_with_factor_sources::*; +pub(crate) use roles_with_factor_sources::*; diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_source_level/primary_role_with_factor_sources.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/primary_role_with_factor_sources.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_source_level/primary_role_with_factor_sources.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/primary_role_with_factor_sources.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_source_level/recovery_role_with_factor_sources.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/recovery_role_with_factor_sources.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_source_level/recovery_role_with_factor_sources.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/recovery_role_with_factor_sources.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_source_level/roles_with_factor_sources.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/roles_with_factor_sources.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_source_level/roles_with_factor_sources.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/roles_with_factor_sources.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/mod.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/mod.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/mod.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/mod.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/mod.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/mod.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/roles/mod.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/mod.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/security_shield_builder.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/security_shield_builder.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/security_shield_builder.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/security_shield_builder.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/security_shield_builder_invalid_reason.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/security_shield_builder_invalid_reason.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/security_shield_builder_invalid_reason.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/security_shield_builder_invalid_reason.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/security_shield_prerequisites_status.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/security_shield_prerequisites_status.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/security_shield_prerequisites_status.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/security_shield_prerequisites_status.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/security_structure_id.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_id.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/security_structure_id.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_id.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/security_structure_metadata.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_metadata.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/security_structure_metadata.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_metadata.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/security_structure_of_factors/abstract_security_structure_of_factors.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_of_factors/abstract_security_structure_of_factors.rs similarity index 91% rename from crates/sargon/src/profile/mfa/security_structures/security_structure_of_factors/abstract_security_structure_of_factors.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_of_factors/abstract_security_structure_of_factors.rs index 5e4ff10fb..1a18cafe8 100644 --- a/crates/sargon/src/profile/mfa/security_structures/security_structure_of_factors/abstract_security_structure_of_factors.rs +++ b/crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_of_factors/abstract_security_structure_of_factors.rs @@ -1,7 +1,17 @@ use crate::prelude::*; -#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive( + Debug, + Clone, + PartialEq, + Eq, + Hash, + Serialize, + Deserialize, + derive_more::Display, +)] #[serde(rename_all = "camelCase")] +#[display("{}", self.metadata.display_name)] pub struct AbstractSecurityStructure { /// Metadata of this Security Structure, such as globally unique and /// stable identifier, creation date and user chosen label (name). diff --git a/crates/sargon/src/profile/mfa/security_structures/security_structure_of_factors/mod.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_of_factors/mod.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/security_structure_of_factors/mod.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_of_factors/mod.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/security_structure_of_factors/security_structure_of_factor_instances.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_of_factors/security_structure_of_factor_instances.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/security_structure_of_factors/security_structure_of_factor_instances.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_of_factors/security_structure_of_factor_instances.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/security_structure_of_factors/security_structure_of_factor_source_ids.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_of_factors/security_structure_of_factor_source_ids.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/security_structure_of_factors/security_structure_of_factor_source_ids.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_of_factors/security_structure_of_factor_source_ids.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/security_structure_of_factors/security_structure_of_factor_sources.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_of_factors/security_structure_of_factor_sources.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/security_structure_of_factors/security_structure_of_factor_sources.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_of_factors/security_structure_of_factor_sources.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/selected_factor_sources_status.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/selected_factor_sources_status.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/selected_factor_sources_status.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/selected_factor_sources_status.rs diff --git a/crates/sargon-profile-supporting-types/Cargo.toml b/crates/sargon-profile-supporting-types/Cargo.toml new file mode 100644 index 000000000..321461a56 --- /dev/null +++ b/crates/sargon-profile-supporting-types/Cargo.toml @@ -0,0 +1,31 @@ +[package] +name = "sargon-profile-supporting-types" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +sargon-core = { path = "../sargon-core" } +identified-vec-of = { path = "../identified-vec-of" } +sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } +sargon-factors = { path = "../sargon-factors" } +sargon-addresses = { path = "../sargon-addresses" } +sargon-profile = { path = "../sargon-profile" } + +# === RADIX DEPENDENCIES === +radix-common = { workspace = true } +radix-common-derive = { workspace = true } +radix-engine = { workspace = true } +radix-engine-interface = { workspace = true } +radix-engine-toolkit = { workspace = true } +radix-engine-toolkit-common = { workspace = true } +radix-rust = { workspace = true } +radix-transactions = { workspace = true } +sbor = { workspace = true } + +# === EXTERNAL DEPENDENCIES === +derive_more = { workspace = true } +itertools = { workspace = true } +pretty_assertions = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } diff --git a/crates/sargon/src/factor_instances_provider/types/abstract_securified_entity.rs b/crates/sargon-profile-supporting-types/src/abstract_securified_entity.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/types/abstract_securified_entity.rs rename to crates/sargon-profile-supporting-types/src/abstract_securified_entity.rs diff --git a/crates/sargon/src/factor_instances_provider/types/any_securified_entity.rs b/crates/sargon-profile-supporting-types/src/any_securified_entity.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/types/any_securified_entity.rs rename to crates/sargon-profile-supporting-types/src/any_securified_entity.rs diff --git a/crates/sargon/src/factor_instances_provider/types/assert_derivation_path.rs b/crates/sargon-profile-supporting-types/src/assert_derivation_path.rs similarity index 78% rename from crates/sargon/src/factor_instances_provider/types/assert_derivation_path.rs rename to crates/sargon-profile-supporting-types/src/assert_derivation_path.rs index c241143a6..e3429b3de 100644 --- a/crates/sargon/src/factor_instances_provider/types/assert_derivation_path.rs +++ b/crates/sargon-profile-supporting-types/src/assert_derivation_path.rs @@ -18,7 +18,15 @@ impl AssertMatches { } } -impl MatrixOfFactorInstances { +pub trait HighestDerivationPathIndex { + fn highest_derivation_path_index( + &self, + factor_source_id: FactorSourceIDFromHash, + assert_matches: AssertMatches, + ) -> Option; +} + +impl HighestDerivationPathIndex for MatrixOfFactorInstances { fn highest_derivation_path_index( &self, factor_source_id: FactorSourceIDFromHash, @@ -35,8 +43,8 @@ impl MatrixOfFactorInstances { } } -impl SecuredEntityControl { - pub fn highest_derivation_path_index( +impl HighestDerivationPathIndex for SecuredEntityControl { + fn highest_derivation_path_index( &self, factor_source_id: FactorSourceIDFromHash, assert_matches: AssertMatches, diff --git a/crates/sargon/src/factor_instances_provider/types/is_securified_entity.rs b/crates/sargon-profile-supporting-types/src/is_securified_entity.rs similarity index 93% rename from crates/sargon/src/factor_instances_provider/types/is_securified_entity.rs rename to crates/sargon-profile-supporting-types/src/is_securified_entity.rs index df5420181..a945e7515 100644 --- a/crates/sargon/src/factor_instances_provider/types/is_securified_entity.rs +++ b/crates/sargon-profile-supporting-types/src/is_securified_entity.rs @@ -1,4 +1,4 @@ -use std::{any::TypeId, hash::Hash}; +use std::hash::Hash; use crate::prelude::*; diff --git a/crates/sargon-profile-supporting-types/src/lib.rs b/crates/sargon-profile-supporting-types/src/lib.rs new file mode 100644 index 000000000..69b54f035 --- /dev/null +++ b/crates/sargon-profile-supporting-types/src/lib.rs @@ -0,0 +1,27 @@ +mod abstract_securified_entity; +mod any_securified_entity; +mod assert_derivation_path; +mod is_securified_entity; +mod profile_state; +mod securified_account; +mod securified_persona; +mod unsecurified_entity; +mod veci; + +pub mod prelude { + pub use crate::abstract_securified_entity::*; + pub use crate::any_securified_entity::*; + pub use crate::assert_derivation_path::*; + pub use crate::is_securified_entity::*; + pub use crate::profile_state::*; + pub use crate::securified_account::*; + pub use crate::securified_persona::*; + pub use crate::unsecurified_entity::*; + pub use crate::veci::*; + + pub use sargon_core::prelude::*; + pub use sargon_hierarchical_deterministic::prelude::*; + pub use sargon_profile::prelude::*; +} + +pub use prelude::*; diff --git a/crates/sargon-profile-supporting-types/src/profile_state.rs b/crates/sargon-profile-supporting-types/src/profile_state.rs new file mode 100644 index 000000000..03663740d --- /dev/null +++ b/crates/sargon-profile-supporting-types/src/profile_state.rs @@ -0,0 +1,17 @@ +use crate::prelude::*; + +#[derive(Debug, Clone, PartialEq, EnumAsInner, derive_more::Display)] +#[allow(clippy::large_enum_variant)] +pub enum ProfileState { + /// When no profile exists in secure storage when OS is booted. + None, + + /// When the profile snapshot retrieved from secure storage failed to convert into a + /// valid Profile. + Incompatible(CommonError), + + /// When a valid 'Profile' exists. This can either happen when the os boots, or a profile is + /// restored, or the user creates a new profile. + #[display("Loaded: {}", _0.id())] + Loaded(Profile), +} diff --git a/crates/sargon/src/factor_instances_provider/types/securified_account.rs b/crates/sargon-profile-supporting-types/src/securified_account.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/types/securified_account.rs rename to crates/sargon-profile-supporting-types/src/securified_account.rs diff --git a/crates/sargon/src/factor_instances_provider/types/securified_persona.rs b/crates/sargon-profile-supporting-types/src/securified_persona.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/types/securified_persona.rs rename to crates/sargon-profile-supporting-types/src/securified_persona.rs diff --git a/crates/sargon/src/factor_instances_provider/types/unsecurified_entity.rs b/crates/sargon-profile-supporting-types/src/unsecurified_entity.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/types/unsecurified_entity.rs rename to crates/sargon-profile-supporting-types/src/unsecurified_entity.rs diff --git a/crates/sargon/src/factor_instances_provider/types/veci.rs b/crates/sargon-profile-supporting-types/src/veci.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/types/veci.rs rename to crates/sargon-profile-supporting-types/src/veci.rs diff --git a/crates/sargon-profile/Cargo.toml b/crates/sargon-profile/Cargo.toml new file mode 100644 index 000000000..570630fd1 --- /dev/null +++ b/crates/sargon-profile/Cargo.toml @@ -0,0 +1,72 @@ +[package] +name = "sargon-profile" +version = "1.1.99" +edition = "2021" +build = "build.rs" + +[dependencies] +# === INTERNAL DEPENDENCIES === +sargon-core = { path = "../sargon-core" } +identified-vec-of = { path = "../identified-vec-of" } +sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } +sargon-factors = { path = "../sargon-factors" } +sargon-keys-collector = { path = "../sargon-keys-collector" } +sargon-addresses = { path = "../sargon-addresses" } +sargon-transaction-models = { path = "../sargon-transaction-models" } +sargon-profile-app-preferences = { path = "../sargon-profile-app-preferences" } +sargon-profile-security-structures = { path = "../sargon-profile-security-structures" } + +# === RADIX DEPENDENCIES === +radix-common = { workspace = true } +radix-common-derive = { workspace = true } +radix-engine = { workspace = true } +radix-engine-interface = { workspace = true } +radix-engine-toolkit = { workspace = true } +radix-engine-toolkit-common = { workspace = true } +radix-rust = { workspace = true } +radix-transactions = { workspace = true } +sbor = { workspace = true } + +# === EXTERNAL DEPENDENCIES === +aes-gcm = { workspace = true } +assert-json-diff = { workspace = true } +async-std = { workspace = true } +async-trait = { workspace = true } +base64 = { workspace = true } +camino = { workspace = true } +delegate = { workspace = true } +derive_more = { workspace = true } +enum-as-inner = { workspace = true } +enum-iterator = { workspace = true } +futures = { workspace = true } +hex = { workspace = true } +hkdf = { workspace = true } +iota-crypto = { workspace = true } +iso8601-timestamp = { workspace = true } +itertools = { workspace = true } +k256 = { workspace = true } +log = { workspace = true } +once_cell = { workspace = true } +paste = { workspace = true } +pretty_assertions = { workspace = true } +pretty_env_logger = { workspace = true } +rand = { workspace = true } +reqwest = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +serde_repr = { workspace = true } +serde_with = { workspace = true } +strum = { workspace = true } +thiserror = { workspace = true } +url = { workspace = true } +uuid = { workspace = true } +zeroize = { workspace = true } + +[dev-dependencies] +actix-rt = { workspace = true } + +[build-dependencies] +cargo_toml = { workspace = true } + +[lints.rust] +unexpected_cfgs = { level = "forbid", check-cfg = ['cfg(tarpaulin_include)'] } diff --git a/crates/sargon-profile/build.rs b/crates/sargon-profile/build.rs new file mode 100644 index 000000000..8d09b6b65 --- /dev/null +++ b/crates/sargon-profile/build.rs @@ -0,0 +1,14 @@ +use std::env; +use std::path::Path; + +pub fn main() { + // Paths for reading fixtures used by tests + let fixtures_path = Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures"); + println!("cargo:rustc-env=FIXTURES={}/", fixtures_path.display()); + + let fixtures_vector_path = fixtures_path.join("vector"); + println!( + "cargo:rustc-env=FIXTURES_VECTOR={}/", + fixtures_vector_path.display() + ); +} diff --git a/crates/sargon/fixtures/vector/huge_profile_1000_accounts.json b/crates/sargon-profile/fixtures/vector/huge_profile_1000_accounts.json similarity index 100% rename from crates/sargon/fixtures/vector/huge_profile_1000_accounts.json rename to crates/sargon-profile/fixtures/vector/huge_profile_1000_accounts.json diff --git a/crates/sargon-profile/fixtures/vector/multi_profile_snapshots_test_version_100_patch_after_app_version_120.json b/crates/sargon-profile/fixtures/vector/multi_profile_snapshots_test_version_100_patch_after_app_version_120.json new file mode 100644 index 000000000..67a3fea62 --- /dev/null +++ b/crates/sargon-profile/fixtures/vector/multi_profile_snapshots_test_version_100_patch_after_app_version_120.json @@ -0,0 +1,1448 @@ +{ + "_snapshotVersion" : 100, + "encryptedSnapshots" : [ + { + "password" : "", + "snapshot" : { + "encryptedSnapshot" : "e1e71e49ff695ffc18dbb825da1b36da92e7c1c12d43bf1c1cfe50fdf69ded3526b7ce4dac2d1f46839c1d4347dcabe9042ee4f998e7362d050cf3b01233bf7cdbb2f67962b2f77fbba470cf0333fe69c56ea8ae2ba2a27670f946256aff1d868ebfdf8003ae01b7f2febe428c8e211bd1985c39d97208ed8a2c05116b06a2e344de72d7ec285867283e1def02dbaebe9ae2dec67e29c3aed14f92e39c1f7439a9f70fe25c70f7a4141086d72bbfbb7e6f538cd0b412072a6258401205df9caf363ac1f9ee6e16342d0a3bb48ebe79edb7b72e438c21523886a04df66e5aa5c4f4f91a224de1bd95f569e2f64e8fc044c08817f3c9a20fef43912c50815211f2de1a5682b490fbee19b202eb94b7dd4e826bba7d2fced9a334571e9bef813a081b901b8f5d9db361043759ddf0f8ccfab481e66ac8d906275ffa9f57626bb4e126ae45311a60af2325d49a1c16dfbc14d7a54d85392807a05df99616331b8ec10d9375d99dabe4fa4386d553d13a08880cc589781049cdd2678ed6666fc5427fcbbb8c8059e9425ad59a46cfac74b8f97c391db6d22bcee57dbbce4f05bbd737dfac0cdfb1cd3a643742b6e007b938c1875f585e12a59469aa8fb7208e72b783c8f38069289a9f986c3511ae547d585be9141be5e1a7f1c300181dbc4780a26428c11ab514c3383f2cac6d27ea2e603fed9b4f5cd4aff034c30cb0e160172592af970cd9f2acf33fbc8796c4bf6d4ccb147f07db444ce96f62ec7546ac051eab01a98e344c18c5a251344e76b3e5cdd06b9329c1b712f34e596c9bbfc0e74bc52282cafb64ea37db622289d25c635135871b11153aa99a1b5143345705bab5f0b4a927261d8cbbae29f001581c92be403820247d9e4111dedee1307fa650eb74cd777aa466fb58ef499f416e3e7951293b9c87174ddc2c028621cd0cc438121fcd621b808b63441d60354d15f062a997aaeef745c60eec4eb9c0162316ae7c0cadb81c90d9e806441e2d8fc9c2f8fc0dfca4984247729d813b9cfad51a0ca9155924fa359be87bad6b220e16466f77890bbfba530c1f591e398b9ec2620cf1037ba45452b757a99f5a27f9b14558a7e632238bb1505a8b600c73cd44dd6bc9a0383b6b2beb7e55a3d642bbeace067f69ade8cab949b128ce2a307eb8d9a3da78c971c8c4312418536e4805cc07dff383077ae39a3ee12fcc5df8e3f0eb375f99b489db7e58fb591785ad5d7bb6ea7defd235af854633152042c0628d238fa7e795513c4f79e23f6218d6c2edce67b51dccc5f2418eacfc6d20621a182790875ecbf3f6934a0be9badc7082905f86a08036bafab9c2268eae5dfbd05d2cadd7ab39b3406c73b0594a7b2a55f6cc607b6f1e285b9fe925f1f867805508cd5e714a29ffc8bb02c005447fa427e2fa3b02c5f7206d55db1bbe73ce16528d0ab672141c2254b958913a1dc8a99da3aa607dcb8545c4d8b18016e7bb888acedfeacc7a70cf31fe84cb7535a537033a235b62f5309d2c130bf4e223f36f71625e3f46d0129c2d6aef8d81e196eee991fe5306a664345bec6c52f2fbe6ae8634c9d4c6321603ef1425bef8b691b363fa669ea02057b5f4c0993db3f0176d2492a14bcc39351bc4eb5b6f9028465abba94476c6d83ca378871bd5b2fa89e7d87c53605d8374f3e155d83e85cf103aed1d8a88f211afb11b7d0f25b46bcb23a8fcae055c64d885c504926ab18a582d2a6e76487f55e63baf25c71371b2358c5bbf75d2b21255dbbc0900e2dd0c94087c1b80f265b71a5ee8db59cdffbb7e73db042c71a39c5e3028a08eea67b635b5de9de9a78729db1a13e372d9b9d013cea1571ac99cc078c1faa5a8cd520137b5f5294e4c64d0a3f935d0bc19431ded86c3cc408d65c4d88ec4ab2f71289ac40e406c90af0636e29db81797472078120f594b131c04e408f19294ea129899cd3133131fcc3dda4cfe28f0efcff850e1d77228ebee04fb7f56a2dc1dcbaff3c5f68c20dad06a50c2c93153cc5213d1f6923c962a443755009f3a7d0b107ae8c1705b8599edc8d96dd71c5c17833fa7048dddd566a3980c4b6e90347873f13a6401c822128e0bfd01d2b366c0f6bc6684483b8da75268e4d4ffbe6eea142b35d58ebc7666b5f999c72ad90d9803c218d133666381ae696e69ae8193470c2b0ae34d8d065cb7fdb49d402f774bd8b7c589659a3790a6530007fe0c1bbe0934e06784fad5eddbf45878132ee4d72a69cc4dfb2e4e3438c9aa40fd9dca8ca7e7674401ea804b7b43d67c90980bf6030637efb7774164b7a6e2c7cee2a6bee9b8d8cfc67f24bee83ecee50bfad191d05d40437a0bae6d254d883a09a763b5a7c785ee6ba5b0972dc7c7d5a304e2aa20187289b5f67db0286ddb334140251830221593e54b08dbf5cf6000d6a347f864cd5c1e2a0317ee17a11777ad4fa2cc243dec0a92740e34a9a153714e5253c8ebb3e391fd12ec1564de8a109cb74bceddfb945301c106b815110d64da5c11ab34a6997b0899a551827aa0687309eefe7e52a0f3f980c6bbebd78ccdf1a9e8ffb33b254b24b9cd0419d193ac2978aae7c2ced608659f2184b8040e6c9843869cf05e47002ad3fd948d0cc75e681a0a4956f400f61bd46431e1b0247f61d65830a629d555ee080b473c11023a3b9ce4b7c92fe5eb3bc4c60c363073d87a77d2faf5576abbaef18178b4d97775b46925b6f1b901aa9a2f99da020f0fc0ae1e5b6e9de258e5e4613b96199b232f960e2b7085a5a6ba748fc967fe81e76a5ffa52fa78595baf007cce31b1d9a303c26445272069ac6c44a5b31ccc2475410015c540605e14a070d5599417b5f13a289667003ba32c388ac7b539b18640f196fd0fed4ef88cb153e4a9624fab3ec3821219470c6bbec9ad9939e42df3f6579caa07fd93bbbadac8b756e1f4a4db8d6484a6ed051dee9ace12609f49c534255eda7f54a0553a16cebf28a13665f821a5b8e4292f49b5383ed439db070a0e085bfe63498a074c66a037c9bc2d2ff3624df6366b4384bf261c48a58d11c877c6225f8520d08ca8d74f78e6424a7ba0e94fa8e98d91dc1e91e40d9a669ac38cc070c5435167b2394f0543de5469d9bac7ee86823ea7dd8cb03eaa8c308e0eb1307fcbd0f32c64b9209507a80a3bbaea8225f0e85bb95b0ac5744071fc5a5f5369bd7b9ef8c18e08508d2ed07eb3a41dda455279be6a8fc1235352c918ccd17915b5ed0557e8cd95f92bffb56dd742179d3ea15caa5599bbdfd91a76c033a775bb3f8e75cfbf4f4dc4e6eb3e7415b65596b139f7817337e09944d0dc7f373f583e8d8a23a3ac2d000db9867f688a192d7c6c4935c24562c0329a37e4b9adae0f3a57599dd4c3b7a4fec273110377b8b2c4b30c214ab49f507cc1518147835de0ba7d6823a8673558f41c6f7219bf5b965413303cad3e74e64947f9490d46380c0a6d121af5aa9c16303032a18b15d3f5b839da009ff0c817cfbfa938f0c84e793593fcce88b389b648366a8569a9d8fca8786c3c693e9308085fe7794256f83ed4c962c30f85426cd20aa1e7714d6e1b8c1f3d92560eb9fc300153331b7a54fab26145cfff9c6f97363dca55c6f4102c5d988e9989327627e909eeffacde197da1f7acfe857c3346491a4cfcae3874b78a8e668da2794e80292ce97c7f16b5c677b174d72bf94993cdfe229aba6a55488137ec22e45489839b3c947c921dda1b60604a939493a1958c75962e3ca438119b2aacf1bfa02d2382ececcbd3bdccd20e84ed4468104c233664816457bba8f812d49982edbe8282ac2a00c65a1a3cce03a68724b93060f7450d7d98140a94f6cd0a6d3edaefd92376790902a0f055fe64f055b83cec25af9f82094c150b0fe5fbc73807e7f6684711e3574c8db40055dd514b47ef287ca772cd5990b7039390cbd73e8075e41d45f384f9c4910961279fb4fb466302b5a11d697374cf0b2cf6f2cb874d1e484975fca01ccee92c647074a2f43bce47953e50e06f2e69af9e042f2a5a70c946733a6d31ba81e84e866e20507caa35809aaeae2da017aad7ee74ce67349dce0aded660353461392b10c525bc240a9ead5a31d3fb3ed2aee7483ed7771e97696065fc75f13c5a7fee8da1181cd037e8bc52443facd3c06a9000ef6e1c90dc79a53f39078f44ae25da150604ebf18db8aaa4fbea7107286c8e68cd5e1cbeeb2201f3e669dbaf6e944e1407e6110ef735474d0c952e59c334e2938a163e01a45a1a4e6a0ab510f11895be518ff6a828fdbc60f29ca4e4b58bbdc95183042b84b320699b009cca28d50d14f6eb0462be434aa8e2205b0692fbedead345467fc239138d29349b6375bc6a21bad3b578c8eb10bef7b82260784924100d50511d1dd414309a57c9c9ce75ed3f2c600919bb1954c03b2fc5cf01cb7c87bc1fff36f6fde5d6e7536c692616bb9dfa362cd921d0335a05d9b313a44312db145a9b7c231c2047dcab59193bec090aa3861d647054dcd61154033cc852d436d724d9cb972535db60239d2e080bab53f71d087d1cdf7e8153096c559c7acffed16738717d40313093e49f48453d158a1547675914963485133676aadacd28b35c2c52ba79ba5e2fe58bc5a2bc2f8fa57d057e66617ae31b577a25f002eb39fbd67aacb3480ed082120ecf6d495b0c137e59c2fb60330f0a5a2e31b341a863e5fbf288e60f43bf6494d809ab079f25396928c2ba0e818e39d793796a1c4eee06e8e29e628f7d4d27d22d58f47c40aeece580e56ef41ce890ab4f72fde6ce07e4d91d8ba30d9321f63084422d728ab1d47f43c0f76debecbef75a62979778f235a488c93d51308ebbaffbecd469b637148e8524da7e889332a7a071a78b844cff75028cdcecc6cdeae3a08855f545dccb1e7053d98beb2db6629d619202caa5434748e861082a6c1c352f0478279cc9e107385baa9486ad62beacc247455c22c6e524ef7ff00dac7192f2d6fdbb12ff6b1337204474b341a4e59b7a408675e3f765d4750e43be0bd04127ab3cd1e27f5807852c8df6cb92438254776131f3dbd2a61be4be68c3146ce2f106bb71ecec5031f90f60e39372b90a577b04ad512d897c72a098ab35c132f44ec979687ba862f66d54b22bbcf89821f09e6d7fb8e3878a95cbd351d64827ea2ea7e0f90210cc53573a13d20e43be4a68b8c49f295c43028d2cfc25cc9e1be543c11aae92f0799438318958a25bf5e4c5528fc3f746000b049aa57d2344aa5494afbd626390d16ed2b911216e548a97b0d5595a13a5315db6b12a6f3a160d1523243a35eb16dffc22eecc82479aac266250635c6af355dc9804938e0fb2747c2f5d21347309e392f7b737ebe5f62b3876cf8fc76867b8e49e771b4a235054689c33724b6f6fd17f6a66b3d3e1a452cc7541d45506f611f5525beb092b112d3dd995b04c682b9ef67a4e40b38c20f7fe49f9d5bd63dc7423929540f56e912b25ce8f459e1a12d9f371de504eab9c8d0f65fe465cdb7b0d10219bbc86577ace5c42165dde377ccc5a5cec51cc53d0ee7a31ceab84e5e77110c764c944bbfe356bac82975fb7951b8682b0483fc3559df195322c0dee83e2335c6720754a53635589aed79eab41d0f1e9db0471fcb36afe88d6eb19846fe1af0c5ba4ef5eafb7a1ca816b1e1895b251b063c1cf6e5a125e3f226fc1f89aa84bafaae687b94208d523486a9059974b7455a9bd6c00ba09af47798d9eb66b1906866601376864a674ee499cf2abaf5b7734b469afcceeced05400811e7b9ea813dd60e1223bd9deb8ae4860c3d1c18daf644202473d903bcb61c8e4119db60160ac0a8d42b77c90b6882e3125f60db53fbbcb7a7a4e15b76d8ac5678f9c723b8de7c2454c783f337f85ee2e25cc628bc3988ae459a39503d99119e74bd98b5b2636aeb8b3cf24c1f269c9550837a0a731c58f084cde33ba866c3acfc21cad78246aefcb91f3fca172949f45577c3ce0c655f36310130cf4050a1e5ea8ae54bb38439d01a8d5b9f2fa83001c8bee96e714fd7705c6bf4ed4f780a8d1dd77e43828e97c645dceaaba2ec514e9ff5a03555ca1ed37b6670af6d89fac79549b85f6495eeb61047eb903db0c983b1a9cea0fe9be2a873526dd7cca8eb7be7f2de2d45f263de4ff974a4f8c60d00a28224975e61f74da5061aae3ad9bf9e182be9661b7d8c1fdf6c5d8f5cec111ad4317fcb9c0b886c628b3b64574a97be6faee406266c0ac8d197641a836d6d8980fb7d394be0aa17c0eb38550f96a8a64e062bea9d07bbf8fd0cd590466b0b9d14ce40de0e4003d39a549a446e05edd38e2633afbc4792e00c9c1fc1d03ed0d01138249ae80adbbe7704c36a0a8dd16a713bd2a2f1353528faefb5a3bc730917a35317841c6c9f2721c3362e61c754f10973cf1dacc321ef4553f25594e2e98bfdd56a44746296c685f3134135a53ee25288d71fec120f86819cc2e5c778939964e9d628936065d2ce09c6b089d621efd4dedba4d3304edd3f646a5783b83888b38699f41a4a9691207b1d823ee81ef5762ac66e2e8137e3f23d118dc19390587333d366472e98d1064afd523b54fa519c631a5511e429ae0a0b0d3c7a721ae1e79260c9edae7e3ce905c20cc65f1970046d167dd29a673ac15cfff40ee43aaac60c30b2e41c6569062cf14a0f16532155d2aa93d551632618d051b23c6ac36908f9d2e9e92e44a7c55208a39b84ceef9bad3ab877bae25c54f0fba1b4f3d962e26b152e425205e1094da9db03d6307af160b63c72c521dd69492987ccf9315843410f6a4ac4bdfe97ba075e215f59aaed4ce59779ef8d6791b48237cc07899d23f5d872df55336871776db19cf1049f008b61fee488bfc6978616fc5e08830b274e4f8441029d30add0b455e5b506ad67e605ce332bc5cbed3061436990bb6046afc84b34e6966dd7d3e0829c586f704f38b5135fe1df1ba46dd8b4e34d2c1f9b6b29755f6833cf10b3dbea9019dda2e64f3784cba3dc47d915c190503cab3cedcaef5663c3fd115decc285087a28fdd92263e212181a0f05abaf4621a6b3efee80ea49501afd542a126e2536361e81e2a1b21a7c8c2f9f617ce1f86a701d2669d801269ddfa99d34f9edb6166344fcca2d739108243733618f7a7d637c2db0796eaa460e8d45bc678089caf1adafa02fd10fedce17ed8c2a2932a03d0b764c3c76c3165e6780c31611d2484122d2583a801f11e1c158ecc923141a325c799f6867eb082c884f737065ce66d00710088ea3eff3eb79c72f5b4de9694dbfca34365e5f4c85418164b01710b9f59a04f3dcdd82ca9351e50c5fefa75a414e71f9e441b762badf7aa3c939210b13ea948b5e9be9bd601d3a04e016f2a158799d0e5ee3c3984daffa9bfc79fd75406247cacb475b093b70015ed96fdee7753adcc26faf4e45d573d8ed5444b2df0f19d0ea15622d4f222faac74f980af1e4dc12e8ac56c43f35a8b4bc30ca81070ebe5c5502a31818a26d305eef709a92ff7d042b1e1180b8d60d2f0f442320dfa7c720673f7b899337d404ffed4c3d753f6d7b7c37c93b2a899bc2497bd49ec2421c111fccbd324f9d1672431eeaa6b5576096040b5bea543f1132cba0dc76e50d50772158e832edd6a720493f369764c99911cc5fe89fccf606c5c9e6865ed3e19d5af5d0f93c88a7903472b0ead8785ed7cb067bff312505bcaa6d69e383723c2942078ecb20826d912b5c1de5b17068d426db9216f15c0ba160effb7fcbe7af81e81ed2a78bd122c3b4fb82af16c91c2ec9188ac2ddd72a60509b208918da857b617f0c2fd5eb2e32cb8286e50cf6012598cc8b738fc4746c645229dce20198220ba68d0389e3f0c15e1f4b736f588839ba2cc3bfff09afcc9065eafdcb64ba91fd025e3c216197afd5aed28fe9dbf278de35c38069edb5b4042a04b10be2dc63a96a3c70454aaaa772b6f2e4d5935a931190f652d8d6417fd53279d93c2079f4d9adccdea43f3956f730ec878387ba36ca8b663bee5f4556c01c25ba5a0e1e9cd2cfcc597a68ff480b344bf8d7a1f4af75ce379eefc666ac83065d9c87045b3c0314679688e40648e28214db2bef8edfc58bf9cc648e6453a37ee6edc6fdbac4062e2a9e0f5268be39accc5e6a035ea2f1277f8f6681ebd7c65049049b70b1641efe7ba120473417e3e1af1032149b214a9d2745eadb54804bd9aa61c3506fd57a168a337179aef7b4e423fa7a3359b7d33772cf69ae963f76740ce953644b7ce1dbfb4ddba58eb4e6c07a60b1fe36d9307e6c59cbec6a962554941efc984c8f7eb2e242b2c9e3037b8a1c33b95053079628deed75497764dc3e06aad2e9ff1b497650563fcebf2d9e7b13b00392c472e52bf1f064e8342423ca5536bd0920dea3d97ad27e2c191067eceb9cdf2e136354c505b06430622c02bf51ddd6d05270dd3b06798632096bb8f120bb72d5912d1604107d43508b88947330c77f9ce8c5586e269d79a8bdbd98bddcc35f448790d538c0671ce161e0369043600b71896e8a24ea94040aaae9ff8d97d19c2bdbc2c6f08c411e4e85e1e5c8fbbc8a5c769fba5678e0e904f6886d070f08abc2d6a4ebe2790ba028bf968ab0edf9b8ed38acf70f34e1ac6db205a31c88842a846eca81d65faaff5a2fef49a6e7215f3b3af0809926b4942479d693bc3a365e6adc04830600560b30132d4ed7b994a47ef18dc69e52d50904f49dc5aa9df03fca009b5681b1aa191f7f7ef2a9b9da42509c03eb99ea135ffa715fe0380e8333f867f2da337382222a8c5535a559551d3a1bd151af8ae914b260d43f3754eb372c164936cc64296f1c506fad262e3704d9a994e3146413e19060710989c9433e235e9dbad7692e20519770b0f8995b4e2d5f592de2a4335a9d9bf6e1bc8088ad4c29760d8d67cdf8eb40f72bb3538fd22cbf4d371b81ee3abad96351bb7d4e57258ebe1c639751432b24374f26610c1429416e3d5cfd929d1ead26fe99233ac4bcb634bef1dd8f5e0722d682878e6cc8e6601e2a78dbd7a0bc637e22b969e60c07db3e9c409008846b4c9ffca572509642d0825776742b145ae413ce669c3f1013c5905bfdda0818da3e8ae189e346f484f064f1879ea69cf215f2ec280deaee09885029ea31dd6069dafc97f9e332dfc47cda7716754bcd638298cf4797fea0a54731596269de6eab92ccf809ef4ba2a869aa2d0a22a0ffd932460deedcbf2a7eba364233f8211b19b25a378d52a880583ac8872b468f73b1417652debdb2f4daf7bbe4b9b036ee0b50d16172c89fadadb72648674b65b3b9d9a8be8d64772dde32097e1f4028c4e3b4bac37e3e2b658da516228841352fec818ec0745ddc4bbad04b5a79b63e98b0efd309a0972c8e33b596b90c77b38f4bb313dacb2d1a96fedca7dbde3eb554e3064bc8936efedbb9a0c155f82c17ece10a9cf51c4c52da5c3b5ce0624ff061ee10389e05ec2334c5d0aab70be19acd04319d8d5dd314dfc4166f9ad2f9302af54995e26899c299602e6214b20f7f3a0b229676c8f4730b0a4e0737a2f8cc1b11568480ca22023fa10ff80ba394bce61c5dbda0b43dbf82b73f245964027b839fa695515e6e4f7f80e164500b50687589e5a295c3368dc02c15844f99cb45a3baa82e4560522bf3e28af451c482212dcc42d66f39e8154c9d81a6c446406a7e1bb2b39e536acfbb35012666ccc9c4e583a8d4a7a6254bbc6d28a59b8bad106e13fc6cc0ef4bec75700da18ca711d91a34d090046af6753ff14c4f94645453ebfb28b5cf827f084798f900ab6257e833cb7519c821431352cd33ae6deca4fbb9ca936d7587f7212cb75b0c917d69ca6abcf2917b5afc2136dadd04555caa50722df65d05367d1f6d3591c99acbdcbf4aca85217d03856eef5a8ac05930114010a6ff91b9326dff8f96d8225d82b212d902952d8c5a90f425b9fb5755ad7aa6bb2ae5ba338e46c063fdd5d6dcf5c91dd34db11dab99f7acd77542c76b1e2e7c97863eb8c0369e5eb63c05f1592687dd541e3e9ba493b01355408a4a9c6bdbdcc8b0405aedb2c015b6995d01b96531864ff355cc285807f5612ca550c9322274b8ca08ddc066c75cf54e8eaa00016bb332a66ec6959a082a91c22dd58ea8c3b34dbb01ab812172003eab9d3b21e91a389a7ce9da2afb8d90d649f0f127ccdcb299fcfacb7fff238e560b06e9002a75fa06288dbb2aeaa6a916bbbb95b7e0689047c0da9b0297d850a0216765b42c0079148fdf01bf66103f7f740b87ad06ef09a7883b52ced9991a416dcc1fa3cdcec4db75338cf06d4eff3f7d2295dee9576e657d8cf9c50747118b39bb012a9fdc47ba45bb8f905884c1375dea6d0b429c9f83335df9b0123f9c82ff71ba3d7d07548e6a1ce065a7b565d7c2fed01129a0d9aad6271cd61feb656d34c0341ba517157881f3786421a0aadcc8db4a8a45a3792fbbb611f8dbddd03f9023ab436fc8661e148015ac272350f4ae47cd06e0de1c6d435d1fa85da9e0ccef701e7077a6da36f3ba458e8480d4e377304a3c5aca65733814e72630f632e3359e7334facb46084ccc6d9d372baa89f4587c183a6ee3e093c597c0c2d14abb6068f01f24054f39161f4aace138cb272f32b7fb93ec3258abb36e9471a8d2d2a89446d119466daf864f80964510eddf4c661eb23b346bb86b7669bd06cc1b3564f67c5fc7d0d2bbd270a7f4b8a15130b7450fc430555ce8b8b16a10eaedd34031e6b2b32b940421ff371e6d31dfb29d678b4052f83b9bee7eeb6f4d65fb527bd8849af3fc5a20acf98a6784df3b2e859dd8a1192f6d1a9445be11f9c98b961924a7b9b7500d358cd56cefd3e35dcda293342f217c2d3d55b81d444dc904abc88a8b2adb0edcf671de1f0a01bc358501aa5b1f7ac92ffe8e95f407c32a52688f6b918fc02abda3108b71c6579ab2f0e432a898368e6de83f1418fc01f3da3ef36a161fc33c689a145c746d9df0dd13dcc2046ca827903096c2d462276c538c330f2fe9a0769462d34b46df165dcde78d46036bf147c613693c6ba631894a2385c51aa2f6a68a287161eb588075af3af48adcf9f955fe16b03a47b5c8f6bccb9a913192da19b03f84ac22f410870b78b895da9d337ceefe74c73d7dd34948cb2f30a960d1760a8b2372649ef0663118cf1b36aca6deafbf6420c6b5fb009221712b63a0bef9b42125ab1ea03439132c71d0a3eeb56bea10ffe77bd4911349b112707d47a4a5f0103ddbe2157cc3311fc92641d4606ad16e2869fe18f8b66d4f53c9efb0970a20ba085c714ea1e69501d4a30674b0845d09de654798b75accbe49e4bed770fe83823fa539c3a4c4c27117257ee8a922e008d40792ccc0092e57dab05eae5ee82b1144ad9354bffec29e5b1b272ea32d2fde3b83acbff8fa9928b8a3dff45061ab1621f14a95ffcecb64d81f5ac015e140b7dc4e1eb5240fc8be52da4960b57aa37ceb6011e191f943a2baf85d271a0823133fd1b2ce36e90fa283e2923f7cf105e066e52ce0c80d0e79a58b9b545720e95483156996a38a60dedf9664d708584389fe59d5ff9b65db71b79a31adbd8835b7878f43bea305e5bc4ad24d3b42cd96cf9cdbad9942e72a8c8365ff3445e4da8670d67a933f437bac47ae42baed787132ee17c449205c05837f095ea29b317da4454cd84fc407a7b0ef1de9a265a6f25ef2721f05f6844793ff683fe7927f0707ef84569d053317c8648726d649e189272d7cb117e441bba9c021dfca5e7a75f97512a125ad6d00d10fefc099775a0a1477b451878f610eb83fe87e91dfc3969daa811f92f82563671edc434ced154cbf2e1ba3578fc1f469e86431e053ba685be2fa8493ffcc7d2e05a548f67858a2285b2818e53a0fe48ae281d9e08f1aa0055dd6d9ce0e6f63117d18db8bffb5f871d964817a59ce84f483eccfc183d9722f0b47db336f19a8c45006de26ca409dd2d5c4e43dd3cc740c08ffe5c7d08a9d404c62ddc91e45f5eb902fdc2065a0ffc3f7ffe56641bdc940b92bf625e62bab6fcc0c48b01ae27d3fa39f0e64d9dcf0e749a3aeb780edd91dc0b6fe64c2f23c702aeda64d89210ecfb277edba7fededc7f2d7fba931c938f626270320389fa3e6d04797c08877f568cd2db733f2de6117cc74decdc1962de5df5472f0c1d9d81cd05c939866ca685ecb8f2f761f64f341ddb5332058bfe1906cdac7f2c039986489a02bb72c6ea785196b9c008104bc7c573e91d4846116d36ef04f9afb28f9cd3e2122bc0b75ba3526b8cc67c8ce475aa526f0237e239ed70994b29115dc632222d41fb0e4ca0627f302c83bc514fe11fe1d0888575ba0a3b925c374c1fa78fc06e981a632c8478df3d00e97402d5ea757958c99f852b4245fe6062c50356972d4c8307dbd60ccb12ad8a1dc00e83fbff3e820ffcd7e0d60f8d5d1ac23ba1922d4d22d26541cd42c0ddb74a901c5ad810d17e9a2de80b72e526821ad3593afccf62933f0597fee50ce5e2407b5397fbf0a11658e08a188aa3bc0d4d50281c2eed3cb2438d2d7f94bc6de429fe850d3590d3f324a6ff092ea891f1e6c4ff7535f1230966b177d2317afbb181a41686cc9635bdfa556e7c25d018a41a81ba0ff9023a7a4fbacee5f02b7331eb8641a335cecfb7752e02f15e05cdc0fe1d0fc71d34530542ea6f9b78f020a8641ba19300d3e016bfcd1be0d5c1345624d3c91918ef336d467e0e9fc4663ee9b018179d91ffab0eec597733286316d335f107a8cf05b74986620e5b1c3ac438b9336b08a5903546520736b8cd888a5deb2b95a7a66671dd64402f592923fa10ba811f1065aa6bb35429a22e83f6e4670e2d1323d2e042dd7074ec0c08a9a87b5f0a3ba610bf6a5cc6503f696959ec6d17316dc92681f984605b7f0001a16b9ace470680b7b2639ccd3bed9b7dd964bb0a1a33813294a27ebc181144fdda8de1d2035b873605fc40ef41cf64f3a0676251030b73d7a1f164577a2a7239a4391df5aba697063bee634d729d655214a75abdf1a49442949b3ea32b88bfbab7a612fcab6590efc398b22ebfeb129276bf776413af825f97ee51478852982b5212b0b3d5f118f1aef4744d0fd7569bfe57bfe8cb9c928f29fedc58d6fde6a9526725d534611ef077bf9f0b5c496fc23aa09edc4133462c0367fb071755c1c505cbf468882f8c1818c45ada43ab3eee4337cc9896e10bfe05b8a47da4f0fdc3eaec2f60e038031a984c0bd8a38662eff771f2b75d3b4b9ae7bd16bd380b767d8b74bac675a8b0c09c9bc2f9de09ea9a3b26062f7738b08df25f76f9bfa2de1f05524ae1fa6fb414d677babb11b24f28ec6085b25798759f5aee15a14b25de2d5bc40342c7dc5dd36f6f4c4ed05b14a4c6917c53ac38ea90d3d1f6449469e7ed671f38c52565f0d60fd691b54434c08cbb511f3ed72b3e1472641c78a476530e30939a53bcbb65bc412cabee05f4bcb50df1a28287d50c763f742ac8b16b15093613099eab097c162bc74b36c620d0fbb2b3f53774fc8ded8a3f5d3d0778845fe5bba8c81d739c720d4ad065109edf6eea87a0909de40755c538a24550a35e43661da04ed5d36714861df2aab32b97d9efe692c98a081774bc5ac1d5d696175469cd5c659fae9d5d03c512e882496088305dc99820d457ddb738ba623db896ca913e3d6c2f07eebe8fffbceeab39d034c8941aa392fb329ca3d7a9686b8ba64392ac8a4f5ff509c50a59a93fc8e8d74bbdd25902696effb6f369090cfba9fc2ad8a21ec2c70ecfe7ec8e470da294daeb9fe0d18ff66865b443b5fa649253157d401725a5bde2268454069b03ba126c6e4e7c73ffe2bd82db607c3fefe21e9068817286bf646d8fc9651cd6cce810941f15d5f9f8948ffc93f7b5997f8512924bb7030eceda6e6bf013909b4b4f71187e834ae1eb33d7916290285349c4e9198fc2a3aeb548ecc09d2a350b756e327c4990f58a5b0466041150cb40dc6dd0494a12646f142eab11dccbafcb7eb4417025b0d4f4c6b34643d17e5e07054f0db7d80cdc18e18aef11cb5aff346b2b2d6e08ee61ee0e9dc6a11cf35e177550c953bf669f50eeaac6a1008bf3837660066364288f25c9678ba6bfa44438b7597eb97a5f056a7572b1e88727d2dfda5cc79742c84799d2a4042dadd89b5c2f9d0439085fe0110b4dd8322e2eb8e6a3d0691cc60354c513a78c59eef22497e931e356009f86e54ca754aeede28ce1e506fde2ed6f704e56aadde51a15a51f0b5cc7c6c1aee92a65d6db1ecc9fb47c02eb2292c5f05d60eff1dbd915e34eb610aea85dd4a46b88b00bd19d3707e86d6a404046b8974e2b69ec502383443364d31df62ec24b031ada8383970cdf7eb0a3c35fed7c02d33e4dc662bb418cf4418263983b549f09c8d315ce2723964c507ac1f5d6a70258eea28ece3317904839f45b2f2605ae799fa1ca351764de9df779b4537769078f7585972cd33e2c879b00cb3d2658aa79a15e8aeb772a1a7a6dab7f7c27cff01b8d70c7b0412a6a512dd9f80120c4555dd31f873400a5f960cdb4c1a30e0ae555822d3b360733c9e3ff018775e4b109de2bedaa7cce324de988ceea72c01e7f9fce985efcd8245e57ebad40b32bd1248509c8c5dbc06926401acda6cb43277bc32be8bf1e315ae027ec40736571c00edeaa203df805f66138e527e528ced2cb461a80478c795b031d17d9a51919042a60c69fef973b6e193e37c82a45b71ad4dc59c0edd05447972de75b9dc90df72605874e2dc09abc97fe12178738eac5a853ac771c48d3e97fc59b00f3404fc30e0f54d322510883cf46f3448c7e9cfbc14ef148fe557e9557f61ca8cd20fcf75dee59e931b7e2798251a9652fe4037d7ed1a8c22467cd4c68addc702536a648a13d50716ddfdc8f00c76035db80618638f6599de2876edb8414107b87153bf81ac7cfa9529f5a338730f272399c1c9b551620bf90ac6a1f8b79bff05519d670ce31bf90f47ce82b4d7bfee9f1533c8761d58fc61694f7d71e40ba958e0b9731091aa6b497c44a20743c68af80ba7446fe89c9b878eb8eb3fe90b112ca6eca5836723f058d0443a8bbb0713f94ec2004677f05034a58cf3cc5ecc95a57772569cec1c3551ca9b40ae23917c22109b38d9ae85bb1ba892669792087b90c5b11987337daa738339cd36784b11819064af91befec53af2fa027324ca89349b485b4b0409cadc10bfe38667a7b8d0d17ed11c68023ce1184787341209bf087ad4c43d13f02f43d72f69d6d2bee6d1ad61045a687ed8eee1fdb0924623566d21e5fb6e48e9abaead2ac3ce06c9b904764c662de2a0bf37242908bf62524daec8980d7c4c39b8c5e5c28bc351ed7c243416754a20a743176962404537e5edc9c63de0faf7db3ac5bcc93f2bef1a8f4beea03d21118c62b3ea390fb5a0ec208d926cff659a75f6a95fbec0f8603512ef93f83ed4a221b29964029a77c89e51a367e8c8e069d924fc04f8a9022ec4bbe497ff60a7b3484ad6bd72e5634c16ae6ca19f7a28d5276cefaa7d6f50baf7d718905c71af100acc1272774606d8931b1410b426d91833f808b3455877919b581cfea4419209850a6742fc1431d13020ac738dcfa5748e1c470ba273f007d0cf3ec7383641b7bc6e3a2c2ab7ee8f711fdfacf1ff92a4ca82bc63b09ea14eda85188cfcdd012ce1ae9899c3e9d1c945f7a4b86f6a6ac8665b084bbea04231bf69908fe9737d9cba044c6ea825a55809ad84d2276e6238b9552e9a01c390f12390836cd26337e9c7b277c35be06fccc8c35680c263f06d56192c6a9bb160bbbad67e5a23a57411aa577d3d67db3b685efc37ace7681446715ffafe069e5bfd838dc82713ce6deba2903f5540e6c2bfcdc550074c1703d7610591ee9704928d314e1dc9dd87087f6080c902885661f16a55880b3019c81c3a2c60acad8724d07507695f70422261f7d71c0e05ac367d10c0bf15d4eedea882551fa1b8681a46530a68ddff96803831d7b39eb5832461f8002bba8e00516b23862939535f343f348469d51678799a3f5606ec575473836e1e624b0e81e320bcdf23fd1b8a078731d0af92853c1c76d77b3b7f8513715b11d149c708ecf88f7ddb7d977d41e4117405f6f6c68c6c2e3032549a3b2550b0d5f7356b3a228d624f1daf1258e363bcdb670751139f22ed87ef228c39018cc86953528ae79e65016d19bf0f1ffa7601b9eb76b2078b77a750bae9b844de318f3b8d3b278f8576219cf971f1d02edd62ef7e260f865cc30a704745157e8db8deb7646837437bf34564cd24b8e8cfe8a71078dfda1c2fabf3efd619391335320e3fd875eaee37c5b91aaa4e7828eefd8b7b0661adc75fa8f644df88d824aa70b9b071ea623de0113319c2a17637492eab233761cf30f43facadedcd1f53e5019a3de91b6b10a91dedd80357b63b8786b7d2100e890aea5aa8d97fd2e6b1f02744d6f5bdfd05303194b556b3cfa023d8c3900c73ae80d651b2afc21188d381d5415f80ba63070f9d7d46fc652e227bf9e37f2deb5c392fe60e04718a1a8d7139b8208ed994bfc16d67cfa5b92fcd1e5b5b96a0cee0ae374aa736d6ef788d674b5fccdac89afe7670daedf3ffaf85f46f340fa38fbf8bd2c62ed673939658f5f1bae2dcea3b7911922b9e48e528c8f211b51d0b55314884968100fb6ccb0998b44394ee734b52966e279d1c502aa2b47b5ee0efb88dbec53889dd6e0a87ca5d106b38f9cf8321a035118bc31a5137fd67a3b3f32311253e85a5d9008eb340188258c7eacfd78da3404e03c381dc32ad975a26a01951dcea63ab67deaaebbcbe6e5268b1e23634502567a891ba8d54d2d58d7d8fdeda7fcba6a1d466ecaccc7ceed665b3cc0517260a416164b16dd2f5fa361ed5c08acddca7f37db4a8e0c88d4b1a855403d65d5b56fdae01e795e1e5cc81db02de9e2ca3a546afc2132d2f881801526482f5052d1f8b9c757e6dcfacb861c7079c461820c99b74199c14f6fa7d51ba87d956df1632efd36f083710a12d5c8a0b88f71c2a4b17f367a8c92a2a3a66915285cea0842f74a8d93caed1eb02d3cad68028e8b6604200e491fa62664f8ecbad340948bc7b2d2d456d853652bd8d7898e05b419b9eda346a37698527a18f69c1b07d77cb6f7bd2951ac232d9090399938a9c38a1fbf21c6e4659443221725e034f8320761ebcaab62a0f2d6bb773ef59b50c4dfca3e1e30eee4d0a664c62245191f3491363766cea5d3b83012dba74eac78815e5954ace8c3f3fde93e13bf69e071bd2c1fd6235a238963f01815c3849246b3ff22500ccfd40b5919dde8ebf99bac66553f7bdeac2659bd52ab09651a5ad24c5af844bcf57385717f6887bb763a6889dab4002e528e52294d788db90f32fc659ce23dfe90f5ac564292393d51a6bb0f2946ae9ce6f7f3dff39975cb3c2bfb20486513111cfe7175b005eebdb0541c9d8d68dbb2412aab368be36aa3b57dc1967e20a655ba42364bf7f44c29748e34e464cdc398827ef41a94baccd039745b983e1747419512c923bce6ebd668bf31aab7c9e3b50bbb67302eb18d5b17dff4db69cbe461c5e5fadb30ecbf4649bd6f19704451057019a09007d9efcb11c93a71a90b0241bf66b6be16947680e31f3c4ec6e177a2b5eed15a7f24e859c61952c924058370894294f53311a4cff6d7c5ab03c4d0855148af7195c6f4a138f080a22095b3b2de3de993b19ec4df365325b93fbae787c479173ac4e6a89fb573be9878eadbff5456713774943fa4bca395b9b9a7a87c1d55d8fb845a28e96e66aaac033da01c8ce7736915c6ec0d36b2420fe55eea788eeded5fa166178b929886918020c943e7f074b9faf7acbcc264ef72542370400c4549d1cb7f5b49ff8a1cec61ec1c056c2a86456cf1e6789f30d3e74af687a92abe3714589185bba24722f8b158250c2c73c3401e916ae171af10a77638aa39f47e83b85b2b8ab4c7b7b549b5a4cbdcc1d67535e53e77ba0d330203187aa24498b8371c439dc1215f45ac3875dedd5bd93ae5f5c0ffcde9e567cd33e0c37b44b2d1ae434fa564562d1cd693aa98ce781e33c533d6f38bab071da31d5d9da58c797513bbdec439cc82bd3c424db408188df36599f1db361d81f030c5aae6836beefe7ee3f92cc589a3951dbca2d4d39f4e703e3c602870ac56526b25ba0566ace7e2b51754048b97daed14256b2c44c644764c7b31606ff98b880d166ed513de6b0ea0a2ce8ffabb871c9b2a068575bd5f7fb91e84fb3df74369e0fcd73f05d58fb8feaef6c79991c2323176b75230eff3a2dd12df4c6112a02a21e83bd152dfd4707edc8a169b923c53f1fd705b81c596c4a56f7872e8914bdf91725e81ced4563f3f6c390fd3e89811c0b21ad8f4b0bf555d5e14baa0a575c94969cca232e519fea0256dc6baf43bab3634c5502aa1a3d14c55b6a82bf72503b77054eab1bcfe158ea4f9992a845fa8aa2da840ba749aa17df5412cf1afe22a6cca61e40059318d8ee8391175f07248d24e7f549a7858780dceef0024d9a40b27a21d50c272bbc581e9762ec4420dd8e84260b2c4bf4d3a56d7476a13a3c5869fa4c2a329593746ffd74a33c89cc0402d01dd52c2c77080b5f8eba2c47471d61e99f21b070cdd62519c4ef9e0d572cfb69b2342bb1a813ea6f838385b27180f77691b4c31a8b72bb55c1748fed8b810bb3692521ca9f8b64452dd918d0d4ea330c5a051dbebefea3ee2678eaedd44c725b0b9a99e672595de45adbcc8d24a468fc18db709b7fd10ae91c89b99bdc5671d0a9803c86ab80e9ac2fc850a3f19d8fd64a2722e7ce2d82911f3f6199b2fd9fc18e3799bd68c4c95aca78932ab7aab0a6f8fec6ddc87cbcaf9746c071b55ac638a581b054034b14222f2653cf9cde49838b3fd3e5c93bd3df87a2458998cf3a8eb71afde24bb4e6dea90f138a49d20ff9011211e381518d84036bb0dc3b4a5092bac5a8871ffd68b781713d2adbe69e6118f9c4a0871c521c0ca416d92a7895c2fb63aea7958c486d537b71014340ca333240c197be3da4135cbef6f17d4357607c392d26251094d88dfab372e1bd7549d6e9f4afcfc92acd08eedfa1f62223d001d3b251ba34b9b692fc3f2c20ca1b83972326eca9e73e27ad2a579d9bdac019fa2ac8989dffb3e13c217e5f3267d95354c5fd35409b779db66999b452ce635dd217fa382adf3a12494eada2c66676fbf3bea40dcab2232123ab9c0182dfcb9b318cf72ca54e52eaf30b31284ad584254ecea351d6eb277153899bcfb2b97b7558e0a1249fc9b69320ebc94cb77d8cec501307bc33a3b1f6238c87ce60b10bb7224ca14d9a5c1eb86b908dcc36188b243ac5172e73d18b82978e5c297783e2758edcd9c7876ca290c4bd0efa859a92635213226463d2b9cfee0f05ab74a6bbbb31d1554389b45139f80d6acd69bef2c01fc88e2b7b1b68ff6a312a21f566a302b43b520cc8bb13717ff3a31ca1083ef8355a14893c0a0815c9e36924566f3762fc644959ba3fcb71525eb1857fba6056065ae3efe6d20c40a4feef74744c3ca69670eba9cf25206d76603058431ac5e90c9119a4c337343c2d96a3974b65ed6c725bcd5144f66ea3d275942966acb7f3c774f305378badb24e93fa5ef0b75d71911b73c717ee374b4417ea64c697088f93d00a0cb8d9c482e747255fbdf9f1cb3d8e5d362f5b0c1e1efa0754effb643d052e5c6dbd3e56051d9a12d848036d80ed52f7767c78cd7a3b041a9747803e00748ce973e4b59fce3d71422bca7933c018bb0d388974029bf3f8d5469bbdd969d340fdd5b2c622a5be11d1ffb2a5e9420a4a6f143f66b234b2fd07ade38ba339e507d6d1a657b091e73da3890153faee7d12928174b3ffea5aac6be6c52c45563a59e1d988e5d10ca7404f7f3ced3e6a1d06fb3ecdbb85f9a4f272d56ecdd708a20c7ba1aaeed26b1fa11f9ce51b07adfd3f6c994df859e69b4ebaae25ddcb0e187cbd053bb15f12a9636dc87119d152107435c131eb32df5fa13c0f591e52944918d41e00b6b273d7993caaec944fcc56bd3cecde1d5973587cfa35ca496b3d176aa8481f0f944e461687b355d98d8d7c26f98a0470a256b8694feb25936575b6657c9363bcf1ac7a5abaaac12adbb53efa6b8cffd7fac1b33ad84451c03aaf7a1d4159c0655842ba89d6cc229b6987aeafbfdbefc4f58fef24ff35f5cfc5f4827512d1b30b4987a30611789f635832f2710021a811e83e1ae8823f2affb99927186491bafc92685b6d5b2ab2e82a9b4634b30064bdd9385055c35f993872565ab97caa18552296dc81add9edc516f4db27367e2dc16f3f8a2331914b7f74144e5e6ac847725f35bb39737e678c5bcdd7a8b6f9858edbafb6307bf858bc7cfefee0b18f23aebe72ec763bffb4004a4be71e84a5548dd20a48d3cfac9701ee7bb1c6b78e6ff13fbd63500063d95aed0b002e13cfa2d09f57de3dc86115b0782845b2e5910ee7942fa7a10797767fea1fca09df504fb69a4804f11ac14310f3a0a1351a5b99a2a3d4cbae3b742539c808c156fc24e5acf1bcb5a8151fc69a4fef9ff4082d1ea88388ea78b3d717fc44492f69aed90fde75e85ee3e1938c4840732269d4f4c9c7bd75d82ad4346560aa982586ea971cbaa6221559b1302b27d34397a1e7033fb88cb579696bacb5814f8ffb923cadbbff6eee3a2d54d4490ab54ac7f9fe930511db3ebf768092ad935cbbbc0fe35a7899b85efb91f84f944d054b87f7f67c6a9c93841d1e60f995011f3fd5660302e4a7f30b70589882e63578310783f77ebf4e0c9e76465b7d9c882688d0367d75da89f29bdb7b16b7eacc930d4496da43fe196a7461f2c8554fe54c0ca144c61bf1257be65a714c4df1a40179ceb6a8c4f1ba9b45d9a3e17d143ab26d597af768f8f74199fec43455f39108d3f9a13f2b2439baec7f564615d0ab2ea3fe12e3e5753d32469de1fd053f574a348b18ad21526f779e1a4234c38a9d9b681ca8b0376b26fb9725176fda53586698dbbf73d6a71aab526b9e17e28f9716f5de137c5bdeb8cb5f82191d3381a294d4927b97ad2a55fdd1a079ecc46b4db15d60d92149d21fc0ad869c00600dc901e4963d500ce01ccab8f35b1e117a3a4ffd47b0857897fb0503880791af3358da6b0e58f3ef0c1513700cbaa9d9f8e4e018679f53ed65c2072f276f84a144add94982c2ec7efb884b6d535787ad312f9880bc6cbf2c38727c0d93f0a8176cf6e4666bfa0dd6365f18fa34df825c093035b5bc86b31449fc8e07256d373ed52734e05964632a5e93af53d7f27abe8940dd3252de0b6b59e8b9eee55dee71d8dc0173ea0f10d7460800e3845fbc832ddfcca1c64ab06d4f1477a68504fa067f41c383c794ebd802d44d324ac7057cbf29fd2ac97c87bc459a8544fb8554c3992748682276227305a2637c9d9fb1ebda0f6c68d8f5815979157f6b30203d3051247fcb5fa9687cd0cea30742615861e3fcb95f9b1f1c84a09a53a4dc68971e3e26371ad46bda6065b6d1b4448619a4df1ce036c41fe631e72d396b45684f0cf23736007af83df3971cfe3be0ca65fe0455f5e3210363cb890431e643399a2fa3ff769331dc0e8e504d2755c85f96621b8b0c21dfc21aa433f9df002257e949da844ba9363391aa539785585d71d177358066404c09e5f1a731c5b9ed72973f94daab2cac572f89f22dfa6c78d85391f676bb79a963ea93bac24d14cb37d421a537b24772e3316fe26067aa258a5704945f918aed7be0f4cc30435b44c0a772555dc802031c536d60789c6fcc340fd89bb2340760bb0f8d54c4b6fd852e6cf53054f4d4842079d79a32f4121d4085c1bd8cd2034e42c5396937e232604974b802762eaa2cc3f30f18849e9e52110aac2f39c74f0294bbb1073394006a4fdb203e5d261ee9fa20d2c4d1335c3d2f89dc354fdd9b80359502491f6f7817be84177f94bfdb44c0d66357fedbaaa097b0732e055e53db6fd28642f84093e16a125c3b7d5fb809ad29b8fc29d222720fa3f9a231c505ed41c4c00f8eb85765427cb032a0b4475e332ec70820f77884c3032c993e49dfdb05285f69908793f7261b287c8cfd265c7078fe0a737be7f1f01f5f7ce798e51029c3f4ca2b39e9119c9933414205cb4ef92bfd6ca4d8ebd4375afb31619447ffb9feeea79fab980cdab95587b27510e1b704268465e37084000813d77f5ba1a601117037d4cf391e2886c830d0a63a39a32e425c7e3bc97760936e2d0ed18e473eada69d40f6c8b3a1204c3e84aa322bc2bee5053ca3b8fe801572553b8927715fd8c68a2a4cedf9c346f10249c8e32eb1006a2ee6e4e1bbc143122f113d8a808a73a154ae4690398343e19ed6f353e78b63b0389ec7991a5565e7c86c7a0194901041ce44ed5f34a6c889b0d910c519f0e1158c91c7a3c9a8b195237662c977f1226d094ec0867936e96aa4cfed4f82d5546daf5bd3ed03618518b95f560346e487913122c52e1f4272ddb1721fa7de05c565bd2d16a6d4c745a09f25908cd797f34791032a4415eb4c57cb4c8a55ef5bb54d68c254afb9b399a823a444582fd8bbec519765fcf6a43211501fb527f139efc19dae090b9a2bedc097645f3bb04cdf727bbf9e7c8635b8d407449db87b5116ca48221dda7b907ef8bd461d6d09c405244c14f99a9af6703b7df76715fae08e368cac68bdb35d8f9f461dd934d0309fd4210c8e8964f68a6560b12a5db24dcf089df52a3d689d771a45ecc28c25ce298cdf544617d50d082463ea3bd34b2aa296ad825e483e66faca02cc772ecc6ccbd562a20ec4283db024e6f08cb2277de6b1462074bf9818b73de4cd558049e3f235e5cca8f61d9c101829f09787f0500da2d6c11acbb84194c5f91e2644a1839c4dd34346e2b37852855b25ffa0c980d1c58a2004277e29baa94d7a6a3df18c6f2dc711f88e5a0c4ccab421a342b3855fc6dc9cba67b53b1d7ceed8018642759445481fa474d6d6b2967f67780ddbf77ed0c716f68efc4dcbc22d9675d79f8c6f73ecd99fb55decae45b09159e5b7abef81e5b9896ad3a652b94d67b52f46f387d2b08cccbcbe22adf1a9f88351882f6e06a1a9f4e320be94d7eb65414b9f7d5bda93f983bf52cd91729a65a481bdd15dd02f98fc53dcbede8d9bd771b61954f98b1d3ca53a232362689ae0f8427a41bf247643812d9db0e771f354ffb2d5f9852af1d7b23901ae8e3cadecf7fb55c490904db882c66aa7868a04d0c0bc1d629a500899c2bd8fb1f3a10b7f500142a18e4275ef39cbfeabb50fcea15ce50531b5d6d493f1b1579136eed18e0359755550c21a971952159b37bbc2f311e2c8148186c34f3694a90c12a43f6c1b981c7de2fb95440e5f777e549694b70404857dda4f2ba15c6947064ee62f175c670b997ce9282aeecd486bdd4774e9df64550103e2c214e216a14196efc3a4f5142ea3cd8465f66256adbada5d9620ef9db44d6296eac69a1619ccfba3cda1611172224f81da70d8957630f6eb53a838bebee1fb1074a2a2f9593d135f8612fdbd9b9a35e4335ea2d2f84cff5016df69b8c33d7654b4aebefdfc0f679010024228db1198778eef0b675e33e5d6360314e6f0896da89a242fff4086f816dcdbf1bc8ea05569116183275d2e4fdb55d488aa6b4d0a4204289794101d38fd3903c00f0dfcbd15abafa3082df016e5213abb514a674e3cda7d5611d7b022065d585e863a811b7c1af448ddea7ee09f2aebe1f9063382fceef66b203e016496816384e8395d2f2293a32817c1eddb50d38c4fb7e2df3362357046829e7d0a1d85068f4a260482f53c947b2999c7f5a077ae2babd6528febac4252d57d15e071dc7cd25ed9307eb6bd75d3047fb2b7e66c11e4eb4e51a1b8c2e0ee71eca1be43aa8acb68c9d762f829719d26ceaaf20ccff0858934c28baf255b42a0f76f261205156597ec27ce72d5cfc713e20817313473fbcdd94a04ce76a9cf59a9fb62564966aa7ed2c0dd3f6f9a834407465493d522d28d4052727831a8f112ef28ef8843c50dde38f97dfd7646f2eff1fccf929759451a23e578de4c706ee5e0459361d49f0f23beabe895b332fc9580533897d2b7bda02a0a440411169c400bc1dda8eb1114dc44f8a52b26902fd11d647fd81a4a70f23fa1a0d6f353912347fc0544e2960e3e724c13d9481da79a6ad671ec2217bb70b5eca2e5cd614480af6817f2f30628717afab33c894616442d52ac8e0241d93e11e06378e6ddc9b9e893931670c287d1ec61294961805f420c17a0bf1a4d2d9ddb1c30817fbc49fe9120f58b14be51df4d0f8724dc2491956a09b2fcf906d96adbb68ad0bf7b5db0dda3be85237f1f4bfa90e71e6302e672990681101dcdc5d2fbdfbbdf233c4b16b2990bf0e3a858572722b82435021e7bc21a204cbb20ec0669e6dd66768495685cfc23f5bb20d349224456f67b669f58728f3b509879029ce7f8396e41c4e50765fa3aa321895bf7f2e32371f177a49186b50ea2c0662c5b00cb531ac3011cc84690604052e094977fd46f5132085de80d8f283f8f217c02906d807d1d2aa549fb6244400776b53210d00ff1511adfaa65559b7ca4dc50ee2a110a425c43771e1521570d0ea4b7a271fc6b67d0045bd86956378f4f7225ff4903b7a9ec2c31059dddd7f3821764f913c441aa9cffdc8b0c968fda54ee20e60b00f9cc406b79debba3570ad02c6f7d1d01884a10fb6d866432a64195f788d8f101f4d375d378901fc36936c46ae036c4e302b887a45d25fd9aec44f3307a2e4d44266199f5ae7c7f8557d3b117b67172323e2eec84e579fd9e120a09fe46346836379bfc6aae8201b772381f0adbc6212e83843a21c24b32b611062ee6a3e245a454b23ba194af25d72f66e3bafacfe4a4569b63d1c96582962c4b57c728c6beb2c773cd0feac9ca5fac86ebccc0828c0ae8bded3893241fe59531596e8aa596d6580ec7a558c2388847cdb1561bf8785768c316a98164fd107692dbe2a747db143462f3b54de0c3bc408d4bdcab2ed41e7d4fc4364ec1ec5c70f1da7ada3af3e7ad5eeca611e8135852a1d030cc8a0c702b4a93ba16279f7b3faed1a27760bc353599615e9adc93dcc6aa537e7420665234c517815abb3318c003f04e7b1a0f0d87054873c25e856d1ca82582b9f81d06e6407c43a1f865951be2a1341f6fc56c2810895d6a68177208b3f0ec2ad688d3e83cc3b82e1269665acb5b711f9d81a51ebd4019054ad9de5485e0b8433e7b3581d032f4976424fed428510fb542d0a918f58cf344559cd64542181fb10f82b33eedaa497bfc8b8f996c40e55d3e6c0a208d9177d21635a6699f09aacf65ec9ccaca907f03c892df906bdd06a4a2cfa0fd74ad23acdcce722bb3181af0fb507d7dd50a261626fc2c7621e26e1da5363f6ea5a2aeafbd6c921a54abdfcb56ce206265bb0586848bc1ca455f65973348c3d987fe200b12ee78f3841dea0ad5798206e084f5b8785dcc3b9bf95ab8309108b88696d54295b2b29cae411ae400e0b2a85869078eff8c5249506faf8c4d7ac41f917753d38c52a4659e3707ad40969bce46b95dd11475fb4e70c0244ffd57b9c347e880437e65a385757e748accd2d99aa8a8ec0d8e10e56e07181cdc0b3e818e2f7a2d5357798b448db0894c9f19416a7e387ebbacc05015ef9452ca2261029aefc9c304859ec378dc3fd31ed2d3cba8b342aa6fc6cb0a9018aea916303527b8be4f694fa6935e3fa6e50e3d3ebbcd46426d5b7e1be435b1335c9c88ba07226ce6cf523bb0aab3f49254b58d831c0e87d5287ac476520c310a6284dd478bd89c3870eb3992429ee52f9cc37ebce291a6ca7ef19f91e0eba31f05664191818bb000d2857d0428dd72bd0f2c4eeeb3cde3aa1f1fc8d0c82914d079514e8809dd96d08667e3884e0e682f2bb152ef06661729b52b312ae38f1a3e7f616143c46dfcdb63d889ea069759a1f410bedfcd77ff8e6090153d557a3bb97cdedf5a18b48dec2f112f409913415ceb9ade1a443a7008a8c582b0ca4ecefc3e49c962810ff968ec4de4f66f332d52e237f9e3b21ac32094c840ec8eb301f350a9b56dc6c02a1424c417fce0d6cb896d1f6bb7cbd83d9e8b4857a39a357535791dec7068a1faf881fab403fd685f23899adfdb467b1c5a2f80cac6f2e6a8e6754f542667641d90485a465a9851cd2b22d0970b874901d011d14dd50d27b6f3a8b4c5549f92b5510e07a84da34f3bacd2c229a648c748531f9878ee46e503ed2858881b42d4c3e19ca0746b98a0b417f3ade57d8c1161e87737b600ec11bbd2a000059b29e36488a78e253f27ce6d24098aa85154452ef890c3360d8a5a7cbe619e3b3f31fab905caa56a1bcdca943748515cb8db4e12e755a2a4c7179ead0240e94875113c63b0edede7d492b0b18bcdbab403ffd51c3c02c23c18e1ca25c363719fb8ba0a3573194457178a5919ab1db88e424ff15f610c9923327c5ea4753225c90de76705a15ccfce9f8f71a6e467a40e0102a0ab7e3bcd8ed518cf2195b72b6768494882c0d92d5cbf24bca89ff7238048211902e886131be929eb34cbc3f39ebc105bc53f5fe9d8bd0de049d2fe911295402fa041adce17fc576e04ec0cb58493cb5eb1e5d92f9d818b59cf1a027757529ae3e0a5bedf830f540a9ec2f747da43da1ed23a932b38ff7895ee555a046a521bf6c410abb89858dd9218fefd29376213872274b9cb3b1fdbc583b33aecf11a26d91852ecf0ccbe70fa75f978b47517497537dedad66dcbc18081d33686f40da451e9886a0ccfa4914b3354587e1aacd01b3ffa4c8a3387fb8b80b56e8613dce321148ad39dbb81c0a6a07e25040e751ecf95c4d22d0bd5c26e978d7d315ba7f895167d89f60cbec8dd3fdf3d62718c3a046e5b08dee8b885e2d56b8cdc8357900c71f4ddb71f3debbdb45e38f4b95f05088c63649c016b16f7cf861bbc756b3e41b179b6f09f53eeb81994bd3cc39d5ea730cc56b6e0d2526c44528f7aefa8ff5a562fe95a0421b35e6479168f178d28692c22220e4f7f8b268db492b3fdb537b686c2898713f773ad2c03805d0e03fdc43c32c96c489897f69f209af2e9a5f73ae0e5d68c2f70555fa2f348c6b45d1860c396d67db5a1f2b73fdcb6f0657fae1b5f74379eba991029ecccc228925978ddbbb30cd2b0b8ca87e2f888abf774ef99c72d974233707f6fc6c7a3a95629d2f445e34de3679faa1cbbf26ebcf33f605b82dc5d06075ee0b958b70d731a71b53470e89e2ab82352b14c5446efd01e940314dbd925fc807615031550074c1b712e8de9e461ce7bbc159206fb38108746c15bb668c720698387b71aa0f577a75747a4365aa83e7111ec89ec863d4247959c1f99b8793b16b4104654de7933109028966db95f245ca10f20ceff0663fdee4521f73b8f145c0706edac824b8f2ea869fb6dcc91284db1bd768a60aa50774d412ab95b08bdaeaa852bd4c38bca21c004b8df9c8aa4e7037a24f3514009ece53408b475b3def76fac185b7de5f6787cea6c1dd5077b161042212ad66c614664c9386bd69aa1f40207a41e107a9ff705ef6ac3a6da511ec21bf8db173dabad553d15ed87ac91c8c927eac6a12bb66128f4f3a01739b2c2b126f1721ea6c4bda75b25c9a6a312b3c2ec8d3d31d2610ddb2d9218888fd2cdcaa62e2ec3c5f2a6970f058ff912d2131d9cf8161bec676a5999f29453469f4b3c41706ac459354b1b98d4da586a2ca192c1e0128da22f59330712ef3e07f38e54050d113d8289e800c5e8268d2c36026fee0a3c1976641d642541926d6fd38fb1b3bb8f4f3d6d23274a980d694d1b270c1e4bc3ed7746983435ca3beb2ad0f8674e32b27208a9a26d3664385aaa66c26fce2bd892c9b0c99f83176601860787a5849d9242f753351162240942c10a14f21a7499608ced790ebd9534a286893bcede74ef3087db9dcf042e71655be1cc17dfc6c247c5122a4cb06c12e3dbc9d479c32efb6fb311a02497351d30420e6782333cb412ea4700dcdd0d55406915f08a298d8ccec363c25129565772f3a55d4e6ba305f4b83e286da6a06dd2d494de84f6b89675b484576a38c2b6c35050a85dc13938426a2fd9d14689d84ce2756079ee5561c320de926b314d4e070824d3ad27ce03a25d7d09b353543e077d1d869b6e345100128877d6f8a1b79c2dd89145f5d0c8b517dec43950f93b704069a2d567599576f8a8d04976321f0c0530956f7315362d058fd42528938eb5040d22f1da778cc2e2ebab7f39883d1f5d8c45a56acc861106ca4f3ed5f3daa1b8c22815c0c09c4beafb16e951d2006aca35c451c65961a08c504c20ba723acb567736b7d8092cf7bab18c9d5a59421ae855e07801ff49ff95ec39f30039edbcfb5be67165e6410e9d9cd6f2f8fbebc067532134071840e895ac1a199d2ba7c3f63e7ac56e7528407a78349feb3761fa1486ff984685d6123face4dc790df75d58b79403ebff4b3c96a4706f6eecb43112687e84b7bccb49e5caa98122afbb92df2a2c31837097015008dbd24f2f6b42ec41ee4c471d9257b013f06bd706da685b387943c72cc0b1f61bc0147ed005801345f39f4f979b349633e551c6b88e34f72c9007353ecd5985875c96927c50f0444067f70b46a92507fa3a01f8486e880b8ebae9a9417fe10856f4c7ccbf489b73c2e23adfb33e9518a7bcff39a6f3541c71b43d0952b67932dface083a09974d95af3b38e34aa6f2111fec40ee3325216c778a8ee1c004815151911f66ea7556353cf87d3001c6ca590491eacc4501ea5ed34124f5e2af503d62dc7197ba7ed0b7208c11a9a652b51d0218ebf016567faedd4245b50a4a7860342c008eb47e62215f8803de313dadb0e494e75cf4f994a6567a827082c853593ea8204e89b3e8ae7808d33c3c4ca5c22f1bd079e4e5a7ea7ac87c9b7c5dafaf64c5660b55dbb99dba0ef832a6acd10f9130457ae849500d4f018512a7b15d89665bc8d39a3d5c16e981e679b19325f4e3651861fd72febc231ad6f2670945d9871abb10d6d1e23042920cdbd6bd0fa243dadad4eca4f567b21f223da7fabc0a9da01d6f971f67454d248ecc24272b2e9003f7bda52206ffd95823662d6e57b446d14e911a65d4fb96d48e4c980ed5ebc122bbe64fc9687c0bb5493509a2927b361896f22e3a9a361fc2a020c116c2fc24658346d304f5e2c63f514460d8b4fcf9cba65921bd25a232151d8de29e446feb56671ad57b29ce26412f06644b844c5cbea1a6e2e0581cd88bc47325e28db0f26dbbb8171c10dd328271e6fb8584a0d55a48287d9d3b9cb662c8fcc802901e0c1ac5e824174fd1eaf8448a5650271c87d5586236746a3934a829adf744b8f2fbd3e4bc7f8011cd41bcc2b0a0a90072be98c4bd546cbc2d73f1c9f4d82d4d38f482611e55bc3ccdc63ddd69095c0d63dc90cb7f17893bf30b5288a0c5ba593362e2d6a2353d8c82267e35311f740d5662b5c4f6fd727b076f47fd62f524b10464dd03d48ff98df49686ddf764e78fa194e557f7d569433e2fd53276154d7f26edaad7da8875aca458cc051ea1a0f41ced03aa6f9c5de3fa0afa4a4c40c779d1545be2208bc0c784605fec3f3a45cc59acf596d1d96542bce8c9e173ae9a67ab8f801e3fe4368fd1a8abee0bd73207045c525e41a70f66fb8e92ec0cd2193ff53f58b7e6c9cd10bfb15ee15136dadc612e1afd7619ff0cb16b836b8ad89f4153db1e43cfc1c94cc9b16c1bfd53b54cdceeb0165922ff8216f26cf66ef0e533166d111568ea1296b2112859fb0d3f8eb6ccc17224a63388b605096f308e0e8951d2a9cd3b390e3df56948437c21070e929b01bf893222e65f84c18ead631904ca22d4a5774ed17942c2fb544e543fa6abe810727cd69ec494b625e738eabca0be0665f91e715410541effc0003565be012f4f3fe5c2ada8a656f5957980d6995dd2f715a17928590fedb5d64bc0dd23243c105bd2ffddc143ee793c8e5ba3ebb8ae18c239b57c12f9200466526ee796b34196cf0e6185be30445b217ed74c743ecc0f00a992a351edfc86f879b3efc6089b6699f9afc0b4443de22c7485d1e513a2e564c7dfda32ee72f2caa8e5c262c68126c5a9d29a9d92131137a80707ff71ae0c0680a8172416a785b40cbda9677c46f3eb1e31ac90f262dbdc1bf8a9dda30c5c9f860c478b5a7eebb2d1bdbe36818eb5c2e5ec5dd1cd4afd5bc8e6f6ef470581967a42f5c493ada9651582f67d0e1d88ac33f51dd47a1d2b16d616416d3045b95b8bb6ec24fa2581cc684263d83e07530c27615bdcc03dd93bcf8f2c0776929367c750502ad6efaa03b4e3cf5a761a68cd323f162b2d44275df3269071af1c355a294297983755d9db9d551ba15345cc16d294542530545b43001ef3eb7f41e7f85ef80982bb3a0381416fc8da0988a39270afc18661d004726a4a03117b6382ea9b693961cb7b7d485b11e4b192524542562a251994641211e70e2a9d17d13f82a4b3c244bfb4170a1402bb9de34927210f7b2cbe8cc4b9a38913acd9f12b8ded8684038225864f80e3f25314123830ca9e0a0077e84f6a236895faeea064dce3d2bddd7bd3696150da2af86ac7c0d4f6435e9abb9fee626ab33d1cc95eef152221eaf6b39b365efeb48efc4590a935e9318ff71d092930c1d25b1e581ceb0e232fe64d5064e8223d7b13b64e0f4979c9b2716b8d07d73646afed8f965c3bcce2a005769aec5d13b84401cc0c1a76e340dd3601251247f6930ffe947f85139116502bbf51c93ac39c7cb0211f35be28505a17359c4094fc6264ec9700a7b9b2875cd82867ff3932befeb8ea327a8c72fb01eaf024477426d4ec7f0ba4435d8bde83c4dec2e180c1a888790d48b5bab51202bb1b0767736bc8cffd5feb20c9a4f545efdd347870301214e5a4abf066a77b1777d5571357e504a7341c52e00f5243e7d69af337a249fc6ba11874758e8f1287ca4dd417972e7f6a898835297b773daad0f524f8c38e67bc698404fc9908d2258768aaeefe34a12b63581c20dcae1ceaf7f914fffd2defc7cbf6ca1ca81d082ddd91c3ad1698033f0a72fba508fede73e21defd551df104e81eaf257fb98e03b3429824ee551c158a1f341786b4f602b668fee1de963dbeb04e7cec71402f0d7aebbdd00ab71ebf8d46215b7660963ff51a4b00b3fe7d43fb6757dc8d0cd46d25d7e5ed404bf63dc9c67f84496895979777629e8abc381ff7cb3e4ddee90adcdcd3f2d0db3d890edeaa1b1bccde4a7b1567f3adb76fbbc6ec8754b93444b19e0a71ab1f95801bc9520bfaad97c25b097206ffe4995f07324e2dce5d918ced114884a628928ee15094827bceb4137e397e376d246bc06a87334bf16469ff674936dccce88ed6ac442cc50b98349e6723166c8f90ccc1929e9d29430ce3fbe690a97c38d7d3350c3664001108ad45aa9893ad2314aa5ae95c4f2ac017e443b79c23f4d3684934b9c622a68b5b6e7197733ee0c89714c77c39f3dd82c38ce00a82cf7e0c6b72d5aa6d68f57612936e0e3092f3fc014f0186c7b5db7b9d8f35b17e72c9a9b4d0efc3e37baab8cc28388ada4b28544c4aeb5dbfcd5034cf3bc429f6c48c4437022d99e2b1645af4457488293d8ec15cca70255d68dee24e67a08f571f572396215d78dc27201a82ceef4a089da0066fe858eaae22d7c3b317bb291ad622e70d5abc8228d8b028fbb5cb7a28356950406e16463117b851d79f453719fc293e219e8aec93a7cb18888c58abfd3bd07c792ad7bc3956337f7bea0e06561cd910e5ae7023783f925517233ba31ad617560a688b48cd66bf3afdcdba02f175ed24ab4c8a0c1161b4e528ab2f7b1c7f63f0a102f76c6f64b9d18b7722ce9e910111875554ac8f82c1af227d7b08c025a9bdb1a2113b977f21d6dc29e8c9cecafcd49e94b00963ef463afe083635179834728da9a524600916756b9ca74fb3cba97241d0429428c616ee3138e7a5ac2634c55f756ed001eff407aae8ec0df1994f727fbb4577d672736d2cba3e28344742a1c0b62a450cff52eea386488405da0355eb89b6fc4105e83fb04c1dcdb90321b344773ba1e823283ec60a5c2396788211b31a7c36a73fc3119009f7c0a66722832aa2283f19830209f036abd55202ac4c9d0937ac688c85588ab1fa3bf62a90efa770232cf214440f16e1d6129db061737bfac10769e0b13d148de51e56e4f54997fdabf382014ac40402518953a3b8f91a2c45d26835311002c0fcb627d6d2ce4f42b98c8300425f48b10e635750818e80d9fe57aa44a76136ab247835103f4eebbf214517ffcc4ff19a8cdfb2f10456c2976ba14e0a79be3cb12f553c1f4afc7bc3154e091d744d8a4b5d6f047f82623070a24c111d5958797b04a1c5cbb4f58ead28a5f4da944ba6eb7e8418674ed8fe49c0570a1b0d612a1dc9526aae87508ec70f89c35198583a70162aa9966f98316ddb7269f9feb9af4f32e067d7643eb286dc0764b2778fe4c5b486b28b43f2e62080dcfd2d0c4d61251a654502fcb19a6bbb22b7b3295c906286935977575b75a9bfb75ae12afa3abd4ea27af19a8ce1506496c56ed6b182377127b50f6a21816616e23d67eda16750b2694787b06604db5c537bc9d16a3b312acba73f80426efb6fa39c65cd9566f6503320c0eafbd92680cb7ad5d563ba4154373a4b77cf4926e496e9d697bc6eb0c63625e015c6af0dd95247d116e28f0fad404e88694799eef366ac9c0db76381035ae9f417f64e896a7d61db24b476fe5b0da87c34b601e42eb4a1c60fc564cb466c0e4706c77b3401525b8230bf55fe0ac73f910becdb12b3f24b3b09d3cec8e1b461baf2a7f169502d30ed4a19a9fc4d31bf4c0191eba851fcc91e58fa2d2f7fab3e4344ab5eeab2790b8a1fbb8c55465bbabffcfd0691b335afbff2af97aa1ee7eced2df1cbdcbbbab257f62ba193dafe8bbc83632932b8fc41f44380efd76f650203e6437ab764f9ce1dc7497b2946490c45a52563bd05f9741edf0daafb555d74118f0e3ccff0d3d712f7f76c4f6296b3392a781e701c34175bffa90fc70fd0ab635788941f904d0097b604e1d4079cb8aabf09ff810d1b27bbff963a95d64eea1fd00df3a013bb615f2c3916da522fee804f23754711d59c98026b2b2274feaf65d257d75183d812e33607ec7c6f29c050be4f275961ad8018d8b55dcf05a407ab3a0c06c41c23a0d9d85afd83492906b4c24bccc0e5922ae36eae42e437454a530fa64348b4761030c2e8bc473f53cb04f57949aa579bebe658b3620aaad7403400294ec1f496a85407199d64ce110d27ff127b8ae5bafd98bc8961fd4aac914313d263368626417198f42bb5ab5247b554f37270f221641b0639fadad3fe5cbd4a1156d98d6939ed1bf5075344b6d79f991373cc9ca26898d2b94bbd2f19808fd1927d9ed6d16847b14b26c1265ab96d6cbcf353d54f959fb67786ac9701075251b7a2463fd9361580c20567faf8eb0f6e2049bd8f53a11aac5aa93ce4138d911dac29bab5e8b21e6ab52c85fca7d9feed110bfbb1ea750079a849b3514754e4295e37849aced0c179e6e5944d09a5e70682389d726c6f7c437060bb2d91667c7b83b50566185d3f57690468d1825bae3be554d4edd02a1419d3ef90c57c2be748f9005fc3ff9eae5035c3f835c8dc5523ef8094026c8152697c316f2ec4353a318a0e6b6f0bb2cb1ee5612ff51e56a38efaa24dbf1e05227d426f850d103199fa2c29688d65173a5ca08eab18e3473267e7297146f7cce36193d3156163147122ec8fbe2076dd131f74a4d542a2acf39f062e8d577063defb30f10cc4a63296b347a09ef72ba8cb73114b7c104fbfe6041114820020641a10186fca594d000201a641a5c9ed99f5063e25415de7aa81c08d228fa80f4e7766fd271b4209d9b8b728818de617c4ee9ab1445f352d147355acd17c29f60571a7a9c74c9b8b38b28c8a1f32557a489e749d31ddbf142b9bfef75948304b3bcac04bc5dcc2854ba40d0bf63d538f24cda4f42881fa8faa3b9bf4e4954650e3e58ab4e1adb4f4ffcf0b2ae834939199717c74137863b784331e3aa5b334f673133d3e0488df3941f46a7a1b5014e290e13f4cea1e2176d03b318f246779c94e609c371edbaf38ca2080cc141fb602ae0e628cb04f026bf5a4268ea3a3903a9d1243541a40569064916da8511acc6b51745535802f7b4535169c7af593422f50062c0f00a6ac8cfc9ff210fe18d2b5425da15a94291e62062457de34fb3979cc31227d4475b7d18a7132c2b280bdcdcf9cd3158d5cd978e7d29d250cb2b2a12b9b7c7d53d2bcb0811f72781cc275802faad777d3d8ac1e170d9af3d1108f9b93b9659417ae0b288b0c5a61fc0a19bbfdacb4df46a3c6f06c062507326f7f487c517ac866f3d0876063cdae5069115d77da722bfc4e791899e88fce1762bb2abca3dc4d2e888f2eea708a31008498cf144c620e2ac9de2270b0e5da420dc4007ac98b5ece427b008b21d10f633642804efe375474beb9b602df6449bd16fd6", + "encryptionScheme" : { + "description" : "AESGCM-256", + "version" : 1 + }, + "keyDerivationScheme" : { + "description" : "HKDFSHA256-with-UTF8-encoding-of-password-no-salt-no-info", + "version" : 1 + }, + "version" : 1 + } + }, + { + "password" : "Radix... just imagine!", + "snapshot" : { + "encryptedSnapshot" : "48231a61990c81a95dd6e859bc08b0f7734146ea557d12f5a462644a2da6c30528059ec9f42456a75875c411f2c4c2ad040970fad56f03183c7802ddb29185615671228185104546549b0fbb9bce230f3fbdb0a6973bb1b47e8a5d8c996b023eb992b3bb1bf15c0bd6d025ced9e2189a5d0c02c5327b7b1eb27c8a8fa5014290917eaba3831eb459677e21f99277495693c5446de2b1bba77e2558cb1c076bacdf3f28be262d9913e9415b79d9085727617a58b5092a700839ac25bdb5bc6d9af73c13ccb1bb1d888386ec6a62f695b4026e92601fc8357193315c31cf4f5cef4853fcbc5421cbc14d8b1c2496b8e4dae3d1a6f42e655f37f187ae69406499d894fccec6cc9591de6ee33f8654ce4e0a2e6627804260885850faa3a86c9a0c1db6f2be94ee1f5bd677c2bff27e25f93b6448b124527764b565bea3dd84a81db09f7456615f089737f3c4ff46f0fb8059447962ae7d9dd287fbb8b3c68045b5892eb57ed2054eb8cab22193b0a00e305bc7c4e0c95787ece6f3fb54d15c5254d7336b045bb65702c72cfec47ccfedbaa5e4ed16b25acd50f996dfc60cefa0435aeca5a4e13e0ae253fde79e8325f4eaa59e1b356f9dc6e0e9b68c9a5d0df8a2acbabddd872b50eb965fc8dc2f958ee87ed2d35addc31b8b2eda7c033f1ee70fe749e7e745ae01132156b5ba160c24abceb112a278d8a688c3878351c47019aab4f46bcd3f70620d5863cc3fe024704ab0f34e43736e295246ca323d471ed422ead0cc6d81abe6bc98efa1bc01985099635e11d6a05b254da0966e334c070a31427db3e17c681eb368f5bdb42f03105057782a580eb07401b26cc2794bc11859d5242a62021d8abd27bde86a57e41b29b7bf2123490f6f901d721699c7733af72ce1315891aa5af2f13341ed660198deccb3386a5b8a6dfbf9616ae3375c3f05b9b6ae8291eda02901ae0daaff0257a4fd7a24bdfd479fdb6ec16e84f17599756c9d5635fbcd21a408111ff7484e491e486b0dc4bf32f39627acc894a0f08c264512a06924f6f9ac5efe9fcd80e73fcb466aaaa2e3b7f034d53e34e4bb7dec6dde4f21b2495c8e5c200e0accbb693ed5cbf7c37b9fabe97dc5289cb2885d425398f7eba0e12d8f4feed1946901916d549659b1357b808d73b30e2621255b440cc9f9697649152c8a9c7492f69b6d7e0fdf1f30d2085e32541005b6af5b5cdf475e24bf6227313b354020aa1cf84b0cd04515ba2123a87222ec5bce4cd66450f846846cb3ae7524c76d58accd3d44b772d28b2123e18c8702dbc66c715bd038623163a5f6a7d7ebe1ea5564853c226646e02e4879fcaa8c7162667bf8f740985b84d6a68a10db980ff08d37678d78a481d780204aeb1af3443b5bae605cb99e1ac1f2b38a062cb6a23546bad804ea2ed51ae48eff0ad61feb347c0821bc1bc6f13556cfab7f799adf6df61314e067d4534379f8e8bc0a592e4739d4ca52b5cf7a84a7cf213f4db994af755a15a2519868a7545b720713eaebb4b970ce82922eb8bf54e591593edda3acbf59b95e84ed5377837a18b013b588e9789f47ce13065658808d932801c4cb11c6bfb149b9d0773e9b7e8f201930a0f6f216b6ad4dcd3bf39c00431801b28ce835bdb89101b8d6a43411d1e17d5ab4a6a1f3f8fc58a006626b4d8842a0faae32ebce606d8f77a43f6f058e9c0a0ff021986762a1084de36a4407dd8c6cddc93967683dedc0060c2e58a20709623248e181f698d5f38b2025b4a266557e14ceec158cd34bdf5ecb4df294154c8859eb470eda36206fcaac3427946158ba63fb81b4cfe579d5ce0283b02b0b2e65a26c98c5e6218dfd1fecac76e1bab2d190f61fefd8e099a95599169b0fcd440f1feef624a723a7ce23cf57ea6a3c4bcd09c872343384623f0bb3402ff1eed691456dacdad52bc72cde569eac16da9c5cbcbfe3f277e742b851a0a3311552e86538c91dff4767ce6769e7df5d6ebb471b7114024eadea7beb984e63d63ddc83c0456cfae9fcab6e04cc79e13dab00dec9eb429ddc09946d576160103679e0f99aa29f25446962e5a1526831f8dad07b22cb27e13b1be456a9e6d3f283ac604f609efa48f29d47716deec3c9c0f9878970d45c882c66d519465f9f6d62dcd576584f09590fc29c0787cd180120a98a1950bb239edef6c6271dd126fe8d4f06ea0a8c9129f4735bd113f0596779043c3768eca235f61e79afc498820e6da56154cb9d1cedaa30bf847d952d595ab44db439e51d10d32b21e1acfefba6fe3573a3b09f3c64d5d5ae4389f10d1509ddaa6b8bcde1169d4bf4e46b4f1b1dae1b7818261c7945ccf27b489bfb2abdd034f4f43b14116eef86da92dafd6c70277962ebfadff27df5846d2acb35679165b86a6109bd857ab8f47f1ed40eea74dee2cf9e6590fdef3c7597e2205f78509dc307a10d311481f09613d2da6772dc6575508a28fba72e757eb29a895fae16983a91e280088b3a350043ed82832f30887d93ef9ef7f5ae3f50a0c3fe2961de2e76da0a30088fbf68d8d6b28342f87dcfc88f9e5e4c5580710b1d52f38887d6d443ecd21e68d4c84dc261850bcbf4dc75790c3833dfcbac91359a0b626a60dd87695aae6d8f6de8c7b6db0b4bffc311286f9529c290ea4644b761c3648084200ae4cdfb8b8e610cb5bd66af3f2ecd408d40e7081a9f1b54726b236c3d4b08064491f63d77026a3547c60c5b927b041053d54930b561dc6716be106d3ebca21e1a3c17585a18599a6b17d077d4b3d277599df239ccdef3370250ac7da1ab2b200af5dd0c0ff4622f2bcc9e6a2532c49e70a374135ef0698c8bd876632e4f1b4b88332b9b79229831b032a0fc43c196de40afd0ab4cb9774ce28e5f5b77e31f4752fbf70231753887492992178809346ab8aba124e9b30de3b25e734eb806988e3d24ecff8c2a32a3a95aef333d9e2c0ddeb6e648d784ff60d5d0cecf3699e27ac78902babf44e9e7fb9c61f34026ddc5cf054fbd4f1ac2f9320c4ab17081138adb142d9c8906f90f7ca2cb267d0b13eac4c0e46dae56bb126e0cda0b74f622497e95368f0af01937ffbad84ba6db50b6fa6e79e6acd573d82e360d6ff4f0cdab976781b496bb2d6491c9f02e03e646c8035b80a28869cc3fbc03ffba84e858f225cd70f308ae4d1f3d56fe80a151b87d47b8d0cc7035cd0d1c4fd9256fcdf003d1691c483df62a5d8b2facceacdb63e888c6b273e37c7dbaaa6c69de7136e4fb9b8e5513edaee28ef21872938f9ffe26453f2e64e397fa9d1a48d0e9e1799365191e615cc1e79c4572b9c25fd7f710868644b9f8a65add6c0c6bd739c13b3ff03f1867ccd5f18210c18c19d0d46f6e3a7ccc3e9238933e146c4a91cfee9b8f24cda4298058163785d9d48c13082eaee1b35014f619a7b51ef3164568dcfda580d910e5f4a81401a50082e29ad9a65ad59ff393ca45ec730dfdae1a438abc4e068e414564b7a84353cb534f1394ef18b362f9623fbb0173a419b594e138f067d4f5b1af6db8da4a295d07c27874096eaea3609028a867de4b73dc053fb35d48256b8eb6b780cdd41d34aa8e5dd7cd92914358a2d027083dcaa03f1e6301af79e7d2c78c861f0dcd7958cfe9b9e2afad2bc45e41d843f24655feee0cc1ebb71ee014b8431a3306d1146393d38436e9aa2c7386b97bc4090ce21829064974e0bcdf844327b0e0cb5a4c16e0a21947c1e9be34284cf9211059fcf9811f472436b5769ba57864d78e5d0d4aa59d6a56973a89a399a2bc0da7cf7973d830089e872294fd08e65d0dd276989a86ab5786d78803666b7a6ef1dafea39ca6c07b5723a7dbfad90a53514133fc602f1c8be9fd9aca24d15617ea39e9d1c83b4b4eaea19abae4d6574c7d17cefee7783c2127f001520b29d3de91cdc5d7e90c06ef0680faaeb509e3d63ce03598661b30a3b017c0ba98f58e2bda9a4fb7baf4de7a3e36f559f894bca20cf9c59978f4a005b766d93b8e3acf1ba425ca96cfc626e193e3bf1dc13302430b46b9c99dc252bbc596e0fe7f44661e0235edb25585084051f87bf401e3f070084f3228b6262c096a56508aec7765868ee1521ec8ad1a67f697583a6723b836d4241d435d06cebbbab4c3c1d86d4d58bb74c9172e50a6960f28fcb042508a7081f3306b22d09fb226dbca49c6118867289e3fe8e671327cd20465c69d2a9b04663740a9e4caf92e065778ddb08b8ddcea4d180ca3ca59390997ba0d089487812f033a0e6c8599b5b07babf2497d2228bbe57bed4cc3834f674df0591bf5ad11695b15daf9d1649e276216ff7240bb80224faccd60098daf306bc5c6095b863b06a8c61ea34c9f0addf798a8d05d4669ae58fee84506c52aaa8f138600fb8d05abe8452780af2fa3a9627261b9a96ce241d1140265c9a3c534754d1c290a5594f451210b32d03af55dcc88cfe699462f3fe5d8f830f78e1b63be0851e541cf571fd9bad0d8e5c8372b9204d0d4abec74b3c18bca9188c80c422d1d23721fdff3ea823d68b6424ce2be2de2d4883c3498e467ecd5b96b9082b104f99f5b755c2fcee92b0fa5aba22629deb74d7d3969dde8c4495ee985ad1367183f87b9093e07006a914ce88897bfdc573bed7ee3ada1bcd6de64898b4e121e1d29ca687af5380d0545cf8912b93383b90bfe73689931a0f397f2f2deff18c6ae353030c8523c4c061f8746e327ae09d0948d1fe9a2ba7b4760aeb46c5a77c0d4ae9219acb96c6d61e78a82066ba318ecbdba20400639117fcac8bd20cb5ec83f85e572d15ad0568d8aff2ca8b6f34a1a44a8a1e6e2849a96636656685c84e0654079ea6c097ca3295e89a7b38ea5de2a0b1af75223cd4272a5707590bcf3677001eb2f3ac3c6b803300fae80fcaf8890e94f6c8dd94352f3585944bf48b513e8317d0028cff06e9f87e2843399794154926a7726fd7fe00ea08c1612f50388df54cd12c66db199a3b505f5a28038bc3a382d45cc85b45ff13a75257505e68510c90c60240d8130f87c41e6369486f76bae5a66a7d993d2c801344003cf529f2b9a066a65b789c293b1d621cfd97dea303fd6797e103c7d8f2ca6426788e4688b3303d99d0efe341bb27f8df95162673807d52b0ba51f7659da220c2b40fb6971c8720c2627726768feebdd651ad6e0489d938a75f8e68d13e41e822e832ec130612a8ff3305bae90027b27748bf694ef3b07bb28265cbf9836573840419064605c31eab5c047c8d6a04bf657d2562496b53197a602be16f9f2a7ef66f9acbf91791cf6184f700f0a5899fc059fdb7edceb5a96db53a3dba2fe3efb27b679fd12df5c71490550677667c6bb17bb0db619e4c872e1d917c772e379b5070d07bcd09af036a34f396d97d96d5dc6559f554970a28596f64ac9d1cd99cd3e815e920cf03295d8c0d7ea4485fcfd30423d8dc44ced5736de3bc5914a2fe8634539b134e749f70f984f338df968f63a7604030b49719d8a196e3cbbb422e7b0361f3444235f325b8fb95145617e2957e8c4dc77f8689ace800dbbc78d3787a4f94b278584e970bb7eb4a97a231aa410a681d587176b4f69e0a35bf4d494188a24659dc3b8c52ededae04013eedcb39712ad5700f9f077f3aa24220549f65995e08c99f04e57a7d122e231130af837c276a7dd69dd7cdcc995726b470b037b9e0a2befb72efeef3e0fb3a2f6fdaf247fb3b79e37b90358e2bef4a05a3616d296b7f92d82a3245c0a2f2f679c1b9d2a9a646da0fec7583d309ca7e089e5a54b9314361ce8a126a9d8d739f9802129710e801d82382123e90be0ae92e1af90df6c6e259010caf7628559fb4aa3cdd1e1be67c2a1d4d378fe31b6ebbe0c3aecb225600e7c74be7c768a472aa24f9e4a7559ab338077e37f83ae4fc70c9dd173fda3274d93002748b414edf61871f57324a2eb8a1a4420cfa5b71b84b4f8267b2079559d975113e024ed3043a0d665b96541ab1679fae5a6986ba292f0cff33997c0506fdf46192b055f424911a7863cb93a29f0acab128a02a37d31c4e0562023c1a63bd53fa3a5e73c63e18657fd62c89fe9ba09df6f7fdf2edb26f27f3d49efdd0d5f617b41e353fc9f5296ad4100ca833e6564d58513842d56823aea6aec5640ac39fabe3bac02db18664b09aa5b339fdf36650f703086543c2c599c8cde6a70ca4d0944cd6b4f0e9d73b2254c5e91d906c6dd4859b81124a78614366aeb24d2b958f0ebe2926b98b52a751880a803d87d923a2efefbfcbdf9f16dea0431f4c25017b23e92548cf2e69f14eea40296c9b5d0f203addcb053a6f7fe0f55c40614aa1bfc500a409914fd295be6eea215796ba3fea1796b98497e8b8074dec36242ddba739d47b6b686006023d65c9fc4975563e8d34949016eb578eb84f1ee7fc91ee7f9d7e7c4995d770c9ea526210970e7120ade09425a1f603b91672d2a33a38f7ffcd5495065c5fcb346e449dda5938dc694caf1f71c882b71c43c28f031ae9b1cffedfc2269e0e1d32205801e6073e5ce2f1738c66127ffb46a9cc0aacc201c8d7655e49a9167111f63704ba04db0cb6c6913fb17b3c389ad2b803490bc9166de35d5e4049f61dab632132066eaa393a8b80cffaf7de5c9cd68fc9a628cefa4f13c3d1224bb610c072e96ffe1c863bd51224f2751aa33e785979e7ac1fafe4e15e56389ced2ba3c6d68c8426965505d83922025a0bb7d22738935ab2039791472a45abab4e93466f66ef7f55ab8e8a75462d4cfa00a0d9d955ba7592513e804b81749232edcac6e68b0e4cbe1751eb2bcd044c4d2c31346f8a648d037eb40213e763d9b00aa5d1e9a7ceff3f26f2fa9e1290842e118cdab8cd2262884289a81a79acd50f6753b1d0880053fe4fb2d2b8f9c8b82c7b4f693a35fa699d2313bda0b73a258159b61dae9f56be7623b68695b3c74131785ce6d54ec9a4107b9877f8cfaf0d6c33df30db40c1049e8856be8f2b57cae28c8f1acd969e9217288d34f0d7747e85cc2cec13a037af07869a6f7bca5732890e2e7b7132bbdb04d7a72f0d89890d91fbb16c61d32e567bb0667b945a2c0a36751fae602dd2e21ecb81e3b0591ccecd6c0d6c105fd683f2d328b88fd38b8b881f8f8f2e57e6c30206f97a76e06af445535cf5618e1751cce3b4a3438803d64c3126d2b71e94d8c17a26fc5cb6dedbad7454f71087c15b8b07330895ea96d78ff05de08b6511126ccc19b1e6e4e33f30b2887c8951ec0d8f1440ebeb3b126351973c73f82fbd95516655dfed15fee4f02510b6b12eb813ad4dc1fbcdbd4bac4253633373bc09a4d1483b0c13a00b79ac33809a3eafebca875f7fc42e1f4b0b70f63e01582a1230c279995b43112e82cfa33a1f27f13fa231d53b1faada430278692fe27922025cd4e69b8ceae6fb3cf41295b789e33d8b784333c351d5d37fa12281c1a7cfe292010c6c95a82e9211edacd8f818ff886d6e71e18cb99c86692e7efb6eeafb97834eb73f3c4ddd45be7cf43a698866b9035a98b7c1d021bf8a4b29379d4609a016a3c8022f47249b1fa116a6cfc53683cb88505fba03e5e33225e942b3b7a1fcef3bcbd0dedc4319f2831862372782a35285dc070045dc2bc8fa7444e627277d9ff79ea6265bfaad2aa286aea05ad2e7c7bc8ece92295f1fe2db549404f9ea437cdf385f3a7dd6e61c4320eb2a392ac0cc066c2d702cbb0bab93ba6f1376507f5ba33a2ccafd77bf5bddf36f2f2eebcc1b2c1ee12fafd08fed61a74089a930ab30692cec7e9a732499737a0afe3c6e7f0be6225b5b17d4d53a27af8897239a06fdfe76057614d7f64a96cc68b94206617d7da9de16935c61e44aec50478710a845eaa25536eb939fc13a1463f6845d5ae82dc4cdfd2cfea14ac16f2946eb7e722b7dceffd832074f8411a80dbe7ce1ddbc5c16136e605d913da0406882a0415b1c4e52e438a6d4e2683be6ed3ae0924db306d931fba632aded8853088491f14591c123e12d186baa4b197afc2d7ea0d07e7f52b7eb8bad149a6a19e5281deec90c2e05901da9c37ee6fc675ee34880289ada22ec7b7cf82883943b11e7378f9e388f8b30b84edaccd7a30c720153c6bec1218c2bdffe919de83aeea2d029b593b952a22248d78bcdf83d67f478301f4f6de8480d279cac4040c611b4a4a2915cbdd623d61aab0a49685a082ecbf29fdb952e6640e6da26f48e638bafc758a9f614830e0c322c842b2939e122b19e42d6b28b6e9e49706a053a88f8c8bf2a26f5044056f6a34262f616e3c54bc1ee1d4eac977be532e976b581cc1e2c09063e8c8222aa55b3da740803aa0d7742882b4161783b25a5c9689ea39a4698a5b99c810351e34e7ade64b6e82af44c3408974f2e81a0da747789432989d25b4f8bd8e989addcff5bc9fa8b442d3e2c04a04e49f5bee97e1f8aa403a88578f0c3f18d68521b34f026f50c8972cc1ed5dfec9497c692413a3080d372efa7b44d300f175542cb1efc1b14feffd35d239078bf0de330796dc61dc5a868d65f5eb011e7c96a305ba983d89773ce55d9211efacf7c38cd43ddf74c2983ec8aeb15de85a9989ce8ff24e8e451c9c7a8dda67f935920ff3fc1bb2b0f523cbffc4bcde8d7338b38759f84dce4e40d36304be7ee4f7075fa5b381dbd6d1e9df380e35356bf46f60dfba0360c0436749ab3b13dbb7edbbc72f331274984f0956b53332fe008c980a9857f2b144ea680657c11c512a26dc56dc6529f52575c2bc8d07372e4833e8e21d2ff4346a12500e4b995ef1ec65f5b81c7ac537c483ececd963360c2da250262afba0f6db3fb1399c9bdc8692abf96968727d7c9dc75779cde3ee8b123dac22d366ba4a43437faacbe7977b77c7437989af9faf8eb075f3b777ffcf8719bf3f77ce9a8770d6fcf50f67cbf673d0cea6967dea7195421e47693d0fb3cf89a3806921a51e4b184d373b2e8c18a590f7dd83e4b57e1d9aeaf984808d789967510c0d72a89dc7ea4bf111bdc9eca676ef02dafc127e3171f42b957dc18bee4cc199d9da50b2d5c8d59139d4b98570b220f4af4e0cb974590db5953203c47fc708ddae90291f5f680895ecbad16f616e99c88b56ce62da628fe9faa5c80263d011fe4a6bde002412bf8ad5ed04eb8bed1df51933e12c066ff22406319048c2a3b2b760a233905d99299a7d46dae1fcc4bf98d1cff4d539605b0e46086f9ced0b9d4c984871010790ceb12159fe1a2cbed1ed4a402908404581692f3b3c58f91e90c745d490209fdd1b4b4612249e1a43e436fa7005f0c5c2bead7206f059b54e81f07f7292e423d412769b1c81b3ada237b8498bbcf47646bfd93d32d19236c1004c615b7661a771943f3a00a25d74c619f14d8ee4932721812605419fc3c783ef1b4908e406c5d0efbbbe483ac5c2ae2b56ae77435e62b78bd80e3b22981468d5c090047e9e2c5a893e72b1fea04489c57ef1b7039aae87f10a169294c6ec9031f33d4053d060549ce0b864f04a059404436c4b26603c132301aec15e8f4975d9320076860bca3845fe4d4aabf95e2b0645c51e259644374ad44142ce008bc376a90d5313215e983b66ef777714f40e4fca0ab4f22491a6e4b8f7a37319d023a25bb3d0bc60abe6c664940989c5d54c989562e0af46e5a15ba7f23d70cb7ec0048cc1f3049e8c931408f5b8542dfd994ccdea0659ebae79543f62dd9f561838db2daee6466ab2e317029488403369a14bdcbf87e8ddc23dcc0859e04ad38c7d07ea006122b948d24efff8afb980008886f10f33369bddbadc069e1cbf12469000aaa44e3e31fdbacb2b4569007f6c2124eed58a32451fc6c873b9067754b34316f5b3b531aa8a9f8250df7de07adc0c55fa558bd8579f3d0e15fe7c35cb15b0809c08d8eea045ea5376bcd0fbd3977f6f795cdf311bb8e46f92a428049e0295ccfd5116963dd435db41234c9d9d8b344e46cffa774e4ce61d566ec3b0eb29a1dd37040be838d747c3cbfe947c4171e472fd7a2e58fc87f06a093122efe81b5d9eebaded8f4b04fb18d177a2623b6727a86c193d3a7ddbe8650e59d0b04f424e04fa3151e0e7548375ef35c7b6fe85ab73bef65a882fd92cc4d18ab966809a1c5bda10cb9c3759408719be4013b144e6c2438002f314ea6398e347e46d5f04d5b3f5de899d04f737c4c31757d7f99d713a8857f96dee3432b8393785fa0a516eeb6cdf136bb11eab61f035ac4188083ee83ed6cafd3066aa80943e4e0a5616a40c1a649bb471cae5caa8eea260bfcd0fb53e966ea130ff88c933b33533bffcb2fb8f6c1ec7bd6969706fe587d82703af873c469b849d6d7842c09f3aee4d9912e6b41fe3a528c3b488e77840a6f52f536c38307587bdb469b527cbf6ae9612b66286737e93ec52d7b24fa47941f62db4c0600c6ce6b47943125e47534dbf12f053b66d5e9117217817a96e76e2f55431def6f55c2690889a07af7b194e122f10b1322343f54a1268bf0e440d335e0f5d31b446c2c7314c646978aee61351acd1311e8f2f00ff4c7f65b6e9f2f1efe946789db599e28a02facc29bed02deeeb10eba1541e59f398977fc23a38c9e0ec63dc5a1eecb2fa800ff89d4f770c532e822e458d30a428b1055080252f89f3fb1b111ad5660e11585328d37ee2837b8c9dcb3a8c2811c3037e2c8d924019c2854bc287966e8b0715118262cb838b044b97e8465a2e6517b7648a32b055ea3d38474b543484e3d9d6a1074f993235974c058ac1321b538f5d00b385f1445b18715c86841a102ba1ab0f02713a1bb6c30fd6a7cef54a021e3cd7b7d7b0e8be6abab6c2392811425598088901d8d32bb2d1e607a21aadbb8b6e24cb44da8bbd3130a589300f29c0484e80c0a5faef2fd5d969a7c87a55618f79ada06a087b1123ec5741caba120a0a44b0d70a2331f65cd963b6bd9b0a533b44d5386c55cc7a29f3ff00d188365935620b44816c58862fee9d13d1bfd95c85e8647356fe5598e2d5e04ffbde554fbede683f04547cc22925fee6fff2c87ec758fdfc15905e0aac67511e97ded12227763ed57cac5c8ae4c513a6e86b48963f2c3e75a6092a8192a014260d3fee9b8f0f615bacc896e7cd68ada1936aeac6895dd20f9ef22de02850539f450a998211a6e13e93b31f04a433f1af2d11585770a8fc1a48ba9cd034f88cdb8b150dcad81ff6e1cb83f43640ebe29e8c8acddad160f1f96b47b4f66b8cd1141d1adabe302687c39f17bdc6992063bca60c347337624cd12444feec76877c073384848fa2150f945732d3619471afb771314bfc2cd745f65b403eac45c83ffb40f791cd66db94d2dddabc60849323381d6432c8756f0cf7b0bc8df26e16e0ef8783044801fd45ed0e7f2e687355183712c0d33fd977d057f1192306f11cd6333b0919d7b2f73777b670ea94dd62eb0269861a7eea88f0083c84a50cd87ed47b02b111691d2e5abc3fadc2898545d299db8b5db8954331b4c441148598fd837c4072e795be27c40ea44c2e5a73696c3b1e8efb3a06b068c956735ac4cc07d3c92b0c89aede3ad8c8c60cbb2d3dce0943b05f60418b4d9ff1511a0d8af8103f203f75706319940dd4b225b652eb933f891bb886037c24236bb2bbe940a071fe2a68d148f6ab171b2e4a5e518ac1fdf610775347420aded3e81bf558333260c14b837abbf551be1a483158030d857e704f65c5ca46a47a7e8cf4dd383eac2237b517c0972d4c2fef1e522eedcbdb449e24dc239bedce15a2aa3613c6aba29011c0db655233b70810e56e06f2b2c5aa28cda56e7263093414e4a833b4cab4c3fdf591302198c338317bb8857bd2b62466abd6a9c38fede6ccdfcbf11021da14cb34cf2ada27da95ca23394f7b80461977ca4cb64993587da80bc0fb6073cb69a840422e339fe9b91c5219a81c9a4a248cce84bc3c949da9afe61c443ff4055c8c2ba301e47a8975b328e0cd0aad7127b7a91d5600f5cf4328f8ebc420f65c0fe279647cbd28ff9961fee773b792e5438e35d86d15ec3ebbac6558002974ce303f514c01f1681268b9c207a3c086bc59d1035f025261fba412aa17fd9a6f325a129bdab3e0b14f12c75095978f7cda0274ba990227853d6deec7fb80fe7cae6aeaa7322776b839dbdad2a06b6ea23ccbc8f8e4dafe54962f7d27f11c539217ca465802104d0ae508001c063e5fc36a0e5fd77d1019c131a2d2d927043fb289be48b6325a5893803c8792cfc6f939c77d733f6d6ee0a614b640a718969101d9c3fb5f72aed96ba384b0319ffa4231d0131b90322098c8461040c54be4a2cea04b2f07846093ab8db653d6a795e664abd5549cf90675526a75ca99448bd5579c3259318b8e92c508ccc1f3b9639d67d83e8438729606952849837d63238244f93080cd17812ed4beea205daed3d8fc076b211e53927851955bd92263b089b1c5f29d82a37d840f4441d242f2b21c17789b24cfb99c04f4b172f61104eb03cd53e3adf989356da6e3a58ee8d122bf1e9e82f97d2aa50c62d05810a9d36a552ef4b2a9ac7ead72826bb008473b6993c3a57ea99dec7630eecff0e496e2356a47d2cfa2d77bea109e8290989ec8b22881e482d89accb25e355deccb3660d3eab7a71499babeb9ebf374c0fa617ca278fdbbb5e64051198dc0cb7023de94dda754c8bdf6ef742c561e3cdd10fb9f03e3ebf10aa63f9fb17a50ef2ba24440062de1797d50d425473eeff8a55330dcfaab654f418e6fa1b7436a6674b93dcc348ac082e7f56a2012b49e4decd85d4f3ed146f91208b9c71e4b54f559701011aa8c3c24ec8eb13beea5a22464319e65e120c5d5919ca034b7532c3e1e409363e74302061997bc478f1386d614dc2ff44ff3e001f045bbabd3732c5cb818fab34804e7ae908e8f968b6405c9a990f1092560e9b64ebb78dc67423d2ef5e06083492d2021e35792aee3a78657eb67c63e7962df4c9b9ddf252afb7e5a22d8e84c2793f054dd2b6c4b78c17cf57096e85677dde5eaa93d84dd0634e017d4e5f3ca5fdc6052e37177e8d2736a338d91598011f978ec898efd4aa7d494b2fe0a5976faeff3a141cb4b20bb91ae57e3e3c49a55d2748fedeb3be605316bbe9e359206db467b15268c91cda8988c57206fc5c03131683a06d877fdd1d14283bffab21a07feb4ed460d5767e6e1b91dbbde4b8dbf99a07579e62f31bfd0124da9b2509f8da41547d10a39c508ceb25428093a080a5508ba51a2b1793c8eeb9843e8fd026fc2c97ca826abe98dd1440b117c819b2e31c8e9fcdd2325675b5465e10163d593589382b4faba9e732771aec9d4dfe5cb10b04eaf6b469ad5191d104ffb481ea2e1f296fe710f7273af1e78db5af87baf5a57eea70996adffff0e32fc739bd1aac033a6c4293c0bda56c7a0f7270044d782b1b5ebe462fcf805348e3678501e59f6a1594da963f6a83bc0453c29a2059b69d700531bab52656fe7a8dab0c63877de506733ce8c1f7a3a94a87a3510d073860b3a55d459fe83d29ee1673b222ba5fd84ea7113ef0cef08ba17c638fd11187ccfc5121760efe5a39b2ca81fd8cde8004e05226dfc0dc72004c5657e25ca86a1649f9f3d69e845d62b143951696442f21d269d6753840813f4e1e7617187ef4a57743a65d2db1b04f767c78bbe5a0df2b790c4ab01b3aaa0aa24b63a69e3f989ba2a0fd148b4068f46da8743037cb61eed552e31aea860c181cd3f06f8cccf4ace65ef168ea48aba7e670d0aa08af7302f72a276d20cee6a6814ff6bc7bfca40dd3611e47ebbdc87932d3f5d3f0660db2053f027a04d9e1ad6735744696a4b5c978c447f1c7b54fa7fd4a1746c5f6ae7c574cf43bfa4d2a9ab0eb0c9d6f377a6a79e838cae3d43d3c01cd0b7612405ee858314c9f4a35a11be2c01869172d98cb2d3c7e9e2435e98497b6dde90dee55bf7ceb5abfc932a7c77c1e756fd8351660bd0e7f05da575b60d5f848b0c5f823e4c6887b839175a1b348e18d3bca01855d3b92d355d83c8971f28c646f6a1b78f18a6300e9e06667f072a924bff0198d25e03178dc2015c979672d01d83eb3ec8b571ecfc5bff158e22b8beb20e2a96a8d5e68d4980798cc56fd2a5cb72b6b2741005be9abb0e31b353442809d8acda6caef49962e360cf80c2f7743b29f8f5ce9c057afc6e052d79ecd5c54613e0f675f02702299d1bdfa7d022db38e591e40cf9b0d1a4d83a92835aaa2abadba9b09900631c3327f07b12a8490aa96490d97facac9e29463fd74b531a79c18d2f6784a6ab6b549a45fa67a940683ad9ec021ba394e9f4422257a6b176d4f3f3c32232297b77ebf32e2d9da8c29ccb3cca7c695e0e4735b1300ef49f0a3cd9b40516727eed167b24cec233d55d86c313d0264c4e42d3618ad01ba81736c5fde99136147bd502375147c239a52678ec8de5393cd2fbd545011a15bcafcc0db35c3bdd0ee2a09570266d6c4f583e612ebae0bf4a31aa3651715c21dc038dbec903b6287352c7e103fe80922ff07049cf6ba7468c7da248bf7dc06bd3ce599be320155d0daaa20e053ae3859cb7f35252d0900d179ccaecc5f353c6ecd8c708a4edfdb23b722a302bb76d5b00f20f65e04ce48563139572475537eb87ad564ad44bc65a99094890ddbd4bfbf29ab7238f76d3cde8790cb0d7f7da47dc6e3e10e24b955a61ef0211c7785a84a2c5732b3552bdffffa18b3c32bc5fd8b113c19961d10e5d3e353b477e153416712886a8ace2cbff5fb2b8efb4f22754201a09c038712377055f707b748efe120deb8b6d93ae92700a6b3e62483702f1c831ae39cb54de985b1022b6a754588325ecf3f733e5d9b415c425eded70adcfbff6f6a4e544a2a26c80288f59be79cb91311b3ef88a686454a81a1799bb79cf0426df0e781818c798702af2713b65e25e1bbde6fb231fc0303d480432b40841760970f29ba513a503e688cde4ccb33798f4c5e0487edb3382fcae9800167dbf3569e535c514b625853cfcf4d3ae90c4e11725e9f1ecaa51446810a84c10ff2e8115ca7f17c5458cedc8cc5c76c884ae4f7efe95153f486db8c1e145fb2a9ba4e448bfbc85b6e94c66c80a7300d1a256cb7bdfaded99bfd755b534a67ce5555f7e089ed3850b742130d7f7877f1521c7a28c83ac848b1d712c2dd5a51d69261afa37f8b99eff70aa1a7e9be558a2379aeae76ab4efa255d96520e2d36dc405dd5b386da8b59ccf35a536690f465875e7f62463a184045ae79e5af3bc19d71bfc903bb864f406526d1c7d8b469c7f61f4786f0d2ab243b8c42a66407ca3a9e4255951cc5e47055efcba06a61c15d13a081de93d8ca23242adb40f7c2ff2ed35e3631b928dce4a04f738c70fa1c326f57813b87a49d57f7960239c78a32b79f19a65033d4f05cfa91907215480b06ff302aa87e1f16611aadb6b29c807667ae87b66435a9dbf821d3c66df96a43b0dd25dec74624338e66b00eb19c43f6eef89d0bcaa459c170c87fc5649c66c3c26f1adf1a19658d077cba55f72b49e881259ef2285c092c6be7009a241e78aa6ade9fbe75a9a1ac00371fbe745cc0d43b786979a690f6a063b75244b7b348d09f522ec8501ec15a9f57191aa5b0be8392bb6708e50caffa074502ccfc4330e79f12163054b740757d6ca679a1858e228c2b7797cf42cff50fb78d54cc9fdc6d1d37e8331951d3f93b8e94e763f1c810edc7efcb2a1db5aba5eaf21fac13d1fe4560355e42020a27b765eead0442f7b74e15e71ad2ea7010e20d0260e2bdb74b91538c2a348ea93eef245567b5ccc686f979a3f1b636fc6cc045af8c99684a60c62c462f07114ab528ecc48484f5a02df60533cd8c088878a3715f83ced174cd385fcbff6a7ebe8c1b0baffdd4ff633a4a5f9dc6aeb3219876cfdfccfad6e09b9ff75fa48ce05e7bdd238b91c85979af40eaf778a2ed7158159a8c05586e19854233ec2b5fcb87d40a04105b10d588bd09da1fbb694503b675031c34858866ed02ede6f336eefab120a62d668b1d2edffe7258ee580e2f1d63a074ad1295f976fc2676db02afbbf2e2da592ae6948325896330f7dd45010912280755217b37ce81dd247ee37c95050cbfe6adc4a0786300b8abffdd0b0555b28f1e376c507dfc96534572bcba8a77b012bfa78737cabc6678dc852195af7347de9ad4da52a150d5a22255b77709ff3fcc6712c093471ee4cccb7f7bd039fdbebb254933f74a6d9b8cef10821a78ed4f5564c6e1bb77af7307e0da92c3ce39e3fd2e1cfff6b6738e2e212cb83ae94de593ef2e4c8a1610ba3b3caf14af21ec08456726af3dd953f1d0620f9816b472b869615a87ee32e2c3e6750fa32da06a669f406751344784fd05f7f7300c8c66753cdfbda0396c5f12a2c9cc50b337556550702d75d3dd876574bb6b02c41c388f8e96fe86edf39ceb5e4d4638f68e1f31b5c56e81596920955f3060bdf028aa6ed9c56b3df5f1cfb496e78886369575dc20a6eae1a2d50fa16e53ae49bda07648e3a7565592ab3cfb70b0489d813d56dffba875e6523ec5282776866f3304cf3c209451b6443a5266ff1269be25aa1e221316f334e24e3bd9e82c2b9525b693acebab0f74e7c2ed090590665fa346a9e17adb1e563228f8dae85d3198df7ff691f5cf48ad2d7cde67518e0f931a6848d032b3b2553c7a4e792ee89c60e02ccfa9baeb283148674087641bfd7bc9fe4bd9998bd5bab9a7298a04b7054f6099267414dda311417a6878a6e7413ac6f9c766eb28bc8ccc53ada0830ae25c928c1a6a1f694a99293ea9da758a3283e73e917d87fc0c13335d4c8be2ca7399609646dcf993e4a8842dae7155f2a6dd690ac7d53d1701e9376654059e8cbd3043fd28e7f1bd595dec1d518ce7612d67cf14f19e5d6d7a5941762175958b2e749b5e3da4e114532f1d0663bf3af9ebda0cf1eec448607e5958e0d3f1753388fe602287d292d05e3ebe775403e9a9456f378de846b660ad520abdbde80da53caada70ff594798190efe38b66e5af11d03e4ca4b38607cf55d1672c465dee2f7336ca5cb4f4b6792d2a0e941d5f51222c1813be870f6608a9a076ea7d5de964f0eff4916b55a94684b6c528cdec9f5693f380454d5acfe65e6adbc6fbbebe7bf24b52146d15f8ee699cac406d42f2cab63988f2acd499857ad59805f23b2ecbc275f6b27da355dd9d4731a8ef8857dc6ea2c742be1ad7512df38c5866789378c9e6eaa9ce1f1d13dd76d5d3f690abe84b114340fcac25046ebbe0ea09e47c74f0bf6ce528e5371222ca5c10c8070f6ce67a8a7329217bd9ee8b9b623b06631de386efeac4a25943aaf905410e87d2c8f4b8a40878752716623bc355a4ee8101cb67ab3cc14e5359b4111864bed78588ad1ba0151a4042e91b96390b4ebf91f8e2b0b9583c113610392a6038e0620367198a6dc1d0d999db0494dc234568156dae563174b0c5caaf818400933c31cb45d02615ce9d22e498e5822a8558398e5295dbf5f51fe73cb387a51d922aee7b32ab0e43c9e3b3006e7ccc0acd8f6a1c0028a5ec2f58858dc66d866b5e846d9fe70b7f17337ff0ae460defa0084e97922eaf120380c9d3de4835abfa316f2913c2d49bcbe659165eb52e5ce7c5afdbdfc7921e9674cb6f1031b16827887f05d7a2aedd8fa148f16273d2c5ea68ed4a6c2ce4f11085e3d8313e40bd50970ac44060314abdef10c910b48aa3aa24fa9d6ab77f7df5dd5462b9d3ba9245bcc44cc05bace5aee333633c75cac969d62b8b4157e8a01311902a1d315624ea0e57b5ffdc27b92ef8a727683aad521de41fd74a6a6ca716b95129bda58c814f730dd11c1ec3862b7f6e00412b921c5bac9415245bf54d31faef4aabf4160469df30d68ea94212d98d030bd4f39aa888accbe3658ca0492c6a75a2a0e08f70e65b7b321119f47661df2d25382776bd4b36d4f916aa602d53b4d5de7444326b2302b68017acdd59f9fc192bc7e5d1f8cde99dd54b6c12fdaad84e5b8d01fb1ed40f308803b51d46b17226c9424bdc365872b7fe6ce095db55aa2cd231f05c2480062088fc61546a96645cdd445b1ca4b8161a7051034db74ac3f2aa57ff1761b76d98f99894505523e669f17568a19fd99a74893abb2a5df97e434e408cecc5136b2050fda3fe77f2aa4ac07d81c6f8ca6b361413b85d0f7a090f113b1f9d2accd51698b5097cea8b528140722545355b0453c6ec87ab1891972f46cf6df0b5920e20582c935a7a2159766109d780e6a488de0b6b6db8770e212c16c96d4ce4f23e8118db414b85c9dd5447a7df49e13aa4b3835bef1e410e8fe5675019e004f1004ca8824a0ef0ae723621137d51377df3707a4da48f02b59e8ff075f9e8414c90db8394c74a999915af7295c89df2afa7f572fcc6fe8da1b06569b7d4cb04b5666bf5290c9987a9a67c416cba7fba906153ec9b3011250a350a1e80142174ddec83b15f2ba4ea65d29ed6e697f3055f8f4550d186a2ee88ebb17bc9cb9ab3011a4014b9d23f2bbb67194b6eb1b60860c3e9749f08f251f0bb93d17f86f9d43a77280e914abcfd710f07fc61374ebee277435191cf6930d9d39ee08e720a3ef1bb9b294c44d0e5711751a77390d143227ce09044a8b74c5cc64c5871d6b6e47a68899b57a8b50e9b6507989a483ec3caa3ce301ddc854c3da6cbc5beddbf30d7c3a139781a7ae79d1a4f3d12925e16e84ab5bfde938f8b41cdb6f48001736c33d3f5769ef57a0776a18c7d352055799172e112b206a19b1cbe274b22c4dbe1ede42be472d45f7e62066f7e9119d4cf3673af54800eddf2d879c1bd957ca2fcd1f9b4757817dce3469a24c8dd1edbba508aef0626a786dc727067d66ad6f6f9f4cfcfa0e5e3a2ffcee151c31571d6b3b5895ab9c8d82586e7e0ceb7b1b9c76f4544deafd6dab811e5157706ad35d034cf56dd78ee82a61b5d6321fe98a5eb3e485bb1e6a206442cd73e0a288b813de33d1e55591c9ed635d675b88186056445663f5b56a1b682e436d88842f582fc3e93de308f3d0d8a2e7fe484db4546518a32ebc35a2d3cf48dffdaff66e830496493cc12a34361e154359fc03563aa84a82a251b41ddadac96bb6b1874a82f0a96d02ad14986d21da534e09aec2528631839c7279b87cf0f53dc34c645012e7974aed6897f0757c0d5e5e9cbd1c46d13e567fa6a7743f737b5ca3a38f4a2dba0cf6da333fe44e4a7e464adbd3de09e1e03e01c15f42aeac8f76eb946dc8b2a35d18a99c6a4aef0235c52ea8ca128e08fe03e3e578330b5ea12b68d8a0600528c9af68144149f57a335654c66c8a54b8bd58f10bafcf311eadc8da81a950c0d8dba4596c94f5f48036af0309f6669e893349d1aa90bb7612e9e262bb1c4977a211cf0390737c2ce5d976763c4f6c9bfe061a690fa99071a55c8b9ff00351f92aabd1a29f8c982cafbc1e92d8df30fa2be07f03cf87c78705dd59d0689685310177cc455fd48239b5eb2ad0ad4b704e237da356f650417953f52b3d6d8927d7803450c0050244786cea20302320c6b23e4e06c9aca0cc37c4c7277020bc33789395529e21733a10ab73425933f322b54745e3c5c9936c3a8319a086844d418e305b2a6379711eb3b89b3a90e84488c28a8336d5b16bfd923622965c1a65eb9d1afd61053c1ecec7bb1eb74ab6d2226dc1c73220a50e68fec1f9de193a9854890c20b4a1850b73eace34da178717dc6980b2ccbbef6510b114ca7c2a63adbe780be77b7d773e06d9f1df0c9dc33d3f7af2327f5441287c3b567214ad1d8ddbd6c38308395507ead883f7f7ffd72194c63942e88c1996369359145e1f5e8e7fca8375e35068dc98d282d7d7a1e767a1bd5d69113ed4888408047d5539d2f0c2cae423bf7f50a4193226416f9d3ad3fa0b118232541e7b6b27b23b015c61825f2c7598b9ff56fd14af6d394167e0b801b7fd9ec069f2f22d72bf663b1c8faced84b1e3fd8cfdeec121bb460c7a45ebfb59f30c6b4674d78f68fd28ca8400114d0229c4f80e617627f432ab898eb7a43b9124f0e5822f515afa8a5754a707b77665d7719267531532215315667329d9a34303e5066432ef1270d4a0c0ab3789b5425195b28e1d334ce94c30a5c7375ae4eadc7f5b2049fc5fbc70df0e5ea280486394180e8bb3443d77de284044d7e5846c1ae49c50b9d3a9205e49231eee511784915adf599f1ea511f1136cf30a555b373e6385841987bd96af2f7b713e66359981746ca9c58e89c101f853f56331a4ed3967e2198400aa9de3d7a76c21f2f5534278cac8e43b5dae66d25712d01a014c0b49f75a710b036acce3ecb5304c8ede9ec2f6db34b1fc52e6c71d24beb3d86377c355a73a622f0008ad243e22fee35f286f96af62844ace488be6f5de3869b13783b3913d67e4352647478f779d310af77c74698a322a118a7747c153b113637739c7c0e9b51a55ce1c28cfefb9012bc76dcd92259f6c74965c91fa9c1a5a9883fcc9e0fe7ac1104de231487540e79e291eccf0cc45694b36a0eb0fa25762dfdf793154e4b85cfad1c314b2b3efc6de90714d2efc3d1e5cb55010bd1a5bc34197d0fd7bf05e362f881c482efe4b8406be2e21f802d27933dd3c1c43c8f24aa821a8c68205d6cefc12563b7863bc9f3af14a58eb56a29c779478fe9e4722b91c5b0b505f1a1862e2ec852e00e0a0a657b696371ca294ff3142fc2175d0d441385759f5f01e3284079df0563f570fc67f476a2f4e6b8783927b338ddc7dc939b3c7918b3a480d55d803e0a371bebf48cd380e4dcf7ac7f4210b2a4754ed7162ce86f7fa7333a1163144d475b231580e9bceaf0c79cfd25031fa4f8ff49d7ed8971b407387b71ad470186890af415d7ace2ef5dabf9de2d801aa580723a69a00dbff6eede212ea2b90f4805eb951c7b68bed89d19d76dbb40475dfa4df22da59388f27e53bb8cb75803f720281e1101b74e998dcbef0693c6b1e33db28a0aacd24281910e6206f1b1ffe55cb3f44d57db5d001a3cf360aa3723458e471ad76d3217ce717dd4f34069f84854dbf8f3af8572d90031a9a47efa0b06b41044307cda4cd39e36017061829e496363d678a333db18f22b7e51f692681037f5dbd36df9349d233dcbaad311c6777522e037679e3af092b1b2a30b551613c5db8ccf1c064ae589c27b31374ce5378b6a4c41e1a8d780181b6f0e65ee39abfc771159df5cabc7d9a8d0a535f45cdcdf835747f319ea76933e071b7fefe2740a0d8a1d813c410720007142f01d907c62ea7e8be41ef017a364ab0060580f5da1cdfa6c15b96209af80e53bcdecce5024ee02cc44ae0791b66f63ade4f5e118eb9f1225ebf0cfa01f7c61412f30a30a4dc07b7b7ac83f5e6fd302139f1fff06a86810ae6b1e72d720f6072b588d6f2eb8df4dd508566b9be6345e1b7c6d4ba3381659d08084b300ea209cec2a32befa8085b27c987cb6daac30ab040f84581dbd3fda01803876db634c84ab2dac9733135d1d2026db6df2aecbecbd19982df205f6013773e12adb47eb982b017718a1586948fbfe280c19a228b6dabfd33fbefd4809b6bbcb2052be34fa3c5042a87f9641b2e362e1baccd7cfe4a980d87ca62bb264253aef3cc8d84bd6c1e6516bf0946b7678537dd78e11d34587de17f743057753dc57051888a52db7e60db26d507b33c1dbc806e968cea40703e52ca998a43f16c287a91fc40f90de13cc2fc3de275759937ab6d787badb69c854414cd6e1ed881bb46211ffe4fa0fbf623ba31f5ea0d36fe28d3294fd96cf74d8efb3e6fa007a51bf79987c8c11a1afe727de0c78cd934df51cf3d1daf3765f5e0c81975018590a9d2c2b6a18cf7541e9a1b505ac32083854bae3d295160dadb0d8dde252c81000fe9a13e156738cb974127017854c82b07cc93d114871ead8f13bf646893373974318168467f55bd736b0f6b6e8ece56afde38f38fa2cd8f66400037912d8660b466e23e68e7627211fd2037e9e6123ff05267e6987c129e7a3c680effdade7a883ed85698efeddff8bfa1a9e69fd9b2cda3eb950da59ffa07494443f97ae0972da11d9cff952970b239e8b92052a17c68a9fabab10f65251a7d1e213bc6ad0b4fb930a486021390dd43c53deaa68ca9b570155d53ad45974ab3aef886285e8475152315033e24bc6d2c2507b93ce2a6fb7708fc925b49a5854699901f506ba602321f5f80c24aeb0c1131f6f1db95f2807a2f78027e2acd42746a2b278368eb43ccc82a9d80cc8530b6229d75fe134884a8154840d78f99554daf10a1328e7215ea93b0316e6d81e7d070a26de55d0f7b5d9e3389502bfb7da07da46d2b6c2176511521fad6841e4b038e6d087cda651d8ebebf81f7d6e1e11cb5bbe1b400c7f38df8a2d23a5e1b553329df6e34b08597c64e4ab5de545f06eb7a759c2096927fd5b52049e516d057c0f90855937c063594f9356d36edb9af788a15fbe6065f2ab5bd73dc28a9ecf82d1aa4f88e3c366eec1839f9e70df4906b3d914e183920d27be0ecf5487f1d2ffb193fecfd825c86e78cb4d94109db44644fc95ffe31a6139283c03a7855c6975d976804bf84b93f3afcb0efa94590d2dbc4532ea4410a8c0b630ce1bebc668e745608e115032ebd02c57eb2d9eac23b31415b339cb47c584270ba8ff40cdc6bb3d9358682106093fc8941e044f372afda2e4beeb7563ac409a08640439a5d841d3a3f6fdb0dd71b4c71116cb12fc97575ce0f0f377b22e2944cd6fecb28707222763c2233cba5df998e0fdb94a696138a528f119f4946bfb120a2958439d5a04ae03257dee021e4894dea73f3ddc6388a7e364ff72e9cdea4018528c07ca0d213545363a4053e2c68e8589d101531df2ea9ebf267e723c15ff6144ca726ccd033be8d6ba3db0a9e84921f2980852d1bdc1e321cf34a5809d562cb770798aa6152a0b3bf0227743917229e30dc3e2b5acdf1c7c17ae849b1f2ef9d0d6783ff3880c5de822d400d73273a98c45cb00936162f9c1ff049cfb39ab4b5adc6c1f24fb98a2193f199b90d881f237601f07ea8e5ac13383b783e01fb99836e48fc3603068db171d0a0f304da967c33a140990d4237423476250c1d340505a0d663cef4f0692675141982d254bf24183cea46ec62538e9656b58c560cff3ac10572a638245d599568df9840d68620015edfe3f3f6729f7df423efcfeda020ebeb020a415841314f32037658fca1455b5719fadaa3e8c48978285300658a39f7d897196830de4821de296fa25bde85a57b34abb54914fa9b33af36d7770d488722a97096bbd1eac81bf49d96de38814a8bb44c4d53e94a9be534e731be2ed47451ac3af2e606c06a564deba77d8670face1293d16e3a8eea514ab9fe18fd564a9c0d2a8f3c73ec8068f46ae41747be10979d7a4a69b918f716e4053658e81333ea71533f74e0bd4a1fd581785736ddb56c8b41f8e2c814cd9ac0fe86584537a5350df98020b969fb80f0f846eb0d1d8ac3407b3b47df3807eb67c76082d1f2a973230856c392eaf2458d8139f90cc1fd2cb7464b64e6a7dfc4e36602076cbdce63387ecec6c18c4cd9f3f13b15354bb1816dffed0b51b230aca64a390d48c724d382440e671886b10c13f811e0f850f36a6507eca978c3ce537331b594fe5ed1702bc9a1c9d2454b28dce0bb695751c934f1c50cffb7704739141d71fa587e637208637e14364435e20bb2d0b1e3557ab68dd06bc26fb287ac11e23bb617ab0ca5f4d2be8f4ea576af9b4998285e96ffe760d9af27047bcb41602f0af353e7e7dd638ed312d0fd10144c52a62c039957c6916051ae1d6127d4221b67ed6f28d38cd410ca5f6ca0160259e09af7661c2ee875f9093cf3fc3d8360b10f79506e8b0c51c803d73274fb9479c0e35d9a434d75da0a40f812b039cc0360af1e93fafbb1c2071113d4a8e3981a5e59c7229d4ded9d64776863992adf16af9f3a75ef4dd94e09b36e239f981258634e55bb77b2aca6edb167235cfcf7b56f316de1ca208f9aba82c264fb693153f2138c145f811bd52e4fc24705c84c46862fd975621de0c2234d7371b94c53b07331a6840fd1c1d6df69a89f329c23c2f5dcb9d8a2873522cd12a5985f83c017dd36805066b1a877c484b273b2e192c15081199432f1f76bb0602470542b8e81cf1498ed0bc27b2f1651848ef80fe24957248f1e8d334c911a54420f7e7944a0ac94aef3222b83d447cdee0d07564876b207ff2a4699ddc9fa6ce826d92148591722af6f8311195543a42655542861ca639b88cee9ab4f7ac6594956870fcedb1feee495c28a33bb0dedaa50b9f98ff0f1d1bc787ada4fb38ad9c834a7375c2c10c4d21234f8a18cf876d0369482ab65879f115857fe07f074f4a993ebdb4495c165cac25771f0e36ea505e174bed232563dd20639676467147723b1e9d276562c28aa119a9905a5aa917f7134eba75b028ef7b9b5027c63d2416f2b83e2e7b684143b60c8d35a730e3c201dfd9bd60f6a4d287ec0ded0d5921515d4001ac25b23e6f80f0e184ac3005a406a5aa4322d66b2c5f29212b9406a3d486cafdda86f1783706fca0886cc421bef732afa51958e78b8182208e2336def85df7d30fc285d1d48a1b5bad4cf54919b0ac4848a7b01dd86ec4402baf89657420bea17aecbfa1a451fd3eec228b4e7af0c255564e2008835de94991c50add95e09189b90e4e96fbbc3402eac4397f0efb5c70ebd8b3259bfc1bb8ca19a8c116a1aa8d147a3a82172cabf4c6384a85491986caaa61e9734f4d2af807b71e579672ff61de90653d1dfef7f0998b2eccb6c2a13889db743f530953fd00f11d1f971d964cb8b2efeaee49e9fc39c8d6201eed9851a33ec512a0c268fc61b0d6ba669cd17fc73ba70f231df85eacad9281d9c1ee04474d94e27a8ad7dea1e485f34a2a521c931199344a79eddf8a736a032119afe0709dc52e00d404a066e057ad644851ab2abb6d51ab62b248513c56549ad357716bca1ac10a79284a11479ecce45b75dc6ae6365d7936046147d2ddca1f64853e0d4a284063d2513d135987e8d746dd6e5419755177eaf5132b909f836e41a74046f6f1041797489ffee6b0b7f9d45bbd5054eafabd6725a1aaae82c6af759d7f1644b19febe680a52f39d3262fd7eb092abe2663ffd602405f1d7284f88f8c25979fd9831de08e40cbb0ea1bf3971a0ef50b720f64806284fa414c76a012ac98c0019fc1d7651f0b4c7700498341328948573061884af1100eca20e53564f7ac4877f509334d0c02bc1a90a7f8fd85a7e345581f75d0db33850f40615639981d8df323d4d794e647b8e3c22ade6ba61b0208402cb1a4ad3dda1b5605556da25ab47b690d8a0b140b5e028479eb9ea6aa575c849bcd6d63d180e370fded28cef3cc6cc0652eb8fddbe011164138a681ea1f609450f25d2f65cf23a69759beda6f90bf7275974a8c3f805547bb853bfe5815749a60d3aaaa05fabe2375804e5864fa6fcfd88a671b84e055e6351897b2e5369d05cf222864f6c7ccebc80c0834ad7e2893ecd19f0dd60cbdb0a3224ca92bccd87e4850e65b477cee6471dc33a42f3142c44936f74b6a7a55b40449dc904f999352140473204bbddb95f339b8e8eac0f3db622ad1c574b1d15a6bac8a1725960a17734d824fad60542407d2e4212a7893ca5b656c5fffbf2ed6c4e26680bf4853c37713d26e4cee24e22ba938916d4eeb8c67b9742702e7e4dce026d6b2063a2ca7a82c124c31dc0363cb79ba521be35f1c58ca99b6937a6beea9291f799549a47beada6745cfadf0dc86b5a94f3ee62e2c88c14946cb5c62b003b541f0da29621f95ff5c57e7518fb6f0e8227768d2a59a907cab037de4173d69a1f83f9c90efeb6b9e3e3decd5a9b57ff3a94430c464e2c058d9d50d5fb1de90771ede4a721aea37083477567f52f14778a4a6aabfd293d2267ee1c755dae10f96055b2e6c17b82e463ef8a833fcc0d4cd409bcbc1c67031fb4142926378eef88af25765149e4c11b0bf471e55961006539ea69172da2b1a0037448029c0c2a9afaed81dabb0bcf1f38a7d124b0888ac159313925bb535b43b2c5c890ea5868f886264de9d659c871058009c7ec9e8829f5c64fd5dae7a92c0b31cc944dc16cbe717929c3f1368ad938281f73471e2a77925f8ed972ea356238ec1fa62bad9c5521d46ad35cca2074bc3e51562648fd5bea230e26719419c3ee7f59f080dcc70a717a2aedadca622d388dd724ef4396b4c8431d4667a9b12b159ad614122433f71971a369cad1a09df0997fc28ae7a0e8d56bf43b6b53cabe142093d19a243b8cdf5cf905591e65b036f5f4a9818da45ead17c63edd03d5ed719fc4ca53b0eb76984c30995ee5d98e46a967985c049df705043185f3c8f637406c5fdf63015e404e9821cef4fb0586420550da0ef01c644cbfc1f4cd41bfe5a9fa8a8288f8efb9e727c6346754676fa9c34eda528900e6f2f66aa93e3e608f6e1499bd259baf6ae5a586a0fd93828e2c71b71991b7a540aca11795af485ae694d68ab5e3d336fda205250a9a09ae91387014bfcee1103807fb0059b88247b5c6c6acffc536198dab2842213a10ab8cc9fa11d2a9be740d2965d925c91e4c7a77c56ecc3db5e4ab34fced862a2bc4e8080409b1fd603c376c5cba2cebac75422b86d7497ccd980940eb7dfa0a70f19872e993886bb6ecd65eac90a4d1ef90bc180042155b40ead10d7489de36b01141b36ccb88f84502ba65674f422758c4ce138849f175c49a1b063b6e4d8b8c61bd0a96a0bb6220a31b1517e591d093beb520a2bbe7c7433c7822d16134f34d58f6ff0eb00bbc7b6eef57e603e83e2ba1013423f1eb5389a45c8887077958c4baac2bf353188a48730ca42284614d0417bde73f6e69e26b9862e0387916b86880e28cf65661a485cbf2f62dc506ac4645c9a374ddcb2beb6d859abaa0d625d99f3f5e978ccf6bd4c3b907aff3ecc768c0b13f1dda32b4a24e76037f7a28bda9a3c6a352632beff3495fee51405d20cd0f83f8dc036ebf02a844e39f0f1b540f96e71676c56ed6f0b749f7773e1f6bc32e1908a0a3acceb8b6573528e7735f4c1e26117b368908ec0f19ab807d9605f429df04879377b5522bece377da9eb720961813e06b96296ef1fb1768e8cd4c9b9468c1cc9b3d19357e84c41c58d84075fd43ea25d82875073b203c9f6720fde336eed55a73f7ea60bb0adf5204de6ac0eb55ab06dcd6fa3039bd3be3bb67d19654ac27d37b3e52854495b16923433c5821b4939b78ab5e38500dc4e86a9fd654cb890ad8d0898e2c0a1fb2d631a94283c4e16901768b62c92703d109ff0679705f1cd4b400d597dd64c380e72d39ffa6ab9478d29e1b6492f621a2fd22dba120a1e337c3cd0ca9fb3f582d0d2a7e9e9e5a928d9028749b1c1e74abec7d7361cdfa6d4b5714beb053ec3f1db5d2c503688b7b6fa4110119650a4a33ffd7fba45a7df7179b9ebaf65eda2d7b982bb92dd3d4db17729714d1cae624d8fa115c9264d1d761be610ace8d2e1738e07288c27165a96f9afe623a4cfc844d1ca0310564537ab4415a6b65d8aae9fa7fe8ce7767ed9f1b3a773931fb25d6e6eb7d9f119b27348578d367f764bd5f175f2024132de604f21cd9261e0e2ea4a7bb217d3ec338d78729c0e14c9d0051da9ca2d2c337f8e1c1abd03c534a6b190a899bc3928aa3d779b28c7d995487dc19b4ec016caa099974e96b3f9ad824bd074ba31363ceb894384446bc327f61da35bfe45a9f890eeef2cf1823a428cdc9e77db2995543eaabebc0b181c990458454410d7608d9c929a65954b8e7268c9779e99f2487d4c256c5d895d7e08e1a7090b0fa94037a2767874a924add95ca5fd574d4e03e345ddb265021b95e0d6e3abde99ce87b9fff2b951923123b1dd12ea5d1ee4a08ed35f3680bd28d6fc174088f9532a73b908b9081a8c14d713ec97ceecfe93e70f2ab7493a0b47daf91d920ea29d8faf7c9f218c7a64f28360d990b91921e947f7837f183bf730144c8566f8d01d563c9e822177b0e6e9e57b5f9b2b46aa866dee6810ea89cb2fabe92385fa9f6751d1f1d05c3b99da249fac1cb222ad8bf25034aefd4cff922d44c2b6f5b141783a15294441ca3eaa8c859d2b943c317a65f81c1f31108cb7396626f4d8d639a5a4b8eb68a1061b20311a00d8ed7590719574ff02e6bd9906f95d50c85f9f33c6d04c428072b49e0baa9202785163902c0a9d7838a698e8fd9f691f7fef96015f3eae3d051562e9294ce497cb81d8b5f8106c18f10f0fa69d73b7f6bde0d9ca81446af3453cc93756ea4ad699d83b40a3e201f3aaee685d5828d1dd5246714f234e6a6e4ab152eefcf6a29a8fb08cc31bebc40f4784ae05c4b2054d04d8051ed615bf0be883c8aa0794864af94b462487ce20489b048bfd49f5f1ab02804c413e69a8f9ce007dcf00ff698d552cbb584736aa68871ad93153393073a47a327437930f8c56d6bf6b1631cbeae4e127315ddbe412c93a8c7291244ad12b67294d05b4d6b97e0daf65e87d8d6a26881886a119aa999815f3f4425bb6c357f486af92d5d39d460df4ea6ad8061e8090aa4e271b4d9bacdb0d16d5185495d0cb1dd9bf2769600f1370c5700484918ad32a5e6b3f9f34b0432c67e3ffada4d382c65d8b56a6d23f19b1418ebf06d723eb108a6cc2e0945d056b77ca2d3605cd21ced3bc0820305cf1fcc96136a5d202833d3848c87e1f7d6f4f0b80ee79de02193d49c74b6036e0c85adb75a2ee47f63f156757e609a7eb12de143cbf431660e628cd9817976eddff1c0889da8c766b1db195577b7bde62986d734ad8b8e9da99d16338ccc26717c9fb4e6091dce12527cb1f4b036470a600e9181fc8a2e9722cc57690e99f64bc5851d82ba8dfc37b81fd4d2b9bf79822746644aa03a6a526be69e84b711b2613b543ba0331b2f4ca2d2af44ae151eb9a496eb6392b2908b99ab9c380948fb981fb9bf09b110ce741d318b16c65d20a35508045584710856cf30c26cd8ab91c2f704a538d349adb1b518ff631fbec152e9b913e95ae33deb94b8b9ecc8abeb91788046c801f6e41001667e891642c6d9dd3e5fedf401cdb2c87bceaa6036b2791c5d22bd6d8ab370e6655de12bf80a902092efab3136f33d94807660f27c430b5968c95bdccbb80d32622233af756d7fc44178ca30e98c6c70b9ae57d4d7e0c0869638e83fd94976f4b9bff27a1710e53acb918d45db5be9df406c761627ed9fcab489b3301c2d1ab051653f1b25185d79caa5d87cfb4a76be7d13a6c8b6efa81b0347a075eb5de874ae7c28ca92dac5b5d79c219ee8ee488b5e6610b11362178df38333a51c9ba09d6bf639180ca805eb1d03ca392d83d2d9550a486e96e0d6684e5a525ab6991c99021c52b51aec5e9e5cd8a900b72f10afa5341fb21c75259e221a7000a992631f4295994f84964bee4ef0db5ce9ea02d28bac1531948bbe37d0cc8e58b6fdaea1635fab4d91b10bc1a790a555e081b6c9d2d4892a609ab1373e7a982719384cf01bdc533c66cf50f904b08b3673166794a1b98fae8b74ac88570459b443c47e1b5182c659c67834d7a7afa48bec1efa82ffd73a218139ece23645d62479d96b8d99e0521a368d1b9ecff643f6d1c3e07b50f66ff7d90968070f0011ff3cbe3aacaba3b6a8d717c6fd91a5293680abe56a2825980f4344bda4f4f708df32db4da7be9cf97005125f4dd7536ac3375e57ecc32b50397fbf830d6a0185f846b5fd7cd26476a379bb1f7a76f193f88cb9cccd8bb3431c431a25fbbbd56066ed4a5906da66bebfe8e97b24c38e69be92b877b3b4fd17a28fc2e5781a126faf130b4dd646df20660e63d38e3fc3a3b78a0d041f94ac951dbb46124b8303f80dbb4bd379c7c2087adcc1fcd53bf9faba44b2c0dc15078d67a4d2ed014056b7b26db0a222db70a6c10a6ebbf86823c4b5ecb6d9cd2033325e819abea360b7a94550d4039df4b6bdde014d7b3dbcacdf1940e61cdf6b5db28b542385719b1ef534a77973d62b53859e15768199e42574644ecd70ca3922172811c9610006764583190f2b54f78e88694f6bf8b4fb58386425d01c738d21566c7bf7ba5a69219931ed6811b918cb4a59ac744ec9c34830ab1d4a7cb3f239e72a6233676141ae1369832226b12e1c0041b077d65bd837861e9c024331343abe5417845c1bec999375dbae92c88e07bcf5196adcfda2abc41ae9d39fc14f99db7c04c3cec533463aa150e22c9ee74b2d0af9846300560b51325db13e4009dd491a778cbd8e2be15424a9703fec595f785835a3c1f3d87aa127d5063b9e79d8e1faf0679be354a5b0a1d506c13e79dad3f1387fc8011840e10c2d07fdbc5bb9a1c89ebca74607fdc8542a02b75ced4cc50bff775017364828dbec939b35161bbf9be40c65c486a88b12aa858b0c15310e8fa141609a071748d79e02106a1df643563dc646ef5233ed061836475790eedea5ba9bec89e6902429980149ca3ec73185f37ce197da3a87caacbdd1ba50e99fc4f1b26728c7eeca0256879ac37ef02681fd4c4a65d07e8272d14ace1f821a605cce0415ec1dc13c36b259c235f8139a93289660531589a1fdf96e321429c3912c9f62cd9d937b2e5f56d474c17f3a166b24530e3d7275885c1bff008417d39558de79c052c7c611a86166c593a7c996f32f614a2651f706c3e9cbe24860b2060c590bf2ebe73d4d6828f57fcede61ec571b8e059ef4e0a7163be7a6e00badf91c0ca89beccfa1b00fb00017555659999963f59bf3c7f5d36427abaee093aa47b4b6b6146d13c15179efe19d7f0fb1a2850d66e9d202a3465d2beebce5d3557be4b723ce4bee5774d39e486c11c68e7b2d3cd9287f90f092171a5a9cba59591c3a0fc8d7cab4a23e7f352abb5e272567b7a18826ca0057f5cd3c087c30a830f96409bf8109e2d827faa6fb9907d9b536a0d5603898817ed509841acb09aa2e5099813dcf2bc534a83e8c63e9da0a6d65a51313dcc1863e55eba017f874f6a6fd8e03027a6c7466e741798edb1c7481838af190c972c59531142649ad34dc9ec962c8f40213cfc84fadeabb4b5a817ef0a8ff9c47cb384c2989194ca318adfbc1bbaf07e5d0085d61765d38bdd38627505a58c5f2c913ca05aa5bf34beb9dcd5e6433648ee113ed94a93f328bd7722513417031fd960848a73827e6a41ad8aeb4338c0b63e0fc775fc798abc947b4f4f64550a0667be27eb24764877019cad30942345d0b92407ea4ff947edf84cc0733b51b50d6e0df5fc68969dd34513aea361767f1798b1f9d5863fb24e6fbbfdd3a160643b23155849ddf6fc63107127f28dd6258680117074c2443bf016b3c7470370a97c4fa1d3b17caf04da05ef5757ebd1ae2d59beb44415f14c602ff4c129b756a1be7b5e8060feb2167f54405530ccc0a0c7cdd2cd8c845f4bd1caf19c8bececd9335c8c6e4aa5f1d19ca8dba53956a12f9b97a8b0d8e789e1ee5016a2fa73b75c2ce99e1b396431f58ad2a1cef1a16a2aa2f6ca39fa2582a0b50014b9649880bf08cab45640f60c5768803634379b680524c04b0ae03c2f1105de59c10edc25d7b91cd61d8a0398dca033811e5df5bcb5fcbe40f1698777d8b87a2051dd8eae0c40d34253f06a089103972da774cf72a0b78e471182a0305ffecf8460ca901a420bc9c3dc1751a583d48162edc1ab645da8be1e5df1f92718c34a8795d4301b2057e7520e3cb4079ab28af99580dd0957ed21178025c8fd7a0f0209719316a3c4de8a78bf5429a404c649a5ade496ab8c5d14d56ebc9bf1f3839999a307a74281a0cf352727759660ecb7317a341052cb2b340ca2eefef681442bddb166623dde34e933a3b1708cc336a44e8f74f63a01a5c201673bbb46105f36b7dff5617a04ef97fa7d01ce7063c92af519b63f492f046677670ee8de9127931eda0749546c22ef70dc38db8f2c823dfcec6b77cb4c63e30dc241b04bad49adf71db40fb5d64822cf9a4cce2b8a93fd978e8eadbd0c57402c6462871eaa39ff741ac540e2b3d2189bd65151c0914b8db9fa36f51f42f9d7bb0564f1192f1d3b012ccaf166300a88373216a0ba4baf00785bb97f4b30b0442d740cfb8df292ce6d98acf1e4ef4b6e84c8c7ef74bd78743f3a8de72d63d7cd628804e76d2991f28e50da6f4ce57ce4e5b9c60b1016215f0e4a9bce87065381aac46cba75a3a22dfec4c20416517ccc894f6a2e79d6880b64b0b0b5bb7e0bd191598f978c85355c296e544ec574730a5facf2d953794ce41b92489cb6a99062aeaec68b8b04899530ec4a18ad4b60cfdeae7b428998645ec29071e67acee788e068d05b61e956ee4977874b183f7475325ba479e267df47d7be3c5d89dcd093dd817b53f2e471b9cf77285e75db15fc67a259a7e6feae77016dcc2c42162f14f02a977ed140ffb26b3d644c8de3e3016b41c9ec09702b243531f0a3f92ee4a8b77ec7044515dfe249fb82f46442e0f1d582b179cea94accb90f4725e4a29a4b74024104a995d0034a9ded7259a871c09eed4a359061005b3dab42122cfa4975b9b44792a1cdd0b2bb2332acd64d66591e028ff2874efc33230b92e19960a22f59d695b7c0246c85f26cfe5ec3631e9e016d50452eb61b10509b2cc67ef5c0fa6fb58bbbc6cc8047a99e036c44c3fad33a949410799d0cc84d5b44015fc59c072fa8335280ca8b1a250a7d62f11a91f7f50a7bc319790e7324945989952a967de948f1f075ffcc2c73b235e6a3d7cd0563188ae0df9109aa9e19091dfa6c4841fdb1b295b993845af90f48b1a21cbbdf1c6af7e5d7fcf52607b3ca2d23e6d8e001e3cd29e21d7eb601f21e5a3ebbcf2160195b45c09ecc13237bb6c90a25a390abb928e6ae33bc1283e5812dd73ecc189470dbf598e8635a405fee3cd92c58632bd5e77107e74d5a848055de42e2ab0ee5e1d84693ab6e5e1026c94d82f3b7a1ef11a1d494364c2996e0b9b1ac6869704aa42bef13eb1fe8f1d8d5f5ee35d3cca72c77d2c889b3a2d8c4660115d6fe56e534d744c8bc6da9ade5c23168074289688f129e86ed23f53fed40d774bde9fade61d73def6c32534f56216e3863ddc735e22fe7db4cdc99e8c4f5c312a4d21ededf9a7d240df9e317a913244dcebd696d41c9a759e07118b4e19929a99cce1cff014a61479e47ea32c86ac745cde1b280975dc53f2fc3786ca0f02e0367c81800892864810d5dca9b0f93a77903e9f9830eef5d03cc2ac3f424a4ac98114dd4cbf8483090a65fbc1457405bfdec9eba483fb53be6241ee3dec5b08875fa666496e4dd9a348b68c5dbe2aee16520f74bc6bf676221a8d50074da03787f9612013d1858b59e2e1a751f2db312b31cd4c0dea97ee109131235c08afa3d1bf7dea40127c3243dd621659f36f0ef64cecd51e50d1d60a82f471c46dcb5cbfa666e697afcd929d66c7bb9ee59ccaedb1cedee4663665e352e866f8b5b9843bfe69185f4e06415b953557738fa1e8923f4435b3f8f1c6bd6c61b888a224dbf1261311eebed11e4c6523869ea574414384883c23df5fd2b7f5deefb1bc57138a5ee1269b31e09775479d39cf8a93d9454a61b88fa16da19a8beda057c2f527e96d79ef00a9dc83aff7c374410f69a145645f16f64935f19597d927b92ac51afbda2094466a5fa81eb7ab88e1c7cd7e23727449d78d601dae502f3844234e798d03130dae6b535687cbe9df9b0fd4431874fd4ed112935354ebefdf2f181b5b8c3a04bbd1e037daacc5f796f899edd819419646dcf6c3bcc47b4eac366c0b09e1a74f0f30c01292b56bf680a3c7d840c29056b52f075e49b4e8a0bf0d210c87acfca645d06fcc50fb165ce6b1444d3c3c64b37b557eed48d70dcb8eefd169e74b225fc50a2e240072c3ccaad71a3b774b9f70191da78e082c8b5d83ac6be67a5b432f4c094729a6e1744ec58d9fa7d1c943facb13af6aab11693cf0380871067583292c1e4d8deafe76d0cea1269aa3a2ff818112eabfff856e2fb2606d4e46ec180a76c74693c531be1e1f50e9f06f2525c1d47605eb56216af0099d1e8037c24c8ace3593b57ec870732d1e936b7b1d29e6852977fd976c16ba5d841f3e225857b1c24257ef13c222c87ca8faac341832dd264583500a873c5e15b62f5af13b0937335ad9a44f34a2a2c06325dd15310dd54ee36109db44800531485e4b1b7a4be12d809990c71581dddee234620417eae01e24947be507be66f6e85a167d37ed78bb182c6f8898580f1ca4557f579f5607ccab84b41ae9f79ed74fc4fa905f056c555bd238d5cba91a82e30b5ce74c9c045b95e9e07715218aa574b91a4273a5da7cf8973934cb6bee2d417c4ec1fe94a8d3ec8250fb0a854239ba525498182092a46ebf4a313a80e5c637e6402cffe934bcf2b2aff2ee536c3fa4e71cc987a53db7856998a6a4e383b19f2f8854152a7a69b765e4d8a5187578e0bed8cd9a41afc37a3217719015fc4ed621b87879f2c6a47bfefb0dc8b5005d4b7a1b143811296b456acd7918ce3f5744c9019ac96caae8409231e974b4bf402fc01477ec54d4cc87623f38342fe1ddaffacdc81b06d3d11", + "encryptionScheme" : { + "description" : "AESGCM-256", + "version" : 1 + }, + "keyDerivationScheme" : { + "description" : "HKDFSHA256-with-UTF8-encoding-of-password-no-salt-no-info", + "version" : 1 + }, + "version" : 1 + } + }, + { + "password" : "babylon", + "snapshot" : { + "encryptedSnapshot" : "5249fa47077784206e6d2401731401b10e412b90a19ab02d05ce166437168a5b75f09c40ae2f132d7ae234eb0e0c7dcd9d3a5431619fce29ae94e36e8ea9861f177f486c4cd797445cabe1912ba38b4a6146dcd976ac31b2b51662ef5839fee5c28d1bbf5009aacc5ac07a47ff2ae726a7c23cbb6514c7c2655fa9b8fd2c07f3bdfdd0ef99597e410a8b4431dd11709efe8101d84b8902ed7287922bc0703361a706dd5863d68122faa35e212042bbb51ebfd568fe55fa0626285a5b12a7bbfa64c5a820069e7aa71d746444dc7943882b54172879f4e26e88e606b89974c6461b1eca8ea488a2441a49702b12a9a83d2bc182907d6a9e88fc8015153f99cff5ea6137e0ae7c05691bdb0eec7d76ec1b7ede9020ad37284cdffeb1b3fbcb6fca36c4d164c59562b5d427503ed7158645008dd3cf33c3c6f867e37af5289a26d64e209929029a833be6c76618aede5971d521422664df78a4ae5ec6dcfe286ce31daa2488a1578bfc81003949960588982ea39f7d3353bcb172aaa0e4ebba880f97570fd73f36c8250eebe280a73c9ae3e82787ebdf2ab58a7d4a8483c4107ad1f92c8c3c1dbb5f7f7e6d3392a0634515dd01271ed57c0aa8a0b05d178db6a9010cfdb4b9dd485b599f0023e25cc5e5df876133c8b405a5795191881da80f50a03dcd99766bd41a5d816e4ebe6bbb24f9409170d28908d2d06e4544d998ee296439f7ecbfb9941d5ab15201fb6b402a3ea8c891923801eeeaa70eefa7419e93b6c3587ddf1599ddc36ef4d28f8d859311d46adba122087f285bd6db80422a0fbaec8a2fd523bf72f15555a92882cf8c4d98bc167e6915e47ba26309052fac664085a12e32e418db334bda3524ad2c105f9c8742cd63de26405e38c71048d7eeca14a9f992132e2d0805e652103ac23fb2605680537f47947587d9b55cec39d56227f9b4c3edbe49f13ae03aa48fdea1203602b7b31b674181b7c60a7b07942e8d31a8caa6f7ea4dfd0f652a9e021d8c5031ba4b567f81c03b55d683f23b90cb71f3d91afc039f39fbffe77cba8f0b38d30dd2db2efd33861603389f960dcba87e985cf4a2f58bf7880764c19e479d4869aac70f630bf2425208aa9636f60e798aae715aee9d01a643c1d2d9463c75999568ff6af0630be3fb325524316b0fe3310ef8e948d98fc7bd5db2efc942aa8f31b925e7913d2f10196156a68973dea2fc9a37b6b03988b7afdf12fb6f84c96f8982d13a437d6ae4d1c7ab0f62d3d639e843380d7b0eb84a168b02d275ab9a3958977364c7dbdd84f5d4b6aab7b63bc01b02e148dad2869503f3dcb9229cb0730efd81e9a13ebd8e94cff90596d7f59a6d69594fe66165e615e3da8c57e03f63f90e1bc281246d0af3da4ad7d72851f6317044fba09dc63c76f7156dcd21c6c8405a0a487454d59da660c1e0e9052db92ee8bdf39bbc9f9f88785944aff78c8881dce627cdc4b4f7f13e2d67c8bf9a61fd302fe9f0a15e8052f1f1a0ea11e4a4c11ca9c003ff03c5a7c15c85008d6674628f620ac946fa09d317ee1cad204fc3762c444fb3e2de44ca520cdc1d0f29ebd226f0c8752b031f055736d6c657c01dce4ef859cca49f794cfb08ab80c38dbcb63e8b4f9ddb3b79825412c2ab1775bfaef6bd118815a5d093c8aa50cfa0a69c4b0377363985b09b4b4d775a3620ce15bffd2e9eed489d5eca3b500548b52073fa1e6c3153ac92cfa1129805b71809cda5299e3a4bf27496e14b2730272243ccb0c391c6aacd2f87e02cd8f3463c84da5176e7c9199208d43bb5e107ddd2e499d250d4aafcf8c7907c8c686539c5052f132e4774b4dd68a45302a947d247532ae0f3db77021a7f44950583c4641d2c6872a5b94c37cdb71598f468eb0614f61ce7d94bd4dcd758af883c372b424fd02aa4da03ffd3000819b382b73731759b4401115eef3c5cd5ff151dee3e2f1983e0807ea6d8c4e190859699521a865513a7984e94bc14e412ddfee724fadca6c0cea28407749a8afc7efcca9a2baa5d656080b4dea085e5d5e0614ca04b588fe46c91be9d49c23a8320c667b6503324ee3177bb2fa3ce3b777eca5bde6f81430c4355bea9ba6cdcdf7dc0cb04b25ab3e3a570ad54927a2ab6b0a6bc6e97704f213276eede0aa37b52d55fccbc579d59033f338af440ad4739efedcd9586ed9d8913a94c11a4ac687f70222d726525fffbe10a2a811d71b225a82b45d2ed1400a4ac6a621e965ceea7540038b188b72c3c33eab16554cf4953e37a70a6c7f3b40a0b5c249a930b1f77dd005b6c05ef0bccc2cf3ce0b34f950a6fbd085c094a2ef08eb797e77d599b6070b7e78ba2683df9afceb17427867ac1066e56a62e460aaa4812153a7de7e3fd0e69bc238cc4bbf00d07f6d9126afc7afe13bbb5f94780ec2c208c88894f148d7d5454ef700ae530cfb2f2326e92e6b2b2acd63d862ef7ecc788e1436be0c866cbf5fe5d4f04206e8006866b7a770cc398ec8d68d5a65466e50b4d1bc7eee79ea890e7461819ffb4fd379df5c9c4f568815b808ad0296d0895e3863bb104ef9a8d220b4ea601403ac5ee258bf2e9a4996eb347cfa49e4fc8e4c0227383af512f5f8fea397fccb3117dad13cb04cdd9b34de30efe08a6f160699a70aab7f45993737881f64af6804134e29d6082dbe232744bdb59003d19caa71bf0a69ba7e8ec3bd86cf3975fb39a228cc09be9d07ff209a1e98f1a5ecfe27298e8e721d0b54c83ca05f39b4eb7b060d447809144e3d072822bc47106fbd9c6f609217923183686fac26aca036c78a50bc0c1fe6e1dedb30a7524edbea7db68bad062afa726938b4b6b85e42dede7e3b22900f051eed036b29392fcb406d58867b071a4671e9f217fd7536d89cecd8404e6d78f03f024c0ea70a61b57c63eab99e041b5ccd6f3fb91df4161370aa9d726a34ea5d7f80327d6e6b692fd7ca615f88194ea23ab35aa7961e1757b6ded536f2d7cec06fadd1f5f7125ff5b6dbc0c56dde3a4d1dcbdad82ada10eda161bb8562259511754afa5ff9a157231a06e5c8254c68a1df2cb302ccb8b442e3418575d2313475ca1931c2f88d48de7099067b3e03a831d8ff20e7904fac35e0360c4b22951fcb79e0c71ff214249ab6936830295eff718c9a831668f03b821193456eaa4ffbbb6452dbf2044b04f4d3b1a680e1e1a2f635c03c2aabc33843cc6f643fb2f20ac141764025364b3fe3fb9fca254d46ac69393a1ac409bf188f9ad8cd9b413638ae838446fd88d4887eec453a713f6c55759b27d76b133d4ee624377f037833ac1a3cbabaace131ee647d4f25bc4a3606ca2ad7ed4723f29599cf676d7f222af149859828bbeb88c2bec789aa04a6127f0ff13e9ab79a55104682eb7a7e91c244a7809df6aea2b8243c1c1c332254dcc710f774d1381c757c397d2e4e38d00aa39438b5b1c9adb88596436664fbefefa3e230baae62051804fb9dab06381fc24cb0e09c913ecc4b7cc60476982590e9a61462447de94e961d5fc69a0dec0c73f3f866b0981ce862dc7f4649b3ee354252221ac095b8ac1c6368fc316bcaab2f1438d6581879759fdd762ddf52f53feb468cb5fc3860add9f7ea824bd1d4165995d04d0eb529e5bbfb6ed7f7169986863d5c1e6cf28302e7366f1f9d07c46d25ace5eab5fdfec5addb196f38abf75168404f93e39e7071fe720ac32d8d0d1460ad39a7bcd0559af01331d6422d5596b037bd91cbaf54c1f8100b0125216348cd302f36d2a222ad3dd45474feee63ba49e4ce3b4fbf132c0bf64858e20482860ffc09a160f12c23f5e73a201fc0beb8bd4fb5f8800a51ec8a8e6cea0adf84cce531f36c9e351ff93eca9cdb147ffa50bebf950817d7bab66ba82c52e0e539157559e209e5924b2eec2dcdef637be9a888c38ad42ebd554e551c3cd1ac96e17a8d7e0553bf97ae632c7a22f7b1438744b74a2c3e7bb73e1e16d9f7ac5bb32395a878797f7b232af3aa1ed8108beaab0d0f9468223a9941f3291097e0cdf32c83dc0759e721c871c926e2799e8434e0f3a6067e8be9dbb7584111c73e38e683ed69b3ba9916dd7845351d2f75bc946d0aea4930e5ddbbcc32f22ff5aa5e08906a5f618691ffcd6e4dad9d06d3d4bb558fbdee9cf5e90b5e55a83c42dd02c8787ff28ddc973f0f9ab619789b32fe10ad88fc28f99880bceaf486935ebe4cae30d89097411e61d82148e1201f3a4ca9835c71467c8afbc4f89401fa00419deac8311a7e4269e52fcd2f6de651912223f18299f7c1b2af9442b9b67e0bd9ee49de9bf2b3b0a825fd30d76639bed9021c17d5d29eae05de796c0f881234d359da277e83ab2c72f5d98f0861266a68b17250d664bd6bf70fd0ac1544e3b40a416d3fbfaa96cfe12f9c68813aa840a0549d762ea7839a4abc4614cfa267aadaa586dd9097cd009feb6533d2ba60f776899801fa5943a4c520c994d7d09adcf8cd9dc6e69379899bd09c9e0f524e6eff588ee2b4b3a9d7e8f6fb56eb7313993b9e0e7f6cc9811c5c4adbc611164f06352f47ebdaebfe5dcae0e8b8066a4525972fab9dcb6acd41d00b3d8853f3fa77f066d735fe99d7099e2c7f80554779c970c705ffdc976e1eb37ae74b0a47b15694ffd20d10b36727c0f34486fc719621aabbe87ea2a62d08edf1c3cb5670bb7adee84a37c694477e441d751fdcf9c3c7215b20958a47646db8c1d29df2ccdcae4038f0ecc7edccb94043c4cd1d148ae2a3dece52983ed60667bc06998c630a28cfe35d688868df20d3705de7a5703f0def544752a908930f795c324293b49ead46888751dabedbe77ccdb4225a0efe78ffda784042fd6ade65d84ac071bd407cada5aa76b05481b534c1a9e22242d98c0a70de0a2af4b59cb770190d7228419e8da1c4cf83a00a93f7460c4255acc0f0e7cdc8624862f3bed3a15f1d54343f8bb370f10b622797dc4bb070b95b05873b52fde5c679106918e2a9fe8db0888f2cd58bb3a9f791643cd1d45310aae5bad797441361277d63d8b933f3daf730cfec6dd3429cd938a21cfaeda1084d34b84fb17431207ce994a42d50cfd92f4c864aaaa6b78accda08d408a2c680f5cd37ef5b96c309ee1283199c7bf3bb5b3ef812fe85c7ba28444a59dd5bb5feda610b690e8731717b874874bae04a2dad0fc7dee264e98687290955cf4b2d2428c35a80f98982b11dbc83c2a88f5c19db673da526bc438321a479dfa761e9d06323d9ba34df3d04b8b6d75ee9d99954e09cff203062d5dd70cb1aeb363297f89dd4601d69e4ae68259210d3bfaeae72ab8bbeb52079c0b7c26646149b96fe47782bddb53a2f626601e74a83262def0e1a49cafa3a05f22c789aeabb1c7a155271c661917b5588b56e4982504d4b6a81a7115dea99d40c3ec23a92ea74b121f3ff2fbfc340ca3b1f34dfa98ae0432d4fafaccfb349815edfcc84d317cfe68c8e389dfdc13240ad349458877cc535683f47c43ef94b43b3ef82179a95d9ab99720ad48116e85f9048cf17daa26e39bb7611fa8c22c0a6a2882331480d6a4155027585de4cf5ed353c991b77341c6a4f2821c6f82c64fd37ff29a1a0ff52e90dadcc2dd1bc03d42bf47aba9446070c80e7ffd7336b0f3d02c00f518e53fd5233fad16e05ab12f2bbdff4865c161b231b6a77a137eac90bc616b9fc9e14c748aeb8433328722f9057059096beba295cf4f445cac2ef61373b96bd40ce6cee8bbf8ba1249905f83795a02c2e8b86cec3452efd83740babdb6086a118327a1c83986871568c7c57eed5bdffb256ee6ec72ec56ee8055e0ef46403b0f4800848ebebfa0107162ec1d44f3038225813e26f08ad3919f66aa8fa1361cd472ab84b10e3b63dee45eb27368f7aa88ac002e7f36e7b2e262403f1c982ab40cac5dbc7facce006907062468bed99eee49a382556bdbd215bd6309e200c099db986c6a98f0ca204574ec78bc1ae93143db8638bb31f87bcbffa3aec8ae33dc8855face0af9a4195597ca0e8d1dbaac11987be0aed3636886ce1e8213ea59fe8de54183cafa415839900d063e49933c0611502a0020a436c379b1899d64c19a057fcde20edca960c6b47d69a2213f48d97c74247ad37a193e371eff1c4b8ce376bde9898f85bd11eb3f7a63aef193d17b60e6583de831e9dd73c29db7c71adb421deac48b7116194ddb07ad1daf5472b2575eb8ac8462ee60094bb1a38143bb295a25bbee51ce5d57715b19df8e708e9e0b48926bd9151ca34cc1e01fe210a79fb396276111697d25f594f90f714658e4db1d92d354ea2d070870b1e144f7a9939b52a4fea8ebd88d9523a1e2475766825f47200f03337718d0c14964c95bc8b67c0ec74dedc806c8bce99d9b311d7149e0f4372046cfb55a82b2c27cc2e589db5fb6c257f43e479159d9df9aacf08611abb35c1e77445713bc337221011b1da5f3a01d2a6489ec8d747eac2b29543592fa316f64947003d39b70661894b46acfe62e46088a5164c659507ed268485a002746f6e42963b4f93ee807ca9f67988915e343aa231eac581d2c9c6b40404eab9ee645290528cd3f0f37733fcacaccd508d4bb8998ad2cf77311c669c9b0e221529d039321f1ba1bb1c42e2468b6d9307551472d6fb3f0bbe519e3978082eb911ceebc2516874ccc466dd32b3a55726cb273404cbb5125c57ee9bb40c2ff5b5ef640b829dd48b79883a44910ff5ab2800cb954960c3e8ece64b4a315f0a2d1de4802d267ee3ab6f23191a1f6eef237e2910b18bd6c181e3944a25701623bab74335863e42d72c62defc6fdebf9c7af560b9ba6367ce9b03d3c2a46839384919b0b565175ce1aabf923e8ac5ee679868e4c867ff860a34d6b6e3a9ca23b9dc6de2dec330dcce67ef18c64defb176b98cdbca91ba30f04c81a02d6e69a2c64bd6c5cc0fb593c3e7cd70fcc52239ee6e4f1a1ddc41ff639c2627bfb9787a2c684aee964a292dd050637469ee78bc3893e2d4b7d9459104ce014cbd1056b52cd92d4c869a47c8f8212d08df4a4488ed06a09e8faaeb76aeb3541f88a40f1b3658cc9c35a339b42d7b47378c876ab86d3178fbebffea363688252a239c00cfa2ab0f5cec74b2fc2738469e09248568bb3c7886dd235fc333bfc81e5e9a831a4aa9c164c44c7140d3177291298222167a4302f9f6645884dab1d667ddda9d461fbf7e81ec1817b1d36537da5fea9aabfb86380c56d7a2706da553d7a15f18232be0fdfc1cd6a94286375d372495e0d4f8b42b39a7d0824f8ac9718d1d777d0bf5c14b4e17c0b31ff7d03197eccf11d5418c8fbc13aef9dc1de2eaf52c31c00de7ab671d92aba36a427a09c4314383fa8c6b24e9378e83d3b2df14939a85aba4850f3c27f8ca061c3538729daf94966aec6e4b92c79778480cf7562574e0cf4a6250377bed3951ca7c29ad27ba080efe10bd6b81193a6824b2cd87f226bb3abb5ac69a59f608cbcefff3ca4d6442a45771b983cf926c608be65efec3b825a80364110a8e407776faad7192260fab5db7b23c2f5871c00d349bd3f251d3914f68c7e5db64149dfed3ab1ba7158c454ca13d04fb1923cde058ded4abeaf2331224601e315854bec461a203e3693983f9bdcae2dbd4baf2cf9ee18b4343da6bcdf90d8d6eb54f380521d136834acb5a73b4fcef892e78fa8f6df5113592d1636341606672b7d6d5c2d5e8f5106a1d3cbb5500d442866addbc44bcc02192c69cf6a81c6c6c2d298b41254cc930d653f2a19aad087e28a4fdf01c99550f608ee6855dca197cf15e9ae32fda084c8b58126fd81afb88ba276830f2893ee183cd65e5b1046908c4016d477eeeb305291d9ab9143120d7c36d0c2724a4b93a2fcf35aa03f64382e7ff1f7b9f6d16e6075f6f1d4e9af62027a46079ab69e120c940f6b54b43a4f5fb5fc75aaf4d346db9aaea80dc4187d33017bbf17f8c464346b222e40754a05a1dd25ba849f380dff7a59fd7cbdf98aac49f4c1e520802c8606f950dceede78ae8576d2ba3f2a1a45eec53fc99cfca92c9aab60fb9a6a82a508c7155e55217b54da8767f9c7262befb0d1165ea7a41fc58f52f7d4c5d0f361512b20d461a40af12e87adabdbf590258eb7e3e8dfb6c8e9ae8cb0a7d71a2411d816c735c9d8b44fb1d904f05677dc0d0837dc107e30836344735e9f181f678fd9f6aff0581b4712389c416fac1a0b1abe107c4bf6430d98e5e64e4f09769890eafd12ed482f70f46d33ca77cfec6e74eb507eafc369b950c1efe1dc0f5a950d14aa5b932fcbec75004a7cb8280959bdd49807dcae7c196a8cdb96459d803ec0fa35223e5239b2330a71759cacc517a5059c1e41fc50e98de329486a266a6cb7b3da9418f322c9598b2d2a5a13bf26aabb5c8b7b4926245e63ec260c21e420990a99ab82629b1a1a91469133322e52ca0b9791d373735c3eab9ad74ee6fd53fa380d6d960b1e987977e740f48bd665135e544b0acf8414f5ca85ebb0f9e3475f702596312a29e30fa03bbe9927363d917bb806bdad117e9914b5bab054b83e7b1547cabd1d2238976a36b01cf5e5f9fb7f0b0029a5d018125ce134241681ab3647283146e2708a52f6590a1eee34b043e2ebd6653fe2bac01a7886e66afef1810ae744854cb0a60fc5f9dccad1a363bc83afed0317b52b3dda092758b052e0de3af8c4114717b2dd1a587f5444a35806e76fe42e9c7690cdc7499806dccf0e164bc4eeed495fec0ca98400a54f802d8d1a5252cd590d8f229b6fbd52c8d1f6674ffcbd4bc6371c01da02d4c9a976e7649e632fb053c8ddc0b3320cef0fd21e77de4e0a0114105bbe4f528d626d8e0c6d45b0204e38dfcfeaad804654c39d5b603d611897ce3d1dbe3ac2556667b83d684410b65317c91ff425fe1ad42198300cabca788618f60d8e458c57923bffb8fb67ca7502fa6eb32cf83537f0345c49db8e93e5752e914e568733918362816b523fded4628821e8252fd544b333b82bacc9b594214f6769f1763e2b1433b1c5d504da60df9ccc75038e309ff24d39004690fb90bfaf83052db90b8c04fe5ce314ef7450819fd9f0aefc5ffdcb3014bbea9e8e0a14496c484bf50c997bcb7485332c74da23cd6545f83c8906cdc194f8cdb70332259bc863740950603b80a139fe168a79548cef31007a14613179ef2d2ebd50a732d29d3160e95386b565e08bb79ca15b6b13fe1702692724c35da872998a1b7bc287af66ef30ccb82d66815fe4e06312cab8b193c3048105a5eb72675d8001570873d507c7f5c575cabfdab778eebceb6d7bb7563f9a9dea6083dbe8f7e1f4a71b993ee24803a4c95799777fc386c6dff62eb61e59ef1c18aab8397f576858cac7b055a09f5affed0f49d7a261408df60fdf491f4446eaa688b382ac814268c6afe9a0093d63bf10da47e41bea7d8ddd69192d209596a19da3099321b4497e51f3fc171c9b396955dc8fafcd760c411d70c25a6be992d671eca6bb813f78a4f8842be586c782019809f68065938d0a00700a360a823909de38b26d017f6a6f73c0e0713dec55ccac0d6fe5c5dc0f46072962807f0c7a615de302953848ad36e40ae547735a71dd4e7882598302b38f40dddcafeaf43c05e46c90900721a8d554b1643c60befd373f5f9fe00e6d482506e81bb5b45c163aaa827b4c70c136dc75b75dc6ef54efa7a2cc1568debc89a340e9ed29cb90b478ee73077c6c2ebeea7a684da5417fe669d9493cdd10e5b8450680f31d61f0e6b1d41ef16261a29d26fdc62922f3fa6711080dbe2b30004060b827e4654ce46ae93a9fe935560854d83bb186beee02022c43d51e8129b2a5ac5131b6a69de79deca3cd413f3f1a405eeb0a05fbc29d72f49bfa031851c4a715fe377b4624336ed7f487abf7a4ccf2169a8193d7353e5ffdb8197ae5d3525083ca4a1b1692c74e818d04a70333b57e7a0879801742395e39dfffbd181ba2a1a2cbcb68665ee4f162461172e1908ebde1aecc160ebf8f4077f9aacf4c6c4c8b9d983bf1ff973394dde39008854e5f1526650c25025e25a2cb5234fe7329e0e8f55d3a1f7892e2639458e23214085845daaf64ac25755aed14ca95af25957c77463c80a8d93d4b298a0756549532f62b58615b444f83dd7fc73ec4a8784c3c00752ddb0c856f77d18eb891591f6422432607503ea5b810e45e7c07f50931e02856341504816e209b01d48ff806175700c1fdcc61dd8ba05a907dccc60099ce42dd37c0408877c938789ee6ea4182d9a51fa64a060173b612a0a4daf1b5cf11de4faa0998d2a786bc8721c0f4d24bb432370e20b24d432466a9f3592b005ce2a56bc1aa6c97cec532b48f4b88fe9684145ab40d73d9e98bf36f61478ca325827bd27f2645b58650a9aef9258bf53dd57a6a1c47b38e62ef5030bb1190dd62ffd7213aa655a6ae88559433677ffe7cd00794254aa025c006e7e4ae9c7c54f1f65a5282cb262e8f4ec2bbbaf7368808396b2ca05bc2692d2ea0653d028a4349f14abb1c25b490e806225607ae1dd73f395b29f5c4ac7cf09f0360d52b77d302a7bd7d466c30d15178725dd4836eccd628f2b24bbce8aa6e01ac5e7641f7f7cf0f455a6bed29c37a800c229eefe14ff715ece49530b159b120fb3d3c640edd0d5da6bdc13ff58d090ff7394b6c82f3ee256c5ad3dc13081ab2a532f6ba01eda917fb7ad08665f0648b813d8d4c4fb8eeecfb213e874f816435900b3406f8984562df22927b36773d02899f24b18af3cf676ac48b1a3a18274887f6d15151a7e2bc138c0c8562ef469d8d3f3ce8fca6b5f61a2eebbc65a3bd2175e45ab7845b29de88e774c781f1859a240dfc4d2f498c87a3b72fa8828aad582b8c8015a4d83a0c712441920ddbaf34457768403b80d4d76c8cbdb974f04f397510090c6f7f0b639a47b06e76ab78533c29648948251035d8f85ada949ad45223de600eacaab1efa58804f3e83249e1742f2f67c187ffc2ab67252a9a38ef685b8b0215bedfbaff481196467fde5c17b9381e72b93a309b69d3369acf42124aa4f6d8bc58b973dbe64e4ab55b0ca01dd4cacf5bbbfeaa357809462dab6c9de1121f9b420ea1e87fe8faef8e3dc761ce211e88cd6ec60dcaf25bba879cefa497860bf1971690d89c00729aa95cc85004c56fcfdfc83ed6eb7134be8ec7cb7e22a48bda106e1e3782dc28301e2b44547622ddc0f9822a57ce77f6f3528b482b8f2c310f5516086002e311f07b4246c476e262ea7927dff994c2b33f5cdc5f1a231474b00023051a5b5d41ed716a231f9054dae836399b976015f23aebab39f1d1a0a68f6e2f35a4c48c0030cc4ddc4b9ccb196d333737fa7d35c35b6822a030dc1b9fee6c06994141573510acfe8c0207b7ac56d6ce0b5758cdf34f68430943db9c648a50425ba96c4d0f9818ce9fa33e3df5e3d9275906530b394d7ceb3d0bb68ed564406014b4fc7f138ccac04a103688b8bcad9065403b63f0e776460119a18fd061510a85711fbfea6ba04ac5f0ee0266da7b077ef739b9cf35b9fc3eb379b24047d7f8166f3388e820ca39ae63e6522dacbe4ac2caa42ef016f1891fb19b2457fc76cb688d3051b20beb4a9da90e687360020f05abf05d61f351731b568fc7baa3b45bbe2ae933bfe32c6f70395ec81efcb0a87a262d25d60690fa166132ffa4085666b6f51a669f5dd129f14c2f009efb2ffaf3f2978906261bdbff39cefe01fc18f8ec47f32a4bb9051850bb9bfdf9155fcd0887083748ff864c8ec64b1e7a8518dc4b78ef5758d33e32de3ac6a86743bfe2aa09a1a68f0cdea2e7a4decf9a9f9f7775a3e854223ca11b433f5424e0bd6cc3647a9b3e7c1c6ed53fbaf1656cb4f673ebed46ff89da02166f8374bdf8295ffe52e5ab57a62e6ac23226d0510ef1a0865226c412b5a8e6161ac2ba608584f8566a6f93cccb2c75b654fc91cccee1db73da0fd882d3ff949a8c970acb0c369b53a9e2d7fdc497db9cfee5b1ab698611147c523122fe759df58eb62486804eef925f29b6675b67e067f0c4314a7bc8e3ce024204005b2b51f040be918c5daded68727cb8db394981f4e819ed0647db18681396ac50907e595003a33758e2cea9f9c47f529e74bc6d208fd34d42a05ffa54a34a2a197ae429cb8f4bc176d17433bc0b007b0371a7000cef7ca037f0ff934f308e8d99e040d21729d031fca6bc84a77b11bb52dff65ea80d5061697547733abdf4e33927c26908de6c8a3517cf56c7e70cbf5aef93e161901450b6ba2d61014ae26c34d36c9253b897961b47be33dd803cafed0655f3af91554dd4f6e9b4546bd6525d2afb322c0432b907da7fed01d8823796b0c90f509755eea1b02a24a8c0a61a31f49edfc7ceeaed0502d2f2c62ef8cd9a24e05006632aa3cdc6644cac048df4a9410abc5a2b81949bbf772005aefc82f4e24a763c611554d4bb1cd9c6c9adcce959b88911119f703376df8aeef23ee40b721206e8bd32c61d72f9b44545303ceaa95226b4a95914f3a271c6c59244ee52fc2b1f8c7c5eada311741eaec48a1920a33ed68ffde7fb1a095b47145cd0825029f3866a64179935c3c771bf898ef11077ec98db834f1ff242b0f969648656b03c8e2aed377d2a30ffb6d947a27852e37dd5a45698d06b5d0399ccb198e7d284022ddc94d306872c5352e1013ecd98ba3474088881971b85bc4ea2f36e8a6d1edb63b761aece92bc2fe6b14153c2efe67b4edaedb8a240ec0e971b1c106cfdcfd2e9fa6c04905449533a46ea41784ae32acfddda01a1f6f72437db94e0f276f97736988ab8b4cbb36aac974e8cdd3a57a96506f1ed7723742396a8a2ab3ccc975c752f5bc40bf7d601f53f821f2796d29b66cd2a5dc7a9a32b8032275febaf1feb3eef1246e258a134af791579661474cfd5f70c9b09a67b5117946e00fdd69e79e53fe0f0a6e0e459767bf8f626b1184f387a8742412c2962efeb7faa2e1f4f7a8a598085ac677a2e83e82be941edc3e5ca53bcc9fd5903244a08b13556cbf839dab9bcb1188dd915527e6b478bf44b60ab33a760bcfdfe564c88eb69ccbe6287c445285591efb56bdc2c819f91692163819a0a2fae5ba1568970bdb350df33f32c215f7d98a056c006ebe15b20aaa9ec989f51d62f81612fcfd991bb49e94a578b69576f68b2c61fa0b37a5db5f959d8e6b72e574facaee96063cf42c9ea269fffbd1d2e6dd9ad52f96d99e6b448314c61b6390cd6e32f1dafaf44f629db5682c7f00c1d9bdb3c248cb116c7ecf51505a8753f15fb57b398391457735f034c8985591364b71225afc49700132ecedeaaf7e46b585fb72c26b19664593396a3425ff89ed7996f620c4cbae1c4bfed1685fb6d3a37780fa6cb77bf25869bdff0cf18369a73fe6f778f5cbbe784a71b20095d4202664f8eb67921503645c19948c5b59ef89337c89b02f12d1c2bf1f997c65b461a9bf107b69a7501e3a1aec465df1f53573024393be75a2870ca9afa89bc86204c59bdadef533fadf2cad93730f47d1400787850e47b0202e4dd2343ccf686955ef463de4439272fc67bd1d56fa0cf2a87fe6ffa2b07480fe018b143bdb3a6df244f8461a5c5875a30fd8fabee61b140f2bafe3cb1a1fda1ed2cb3a9f22ac4dbfd77195443707c6b16563c2ebd4bb9c232c0a4695c90ce0521f4a7c8f7970e62739a225c3e4898913d4019d6ed73f7e9184c52ba49784f782f4b3148a1965b6e1143c5237e688fddb43036429903363555ca47cd97f5b0f0fe666aa722abc40feaf23b059878055a38383b6ece82584bbaa0ba818f8f4d9320bcb620929393ffaeb2d062d08e2ae8c9bafbf01c30f1ade8c47de85d817ef27f1e402dd6f48b7b43ef6217aef16a8a061be8409b982c1fe7042b5c6a4ec3bef30f12d7fb5e00be3914c6e6116d7cd4eefd69fc8732fbb3ee11c31d5ed40eff1af043ac26608a4d8c2d3f00efe162238207c2455724e356540e2ed622f24df46b6c779a4e8471b298970e7aa36953c6f32e53bd4ff58b9dddf24e647847082c164a95c8ff3daec9ec929e7c49cb2db8ca8f6a3e35c46954414ccaa1d49992686a3812d08cd5ca8a12bd83c30e712b0cd548c1a4a82e48b6641127daa019868defb568feceff22cdcb59a3fed66d74ec9c0988b61824a62472dd3bb1e7a10dddd6a2f712e0f4012d348b3f8c1446d2e0120bd07d0f5ea0e3ce7c21c510f90bef16bd05cd7f707539860b9bb5fff2a308e006ebfd410e135db60f868d09855c5b54d3b9c20750518f384c099f1597e0bdcf5ad4d0b64504ccd34ff93131b847de141b365c551dec36190c2ce5e5a7f34122b4e0595596e1b3f5c98d41bf2b5f703fdd1d7878544eebc8359eea48f3ef435b5b276848ffd2656a3026d285f88591f766d224feab9451ae045b02f4b44b28ceb53b1381bf1dee67ac631775ec3070d42ca5e64a12926827da163fd401150656f8361c6af11e5fa5b30ecf3eb101f6587ffc817cdece954b63cc52fca6feba16bb66349a13952478bf20fa1b632d9fcdc01bdbf9cb1bf74b29efe5751c316bf25aed77337c0032229a317d36e5e9f4d2a21f900f56cd4d717fbf0b4f36dadc923dcd15c2bec0ec0910165e195309d66cd76f26f2dc6c915d41ca2d1222e6a4ea0dfd32a45e3b57ccdcf4a06306902d7b652935eca32a701aa1b60121f5a3ed5a3c8a46d2f66f62a34c49a414e20038e9203bd48661b7b6531456814a39b869bf013827751c994501fb71f3543eca3021b571c20c14bc566c3d5d5f8a73c75ac1a3f1c6dacc76d8ad4a3cd282878eec4b8f3881e74c5bdf5aeba298edcaa4b06b48cea4f99bb8e97dac11f722121229372208d9fac912e7b0cb7558f53708091381c26f85361fb3b22ec3bee92e365cde38140ccb0fa67e6bfec4496410d806f268c3062873a7ff5d000519ec0440e81ebc352f0d522717aaafd8679292dc2fd80a41e67d8517bda792ce921ba2eb5ee6c7ce90b470bf88b0cf5b53fd030b6942cb150fa9137800957d0bdde383fa59b6e34e17d3afc95b68b0a44177bcc7dc4a7c17a9aef694a22b9b2a8fc6be4ab7db37672732b99415c09679a8608b7047da3a76dad89ffd892f08c0bdc0d6349b6c483cdfc1ce150b7913540eb86a1f163ef6e5cc570f19d1d62119deb8ae2809fd9cb207ae15d42a9408e6340f6e3a4a8e6cb536470c16efd9e8e9abd4dcc864a01f850ae1a92912dc66e5ce2a0c00189c347a44969f1214f60fd4df4b645472befa9c3e5d52afd8ac74417ecf261df15043b01c960fd0bd510c150f58b5b7f967aa600b22e81caf03970b90cdd7adfaabad8323c1e2e58ec549884b8c48dfea0d549058e637af3979f6d653f6516a07d93cb6a4d664a66d29a4120e1eb4f35a5fce686847a79a69a1d62c4645e6f18f6fec8682274ae4b84b22583937d57627cb336890c6adce644596bdf45fdf6bfd3608f76902ea69d5eee8b8f6162e92533712d5a4f4d3289e9a2f956051a8ea45bc8b0477ec1a7202dde20ec04ba6f2758196569bda7856e5209f6ea2c0af89d9789cabc153d21b71ec134de7f8d7d82dfcd11d04bbdc314a90e9d6cf4b58a1ecbb3b138170416471a5267fdd49c90a3b68d3bf45820a988ef8c862938c81ccf6dd549fc398d732a8e0bf9a36b40123623770318c6c3877b93439b35e40306d9e1be7f4e768279be2444e9223cd2de158f6204febd4c760dfe198a886e2362956fb53a355ac1fe51c443d2d59567e949374f7614bc58ab3edf4aed16347edbcf0cc8b6e4b14c11fa47b44ef97d74ebf4f2f561a777b7773b42ba8c20c8a46de6805d349ff9b541302678eb581b27ebabc595dfe17a34ffff2b724d0370cb46c770acca69ae1531e5cf98b85cb617620b9d76dc00cf8b1d4e69befdecb19f4a1494abadbcf598f588cc9d43ca2fa02041be8cc7eb29e421b22563e21bf05d35434537b6ffaba0dd7c0afc70cfa42d4c72b99d31b9e4e6a46e1ef05876d56809edd81758d44b784714d7652566e91697648eea4eac09840cc1671e03ecf76b6dc47c3d2cb0a45c11476b8ce2c1f95f7363d7e89c281683bffde0c8a330e6e97ce6f24c0b416862ecf2922ef37e1c105c620eb297a3fc2a834abe81edd1de1a700341590696aff95b9e951b99d81da4955818392d1aedce6169b584e2cf29c26b8cfc9919790a1c8e0f13291ef81ef3edb6b286fe86f6de519bd7d722dd112551448969a4391f5f888ac5b9bd2a3724d758ef156fda40aaa4bb2967ac406ec94f6cf9f301d0f8da1efe780c9fc00a80fb9645076c1f2bec012be54f3d222bfbfb4adcd10550de98a1988ab7f613c14a83df53ce2b0b04e912e9529658cb0a90d0661d8cbd5be0ea8ff2a80c034769f478429c2f6a54217f901497eddfccdc764fd7ebf5ab3e001ba54db11a45fc77c80d3c85efae19510f0007736de38b3352da07df38c3eaf6f8956d281d2dc4987ec52f19e121c53eab1181e1a1ebfbf0ae5d4e6064613b7411ff8e882f0aefc9bc426f6675f41e3289091e75fe4a7f2e1f5be539d89a312e4b599f0169ff47f8525c1a79fcf0f9080b49a486532dc5569dd722ba95349ac32ec61763877fa40bdeda4767aef429cff0b0438dd8a42c8b77e4dedc41a6481c2deef4320601189a3e401614849f894c3153db7ec9f73ced2622fca862995ee153555236bc80f9ab102f48dbde96772de30118424d84b485f7125da93d494ba654a6a50855396b36ba364928c369259199fe1488d96f9864a2aa259c86bf308ae467fba98dfb1615e9521901dc7d1272710f0164fbcb64e252b57e0914acb64ef63bce449748d93a1a416a090da781e39354e2c64619c967327707abbb699391b018b1aa911cc085d927b5ea8a912b704fba88f5c7e1f8ed965273f78f570d93d6e103b1de027d8fcb98b9ffb0b7b811055d838d68377cdc4553e05aa000e022530a307ae7e1c416878149a1308f70f082ab91c18ced3087732659fd3f1921fa29872a59d2abb44d49faee0de739662bc8860b24d4798ae1cd1e0550cc7e905e9e0040a62352c556caac28cb6ef7c8521a847dd39313fe995c236af36cfa216dc94fd1abaa6c2fbb701fe7b0a1c83acffb9b35951d0a58e9fad77f07130a330440a7facae9c70399fc962c7947f2f792ad1d4fc8fd7ff9bab94e0d6cfd86a66e07793019e3446eeed0989ceb178a17986b5eba3564b340ee2816fcc2c51a1c3dc6187450d66613d8d02e9dcfc60001241e6f942a5a01009bd6180babb7d17202f1402d5f16be3b57a9a1cb5b164483ccaad73bb4814711fb6bd9ada64b8d9dd320c2590cd7dc900c720572d4cb43ec12df33d0ca6e6ff00931b69c7c4c12b753858361650c7da572309426556907d8ef3480a513cbb55c99f0ce12e1c34964c89a5108a73eef0c84ae60b8f5f35b3602eae962165e3d9f96874c7f793a79e72f0fa157c5b153a23bb7f3d2443ce3604ab8e12bf4bb9295778e7cf036bee91a21db89b6f256134d94b93fb2541c8b258e09c9bd2b99a8b668a929138133f6c2254aff4deb71ac20663468e5c4c93db00875c194efd082fdc659d37c413e9e61d3bc6ca2c70ad904e7b36085b8e10bcf51920414924a8c063b66aac319e2e68b8131e9da274597de63d5556535c83d3fa31b05fd555dc1f675e9a06bf67e1f178fe47e190cecdf87cea0538fb94a408089b06126d505a3cb42f6ce24cdfe4213870dfcf1f634179e4c0e0a4c5967544efe05c12957b1ee670b76c88a238fc5833fc5b28ec985584dd082b5776818cd562ac81f3a91d04647ca8cc2a9c8cf4bd4be22c38b740312cdea36a734ec97d7fce06914564909b0a1cdd781684a95d9adeac47aae112b2afe1bfc85f3e6dd81eaba7a2bcff60648c99e21078745b53bdd13f63ec693458adc147310ef2435c32709adf85ab86d49dfdb84ad41e698830868fc9b073128039fdb0647e905dd69ea565563c7b70d6c9c8c55456ae741e0547793e11a479dacfb8ab9dcb379c2689ab061326888c4d4a63d5f4c0dc193c873b18d4629d3c7c86d4c6f8d7ed46bc4ed579be80efe2dd376e415cb66208022dac5624efad8ff095af6a4a84f84b72d214238d7d9fd5d2655e86a1340e12ee322d8c51b96c10eacd799855834986133feea3dbc6450a23d348426a5181885acc55abdc039b4e81cdc2ced9a3ac5e8c3cb854daed512df9592be63e588e93f7846a549a7da0a15233914e7603acfb41b2646fc315d9aa7fb840e7bc930818fade974b506c0fea89bddb4ff02a2c7eff7cf9b393a6cfdccb4ee73048d446755ad069b3b376c4427ca2c6236cab87354e9705be7a5336aa9e51bbc8651114952032bee901dab83a473f3cb88c5101052d9b3bebd3c51c225d4d2c5768466b3d6690e35500fc734665fd90578742a596599efa778e90185e5324262f4512f3eca0ea385eb01f4fb2e9b8c1bd9b7f3e945396562f81f2c144456fc8313200ac7233ed2e2750696de5c279baac4ca8ffa9104e13bdedefe8d5068fa5315cf217955b48522e3b28e7a9ea3172d8818749990105a6d8b942ac82291263de3e6ca6d65b884cc427f8c3ddee77efded6b42e28aea2de443cfe2ab7a232f2fe61ef2b293fff9ebcaed5c457c774b4a098ab8f05fc644df918f3f91dba0d89532b65a8677e3d8538c86d4a0d0ae2cef30a51952252ff2f43d6c8297df2e50f1b3926e7d46649f49e276d8532a9b52c46c42acf4cc299925b659b49d34955a41d5b2ab535f646131e02271b8deedf042a2dda942c53d4fca4b0570857303f64a368cb937eb815ed71d140418767b81f567524d425b88d1cd07c74fa6f67d3c742e26472506210d4a9400e7c38b4ba9801b76f5de462eddf1cd4c2879b1b911321aabbd2763883410aafd2e0d13db5fa0d37af93b842c584a361dc9d32880c156ec1cb544e8eb95b15d6bcb754a5f832ea1adf66ad802364be463cda2d26261ace1504f59b5d290badba6fbd4b89fbb323f3e977b9cd64c6a4cd83b7668a3aa5e2205e5ade4ff3b5f4375e0a8ca9dca600ec761eaa5bd556bed2ace2fe6996445b24c68df1499fe041aa286defcea58191f181ed72898dff7ba48469dfee2080a00b2a47eec19c4ce047842cb6c76eb22d2add8e9050b87a7cba30f371f25cbe92621cceb37233c1e852d795b58a1bf72f3f20dac70432a97895d4c7f67c8b5f261edb2e04e40e5af02b7b83ed416b9df629dbfee37cb189b5d00353062287a42d6ba6fc8e78c5b8eaf42f68d2c7981aea2549c0281671cc47ca0f76eec2b8be32ee38dd9e1f42de2cdac419de3466cf3f34540edbdc334d5d27a8bf9d27b4ed0dfabaa94a9b4c7d5b0e8dd4427dfade9853c15f33d2fa2ed0b474e94a8f63e3906d3a3644d32308690580146bbdb659d73fcd10037e9ca937473da8c589f21a712f107c4ed4b57667b8e493a30d2bb66d0edcdd3617077cd225e08a2dbc3ad3f84c51a8cef198271a3a74a37572cb3cd7c2c2fd5ae51926fac198bfff5aa6fefd918321bc7d7666b01fc06a28ce42509d5003edd2d8dcd5d5996e95215d228ac1b1d45b14f8e2e71b7456402aa36c65ca9d9ac79f586bda6e0954a3e5c43377330e51ac49d8b7ad374f42fc12dfee317180ba95fb1e5be24b32ab420f96afdb22db433bcaca8d047ab075e46b69645b261d050fe0c3c8e82f2d5a2f844cce6524c2bbfa97ef4ca821c8994394a12f081301dc428fd295fed649e05695f8c5afe2f624407322657356b34607c137e198ed1ad68486bf224adb2d886a6e598a42f3a94aec7b4a496ac117f0acdf6278c8aa06082c482ca4278add6b6d05a50fd1022aafab50bf0e64269ac65e975f8d5b707ac13fb7ae8d2641be2acd0ac8ebc1bd4fd1fa4fd04b2ba31f62f7dbab6061019f4d3d21e15eab95aee8557117a39a6055e5fa59a719b6fbbb87666abf8201ed28a56ea0e565c4bae35a0f8283c3bc438ed11e127ea27b63b43e38c3d71f34e12f5a2b2ae9ea0aa4892a2b795f192682813aa08cfdc4c36584b854a8e49b9055a2ab2dbf99ab9bfc92f5ff0f1939631bdcff329f4aa4227ffa570fc4f411b3d1742a210fd0efa76d95cdacf6ff69ef95e6ce1b04a140a029225e71cc09ce31162f768ff6ac23a03704c20501315df7932eccf50743cc4a50f99081b937eca371c2bae7d724fc951b80892d74111ceea521ad7b49d66462d465a46c7453582711fb8ae353a6fa2c5c1261ad3bd6f142c5d3d8b93103d2210c9dc5423c931ac44042d2abba2b2572767bcbde873119b444ed303548cd241421459bec1e3a1826a65968727a4fd3454d6dae6440a0ae830ea984df7aa5e80892b4dcfb18a0cbd9435eb89989068b2f45523593d5dfd306e98adf1aafc7b0475ca2635fbe8e14ed6ff42a1c3d0dea7859e8aa258d74429b97d1d2003c3ae55c777aef3363b59c9f5d65b7dbb48d3bf8e869dbd16e1e825696012e0579f87150ea69060495fe77acc5bf0c7e1e846d84060096406f43f899741bb6adc418fdd2ba5f19c600b03c55f16d3edba4efe5229c0eeed0fc823d1b6dfb52428618b6e5c2c8eb52e59878e039c9da8cea2341f6168039b84f2b340c546d6ba9efacc3402127a8118fc03e9f766b12633e8ca978b8dc5f3352b5b4fa498082ac63d239f4474fd17f3e2e7576a22d6c42117fc605e22bce2ba7cce90a1f2290522096b2698ef375dd9f7aa4376aca3987edf3a68e81a40aa20fbcbc647be51c5572bf5d172a951f462d9a702ca4e0266d2d6b1b447a62a888ff75d3191d8d8bf8d809b8ac522e15dba4dffe4fbde1df572408bc8857d172d27b0a3f2b6973e692771913115c7221511a7652ce59bdb963de44b5503bd054e46d28bd1d1e63a305b9d8b49cc3f5a7e3bd3fe7f0d3c6d076e9138682fde27a0b38ac4a4f73504cc54bd2db8c393373c6ec17e3593ec254a50f1af2d6cbb5dc3ecf5f6692ba2c56791cd01bfa23fab1a1a8f14cc79a0a5a006777312583c0b14852b84d3b54a1cfdd9fece127678cff1c951bae43366aef68b0cab4d9b27d31228e70b1107bc193d87ed87b7b01a8e51493a4e0993f04bb0dc62815dc03ae5d13dd217feb73e996e8006b7887174443b5302049dff994d7f7a57eb68a9cb22b36b0dac02da01df6f2e1ec18c24a96d107c1bd931488dba2a298c279d22a4773476c7b5374e9bd02f3c384d5da3be3069c046c885960d1d30bb24c8d8f7b5ab87e4c2a216763babdea825765e0edbf74450b108575a4855a4d75b5524e1a6673034255ec6f08b7a3a2fb7406a21dec2a27c624a175d6cd30457aded261a94cf9d8ad057a507fb947a65caee97f132ca2af0ff405592f5c0888298f16dacb9faf72e23bea9e41184419833df6c5acca4b0653c98690bc978d7e2e84c6d812f6e955884aea08e763126943679bc8c3a15759e5b38a8204ac1c45131ab0c4ad18abd3597e365eb3ec0198c180be69a26c48feb81b27fb11a4388c4c7faca25c12602cf65345d5f66c41e66f6ea36ff21d3b1f57375b82fc0f537926cce2bafb852d36faece7d2c0ce12443abc3654eca00f2d1b530a6d7c6aa10e73193eb0007d37fa1952d24d82e20dbdd2d3d9889fdbb7ae371d8d9bde9e02a645441d5dd3df12ba3bd0bbe7798125ea54ff7b0b8c60901a917500998676dda7c7d8f9876209b76f690fe0bfb4b11016e413fc1f936b0952a63dc5c1617083561eb3edc89e9e0d258afb5f188d62ee9cc1c2d29f937baafbf81cbf56d3e0ed0364af37df2b577f40383737eeaf29f75c6313b48f863686cd9283e7782afc918b86edb7dbdd6185ebe83852712faf8cf4113f31bc666b7295b64f8e4e1536982560725ecb9d6bd08ed58b207836950982fea32777bc613c25c497c887047727b699a6a810331da5c81de188db2b7ccc5b0c94a75d942ae8baae1dc358efb9bf77435317dfa911f941415f9669bb399a394d7123dbbcde7d478fdacc5f528e25400835ed6ec70e6ccac8b3fe7bfd736a7ce06693d23c46080444e6c175966a96bc773d37d959c1ac8d8bd8b564d3a38257db512fc9a3588c6fadf2ae3d39a46e5c8ac312884f6c7d8f773ebb5bdd46f90c21353f3f4e834a91f956c81760a904354b8199ada10ab56a66966c5af2c66706bf76cfa305b96883a0efcc22ba2638856b9e4b1ae510a3c9cb0601630a9cf42dcb3ea71d6cb27c572ed7a6fa855c12473ad086a3eecb8094821ed1329d7fd305b65170ab9d94217590502593fc771deffc4a2c325432fb0ab5240186f03c5aa4fd0b3dd137d8a9da16e2682980ca9c1a5bf212d0937149bcdc5f5b03d6734d7756bfef297a5b1b754319e235b75147de14402952c35f059773fe70280d0b4012e89aefcb5c338207b53a322b31fdde79bbb74da17cf08f00cdb4aac20cae1f21c5ee0943c682099af00465e60b5123b7c72694f2e6b5e54f39034c6c413d31fd44f2df535872e4fe1ece0cfaa700590e07081861941b3315ade87eb3ec4b4bb49ce4f8b0e6d612de2ac36024256786215e7dee7af45b90088bc3d297d2a6b8504c400a68b5ae872fe075e664d0dc690bdfbd93a19000c105a861fb89530f8485411ef1961818c72056da900889b0391124ff7c3d5da9337bbca1aeba772570db59e33e6b3295a97ae22323caf011a3f3c79be6d56a0a5e20204e1922c636ffeca7b4926a4191ba48c574b96a84709e9c238b402fe7e428565e4c4915dcc408fc749307c43048f16e93a98997db4072347914d056650052f5f46aacdce465c747b2bf96df183d397492d60b4af66a05ae11e25898ec13787a95e1db9695f13e2a2322d360be593e5cc4b1a34eee1307578fe08e88cbdc8bfdb43f575cb06185b4be4b8ce084c369acc5d5a2c374880279983e2fc63544d4565101f66baddebeed63796103be5c2121fefa1c12385078f968390a48d7432363a2ac3d2f723aa130dae8bc60a62242b1364b848f3425137588c5f4713bf34af9ce3e0f0b94c1d61bb9c74c9c9829f186d927554f0ed1df06ac35326ffc333955a6ccff991c5b774b33ed70c39b5c125d13de1093c4025bbec268f26cd408872b81d7ffe61b18ee37d9f3494236b8881b0647cda9467b321677819d4a9346ed216023ace1b22d3bcaff3a2c5e5c87443dc3233a1a94fc08560d6f352fc8c8f6aa09c482c6271a52a8213c77a781853206f7c91f9550c6ce7d56a345d8ca9453568687474911956e732be89081d9ef3d0dc844157d458958f93a4dcf357c10d42d1a0583aaec8a1cfc7f154d48eb7767c1ae0ee8bef4556357ad40b239728ad04c15da1302f6885b24a5e0c662dc270159abde7fa715309ab6afb9e146d4d3155aefc4074ffc55200b817d33e7528a8b7f66e7ed276707559d66916e0a8ce4bac7e6adc2f4bf47b8d41e2f79e2499ba00d7b0cdd78e73bb2c529c1997c14e2604f592194abf2eb3b4170dffa3d38f3334deff509d0d57a96a12c3915ebfa43e9a48f30bff24cac94989051369c4d26b2f8c8f1a64d887812f38886b597a26674cc539c711dd882e146df7a0ab06f1482ca09ae4c0751428a29d5f57af1614ee4d80062d4d046707b40f83b4a8f33b94acdc06b305098786d98eb071024ecbe7d2305d34b289498c87957566b282852cec7630172cccb784689b1ce76358709b009a819276a7e3624fb720f463a86c198c4ecb51161b3a75c1d517f9bdd7548eed7b00541eb509864e0dbc7e63488f59770ff31181aad2ab7a52fbc7a586940c44231a1f7c1ce45eb230e504a0015902f6e5ba3b411740d1535621126dba9b63ed42d03f2481cb3c69d1158dc5f02e7829faf737e2273e7bb05adb893bd0a8d07c9a6475dcbf55a4f67d94d445d4d4fa85d4d0e18249c4d2405296287646fb4eefb445623b9d40fce8a8fe7c6da29994278acfb572e4fee4d552e9568ab0bc121a4ba9049e9050de76689a65777f2b51cf466b10a7dc2cfb8bcd6437076cbccfefd975ef913ce67ce6b8701b89b55b5f3d53d0b844a53ccc5efe76a13fc07cbfa213806312b7a2d95631a074b47b5ec3e0538b963c04571f0d3da5890f75b320f2e6c7903d1acb1635f3f32dcb928a657768bf4382508a691c54c0ea71521e9c7364c0227e2308605852c6bc9c6d502acea2316815881c134df2364ab1836fb2778d2503e9532bfbc5ebbc483bbf36b6602c4ae99cbc22d4520fad96b8896751d4add860bef5c78297a368d5c0a578ae3dec492bd85c4b9bb2826357ea0355eaaad71fdce8357ef0d48b536c37b9342d1c3cc28279c75cb274d1c664175bef6066db57c86257a150e249fd1f32cd15763d5ef62146648a8e99729acb671c056b93d823aafa1e4d633df652c847449ad9067245952f5092317f9e527a1af061d1f5648f104eabfbaf40bccd74819a1b3e9c3c94e7180d4f84189197bf6cac2c7e6e7f437a7298e69b8cc4835eedc9ad20f38d9a471c9f21e53fd0e52ebca5c5c927dc4530049d25933883d1e9da352314acd8b8ab5f267bd2ecdcaaaa62c2d245183e00bcf11da8ef391dc4b75a7f07079ca8773af449d07aa412cf39c8f503896dab676a5747b48a4c072c4b5309f174cfbfb69d75384c08436af415571ef2c33844a1f959160a1feedc5c69fe1c8a3acf94ba6ebcbd5458cb600790446c11fd3130b64b28416a9420a9ae4d94477df9d6124500267e632cdccacdf07de11045a31c837e19394b16fd0d17dffde60a6e50766932a7c2af4a5e6ecb1bff4926f64bb85dbd7f7cedbaa44ef2f3cc4f1b5c2c9d1f71f85613060c5b9775d0bfd9d05b8cad9513177db645207eeeca348121156f0e296b109492f3eab7fff433523293799dcb1e200deb7532d6ae5f89dc2dd2f10d9f2120e2d80aaec26a547e76c0c9afb3e785ab91e5db3ea6fae20b5d42f389d20d84d7fcae38053c080e4b97521047f7a15333a46865fd43d612203983cf7836291940bfa90b9bd5d2ad80c2803cedb7d551d424c1a765a971bd3d88e3ff0f1dc9ee256a95d7ceedf51627fe6250eaa674dcce45057ff1ac548e420e8d9d149e9866aea3f75153d25db09e11c85e2b8e6ed89ae4779776cfb71fd9d616351b3545cb2d54512c41465f14c98fe85544b51ba901bee6f95ce01ee0a77ad4562afe7546f4ac28f292387292e9782203d41c9ce456a97b3cb4edcc1669c00101e92adcb557b189a6d1b1c30d5791025997fe64c96636d0d22f597d261e4ed0f91d1e0fe21245bd64968329690a2e71ae8b7d67c5993dd344a4dacfc080e90df4754363b24c9c52ecfa1e3ece2841c67e235699811959ad9cd744001a70e9149a7b220ba9099dbaa77a44059ba5c947e7d7ac1b30e344a8e2a8d7c211a8ff82c751b9fb3cfa73892228f623c50d706c47b589b64196a960f49eda7dc12e32854adb7d414abb7be3918ae8511c8d7832666d884f23d3c01d86435361531c152048473030be8369a66b80cdae84628ba36c95f6b09f46ead6779f66a0f3f0da0e0723b7f1c85fe323654dc6aa0f5c2978351f092456024d407e1d5b284ca7d144a0053955a84f9d3507331c82c4748b728e52627ee7f624a562b31728f3f14fe3f824bcd7ef4e7ada6e6cff9053cba0f6221aa05e9058770d522923f24e52911c5834a2d6f78202189d8fa41bd791d8e86c4239d37a48a868b2467fb85b218166c28834f5411aa3654bb8503a035dfdad0c49588d6ab2a80e76fcabf76a3a73de03c1690d789bcbd4fdcd1cee84484cb20eca18ccc7c79157a1e9e5b8eddd6362566f44072b6b24417ffb1a34ea758da091bd4bedce735850eaca9ce68a8136ef402ac54b87aab3c3f84fde14e0ede8f4cbc7c1affeb0a6161b1d84a1eb25774af1fc3e6b886876f9e9c018749a6fecebf304d15f1d58b7dc204aa7e1bbdb7b89a5e5744cb7ce83b937cbd3092a17ca5ccdb8a0403ad8252f9e786f915b14c0543861429bde9d8eb49481c130383831bfa76a69e483956067bac5a8412fb97968fab2eeb7e56acb27343718a5dd1fcdbb1535541d5334e9bfe6ee21df0283d2d0e64e841ab04f7dfb61336b1f6039098d11aa50120d28dfc332f96ba1a388e6be0e4b432108fffb36e60ca2c01bf3686dd3f4e3455fcc7207548ea4da13b0840bb11ec22b1677031437f9f202be9c1031754ac7a4e5df9acc77f8ebe09639837842e8d21c810c1e151474f42051355ad88a805192f29b42750c4485b22316ab29af27924b9e22221c6409953ddb17c9c535423a56c6117aa5c58e03e9a82b38d31721907ba83db442422f646f066184245a7945fa35387795c641307ef39195acd85ffb57cec040f1d00ed458f0b379ecc1ded0233bde6025306821bbb9251572b5ea87be0072882db8c29c20b8964affd807bf7956637d1e84b8a2c71cf6781502e74a117489b71a7b7be4aba87e2f049e52cc0603976f925fbe1f0905a0f9de0bd3948fe7dc1e5969fb6c70a085eeb4b5031f5868f0601b774a8c830ce296e9dca335fe03b542a3fff84778241971327e2c8fe76c5b720e6ca501590344c2a3ef5186a93e69a4b27d15fb63989e838281637da314f055d4232ebb33112763c9be0245466063ea2c34b8b969896a8eb661e281d882b1ae76e0aa312ca71d3dc446389ac00466e1db7d191b1b6459cffa6c10f8f7035c96af195bea3377a0fca9602c1bbe510b56b6cb41daf2e82a2ab734b53bd1a5a60102c8d810660637138bfacd8c7d51bf16fd92615b92e574b8b2a0e91b8dc898d3d8b094b47849512c18f7e86e979fecca0eac74948811e4a2cc40e0252aa18284eccd9fc0c9a7391626134e659899d43090bfc3a07011ad07bf1809b678b833ca3948223f5223caf286db1d013e22305bf682a646de8187ff08e9562a805680431daa175b648c7e729a506e1aa5b4510a13927f9a518ad77a97ac06ed48da5c550c227aa7682b12389ad348da8caa4ba694014830bd41f35a4ca3a7d91d1f31ea8e17b7decd49c55968c0a52f476d07fd9ae976a6d9966aaf426a519aae1704179b14d661be6326c8f8038f34aed7edf0bcd0b473aca8213396d05c906bc6b2b4e1ea805d1cb30bbcf7621cff052dfaa9121c6506913c58ab37cd345a5f326d6c903ff3452e87a95274aac23b03d60c31dc899b644c575d95406eca58eb322edcebbd62985bd1193d336ff2b0e013fa4a11a6feb2f197c9d315dbc4fc6d9d6ddba5bb16aeed65ddece608398b959021793096cfe325e731ef18b7a6ebfcd766e5846fdd78c67a1418950a9bfae7ef4e6af1e9199e438f8846201ba8d5682675e47c9891aa2776a91503ffdae8178cb29484614331990573ed9bab6b9aa572075ecac49a9064e4d2a9a4b30b6079c78fd25790520373473e9586906484b758d859c3a411cf264e702ce1bc4355e83e6788ec699b9de5506b7578da0c235c25957d1fcd9c3ff0fb9e99775b385526e87a04c97a326055b8698f7c341624872f59900e4a8f8f44450a684a09ecbb32c83a2099f0a9d5bf6fe3dcb9526e0cf3cc3c7dbf3c3e43109c5d2f31caad366875910638d4116ae8455ef810cdabfab0e84925193ffbd312b5a33881ce14ccebed7ab4f4ac5ae9dcffb622910cae333e25a6928e2a64a323324fc57e0833f49ac4264994c6a923520a90247396056fdeea23233fc322f1a7d3e1a7d6f95188a00dcad935a4e340e3da105cfc06e9bac3c2ed043836a5c5ac0c99e473522fdf9448950bf0d65acf8131ec147712e66f7f37a9b4020f305cef20f28facb22ddfc039a478b36e6cd9a0164644b3a01981eae1f3d720c2e8ad81b2319ef9bf63352ade09c898c4aa8ef1da0d0beb361daecbfe665f21217a20e60b1aa35ca9413e47fb134c6d69af926cadcc25f1e935396c2e69d2a44c4b03adc601691c0b20fefff4ccd0436b1510d3829deaf60990b4419250f7caa327519a503dfb7bfdb058a6737194d385808c133be62f4e3a435579da473f012a97aa1788f4696a39afc34da7798b291f11f96250c842127238bdf55eac5d1e02960939cd6778fcf46e70baa71bf46cb92c0307ed58dcd62aec99c126c2ce664c0f34698146cd911b0efe8df28cecbbf150cc2105703223149fc81c3323ca40197775fa13a15fa8e7146256fc91b579959c0b6a91eaed244cb4f8223bbb0e7b2e40245a82b02565f866b906a2e8b175ac6308c66e37085a4deb1caf9a40a2886555b6b88cbf769aa9fc76079875b03b5fc5680cc9282b98bf9c512079801a74d9f241dd4a6ead936fd3a166591a1dd4eb41c67e87ddda236dcf641ce1be6cc15d9469158f722f66f9a1e24d6013c46b1670678a38c877240dc2a30cbe49427cc426bca212c371d6cadbff8dd2b4e8e90a269430464d3e7aabe9736f023fcb95c9ecb48c4826b13feee142040ffaa4de6b60824d6db7072965b0179f090a92b24f5d4a658cd101d2bbf6bea80ebc586fecc260d85a0b32a5168ae525b7b2a8b25af014742131573fe042e76b1710918f08c9d6b1c976b42e22245bdc217c351f6042ecf9f2fefba0ea47a6462b164c1a4af4037d2026235765ec8e115a4727d714a3666de975b525b9f0b35476fecf4fd8bd2a76ed0782a5435828a4947c5b2ac561d00a39d9dd7ef29d9024eb16446d5fdcbb9dd47a2d00c102b55d3a5df42b94b3620e87b22410d195d59d7fa6f9819b45bdf68ee76ab970723c74bd62ebe5a39096b510ef6c3ac0a0995db68b208038ef1825c699666ca2c205060feb97c441368a3e65302ebb9da3ada301305ae2c05c9a02c5c3a7a712c8f9234b7416bca2f4006050e6ca259ffcf1c1ff5998af8641962be56dd385bfce28c71c923394c1833e23d244c7ebe0ab162db4d61ab8a86f54480aea787dd5b77dd9a6b4517a7347c03346abc9e358a916697e0db61a887028cbc2162480409efd3ba9d98a94bc39d72c2ffed0aaf11da25657f417843bda9eeed0dc57b6dcddefe67c476b941c214764952eaf062e1177cb355fd50f1eefaa4b50eee2140d8b8cdf4b65b78d779f66c84cc7308a4847a779320daa24606cdc7670d42c5b69994cb0c92db274f4996d58c308107db395df2c9e501ad47660b0f9559e21358ecc14e3416eedd07a9e6fdc7c3039a4c1d5f873672185fd57085cc270aa5c6d004b7d1e9a7b807b633746572ea153e4ff172596865abbd35781f1af536b68d873f780362453d0d514e46841d813cfb060546dc1b1628f42dede3067cba5d247d613dcadc92dc023aedef5b279dec28a5a725eacfaba9671e2d6278402d3df0ad7ffff64369cc3381c845230fef9cbae39897a9c98dc8b286337c2bec39b2911d0a1845779d2c7423ab9fa4b42889c59a73b193e55993ca54bc361050795fc7205ac23572800a7d903d5c6d209626b962f9f93bef63f3b659fab6e90547cf63a8057f1e22ed8fb5cf02c4f1d6a2da7cc1f574aacbe60815e60338eb4dd103aa474c4028bae96d7b1caa2bc651da78172bd253ac701b6ea0f7e51fcdacaf4966ddba7b98f90021e3fd14e8864f079399172405cbf5d7aa9ddfe8470092404642716c9f7f3e6fd6778856b5c56b20cf3fc5e882ea6210d7693e1a2148713027d1d6da627c1b31f553a3c5efb0fbd295727da1a64557f53284c95360988326d3e1c83a5dbf0b2d75eb8de4c77ada8bdf993e5187d5e09d09f8db69086d75bc7dc78164eb757da1ac6144f892a32fbddcdfeb2ba3511cae3ca249495e11404df5418c2e99585cc56f9e2843d6b6116dc40781132632524860ada00be0be8ea11c1379cc49e14466b8138a3ad981632b3b033d5c78232ca7cb2c7ea5795bd900ee698bc1f680f58ffbe9ed35e12320a606205b12efaaea020f0794720d7a779210abf9151cfeba1728767e086f56ac7526990ba0d67292a7c1c1c886added0703ca31394afe48841268ef4a03d026ba3b4d685c753a7c85c87b29fc78db99cc05c1466655345aa88b978fc01d55a4c9505ce54b46d3ea73629ca234015577330320cef8b6d3fcc66c192e89fba5c2818e466700cb96e97ffb64212b8daa7502c48ddf3449adbed569c2c38d79978ff4a4e59779273ee4010ec0815d41b59a4eff14defd72e9b80b82f68e0114f5cebc9477b04e672250eb9c2dd7f5bdf3e8da23abd7f932d1fd109830d9b21a0ff42e1eccecd8371a69ccb365177c124ab3c90da5d6398c8fba3fdac78d1fb61154a7baadd830b9e413437cbf5cab0b714861c2f94971fcc4461b21a774ae7842bd671face9d8673258855977b5d9405fad449fc9f0d7c507a70d91f0a2e1ee8aebcf6eef14f207aa3323137097ceaa11984b59a101588983a2d16d38515f23bddeac0929c59fc523ed7dd1d30007405f70aaac2fb8c3f6daafa61e30a1ee29eac89d033f698cb12935bba225286b2f0701af0f5924e5ada2a39f082f532ea0197f3a46ea14fc4a5a79adc9618a8a6817761e5b534e235270be1e11d99cc8c3552b3da4320449c7b415313f7a80d37583279ea12aaa45d459aa2852d8a3cfd6af2f8fbfadb91681d72a1ed9c1d79c3c12d8650fff9a937ad301b8a1c92bb82ecbbe76abea7ab8b2856c260a79770e8bdd1cd60ab023191a615f7d5d5eb3d8fb719206658f20fbf2d919ca6d511c620e153bb357a8eb6806057712c21a9894cadb67e26f6e5f7f3ae795ccf5472415a9429d66789289bd4f5e50e585bf4275afda657f0ef94cc421f7d7f473d8ba9921a225d370fccc50a6824176dccd93be4b1c12d0a1471c86d187e3d40dd00dc5a61d88291bda07c4baafd4cf698674d0553ac15c179d13b6a4a06fc788645d0c115881845f30ef041a544da88b41ef1286b69c5f2179d93f0f21ccaf470c3d8a897a86c8b433a7d9cf4b750fe7e5cc2d7e3c9da4e511eaa131563bedfa49d208de5a32e30105c8bbacc27a7fe76c28370e81a22b840ed6299b460eaed7fa704a610d264c58cf93467ed62409ff883bc1eaa3b1d552755320e9c0059f5ed217e117e54a1b787e645e3505b0394644ab73a82cd828a854d9872fa083e830a1eeaaa0a47fbeff016eecae064a1adeaa26da99ea4e7145a6b3657490ef7c693b2146817f13b25850a8e7591ea08c373352534a5ef0af1e76d1c96efd7155c91a874a8aa0507489d90ef8fe3a52de7c39ed2ebd3fee83b764bc02fc082e4a2305557c3656ff5e6b4770138eaa6248073acf23a3aacfcedb4a7c354f33ab107d1120ba2e7ed90bc38b53a924ca64fbed6aaadc98120bf21339a5c80ad7424a446963d4eb58b3c959b746eba5242d9e876b5e8a85da6ea4a8ccaa05eea4c13c6877778298c05fe33e3be894de1b10f7e3d3be6bb6ff863be94162f34b3b8b96104ceb7cfb61fa9a7d2331a57dfcad9fa65408dc9e67b560eab5dc66c5b1ecf4d1bcdb4a707a6734930336161f35ab43844614a983f75ffaefe63884068203d51f6ba58b93b645cbe57d6a0e456e053c70e75665aea1bce17239789ebd91f07120058c2ab95d4c58c74fbf303121692e1f99a41055d77976095511438e97c4efb4f5a7c3f2a05ae0b767d7c8e1fbdecd41b3fc4607e3915fb4c365adb7aa2e6f111a8b8677b97ca52f20dfa8bdd48cb09fca20c6252099c24f0ee7e0abb490042be7db22b5d9ca20734490b04c52375f442499e35d8f1f2da8900b1cdb973d5dfec2b85a97019feb79feae378165cdc11574bfbe449fb3df5ac0123cae80930f82543c5a3c58b377a73aff6beda66e02623b3b0b755c8b8c65755e806813ba3f8426cdc63a94b6e5e8679fdc6e919100dcf0179390b2c8ef8cfe56551bf9c351e29869913ad92c3fdaae812f97d2c8e17efb413c249c89c3b11af18676937a0b2e1f9be4020fb050a215d12b57b018c237adbaf584826a8aeb8abcd5897d56a75bf57f88b7148974fe7eb16546df6d8c538543d912b9451f5bd4903b797bef903a09837dbc0db28ac867dfd179e97809906407257ba33277c0c87894b0fb761f9c2bbb383e42c72cfa322f13adf0f9e760f57623880414b8cc5a2943378a8c9e5f3c1103e7672413c028a41e6b91530592dbe86c2de36b3f041fb0237bbde3bb702659c8040eea18018074f9ee6e7553ecd5f9ef46f07ee6f7f9c518dee41c8f0d56a7c7189b4f88ee64fab0d9568811c470b22e6383bcf6a8820a3ac1eb62eff8b0e04d1af1b02972ea568047da4cb94bbf8bbab4b451bb5eca8d82a94db6c794f2a1464a333ecd7d757915e993078f82384519ca9f8195285b4c73f18a0d24d4abc4a7eefa853ca9f57fb1ff168ddca90e91940aa2d157e13f932ac1c4f932b282e171e1941751dc0887579e87aa0ca1a9455e974560459e6e1991b6853ad5e902be33e0ca9a580794593427863dd51dade75144bf2e9e6bdb3bfdf8d5a50d2b49626db427342cd609801d7ab8eebce31683e2e6759ac7bcaf1dad3056a50ae8620f7365e0b5ed434807cd808cb2922b6071a93b6b2994903288a0c82ae0a3dfbecce3c106e0bd38a0a8ccdc95d9c4e1e35a22abddfa4c52ea12ca44c04be079f0d4b9d9f1cf79fcd8bcca53f82ffecb363b72e10aae408c6980e873ffde0fbb827ac453cda55a76ce8131f4701479aa41e65476014be13b8db44ec102b67d7a84f723b6ed046c0021221e6697b20dc7d5f2a5c75dbef48a60d37e9888cde929dbcb43af9481b3807e1f79d7746e130fe2e70d1a5eec5e3401ab462b417bd6a609ebf87280e6c672bd14d51a2c5ed649183b62b4c46cb993050acc1e42d30ce2b446bafc8a9ce25b0208ea8aaa03c46570504bb1e84ed3a2b6fad7d5d07b286b8f59da6cd872ba0eb17c6e763710a96baef9d38c0e5191ae81802636de955dc952449625461492762e0e86340ec76059fb08172cc1aa6a4c3682b33cbf3eb8d0606a3fe8913e0a4f7fa225d041a85dfeb55fd4fb0ef40b4b104ad3c73566b7f2009dfca48761280cd5724a8cba023c73a356ab40e825c4268e0730fbb7c03dbaef30254dbccf0e81b057ddc51c0358ecacde145fbbeca5a92e42e1a3047abbf4d1cf1fcb34191af44184dd3f3da11ff02d3e61ab1bf4d6351402fe1f63c17c89884502fde6be0388a648a0ea729a5a7a1ecb29d1122e6fa921ba5b870be5a4ecbc0b4252da9f6fbe77b6baa001cecddeaae537128696eb588ff986c78e16b1963e413b205cbdcd28bae027ac5ace752853fb425954cb51437153c12d7517d75e29aa3c0d23193b4215dc6db4a71f9f5e15e1761baf5cb78a404c5e08bd0a51908a8f1071a9cc71b35326cdd6024b57d3834cbbaabf3e0e06d85ee268c5ac87dde7ad8bef015b9b4e7da116a7f1d879db14c06f9e9c96832bf09e1155b4cd14c3e8de08c5d3881e2b89119c933075af308d7334b6319ac627d679836b35bb84eb826da4a8e9cd50c9e40eb93d8f4cc8b6b88402448952b4acf1868806606bbad8817b8394c1e7355c2548057115ed89cb0ae8e53a44fe8d37c36bb13d358d1a9b3c38adcdfc0c20a606e1abb9ccef0fe8c2ff46079af9af74d4dfdb3dafc12558149995e5a9a2335b7f4bafeca1282241f590cbdeb653119e0f6a0c8e57c63afa31911f66833ec20ea1624b6e370bdd878b6ade09dc4fa4f0a79cdd6d91a207ab05c6993345319ab856ba966279a634e8d1d6c7aaed06f13cfb9028cfff6cf7bbadc1c4e5a86d36434299f7c5a6d8d2ea064ac412016e1c2c5db36b6b81af5a96f692956f4b3188218404a4f577ddefee18ec1c189cb59edbed11df1a2853510a8375de3373142141770250b94f3d36d206010753b5d4a10b96a66b25d4865288e28f2dfab8b6d8f92c60525754df0de357e57e8fdbb28d55bd7634a71a02976336bd7d5e54a1b37ee74529ad0ada3a3f586aeb15582f1455f56362309bb91c391ae3a33af10b29056e911e1020fa2c464e79604f53ec635dcae9ee0b61ec148de99c8dc096c1aabec170bc0dd7fd6a627e8bc3f329d0d1ee086d61119d859db1704eff353279805a271dd53974506f7a9bcf4a4990211ec7ab32312bbda581ba3af7f0b268101fbe4b10f730cfa888d5afcdf1009b79cccc25fc4d133be3de21e57c371d545f6b4065a5dc968772a931f8f9431618ca161b8abe23203eb4014560a74fb63d9ff2930515918d48c62f2a5215ff8aeaf76726387c8c24b9d12813c54ae41664b5ea0dc9d94e43400dd555c2de1c46c7a078357f040ebb63c0d4e0facc177153773de1d3f8cd6b9dbea6e35db2e8488a7331df54e507dcc27502b5212abff2eef747169a4bf34c9bd2b87e8dcec5475178536d31e47e196f9039d17a208861d75193e78d627de1e924e12752c830a77b88943eec367a808ab664e06c049da24511345bb0d2c3db455d055fbab5bb9a0a9425dbc1e3219db83a7ac251bbf9c02542478e025ad82ca06dcc470b90faa18b6ab4e17867a435e7e045a89615d9193e3f07c2c9b81f0360f29b922cfe4d4779f1c55abeb7ceae3ffc4efb8930d47536a899e9220be0fc78b3a89f1a2cc12771aeffa1028df0a7648d55a61b6ddb4953ff63850e47074082736fcf76bb34a730d11160b707a10c250034a124218dea283bcc49d0bd7805c2b5ad20b38ad2e3b4f7097519c07621dab112ee3cadec07fd7baf0e7b29d958d1466980831d8ab6bcd21a874", + "encryptionScheme" : { + "description" : "AESGCM-256", + "version" : 1 + }, + "keyDerivationScheme" : { + "description" : "HKDFSHA256-with-UTF8-encoding-of-password-no-salt-no-info", + "version" : 1 + }, + "version" : 1 + } + } + ], + "mnemonics" : [ + { + "factorSourceID" : { + "discriminator" : "fromHash", + "fromHash" : { + "body" : "c9e67a9028fb3150304c77992710c35c8e479d4fa59f7c45a96ce17f6fdf1d2c", + "kind" : "device" + } + }, + "mnemonicWithPassphrase" : { + "mnemonic" : "alley urge tag valid execute hat little funny armed salute orient hurt balcony urban found clip tennis wrong turtle canoe castle exist pledge test", + "passphrase" : "" + } + }, + { + "factorSourceID" : { + "discriminator" : "fromHash", + "fromHash" : { + "body" : "8bfacfe888d4e3819c6e9528a1c8f680a4ba73e466d7af4ee204591093006589", + "kind" : "device" + } + }, + "mnemonicWithPassphrase" : { + "mnemonic" : "gentle hawk winner rain embrace erosion call update photo frost fatal wrestle", + "passphrase" : "" + } + }, + { + "factorSourceID" : { + "discriminator" : "fromHash", + "fromHash" : { + "body" : "eda055ed256d156f62013da6cf5fb6104339b5c8666dd3f5512030950b1e3a29", + "kind" : "device" + } + }, + "mnemonicWithPassphrase" : { + "mnemonic" : "smile entry satisfy shed margin rubber disorder hungry foot error ribbon cradle aim round october blind lab spend", + "passphrase" : "" + } + } + ], + "plaintext" : { + "appPreferences" : { + "display" : { + "fiatCurrencyPriceTarget" : "usd", + "isCurrencyAmountVisible" : true + }, + "gateways" : { + "current" : "https://rcnet-v3.radixdlt.com/", + "saved" : [ + { + "network" : { + "displayDescription" : "RCnet-V3 test network", + "id" : 14, + "name" : "zabanet" + }, + "url" : "https://rcnet-v3.radixdlt.com/" + }, + { + "network" : { + "displayDescription" : "Mainnet", + "id" : 1, + "name" : "mainnet" + }, + "url" : "https://mainnet.radixdlt.com/" + }, + { + "network" : { + "displayDescription" : "Stokenet", + "id" : 2, + "name" : "stokenet" + }, + "url" : "https://babylon-stokenet-gateway.radixdlt.com" + } + ] + }, + "p2pLinks" : [ + { + "connectionPassword" : "0a54ab49f7c1dac68666945f8cffa17c596e65daa551d739ef6529edcf39d34f", + "displayName" : "Chrome" + } + ], + "security" : { + "isCloudProfileSyncEnabled" : true, + "isDeveloperModeEnabled" : true, + "structureConfigurationReferences" : [ + + ] + }, + "transaction" : { + "defaultDepositGuarantee" : "0.975" + }, + "resource": { + "resourceFlags": { + "resource_rdx1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxradxrd": [ + "deletedByUser" + ] + } + } + }, + "factorSources" : [ + { + "device" : { + "common" : { + "addedOn" : "2023-09-11T16:05:55Z", + "cryptoParameters" : { + "supportedCurves" : [ + "curve25519" + ], + "supportedDerivationPathSchemes" : [ + "cap26" + ] + }, + "flags" : [ + + ], + "lastUsedOn" : "2023-09-13T07:24:55Z" + }, + "hint" : { + "mnemonicWordCount" : 24, + "model" : "iPhone", + "name" : "iPhone" + }, + "id" : { + "body" : "c9e67a9028fb3150304c77992710c35c8e479d4fa59f7c45a96ce17f6fdf1d2c", + "kind" : "device" + } + }, + "discriminator" : "device" + }, + { + "device" : { + "common" : { + "addedOn" : "2023-09-11T16:23:40Z", + "cryptoParameters" : { + "supportedCurves" : [ + "curve25519", + "secp256k1" + ], + "supportedDerivationPathSchemes" : [ + "cap26", + "bip44Olympia" + ] + }, + "flags" : [ + + ], + "lastUsedOn" : "2023-09-11T17:17:46Z" + }, + "hint" : { + "mnemonicWordCount" : 12, + "model" : "", + "name" : "" + }, + "id" : { + "body" : "8bfacfe888d4e3819c6e9528a1c8f680a4ba73e466d7af4ee204591093006589", + "kind" : "device" + } + }, + "discriminator" : "device" + }, + { + "device" : { + "common" : { + "addedOn" : "2023-09-11T16:26:44Z", + "cryptoParameters" : { + "supportedCurves" : [ + "curve25519", + "secp256k1" + ], + "supportedDerivationPathSchemes" : [ + "cap26", + "bip44Olympia" + ] + }, + "flags" : [ + + ], + "lastUsedOn" : "2023-09-11T17:18:33Z" + }, + "hint" : { + "mnemonicWordCount" : 18, + "model" : "", + "name" : "" + }, + "id" : { + "body" : "eda055ed256d156f62013da6cf5fb6104339b5c8666dd3f5512030950b1e3a29", + "kind" : "device" + } + }, + "discriminator" : "device" + }, + { + "discriminator" : "ledgerHQHardwareWallet", + "ledgerHQHardwareWallet" : { + "common" : { + "addedOn" : "2023-09-11T16:35:08Z", + "cryptoParameters" : { + "supportedCurves" : [ + "curve25519", + "secp256k1" + ], + "supportedDerivationPathSchemes" : [ + "cap26", + "bip44Olympia" + ] + }, + "flags" : [ + + ], + "lastUsedOn" : "2023-09-11T17:19:41Z" + }, + "hint" : { + "model" : "nanoS", + "name" : "Scratched 24" + }, + "id" : { + "body" : "41ac202687326a4fc6cb677e9fd92d08b91ce46c669950d58790d4d5e583adc0", + "kind" : "ledgerHQHardwareWallet" + } + } + }, + { + "discriminator" : "ledgerHQHardwareWallet", + "ledgerHQHardwareWallet" : { + "common" : { + "addedOn" : "2023-09-11T16:38:12Z", + "cryptoParameters" : { + "supportedCurves" : [ + "curve25519", + "secp256k1" + ], + "supportedDerivationPathSchemes" : [ + "cap26", + "bip44Olympia" + ] + }, + "flags" : [ + + ], + "lastUsedOn" : "2023-09-11T19:51:11Z" + }, + "hint" : { + "model" : "nanoS+", + "name" : "Orange 25" + }, + "id" : { + "body" : "9e2e0a2b4b96e8729f5553ffa8865eaac10088569ef8bcd7b3fa61b89fde1764", + "kind" : "ledgerHQHardwareWallet" + } + } + } + ], + "header" : { + "contentHint" : { + "numberOfAccountsOnAllNetworksInTotal" : 16, + "numberOfNetworks" : 3, + "numberOfPersonasOnAllNetworksInTotal" : 3 + }, + "creatingDevice" : { + "date" : "2023-09-11T16:05:55Z", + "description" : "iPhone (iPhone)", + "id" : "66F07CA2-A9D9-49E5-8152-77ACA3D1DD74" + }, + "id" : "E5E4477B-E47B-4B64-BBC8-F8F40E8BEB74", + "lastModified" : "2023-09-13T07:24:55Z", + "lastUsedOnDevice" : { + "date" : "2023-09-11T17:14:40Z", + "description" : "iPhone (iPhone)", + "id" : "66F07CA2-A9D9-49E5-8152-77ACA3D1DD74" + }, + "snapshotVersion" : 100 + }, + "networks" : [ + { + "accounts" : [ + { + "address" : "account_tdx_e_128vkt2fur65p4hqhulfv3h0cknrppwtjsstlttkfamj4jnnpm82gsw", + "appearanceID" : 0, + "displayName" : "Zaba 0", + "flags" : [ + "deletedByUser" + ], + "networkID" : 14, + "onLedgerSettings" : { + "thirdPartyDeposits" : { + "assetsExceptionList" : [ + + ], + "depositorsAllowList" : [ + + ], + "depositRule" : "acceptAll" + } + }, + "securityState" : { + "discriminator" : "unsecured", + "unsecuredEntityControl" : { + "transactionSigning" : { + "badge" : { + "discriminator" : "virtualSource", + "virtualSource" : { + "discriminator" : "hierarchicalDeterministicPublicKey", + "hierarchicalDeterministicPublicKey" : { + "derivationPath" : { + "path" : "m/44H/1022H/14H/525H/1460H/0H", + "scheme" : "cap26" + }, + "publicKey" : { + "compressedData" : "3feb8194ead2e526fbcc4c1673a7a8b29d8cee0b32bb9393692f739821dd256b", + "curve" : "curve25519" + } + } + } + }, + "factorSourceID" : { + "discriminator" : "fromHash", + "fromHash" : { + "body" : "c9e67a9028fb3150304c77992710c35c8e479d4fa59f7c45a96ce17f6fdf1d2c", + "kind" : "device" + } + } + } + } + } + }, + { + "address" : "account_tdx_e_129fj4fqmz2ldej5lg2hx9laty9s6464snr6ly0243p32jmd757yke7", + "appearanceID" : 1, + "displayName" : "Zaba 1", + "flags" : [ + "deletedByUser" + ], + "networkID" : 14, + "onLedgerSettings" : { + "thirdPartyDeposits" : { + "assetsExceptionList" : [ + + ], + "depositorsAllowList" : [ + + ], + "depositRule" : "acceptAll" + } + }, + "securityState" : { + "discriminator" : "unsecured", + "unsecuredEntityControl" : { + "transactionSigning" : { + "badge" : { + "discriminator" : "virtualSource", + "virtualSource" : { + "discriminator" : "hierarchicalDeterministicPublicKey", + "hierarchicalDeterministicPublicKey" : { + "derivationPath" : { + "path" : "m/44H/1022H/14H/525H/1460H/1H", + "scheme" : "cap26" + }, + "publicKey" : { + "compressedData" : "3c04690f4ad8890bfdf5a62bac2843b8ee79ab335c9bf4ed1e786ff676709413", + "curve" : "curve25519" + } + } + } + }, + "factorSourceID" : { + "discriminator" : "fromHash", + "fromHash" : { + "body" : "c9e67a9028fb3150304c77992710c35c8e479d4fa59f7c45a96ce17f6fdf1d2c", + "kind" : "device" + } + } + } + } + } + }, + { + "address" : "account_tdx_e_129enl4x6w6mz6nlh9y4hszx6zwfvv3q80keqdzqkewvltugp8g6g7v", + "appearanceID" : 2, + "displayName" : "Zaba 2", + "flags" : [ + "deletedByUser" + ], + "networkID" : 14, + "onLedgerSettings" : { + "thirdPartyDeposits" : { + "assetsExceptionList" : [ + + ], + "depositorsAllowList" : [ + + ], + "depositRule" : "acceptAll" + } + }, + "securityState" : { + "discriminator" : "unsecured", + "unsecuredEntityControl" : { + "transactionSigning" : { + "badge" : { + "discriminator" : "virtualSource", + "virtualSource" : { + "discriminator" : "hierarchicalDeterministicPublicKey", + "hierarchicalDeterministicPublicKey" : { + "derivationPath" : { + "path" : "m/44H/1022H/14H/525H/1460H/2H", + "scheme" : "cap26" + }, + "publicKey" : { + "compressedData" : "fe6368cf2907d0da61a68c31e461213b8e56ba84f1cfbdb4d79311fce331b7ee", + "curve" : "curve25519" + } + } + } + }, + "factorSourceID" : { + "discriminator" : "fromHash", + "fromHash" : { + "body" : "c9e67a9028fb3150304c77992710c35c8e479d4fa59f7c45a96ce17f6fdf1d2c", + "kind" : "device" + } + } + } + } + } + }, + { + "address" : "account_tdx_e_169s2cfz044euhc4yjg4xe4pg55w97rq2c6jh50zsdcpuz5gk6cag6v", + "appearanceID" : 3, + "displayName" : "Olympia|Soft|0", + "flags" : [ + "deletedByUser" + ], + "networkID" : 14, + "onLedgerSettings" : { + "thirdPartyDeposits" : { + "assetsExceptionList" : [ + + ], + "depositorsAllowList" : [ + + ], + "depositRule" : "acceptAll" + } + }, + "securityState" : { + "discriminator" : "unsecured", + "unsecuredEntityControl" : { + "transactionSigning" : { + "badge" : { + "discriminator" : "virtualSource", + "virtualSource" : { + "discriminator" : "hierarchicalDeterministicPublicKey", + "hierarchicalDeterministicPublicKey" : { + "derivationPath" : { + "path" : "m/44H/1022H/0H/0/0H", + "scheme" : "bip44Olympia" + }, + "publicKey" : { + "compressedData" : "02f669a43024d90fde69351ccc53022c2f86708d9b3c42693640733c5778235da5", + "curve" : "secp256k1" + } + } + } + }, + "factorSourceID" : { + "discriminator" : "fromHash", + "fromHash" : { + "body" : "8bfacfe888d4e3819c6e9528a1c8f680a4ba73e466d7af4ee204591093006589", + "kind" : "device" + } + } + } + } + } + }, + { + "address" : "account_tdx_e_16x88ghu9hd3hz4c9gumqjafrcwqtzk67wmpds7xg6uaz0kf42v5hju", + "appearanceID" : 4, + "displayName" : "Olympia|Soft|1", + "flags" : [ + "deletedByUser" + ], + "networkID" : 14, + "onLedgerSettings" : { + "thirdPartyDeposits" : { + "assetsExceptionList" : [ + + ], + "depositorsAllowList" : [ + + ], + "depositRule" : "acceptAll" + } + }, + "securityState" : { + "discriminator" : "unsecured", + "unsecuredEntityControl" : { + "transactionSigning" : { + "badge" : { + "discriminator" : "virtualSource", + "virtualSource" : { + "discriminator" : "hierarchicalDeterministicPublicKey", + "hierarchicalDeterministicPublicKey" : { + "derivationPath" : { + "path" : "m/44H/1022H/0H/0/1H", + "scheme" : "bip44Olympia" + }, + "publicKey" : { + "compressedData" : "023a41f437972033fa83c3c4df08dc7d68212ccac07396a29aca971ad5ba3c27c8", + "curve" : "secp256k1" + } + } + } + }, + "factorSourceID" : { + "discriminator" : "fromHash", + "fromHash" : { + "body" : "8bfacfe888d4e3819c6e9528a1c8f680a4ba73e466d7af4ee204591093006589", + "kind" : "device" + } + } + } + } + } + }, + { + "address" : "account_tdx_e_16yszyl5pd54vdqm4wyazdgtr7j3d5cl33gew3mzy6r9443am5dlsr7", + "appearanceID" : 5, + "displayName" : "S18 | Sajjon | 1", + "flags" : [ + "deletedByUser" + ], + "networkID" : 14, + "onLedgerSettings" : { + "thirdPartyDeposits" : { + "assetsExceptionList" : [ + + ], + "depositorsAllowList" : [ + + ], + "depositRule" : "acceptAll" + } + }, + "securityState" : { + "discriminator" : "unsecured", + "unsecuredEntityControl" : { + "transactionSigning" : { + "badge" : { + "discriminator" : "virtualSource", + "virtualSource" : { + "discriminator" : "hierarchicalDeterministicPublicKey", + "hierarchicalDeterministicPublicKey" : { + "derivationPath" : { + "path" : "m/44H/1022H/0H/0/1H", + "scheme" : "bip44Olympia" + }, + "publicKey" : { + "compressedData" : "0233dc38ad9e8fca2653563199e793ee8d8a1a5071d1fc2996a6c51c9b86b36d8a", + "curve" : "secp256k1" + } + } + } + }, + "factorSourceID" : { + "discriminator" : "fromHash", + "fromHash" : { + "body" : "eda055ed256d156f62013da6cf5fb6104339b5c8666dd3f5512030950b1e3a29", + "kind" : "device" + } + } + } + } + } + }, + { + "address" : "account_tdx_e_16ysdhjfehs8t80u4ew3w3f8yygkx7v3h3erptrzjacv86sn9l3feln", + "appearanceID" : 6, + "displayName" : "S18 | Sajjon | 3", + "flags" : [ + "deletedByUser" + ], + "networkID" : 14, + "onLedgerSettings" : { + "thirdPartyDeposits" : { + "assetsExceptionList" : [ + + ], + "depositorsAllowList" : [ + + ], + "depositRule" : "acceptAll" + } + }, + "securityState" : { + "discriminator" : "unsecured", + "unsecuredEntityControl" : { + "transactionSigning" : { + "badge" : { + "discriminator" : "virtualSource", + "virtualSource" : { + "discriminator" : "hierarchicalDeterministicPublicKey", + "hierarchicalDeterministicPublicKey" : { + "derivationPath" : { + "path" : "m/44H/1022H/0H/0/3H", + "scheme" : "bip44Olympia" + }, + "publicKey" : { + "compressedData" : "035e86fc1679aefcb186a3c758503aa146e2a4e730e84daf6fd735861ccd5d8978", + "curve" : "secp256k1" + } + } + } + }, + "factorSourceID" : { + "discriminator" : "fromHash", + "fromHash" : { + "body" : "eda055ed256d156f62013da6cf5fb6104339b5c8666dd3f5512030950b1e3a29", + "kind" : "device" + } + } + } + } + } + }, + { + "address" : "account_tdx_e_16x5wz8wmkumuhn49klq0zwgjn9d8xs7n95maxam04vawld2drf2dkj", + "appearanceID" : 7, + "displayName" : "0|RDX|Dev Nano S|Some very lon", + "flags" : [ + "deletedByUser" + ], + "networkID" : 14, + "onLedgerSettings" : { + "thirdPartyDeposits" : { + "assetsExceptionList" : [ + + ], + "depositorsAllowList" : [ + + ], + "depositRule" : "acceptAll" + } + }, + "securityState" : { + "discriminator" : "unsecured", + "unsecuredEntityControl" : { + "transactionSigning" : { + "badge" : { + "discriminator" : "virtualSource", + "virtualSource" : { + "discriminator" : "hierarchicalDeterministicPublicKey", + "hierarchicalDeterministicPublicKey" : { + "derivationPath" : { + "path" : "m/44H/1022H/0H/0/0H", + "scheme" : "bip44Olympia" + }, + "publicKey" : { + "compressedData" : "03f43fba6541031ef2195f5ba96677354d28147e45b40cde4662bec9162c361f55", + "curve" : "secp256k1" + } + } + } + }, + "factorSourceID" : { + "discriminator" : "fromHash", + "fromHash" : { + "body" : "41ac202687326a4fc6cb677e9fd92d08b91ce46c669950d58790d4d5e583adc0", + "kind" : "ledgerHQHardwareWallet" + } + } + } + } + } + }, + { + "address" : "account_tdx_e_16y6q3q6ey64j5qvkex3q0yshtln6z2lmyk254xrjcq393rc070x66z", + "appearanceID" : 8, + "displayName" : "1|RDX|Dev Nano S|Forbidden ___", + "flags" : [ + "deletedByUser" + ], + "networkID" : 14, + "onLedgerSettings" : { + "thirdPartyDeposits" : { + "assetsExceptionList" : [ + + ], + "depositorsAllowList" : [ + + ], + "depositRule" : "acceptAll" + } + }, + "securityState" : { + "discriminator" : "unsecured", + "unsecuredEntityControl" : { + "transactionSigning" : { + "badge" : { + "discriminator" : "virtualSource", + "virtualSource" : { + "discriminator" : "hierarchicalDeterministicPublicKey", + "hierarchicalDeterministicPublicKey" : { + "derivationPath" : { + "path" : "m/44H/1022H/0H/0/1H", + "scheme" : "bip44Olympia" + }, + "publicKey" : { + "compressedData" : "0206ea8842365421f48ab84e6b1b197010e5a43a527952b11bc6efe772965e97cc", + "curve" : "secp256k1" + } + } + } + }, + "factorSourceID" : { + "discriminator" : "fromHash", + "fromHash" : { + "body" : "41ac202687326a4fc6cb677e9fd92d08b91ce46c669950d58790d4d5e583adc0", + "kind" : "ledgerHQHardwareWallet" + } + } + } + } + } + }, + { + "address" : "account_tdx_e_16yyhtwlwrtpdqe2jufg2xw2289j4dtnk542dm69m7h89l4x5xm60k7", + "appearanceID" : 9, + "displayName" : "Shadow 25 | 0", + "flags" : [ + "deletedByUser" + ], + "networkID" : 14, + "onLedgerSettings" : { + "thirdPartyDeposits" : { + "assetsExceptionList" : [ + + ], + "depositorsAllowList" : [ + + ], + "depositRule" : "acceptAll" + } + }, + "securityState" : { + "discriminator" : "unsecured", + "unsecuredEntityControl" : { + "transactionSigning" : { + "badge" : { + "discriminator" : "virtualSource", + "virtualSource" : { + "discriminator" : "hierarchicalDeterministicPublicKey", + "hierarchicalDeterministicPublicKey" : { + "derivationPath" : { + "path" : "m/44H/1022H/0H/0/0H", + "scheme" : "bip44Olympia" + }, + "publicKey" : { + "compressedData" : "0220e2ef980a86888800573b0f5a30492549c88c1808821475c828aeccdca4cc5a", + "curve" : "secp256k1" + } + } + } + }, + "factorSourceID" : { + "discriminator" : "fromHash", + "fromHash" : { + "body" : "9e2e0a2b4b96e8729f5553ffa8865eaac10088569ef8bcd7b3fa61b89fde1764", + "kind" : "ledgerHQHardwareWallet" + } + } + } + } + } + }, + { + "address" : "account_tdx_e_169cdlneks2wrrmg82cc36xqtx2ng8qjtkpe0j3sfzddl0xje47janr", + "appearanceID" : 10, + "displayName" : "Shadow 25 | 1", + "flags" : [ + "deletedByUser" + ], + "networkID" : 14, + "onLedgerSettings" : { + "thirdPartyDeposits" : { + "assetsExceptionList" : [ + + ], + "depositorsAllowList" : [ + + ], + "depositRule" : "acceptAll" + } + }, + "securityState" : { + "discriminator" : "unsecured", + "unsecuredEntityControl" : { + "transactionSigning" : { + "badge" : { + "discriminator" : "virtualSource", + "virtualSource" : { + "discriminator" : "hierarchicalDeterministicPublicKey", + "hierarchicalDeterministicPublicKey" : { + "derivationPath" : { + "path" : "m/44H/1022H/0H/0/1H", + "scheme" : "bip44Olympia" + }, + "publicKey" : { + "compressedData" : "034a8a2ee1801d91cf8c9157d8694ae0d8d2c9563021a9764a34580493f75d0c75", + "curve" : "secp256k1" + } + } + } + }, + "factorSourceID" : { + "discriminator" : "fromHash", + "fromHash" : { + "body" : "9e2e0a2b4b96e8729f5553ffa8865eaac10088569ef8bcd7b3fa61b89fde1764", + "kind" : "ledgerHQHardwareWallet" + } + } + } + } + } + }, + { + "address" : "account_tdx_e_12yavnpctf6l2dw76tazge90kkufzks45vq6u28vvarse6cyra5stuv", + "appearanceID" : 11, + "displayName" : "Babylon Ledger 24", + "flags" : [ + "deletedByUser" + ], + "networkID" : 14, + "onLedgerSettings" : { + "thirdPartyDeposits" : { + "assetsExceptionList" : [ + + ], + "depositorsAllowList" : [ + + ], + "depositRule" : "acceptAll" + } + }, + "securityState" : { + "discriminator" : "unsecured", + "unsecuredEntityControl" : { + "transactionSigning" : { + "badge" : { + "discriminator" : "virtualSource", + "virtualSource" : { + "discriminator" : "hierarchicalDeterministicPublicKey", + "hierarchicalDeterministicPublicKey" : { + "derivationPath" : { + "path" : "m/44H/1022H/14H/525H/1460H/11H", + "scheme" : "cap26" + }, + "publicKey" : { + "compressedData" : "d24228459e0000d91b7256cac6fd8f9b0cb30dfef209db201912fb0b8d710edb", + "curve" : "curve25519" + } + } + } + }, + "factorSourceID" : { + "discriminator" : "fromHash", + "fromHash" : { + "body" : "41ac202687326a4fc6cb677e9fd92d08b91ce46c669950d58790d4d5e583adc0", + "kind" : "ledgerHQHardwareWallet" + } + } + } + } + } + }, + { + "address" : "account_tdx_e_128duqx53e4e6hpz4vxkm9qskpqgu8un0p49gm2t8lfcsfxl9vej4eg", + "appearanceID" : 0, + "displayName" : "Babylon ledger 25", + "flags" : [ + + ], + "networkID" : 14, + "onLedgerSettings" : { + "thirdPartyDeposits" : { + "assetsExceptionList" : [ + + ], + "depositorsAllowList" : [ + + ], + "depositRule" : "acceptAll" + } + }, + "securityState" : { + "discriminator" : "unsecured", + "unsecuredEntityControl" : { + "transactionSigning" : { + "badge" : { + "discriminator" : "virtualSource", + "virtualSource" : { + "discriminator" : "hierarchicalDeterministicPublicKey", + "hierarchicalDeterministicPublicKey" : { + "derivationPath" : { + "path" : "m/44H/1022H/14H/525H/1460H/12H", + "scheme" : "cap26" + }, + "publicKey" : { + "compressedData" : "7d918320fdd9d4102f2392aec4a6c43e959645cb525b4bd407cbc9c5bac00495", + "curve" : "curve25519" + } + } + } + }, + "factorSourceID" : { + "discriminator" : "fromHash", + "fromHash" : { + "body" : "9e2e0a2b4b96e8729f5553ffa8865eaac10088569ef8bcd7b3fa61b89fde1764", + "kind" : "ledgerHQHardwareWallet" + } + } + } + } + } + } + ], + "authorizedDapps" : [ + { + "dAppDefinitionAddress" : "account_tdx_e_128uml7z6mqqqtm035t83alawc3jkvap9sxavecs35ud3ct20jxxuhl", + "displayName" : "Gumball Club", + "networkID" : 14, + "referencesToAuthorizedPersonas" : [ + { + "identityAddress" : "identity_tdx_e_122k9saakdjazzwm98rlpjlwewy0wvx0csmtvstdut528r0t0z8cy30", + "lastLogin" : "2023-09-13T07:24:41Z", + "sharedAccounts" : { + "ids" : [ + "account_tdx_e_128vkt2fur65p4hqhulfv3h0cknrppwtjsstlttkfamj4jnnpm82gsw", + "account_tdx_e_129fj4fqmz2ldej5lg2hx9laty9s6464snr6ly0243p32jmd757yke7", + "account_tdx_e_129enl4x6w6mz6nlh9y4hszx6zwfvv3q80keqdzqkewvltugp8g6g7v", + "account_tdx_e_169s2cfz044euhc4yjg4xe4pg55w97rq2c6jh50zsdcpuz5gk6cag6v", + "account_tdx_e_16x88ghu9hd3hz4c9gumqjafrcwqtzk67wmpds7xg6uaz0kf42v5hju", + "account_tdx_e_16yszyl5pd54vdqm4wyazdgtr7j3d5cl33gew3mzy6r9443am5dlsr7", + "account_tdx_e_16ysdhjfehs8t80u4ew3w3f8yygkx7v3h3erptrzjacv86sn9l3feln", + "account_tdx_e_16x5wz8wmkumuhn49klq0zwgjn9d8xs7n95maxam04vawld2drf2dkj", + "account_tdx_e_16y6q3q6ey64j5qvkex3q0yshtln6z2lmyk254xrjcq393rc070x66z", + "account_tdx_e_16yyhtwlwrtpdqe2jufg2xw2289j4dtnk542dm69m7h89l4x5xm60k7", + "account_tdx_e_169cdlneks2wrrmg82cc36xqtx2ng8qjtkpe0j3sfzddl0xje47janr", + "account_tdx_e_12yavnpctf6l2dw76tazge90kkufzks45vq6u28vvarse6cyra5stuv", + "account_tdx_e_128duqx53e4e6hpz4vxkm9qskpqgu8un0p49gm2t8lfcsfxl9vej4eg" + ], + "request" : { + "quantifier" : "atLeast", + "quantity" : 1 + } + }, + "sharedPersonaData" : { + + } + } + ] + }, + { + "dAppDefinitionAddress" : "account_tdx_e_168ydk240yx69yl7zdz2mzkdjc3r5p6n4gwypqsype2d6d942m5z2ns", + "displayName" : "Radix Sandbox dApp", + "networkID" : 14, + "referencesToAuthorizedPersonas" : [ + { + "identityAddress" : "identity_tdx_e_122k9saakdjazzwm98rlpjlwewy0wvx0csmtvstdut528r0t0z8cy30", + "lastLogin" : "2023-09-11T17:55:07Z", + "sharedAccounts" : { + "ids" : [ + "account_tdx_e_16y6q3q6ey64j5qvkex3q0yshtln6z2lmyk254xrjcq393rc070x66z", + "account_tdx_e_12yavnpctf6l2dw76tazge90kkufzks45vq6u28vvarse6cyra5stuv", + "account_tdx_e_128duqx53e4e6hpz4vxkm9qskpqgu8un0p49gm2t8lfcsfxl9vej4eg", + "account_tdx_e_128vkt2fur65p4hqhulfv3h0cknrppwtjsstlttkfamj4jnnpm82gsw", + "account_tdx_e_16yyhtwlwrtpdqe2jufg2xw2289j4dtnk542dm69m7h89l4x5xm60k7" + ], + "request" : { + "quantifier" : "exactly", + "quantity" : 5 + } + }, + "sharedPersonaData" : { + "name" : "D264960B-1E2B-4E40-AD50-D281B9DBB6D1" + } + } + ] + }, + { + "dAppDefinitionAddress" : "account_tdx_e_16xygyhqp3x3awxlz3c5dzrm7jqghgpgs776v4af0yfr7xljqmna3ha", + "displayName" : "Radix Dashboard", + "networkID" : 14, + "referencesToAuthorizedPersonas" : [ + { + "identityAddress" : "identity_tdx_e_122k9saakdjazzwm98rlpjlwewy0wvx0csmtvstdut528r0t0z8cy30", + "lastLogin" : "2023-09-11T17:57:57Z", + "sharedAccounts" : { + "ids" : [ + "account_tdx_e_128vkt2fur65p4hqhulfv3h0cknrppwtjsstlttkfamj4jnnpm82gsw", + "account_tdx_e_129fj4fqmz2ldej5lg2hx9laty9s6464snr6ly0243p32jmd757yke7", + "account_tdx_e_129enl4x6w6mz6nlh9y4hszx6zwfvv3q80keqdzqkewvltugp8g6g7v", + "account_tdx_e_169s2cfz044euhc4yjg4xe4pg55w97rq2c6jh50zsdcpuz5gk6cag6v", + "account_tdx_e_16x88ghu9hd3hz4c9gumqjafrcwqtzk67wmpds7xg6uaz0kf42v5hju", + "account_tdx_e_16yszyl5pd54vdqm4wyazdgtr7j3d5cl33gew3mzy6r9443am5dlsr7", + "account_tdx_e_16ysdhjfehs8t80u4ew3w3f8yygkx7v3h3erptrzjacv86sn9l3feln", + "account_tdx_e_16x5wz8wmkumuhn49klq0zwgjn9d8xs7n95maxam04vawld2drf2dkj", + "account_tdx_e_16y6q3q6ey64j5qvkex3q0yshtln6z2lmyk254xrjcq393rc070x66z", + "account_tdx_e_16yyhtwlwrtpdqe2jufg2xw2289j4dtnk542dm69m7h89l4x5xm60k7", + "account_tdx_e_169cdlneks2wrrmg82cc36xqtx2ng8qjtkpe0j3sfzddl0xje47janr", + "account_tdx_e_12yavnpctf6l2dw76tazge90kkufzks45vq6u28vvarse6cyra5stuv", + "account_tdx_e_128duqx53e4e6hpz4vxkm9qskpqgu8un0p49gm2t8lfcsfxl9vej4eg" + ], + "request" : { + "quantifier" : "atLeast", + "quantity" : 1 + } + }, + "sharedPersonaData" : { + + } + } + ] + } + ], + "networkID" : 14, + "personas" : [ + { + "address" : "identity_tdx_e_122k9saakdjazzwm98rlpjlwewy0wvx0csmtvstdut528r0t0z8cy30", + "displayName" : "Sajjon", + "flags" : [ + + ], + "networkID" : 14, + "personaData" : { + "creditCards" : [ + + ], + "emailAddresses" : [ + { + "id" : "8D8AB282-AB20-4D07-8461-06A31553AF1C", + "value" : "alex@cyon.com" + } + ], + "name" : { + "id" : "D264960B-1E2B-4E40-AD50-D281B9DBB6D1", + "value" : { + "familyName" : "Alexander ", + "givenNames" : "Cyon", + "nickname" : "Alex", + "variant" : "western" + } + }, + "phoneNumbers" : [ + { + "id" : "F30A2A14-E25F-4597-8A49-E74FEDB10F44", + "value" : "0700838198" + } + ], + "postalAddresses" : [ + + ], + "urls" : [ + + ] + }, + "securityState" : { + "discriminator" : "unsecured", + "unsecuredEntityControl" : { + "transactionSigning" : { + "badge" : { + "discriminator" : "virtualSource", + "virtualSource" : { + "discriminator" : "hierarchicalDeterministicPublicKey", + "hierarchicalDeterministicPublicKey" : { + "derivationPath" : { + "path" : "m/44H/1022H/14H/618H/1460H/0H", + "scheme" : "cap26" + }, + "publicKey" : { + "compressedData" : "3c9f6a080e75c28e9210bf53fee777e3f943852790b2c016dc699e46d041477e", + "curve" : "curve25519" + } + } + } + }, + "factorSourceID" : { + "discriminator" : "fromHash", + "fromHash" : { + "body" : "c9e67a9028fb3150304c77992710c35c8e479d4fa59f7c45a96ce17f6fdf1d2c", + "kind" : "device" + } + } + } + } + } + } + ] + }, + { + "accounts" : [ + { + "address" : "account_tdx_2_12ygsf87pma439ezvdyervjfq2nhqme6reau6kcxf6jtaysaxl7sqvd", + "appearanceID" : 0, + "displayName" : "Stokenet", + "flags" : [ + "deletedByUser" + ], + "networkID" : 2, + "onLedgerSettings" : { + "thirdPartyDeposits" : { + "assetsExceptionList" : [ + + ], + "depositorsAllowList" : [ + + ], + "depositRule" : "acceptAll" + } + }, + "securityState" : { + "discriminator" : "unsecured", + "unsecuredEntityControl" : { + "transactionSigning" : { + "badge" : { + "discriminator" : "virtualSource", + "virtualSource" : { + "discriminator" : "hierarchicalDeterministicPublicKey", + "hierarchicalDeterministicPublicKey" : { + "derivationPath" : { + "path" : "m/44H/1022H/2H/525H/1460H/0H", + "scheme" : "cap26" + }, + "publicKey" : { + "compressedData" : "1145c0041719f2640333ebdfa6652b8399bd73f9205af8a94beb25f6375b5900", + "curve" : "curve25519" + } + } + } + }, + "factorSourceID" : { + "discriminator" : "fromHash", + "fromHash" : { + "body" : "c9e67a9028fb3150304c77992710c35c8e479d4fa59f7c45a96ce17f6fdf1d2c", + "kind" : "device" + } + } + } + } + } + }, + { + "address" : "account_tdx_2_12yymsmxapnaulngrepgdyzlaszflhcynchr2s95nkjfrsfuzq02s8m", + "appearanceID" : 1, + "displayName" : "Stoke on trent!", + "flags" : [ + "deletedByUser" + ], + "networkID" : 2, + "onLedgerSettings" : { + "thirdPartyDeposits" : { + "assetsExceptionList" : [ + + ], + "depositorsAllowList" : [ + + ], + "depositRule" : "acceptAll" + } + }, + "securityState" : { + "discriminator" : "unsecured", + "unsecuredEntityControl" : { + "transactionSigning" : { + "badge" : { + "discriminator" : "virtualSource", + "virtualSource" : { + "discriminator" : "hierarchicalDeterministicPublicKey", + "hierarchicalDeterministicPublicKey" : { + "derivationPath" : { + "path" : "m/44H/1022H/2H/525H/1460H/1H", + "scheme" : "cap26" + }, + "publicKey" : { + "compressedData" : "eda9a63d679d6ba3d3c3b1b1e970de9ec3531cc19e2a523375d9654db4a18b75", + "curve" : "curve25519" + } + } + } + }, + "factorSourceID" : { + "discriminator" : "fromHash", + "fromHash" : { + "body" : "c9e67a9028fb3150304c77992710c35c8e479d4fa59f7c45a96ce17f6fdf1d2c", + "kind" : "device" + } + } + } + } + } + } + ], + "authorizedDapps" : [ + + ], + "networkID" : 2, + "personas" : [ + { + "address" : "identity_tdx_2_1224clayjwq45swgd0xj2uc4s3gq4l6g7q77f9d290su4flufq2lt9j", + "displayName" : "Stokeman", + "flags" : [ + "deletedByUser" + ], + "networkID" : 2, + "personaData" : { + "creditCards" : [ + + ], + "emailAddresses" : [ + + ], + "phoneNumbers" : [ + + ], + "postalAddresses" : [ + + ], + "urls" : [ + + ] + }, + "securityState" : { + "discriminator" : "unsecured", + "unsecuredEntityControl" : { + "transactionSigning" : { + "badge" : { + "discriminator" : "virtualSource", + "virtualSource" : { + "discriminator" : "hierarchicalDeterministicPublicKey", + "hierarchicalDeterministicPublicKey" : { + "derivationPath" : { + "path" : "m/44H/1022H/2H/618H/1460H/0H", + "scheme" : "cap26" + }, + "publicKey" : { + "compressedData" : "679152f01032dc15895247a394d622d31342017951471922ba8170e0ee4fb90c", + "curve" : "curve25519" + } + } + } + }, + "factorSourceID" : { + "discriminator" : "fromHash", + "fromHash" : { + "body" : "c9e67a9028fb3150304c77992710c35c8e479d4fa59f7c45a96ce17f6fdf1d2c", + "kind" : "device" + } + } + } + } + } + }, + { + "address" : "identity_tdx_2_122tvh7nq6jd2mp7l8ar5kayc3wr5u5z5pew9r86vtvlwnsydx80pne", + "displayName" : "Dan", + "flags" : [ + "deletedByUser" + ], + "networkID" : 2, + "personaData" : { + "creditCards" : [ + + ], + "emailAddresses" : [ + { + "id" : "F6CFE950-100C-4696-9AA2-68766D10B6BE", + "value" : "dan@stoke.com" + } + ], + "name" : { + "id" : "B114A7B6-6FE3-41B6-8CE6-CE16148ED1D7", + "value" : { + "familyName" : "Hughes", + "givenNames" : "Dan", + "nickname" : "Fuserleer", + "variant" : "western" + } + }, + "phoneNumbers" : [ + { + "id" : "FB3E1AC2-FCC7-474C-82A2-600E1A2D69E9", + "value" : "1337" + } + ], + "postalAddresses" : [ + + ], + "urls" : [ + + ] + }, + "securityState" : { + "discriminator" : "unsecured", + "unsecuredEntityControl" : { + "transactionSigning" : { + "badge" : { + "discriminator" : "virtualSource", + "virtualSource" : { + "discriminator" : "hierarchicalDeterministicPublicKey", + "hierarchicalDeterministicPublicKey" : { + "derivationPath" : { + "path" : "m/44H/1022H/2H/618H/1460H/1H", + "scheme" : "cap26" + }, + "publicKey" : { + "compressedData" : "04d20a076e310d04723c6b3a3e720c0a3ea58be1364c879a451cac9059d5e213", + "curve" : "curve25519" + } + } + } + }, + "factorSourceID" : { + "discriminator" : "fromHash", + "fromHash" : { + "body" : "c9e67a9028fb3150304c77992710c35c8e479d4fa59f7c45a96ce17f6fdf1d2c", + "kind" : "device" + } + } + } + } + } + } + ] + }, + { + "accounts" : [ + { + "address" : "account_rdx12x20vgu94d96g3demdumxl6yjpvm0jy8dhrr03g75299ghxrwq76uh", + "appearanceID" : 0, + "displayName" : "Main0", + "flags" : [ + "deletedByUser" + ], + "networkID" : 1, + "onLedgerSettings" : { + "thirdPartyDeposits" : { + "assetsExceptionList" : [ + + ], + "depositorsAllowList" : [ + + ], + "depositRule" : "acceptAll" + } + }, + "securityState" : { + "discriminator" : "unsecured", + "unsecuredEntityControl" : { + "transactionSigning" : { + "badge" : { + "discriminator" : "virtualSource", + "virtualSource" : { + "discriminator" : "hierarchicalDeterministicPublicKey", + "hierarchicalDeterministicPublicKey" : { + "derivationPath" : { + "path" : "m/44H/1022H/1H/525H/1460H/0H", + "scheme" : "cap26" + }, + "publicKey" : { + "compressedData" : "c948443a693de85e55b07cad69324aeed19082f0d15bf28ae64a9ca21e441b4d", + "curve" : "curve25519" + } + } + } + }, + "factorSourceID" : { + "discriminator" : "fromHash", + "fromHash" : { + "body" : "c9e67a9028fb3150304c77992710c35c8e479d4fa59f7c45a96ce17f6fdf1d2c", + "kind" : "device" + } + } + } + } + } + } + ], + "authorizedDapps" : [ + + ], + "networkID" : 1, + "personas" : [ + + ] + } + ] + } +} diff --git a/crates/sargon-profile/fixtures/vector/only_plaintext_profile_snapshot_version_100.json b/crates/sargon-profile/fixtures/vector/only_plaintext_profile_snapshot_version_100.json new file mode 100644 index 000000000..d7ab5f8af --- /dev/null +++ b/crates/sargon-profile/fixtures/vector/only_plaintext_profile_snapshot_version_100.json @@ -0,0 +1,1229 @@ +{ + "appPreferences": { + "display": { + "fiatCurrencyPriceTarget": "usd", + "isCurrencyAmountVisible": true + }, + "security": { + "isCloudProfileSyncEnabled": true, + "structureConfigurationReferences": [], + "isDeveloperModeEnabled": true + }, + "p2pLinks": [ + { + "displayName": "Chrome", + "connectionPassword": "0a54ab49f7c1dac68666945f8cffa17c596e65daa551d739ef6529edcf39d34f" + } + ], + "gateways": { + "current": "https://rcnet-v3.radixdlt.com/", + "saved": [ + { + "network": { + "name": "zabanet", + "id": 14, + "displayDescription": "RCnet-V3 test network" + }, + "url": "https://rcnet-v3.radixdlt.com/" + }, + { + "network": { + "name": "mainnet", + "id": 1, + "displayDescription": "Mainnet" + }, + "url": "https://mainnet.radixdlt.com/" + }, + { + "network": { + "name": "stokenet", + "id": 2, + "displayDescription": "Stokenet" + }, + "url": "https://babylon-stokenet-gateway.radixdlt.com/" + } + ] + }, + "transaction": { + "defaultDepositGuarantee": "0.975" + } + }, + "networks": [ + { + "networkID": 14, + "personas": [ + { + "securityState": { + "unsecuredEntityControl": { + "transactionSigning": { + "badge": { + "virtualSource": { + "hierarchicalDeterministicPublicKey": { + "publicKey": { + "curve": "curve25519", + "compressedData": "3c9f6a080e75c28e9210bf53fee777e3f943852790b2c016dc699e46d041477e" + }, + "derivationPath": { + "scheme": "cap26", + "path": "m/44H/1022H/14H/618H/1460H/0H" + } + }, + "discriminator": "hierarchicalDeterministicPublicKey" + }, + "discriminator": "virtualSource" + }, + "factorSourceID": { + "fromHash": { + "kind": "device", + "body": "c9e67a9028fb3150304c77992710c35c8e479d4fa59f7c45a96ce17f6fdf1d2c" + }, + "discriminator": "fromHash" + } + } + }, + "discriminator": "unsecured" + }, + "networkID": 14, + "flags": [], + "displayName": "Sajjon", + "personaData": { + "emailAddresses": [ + { + "id": "8d8ab282-ab20-4d07-8461-06a31553af1c", + "value": "alex@cyon.com" + } + ], + "name": { + "id": "d264960b-1e2b-4e40-ad50-d281b9dbb6d1", + "value": { + "nickname": "Alex", + "familyName": "Alexander ", + "variant": "western", + "givenNames": "Cyon" + } + }, + "phoneNumbers": [ + { + "id": "f30a2a14-e25f-4597-8a49-e74fedb10f44", + "value": "0700838198" + } + ] + }, + "address": "identity_tdx_e_122k9saakdjazzwm98rlpjlwewy0wvx0csmtvstdut528r0t0z8cy30" + } + ], + "accounts": [ + { + "securityState": { + "unsecuredEntityControl": { + "transactionSigning": { + "badge": { + "virtualSource": { + "hierarchicalDeterministicPublicKey": { + "publicKey": { + "curve": "curve25519", + "compressedData": "3feb8194ead2e526fbcc4c1673a7a8b29d8cee0b32bb9393692f739821dd256b" + }, + "derivationPath": { + "scheme": "cap26", + "path": "m/44H/1022H/14H/525H/1460H/0H" + } + }, + "discriminator": "hierarchicalDeterministicPublicKey" + }, + "discriminator": "virtualSource" + }, + "factorSourceID": { + "fromHash": { + "kind": "device", + "body": "c9e67a9028fb3150304c77992710c35c8e479d4fa59f7c45a96ce17f6fdf1d2c" + }, + "discriminator": "fromHash" + } + } + }, + "discriminator": "unsecured" + }, + "flags": [ + "deletedByUser" + ], + "networkID": 14, + "appearanceID": 0, + "displayName": "Zaba 0", + "onLedgerSettings": { + "thirdPartyDeposits": { + "depositRule": "acceptAll", + "assetsExceptionList": [], + "depositorsAllowList": [] + } + }, + "address": "account_tdx_e_128vkt2fur65p4hqhulfv3h0cknrppwtjsstlttkfamj4jnnpm82gsw" + }, + { + "securityState": { + "unsecuredEntityControl": { + "transactionSigning": { + "badge": { + "virtualSource": { + "hierarchicalDeterministicPublicKey": { + "publicKey": { + "curve": "curve25519", + "compressedData": "3c04690f4ad8890bfdf5a62bac2843b8ee79ab335c9bf4ed1e786ff676709413" + }, + "derivationPath": { + "scheme": "cap26", + "path": "m/44H/1022H/14H/525H/1460H/1H" + } + }, + "discriminator": "hierarchicalDeterministicPublicKey" + }, + "discriminator": "virtualSource" + }, + "factorSourceID": { + "fromHash": { + "kind": "device", + "body": "c9e67a9028fb3150304c77992710c35c8e479d4fa59f7c45a96ce17f6fdf1d2c" + }, + "discriminator": "fromHash" + } + } + }, + "discriminator": "unsecured" + }, + "networkID": 14, + "appearanceID": 1, + "flags": [ + "deletedByUser" + ], + "displayName": "Zaba 1", + "onLedgerSettings": { + "thirdPartyDeposits": { + "depositRule": "acceptAll", + "assetsExceptionList": [], + "depositorsAllowList": [] + } + }, + "address": "account_tdx_e_129fj4fqmz2ldej5lg2hx9laty9s6464snr6ly0243p32jmd757yke7" + }, + { + "securityState": { + "unsecuredEntityControl": { + "transactionSigning": { + "badge": { + "virtualSource": { + "hierarchicalDeterministicPublicKey": { + "publicKey": { + "curve": "curve25519", + "compressedData": "fe6368cf2907d0da61a68c31e461213b8e56ba84f1cfbdb4d79311fce331b7ee" + }, + "derivationPath": { + "scheme": "cap26", + "path": "m/44H/1022H/14H/525H/1460H/2H" + } + }, + "discriminator": "hierarchicalDeterministicPublicKey" + }, + "discriminator": "virtualSource" + }, + "factorSourceID": { + "fromHash": { + "kind": "device", + "body": "c9e67a9028fb3150304c77992710c35c8e479d4fa59f7c45a96ce17f6fdf1d2c" + }, + "discriminator": "fromHash" + } + } + }, + "discriminator": "unsecured" + }, + "networkID": 14, + "appearanceID": 2, + "flags": [ + "deletedByUser" + ], + "displayName": "Zaba 2", + "onLedgerSettings": { + "thirdPartyDeposits": { + "depositRule": "acceptAll", + "assetsExceptionList": [], + "depositorsAllowList": [] + } + }, + "address": "account_tdx_e_129enl4x6w6mz6nlh9y4hszx6zwfvv3q80keqdzqkewvltugp8g6g7v" + }, + { + "securityState": { + "unsecuredEntityControl": { + "transactionSigning": { + "badge": { + "virtualSource": { + "hierarchicalDeterministicPublicKey": { + "publicKey": { + "curve": "secp256k1", + "compressedData": "02f669a43024d90fde69351ccc53022c2f86708d9b3c42693640733c5778235da5" + }, + "derivationPath": { + "scheme": "bip44Olympia", + "path": "m/44H/1022H/0H/0/0H" + } + }, + "discriminator": "hierarchicalDeterministicPublicKey" + }, + "discriminator": "virtualSource" + }, + "factorSourceID": { + "fromHash": { + "kind": "device", + "body": "8bfacfe888d4e3819c6e9528a1c8f680a4ba73e466d7af4ee204591093006589" + }, + "discriminator": "fromHash" + } + } + }, + "discriminator": "unsecured" + }, + "networkID": 14, + "appearanceID": 3, + "flags": [ + "deletedByUser" + ], + "displayName": "Olympia|Soft|0", + "onLedgerSettings": { + "thirdPartyDeposits": { + "depositRule": "acceptAll", + "assetsExceptionList": [], + "depositorsAllowList": [] + } + }, + "address": "account_tdx_e_169s2cfz044euhc4yjg4xe4pg55w97rq2c6jh50zsdcpuz5gk6cag6v" + }, + { + "securityState": { + "unsecuredEntityControl": { + "transactionSigning": { + "badge": { + "virtualSource": { + "hierarchicalDeterministicPublicKey": { + "publicKey": { + "curve": "secp256k1", + "compressedData": "023a41f437972033fa83c3c4df08dc7d68212ccac07396a29aca971ad5ba3c27c8" + }, + "derivationPath": { + "scheme": "bip44Olympia", + "path": "m/44H/1022H/0H/0/1H" + } + }, + "discriminator": "hierarchicalDeterministicPublicKey" + }, + "discriminator": "virtualSource" + }, + "factorSourceID": { + "fromHash": { + "kind": "device", + "body": "8bfacfe888d4e3819c6e9528a1c8f680a4ba73e466d7af4ee204591093006589" + }, + "discriminator": "fromHash" + } + } + }, + "discriminator": "unsecured" + }, + "networkID": 14, + "appearanceID": 4, + "flags": [ + "deletedByUser" + ], + "displayName": "Olympia|Soft|1", + "onLedgerSettings": { + "thirdPartyDeposits": { + "depositRule": "acceptAll", + "assetsExceptionList": [], + "depositorsAllowList": [] + } + }, + "address": "account_tdx_e_16x88ghu9hd3hz4c9gumqjafrcwqtzk67wmpds7xg6uaz0kf42v5hju" + }, + { + "securityState": { + "unsecuredEntityControl": { + "transactionSigning": { + "badge": { + "virtualSource": { + "hierarchicalDeterministicPublicKey": { + "publicKey": { + "curve": "secp256k1", + "compressedData": "0233dc38ad9e8fca2653563199e793ee8d8a1a5071d1fc2996a6c51c9b86b36d8a" + }, + "derivationPath": { + "scheme": "bip44Olympia", + "path": "m/44H/1022H/0H/0/1H" + } + }, + "discriminator": "hierarchicalDeterministicPublicKey" + }, + "discriminator": "virtualSource" + }, + "factorSourceID": { + "fromHash": { + "kind": "device", + "body": "eda055ed256d156f62013da6cf5fb6104339b5c8666dd3f5512030950b1e3a29" + }, + "discriminator": "fromHash" + } + } + }, + "discriminator": "unsecured" + }, + "networkID": 14, + "appearanceID": 5, + "flags": [ + "deletedByUser" + ], + "displayName": "S18 | Sajjon | 1", + "onLedgerSettings": { + "thirdPartyDeposits": { + "depositRule": "acceptAll", + "assetsExceptionList": [], + "depositorsAllowList": [] + } + }, + "address": "account_tdx_e_16yszyl5pd54vdqm4wyazdgtr7j3d5cl33gew3mzy6r9443am5dlsr7" + }, + { + "securityState": { + "unsecuredEntityControl": { + "transactionSigning": { + "badge": { + "virtualSource": { + "hierarchicalDeterministicPublicKey": { + "publicKey": { + "curve": "secp256k1", + "compressedData": "035e86fc1679aefcb186a3c758503aa146e2a4e730e84daf6fd735861ccd5d8978" + }, + "derivationPath": { + "scheme": "bip44Olympia", + "path": "m/44H/1022H/0H/0/3H" + } + }, + "discriminator": "hierarchicalDeterministicPublicKey" + }, + "discriminator": "virtualSource" + }, + "factorSourceID": { + "fromHash": { + "kind": "device", + "body": "eda055ed256d156f62013da6cf5fb6104339b5c8666dd3f5512030950b1e3a29" + }, + "discriminator": "fromHash" + } + } + }, + "discriminator": "unsecured" + }, + "networkID": 14, + "appearanceID": 6, + "flags": [ + "deletedByUser" + ], + "displayName": "S18 | Sajjon | 3", + "onLedgerSettings": { + "thirdPartyDeposits": { + "depositRule": "acceptAll", + "assetsExceptionList": [], + "depositorsAllowList": [] + } + }, + "address": "account_tdx_e_16ysdhjfehs8t80u4ew3w3f8yygkx7v3h3erptrzjacv86sn9l3feln" + }, + { + "securityState": { + "unsecuredEntityControl": { + "transactionSigning": { + "badge": { + "virtualSource": { + "hierarchicalDeterministicPublicKey": { + "publicKey": { + "curve": "secp256k1", + "compressedData": "03f43fba6541031ef2195f5ba96677354d28147e45b40cde4662bec9162c361f55" + }, + "derivationPath": { + "scheme": "bip44Olympia", + "path": "m/44H/1022H/0H/0/0H" + } + }, + "discriminator": "hierarchicalDeterministicPublicKey" + }, + "discriminator": "virtualSource" + }, + "factorSourceID": { + "fromHash": { + "kind": "ledgerHQHardwareWallet", + "body": "41ac202687326a4fc6cb677e9fd92d08b91ce46c669950d58790d4d5e583adc0" + }, + "discriminator": "fromHash" + } + } + }, + "discriminator": "unsecured" + }, + "networkID": 14, + "appearanceID": 7, + "flags": [ + "deletedByUser" + ], + "displayName": "0|RDX|Dev Nano S|Some very lon", + "onLedgerSettings": { + "thirdPartyDeposits": { + "depositRule": "acceptAll", + "assetsExceptionList": [], + "depositorsAllowList": [] + } + }, + "address": "account_tdx_e_16x5wz8wmkumuhn49klq0zwgjn9d8xs7n95maxam04vawld2drf2dkj" + }, + { + "securityState": { + "unsecuredEntityControl": { + "transactionSigning": { + "badge": { + "virtualSource": { + "hierarchicalDeterministicPublicKey": { + "publicKey": { + "curve": "secp256k1", + "compressedData": "0206ea8842365421f48ab84e6b1b197010e5a43a527952b11bc6efe772965e97cc" + }, + "derivationPath": { + "scheme": "bip44Olympia", + "path": "m/44H/1022H/0H/0/1H" + } + }, + "discriminator": "hierarchicalDeterministicPublicKey" + }, + "discriminator": "virtualSource" + }, + "factorSourceID": { + "fromHash": { + "kind": "ledgerHQHardwareWallet", + "body": "41ac202687326a4fc6cb677e9fd92d08b91ce46c669950d58790d4d5e583adc0" + }, + "discriminator": "fromHash" + } + } + }, + "discriminator": "unsecured" + }, + "networkID": 14, + "appearanceID": 8, + "flags": [ + "deletedByUser" + ], + "displayName": "1|RDX|Dev Nano S|Forbidden ___", + "onLedgerSettings": { + "thirdPartyDeposits": { + "depositRule": "acceptAll", + "assetsExceptionList": [], + "depositorsAllowList": [] + } + }, + "address": "account_tdx_e_16y6q3q6ey64j5qvkex3q0yshtln6z2lmyk254xrjcq393rc070x66z" + }, + { + "securityState": { + "unsecuredEntityControl": { + "transactionSigning": { + "badge": { + "virtualSource": { + "hierarchicalDeterministicPublicKey": { + "publicKey": { + "curve": "secp256k1", + "compressedData": "0220e2ef980a86888800573b0f5a30492549c88c1808821475c828aeccdca4cc5a" + }, + "derivationPath": { + "scheme": "bip44Olympia", + "path": "m/44H/1022H/0H/0/0H" + } + }, + "discriminator": "hierarchicalDeterministicPublicKey" + }, + "discriminator": "virtualSource" + }, + "factorSourceID": { + "fromHash": { + "kind": "ledgerHQHardwareWallet", + "body": "9e2e0a2b4b96e8729f5553ffa8865eaac10088569ef8bcd7b3fa61b89fde1764" + }, + "discriminator": "fromHash" + } + } + }, + "discriminator": "unsecured" + }, + "networkID": 14, + "appearanceID": 9, + "flags": [ + "deletedByUser" + ], + "displayName": "Shadow 25 | 0", + "onLedgerSettings": { + "thirdPartyDeposits": { + "depositRule": "acceptAll", + "assetsExceptionList": [], + "depositorsAllowList": [] + } + }, + "address": "account_tdx_e_16yyhtwlwrtpdqe2jufg2xw2289j4dtnk542dm69m7h89l4x5xm60k7" + }, + { + "securityState": { + "unsecuredEntityControl": { + "transactionSigning": { + "badge": { + "virtualSource": { + "hierarchicalDeterministicPublicKey": { + "publicKey": { + "curve": "secp256k1", + "compressedData": "034a8a2ee1801d91cf8c9157d8694ae0d8d2c9563021a9764a34580493f75d0c75" + }, + "derivationPath": { + "scheme": "bip44Olympia", + "path": "m/44H/1022H/0H/0/1H" + } + }, + "discriminator": "hierarchicalDeterministicPublicKey" + }, + "discriminator": "virtualSource" + }, + "factorSourceID": { + "fromHash": { + "kind": "ledgerHQHardwareWallet", + "body": "9e2e0a2b4b96e8729f5553ffa8865eaac10088569ef8bcd7b3fa61b89fde1764" + }, + "discriminator": "fromHash" + } + } + }, + "discriminator": "unsecured" + }, + "networkID": 14, + "appearanceID": 10, + "flags": [ + "deletedByUser" + ], + "displayName": "Shadow 25 | 1", + "onLedgerSettings": { + "thirdPartyDeposits": { + "depositRule": "acceptAll", + "assetsExceptionList": [], + "depositorsAllowList": [] + } + }, + "address": "account_tdx_e_169cdlneks2wrrmg82cc36xqtx2ng8qjtkpe0j3sfzddl0xje47janr" + }, + { + "securityState": { + "unsecuredEntityControl": { + "transactionSigning": { + "badge": { + "virtualSource": { + "hierarchicalDeterministicPublicKey": { + "publicKey": { + "curve": "curve25519", + "compressedData": "d24228459e0000d91b7256cac6fd8f9b0cb30dfef209db201912fb0b8d710edb" + }, + "derivationPath": { + "scheme": "cap26", + "path": "m/44H/1022H/14H/525H/1460H/11H" + } + }, + "discriminator": "hierarchicalDeterministicPublicKey" + }, + "discriminator": "virtualSource" + }, + "factorSourceID": { + "fromHash": { + "kind": "ledgerHQHardwareWallet", + "body": "41ac202687326a4fc6cb677e9fd92d08b91ce46c669950d58790d4d5e583adc0" + }, + "discriminator": "fromHash" + } + } + }, + "discriminator": "unsecured" + }, + "networkID": 14, + "appearanceID": 11, + "flags": [ + "deletedByUser" + ], + "displayName": "Babylon Ledger 24", + "onLedgerSettings": { + "thirdPartyDeposits": { + "depositRule": "acceptAll", + "assetsExceptionList": [], + "depositorsAllowList": [] + } + }, + "address": "account_tdx_e_12yavnpctf6l2dw76tazge90kkufzks45vq6u28vvarse6cyra5stuv" + }, + { + "securityState": { + "unsecuredEntityControl": { + "transactionSigning": { + "badge": { + "virtualSource": { + "hierarchicalDeterministicPublicKey": { + "publicKey": { + "curve": "curve25519", + "compressedData": "7d918320fdd9d4102f2392aec4a6c43e959645cb525b4bd407cbc9c5bac00495" + }, + "derivationPath": { + "scheme": "cap26", + "path": "m/44H/1022H/14H/525H/1460H/12H" + } + }, + "discriminator": "hierarchicalDeterministicPublicKey" + }, + "discriminator": "virtualSource" + }, + "factorSourceID": { + "fromHash": { + "kind": "ledgerHQHardwareWallet", + "body": "9e2e0a2b4b96e8729f5553ffa8865eaac10088569ef8bcd7b3fa61b89fde1764" + }, + "discriminator": "fromHash" + } + } + }, + "discriminator": "unsecured" + }, + "networkID": 14, + "appearanceID": 0, + "flags": [], + "displayName": "Babylon ledger 25", + "onLedgerSettings": { + "thirdPartyDeposits": { + "depositRule": "acceptAll", + "assetsExceptionList": [], + "depositorsAllowList": [] + } + }, + "address": "account_tdx_e_128duqx53e4e6hpz4vxkm9qskpqgu8un0p49gm2t8lfcsfxl9vej4eg" + } + ], + "authorizedDapps": [ + { + "networkID": 14, + "dAppDefinitionAddress": "account_tdx_e_128uml7z6mqqqtm035t83alawc3jkvap9sxavecs35ud3ct20jxxuhl", + "displayName": "Gumball Club", + "referencesToAuthorizedPersonas": [ + { + "sharedAccounts": { + "request": { + "quantifier": "atLeast", + "quantity": 1 + }, + "ids": [ + "account_tdx_e_128vkt2fur65p4hqhulfv3h0cknrppwtjsstlttkfamj4jnnpm82gsw", + "account_tdx_e_129fj4fqmz2ldej5lg2hx9laty9s6464snr6ly0243p32jmd757yke7", + "account_tdx_e_129enl4x6w6mz6nlh9y4hszx6zwfvv3q80keqdzqkewvltugp8g6g7v", + "account_tdx_e_169s2cfz044euhc4yjg4xe4pg55w97rq2c6jh50zsdcpuz5gk6cag6v", + "account_tdx_e_16x88ghu9hd3hz4c9gumqjafrcwqtzk67wmpds7xg6uaz0kf42v5hju", + "account_tdx_e_16yszyl5pd54vdqm4wyazdgtr7j3d5cl33gew3mzy6r9443am5dlsr7", + "account_tdx_e_16ysdhjfehs8t80u4ew3w3f8yygkx7v3h3erptrzjacv86sn9l3feln", + "account_tdx_e_16x5wz8wmkumuhn49klq0zwgjn9d8xs7n95maxam04vawld2drf2dkj", + "account_tdx_e_16y6q3q6ey64j5qvkex3q0yshtln6z2lmyk254xrjcq393rc070x66z", + "account_tdx_e_16yyhtwlwrtpdqe2jufg2xw2289j4dtnk542dm69m7h89l4x5xm60k7", + "account_tdx_e_169cdlneks2wrrmg82cc36xqtx2ng8qjtkpe0j3sfzddl0xje47janr", + "account_tdx_e_12yavnpctf6l2dw76tazge90kkufzks45vq6u28vvarse6cyra5stuv", + "account_tdx_e_128duqx53e4e6hpz4vxkm9qskpqgu8un0p49gm2t8lfcsfxl9vej4eg" + ] + }, + "identityAddress": "identity_tdx_e_122k9saakdjazzwm98rlpjlwewy0wvx0csmtvstdut528r0t0z8cy30", + "sharedPersonaData": {}, + "lastLogin": "2023-09-13T07:24:41.000Z" + } + ] + }, + { + "networkID": 14, + "dAppDefinitionAddress": "account_tdx_e_168ydk240yx69yl7zdz2mzkdjc3r5p6n4gwypqsype2d6d942m5z2ns", + "displayName": "Radix Sandbox dApp", + "referencesToAuthorizedPersonas": [ + { + "sharedAccounts": { + "request": { + "quantifier": "exactly", + "quantity": 5 + }, + "ids": [ + "account_tdx_e_16y6q3q6ey64j5qvkex3q0yshtln6z2lmyk254xrjcq393rc070x66z", + "account_tdx_e_12yavnpctf6l2dw76tazge90kkufzks45vq6u28vvarse6cyra5stuv", + "account_tdx_e_128duqx53e4e6hpz4vxkm9qskpqgu8un0p49gm2t8lfcsfxl9vej4eg", + "account_tdx_e_128vkt2fur65p4hqhulfv3h0cknrppwtjsstlttkfamj4jnnpm82gsw", + "account_tdx_e_16yyhtwlwrtpdqe2jufg2xw2289j4dtnk542dm69m7h89l4x5xm60k7" + ] + }, + "identityAddress": "identity_tdx_e_122k9saakdjazzwm98rlpjlwewy0wvx0csmtvstdut528r0t0z8cy30", + "sharedPersonaData": { + "name": "d264960b-1e2b-4e40-ad50-d281b9dbb6d1" + }, + "lastLogin": "2023-09-11T17:55:07.000Z" + } + ] + }, + { + "networkID": 14, + "dAppDefinitionAddress": "account_tdx_e_16xygyhqp3x3awxlz3c5dzrm7jqghgpgs776v4af0yfr7xljqmna3ha", + "displayName": "Radix Dashboard", + "referencesToAuthorizedPersonas": [ + { + "sharedAccounts": { + "request": { + "quantifier": "atLeast", + "quantity": 1 + }, + "ids": [ + "account_tdx_e_128vkt2fur65p4hqhulfv3h0cknrppwtjsstlttkfamj4jnnpm82gsw", + "account_tdx_e_129fj4fqmz2ldej5lg2hx9laty9s6464snr6ly0243p32jmd757yke7", + "account_tdx_e_129enl4x6w6mz6nlh9y4hszx6zwfvv3q80keqdzqkewvltugp8g6g7v", + "account_tdx_e_169s2cfz044euhc4yjg4xe4pg55w97rq2c6jh50zsdcpuz5gk6cag6v", + "account_tdx_e_16x88ghu9hd3hz4c9gumqjafrcwqtzk67wmpds7xg6uaz0kf42v5hju", + "account_tdx_e_16yszyl5pd54vdqm4wyazdgtr7j3d5cl33gew3mzy6r9443am5dlsr7", + "account_tdx_e_16ysdhjfehs8t80u4ew3w3f8yygkx7v3h3erptrzjacv86sn9l3feln", + "account_tdx_e_16x5wz8wmkumuhn49klq0zwgjn9d8xs7n95maxam04vawld2drf2dkj", + "account_tdx_e_16y6q3q6ey64j5qvkex3q0yshtln6z2lmyk254xrjcq393rc070x66z", + "account_tdx_e_16yyhtwlwrtpdqe2jufg2xw2289j4dtnk542dm69m7h89l4x5xm60k7", + "account_tdx_e_169cdlneks2wrrmg82cc36xqtx2ng8qjtkpe0j3sfzddl0xje47janr", + "account_tdx_e_12yavnpctf6l2dw76tazge90kkufzks45vq6u28vvarse6cyra5stuv", + "account_tdx_e_128duqx53e4e6hpz4vxkm9qskpqgu8un0p49gm2t8lfcsfxl9vej4eg" + ] + }, + "identityAddress": "identity_tdx_e_122k9saakdjazzwm98rlpjlwewy0wvx0csmtvstdut528r0t0z8cy30", + "sharedPersonaData": {}, + "lastLogin": "2023-09-11T17:57:57.000Z" + } + ] + } + ] + }, + { + "networkID": 2, + "personas": [ + { + "securityState": { + "unsecuredEntityControl": { + "transactionSigning": { + "badge": { + "virtualSource": { + "hierarchicalDeterministicPublicKey": { + "publicKey": { + "curve": "curve25519", + "compressedData": "679152f01032dc15895247a394d622d31342017951471922ba8170e0ee4fb90c" + }, + "derivationPath": { + "scheme": "cap26", + "path": "m/44H/1022H/2H/618H/1460H/0H" + } + }, + "discriminator": "hierarchicalDeterministicPublicKey" + }, + "discriminator": "virtualSource" + }, + "factorSourceID": { + "fromHash": { + "kind": "device", + "body": "c9e67a9028fb3150304c77992710c35c8e479d4fa59f7c45a96ce17f6fdf1d2c" + }, + "discriminator": "fromHash" + } + } + }, + "discriminator": "unsecured" + }, + "networkID": 2, + "flags": [ + "deletedByUser" + ], + "displayName": "Stokeman", + "personaData": { + "phoneNumbers": [], + "emailAddresses": [] + }, + "address": "identity_tdx_2_1224clayjwq45swgd0xj2uc4s3gq4l6g7q77f9d290su4flufq2lt9j" + }, + { + "securityState": { + "unsecuredEntityControl": { + "transactionSigning": { + "badge": { + "virtualSource": { + "hierarchicalDeterministicPublicKey": { + "publicKey": { + "curve": "curve25519", + "compressedData": "04d20a076e310d04723c6b3a3e720c0a3ea58be1364c879a451cac9059d5e213" + }, + "derivationPath": { + "scheme": "cap26", + "path": "m/44H/1022H/2H/618H/1460H/1H" + } + }, + "discriminator": "hierarchicalDeterministicPublicKey" + }, + "discriminator": "virtualSource" + }, + "factorSourceID": { + "fromHash": { + "kind": "device", + "body": "c9e67a9028fb3150304c77992710c35c8e479d4fa59f7c45a96ce17f6fdf1d2c" + }, + "discriminator": "fromHash" + } + } + }, + "discriminator": "unsecured" + }, + "networkID": 2, + "flags": [ + "deletedByUser" + ], + "displayName": "Dan", + "personaData": { + "emailAddresses": [ + { + "id": "f6cfe950-100c-4696-9aa2-68766d10b6be", + "value": "dan@stoke.com" + } + ], + "name": { + "id": "b114a7b6-6fe3-41b6-8ce6-ce16148ed1d7", + "value": { + "nickname": "Fuserleer", + "familyName": "Hughes", + "variant": "western", + "givenNames": "Dan" + } + }, + "phoneNumbers": [ + { + "id": "fb3e1ac2-fcc7-474c-82a2-600e1a2d69e9", + "value": "1337" + } + ] + }, + "address": "identity_tdx_2_122tvh7nq6jd2mp7l8ar5kayc3wr5u5z5pew9r86vtvlwnsydx80pne" + } + ], + "accounts": [ + { + "securityState": { + "unsecuredEntityControl": { + "transactionSigning": { + "badge": { + "virtualSource": { + "hierarchicalDeterministicPublicKey": { + "publicKey": { + "curve": "curve25519", + "compressedData": "1145c0041719f2640333ebdfa6652b8399bd73f9205af8a94beb25f6375b5900" + }, + "derivationPath": { + "scheme": "cap26", + "path": "m/44H/1022H/2H/525H/1460H/0H" + } + }, + "discriminator": "hierarchicalDeterministicPublicKey" + }, + "discriminator": "virtualSource" + }, + "factorSourceID": { + "fromHash": { + "kind": "device", + "body": "c9e67a9028fb3150304c77992710c35c8e479d4fa59f7c45a96ce17f6fdf1d2c" + }, + "discriminator": "fromHash" + } + } + }, + "discriminator": "unsecured" + }, + "networkID": 2, + "appearanceID": 0, + "flags": [ + "deletedByUser" + ], + "displayName": "Stokenet", + "onLedgerSettings": { + "thirdPartyDeposits": { + "depositRule": "acceptAll", + "assetsExceptionList": [], + "depositorsAllowList": [] + } + }, + "address": "account_tdx_2_12ygsf87pma439ezvdyervjfq2nhqme6reau6kcxf6jtaysaxl7sqvd" + }, + { + "securityState": { + "unsecuredEntityControl": { + "transactionSigning": { + "badge": { + "virtualSource": { + "hierarchicalDeterministicPublicKey": { + "publicKey": { + "curve": "curve25519", + "compressedData": "eda9a63d679d6ba3d3c3b1b1e970de9ec3531cc19e2a523375d9654db4a18b75" + }, + "derivationPath": { + "scheme": "cap26", + "path": "m/44H/1022H/2H/525H/1460H/1H" + } + }, + "discriminator": "hierarchicalDeterministicPublicKey" + }, + "discriminator": "virtualSource" + }, + "factorSourceID": { + "fromHash": { + "kind": "device", + "body": "c9e67a9028fb3150304c77992710c35c8e479d4fa59f7c45a96ce17f6fdf1d2c" + }, + "discriminator": "fromHash" + } + } + }, + "discriminator": "unsecured" + }, + "networkID": 2, + "appearanceID": 1, + "flags": [ + "deletedByUser" + ], + "displayName": "Stoke on trent!", + "onLedgerSettings": { + "thirdPartyDeposits": { + "depositRule": "acceptAll", + "assetsExceptionList": [], + "depositorsAllowList": [] + } + }, + "address": "account_tdx_2_12yymsmxapnaulngrepgdyzlaszflhcynchr2s95nkjfrsfuzq02s8m" + } + ], + "authorizedDapps": [] + }, + { + "networkID": 1, + "personas": [], + "accounts": [ + { + "securityState": { + "unsecuredEntityControl": { + "transactionSigning": { + "badge": { + "virtualSource": { + "hierarchicalDeterministicPublicKey": { + "publicKey": { + "curve": "curve25519", + "compressedData": "c948443a693de85e55b07cad69324aeed19082f0d15bf28ae64a9ca21e441b4d" + }, + "derivationPath": { + "scheme": "cap26", + "path": "m/44H/1022H/1H/525H/1460H/0H" + } + }, + "discriminator": "hierarchicalDeterministicPublicKey" + }, + "discriminator": "virtualSource" + }, + "factorSourceID": { + "fromHash": { + "kind": "device", + "body": "c9e67a9028fb3150304c77992710c35c8e479d4fa59f7c45a96ce17f6fdf1d2c" + }, + "discriminator": "fromHash" + } + } + }, + "discriminator": "unsecured" + }, + "networkID": 1, + "appearanceID": 0, + "flags": [ + "deletedByUser" + ], + "displayName": "Main0", + "onLedgerSettings": { + "thirdPartyDeposits": { + "depositRule": "acceptAll", + "assetsExceptionList": [], + "depositorsAllowList": [] + } + }, + "address": "account_rdx12x20vgu94d96g3demdumxl6yjpvm0jy8dhrr03g75299ghxrwq76uh" + } + ], + "authorizedDapps": [] + } + ], + "header": { + "contentHint": { + "numberOfNetworks": 3, + "numberOfAccountsOnAllNetworksInTotal": 16, + "numberOfPersonasOnAllNetworksInTotal": 3 + }, + "id": "e5e4477b-e47b-4b64-bbc8-f8f40e8beb74", + "lastUsedOnDevice": { + "id": "66f07ca2-a9d9-49e5-8152-77aca3d1dd74", + "date": "2023-09-11T17:14:40.000Z", + "description": "iPhone (iPhone)" + }, + "creatingDevice": { + "id": "66f07ca2-a9d9-49e5-8152-77aca3d1dd74", + "date": "2023-09-11T16:05:55.000Z", + "description": "iPhone (iPhone)" + }, + "lastModified": "2023-09-13T07:24:55.000Z", + "snapshotVersion": 100 + }, + "factorSources": [ + { + "device": { + "id": { + "kind": "device", + "body": "c9e67a9028fb3150304c77992710c35c8e479d4fa59f7c45a96ce17f6fdf1d2c" + }, + "common": { + "flags": [], + "addedOn": "2023-09-11T16:05:55.000Z", + "cryptoParameters": { + "supportedCurves": [ + "curve25519" + ], + "supportedDerivationPathSchemes": [ + "cap26" + ] + }, + "lastUsedOn": "2023-09-13T07:24:55.000Z" + }, + "hint": { + "name": "iPhone", + "model": "iPhone", + "mnemonicWordCount": 24 + } + }, + "discriminator": "device" + }, + { + "device": { + "id": { + "kind": "device", + "body": "8bfacfe888d4e3819c6e9528a1c8f680a4ba73e466d7af4ee204591093006589" + }, + "common": { + "flags": [], + "addedOn": "2023-09-11T16:23:40.000Z", + "cryptoParameters": { + "supportedCurves": [ + "curve25519", + "secp256k1" + ], + "supportedDerivationPathSchemes": [ + "cap26", + "bip44Olympia" + ] + }, + "lastUsedOn": "2023-09-11T17:17:46.000Z" + }, + "hint": { + "name": "", + "model": "", + "mnemonicWordCount": 12 + } + }, + "discriminator": "device" + }, + { + "device": { + "id": { + "kind": "device", + "body": "eda055ed256d156f62013da6cf5fb6104339b5c8666dd3f5512030950b1e3a29" + }, + "common": { + "flags": [], + "addedOn": "2023-09-11T16:26:44.000Z", + "cryptoParameters": { + "supportedCurves": [ + "curve25519", + "secp256k1" + ], + "supportedDerivationPathSchemes": [ + "cap26", + "bip44Olympia" + ] + }, + "lastUsedOn": "2023-09-11T17:18:33.000Z" + }, + "hint": { + "name": "", + "model": "", + "mnemonicWordCount": 18 + } + }, + "discriminator": "device" + }, + { + "ledgerHQHardwareWallet": { + "id": { + "kind": "ledgerHQHardwareWallet", + "body": "41ac202687326a4fc6cb677e9fd92d08b91ce46c669950d58790d4d5e583adc0" + }, + "common": { + "flags": [], + "addedOn": "2023-09-11T16:35:08.000Z", + "cryptoParameters": { + "supportedCurves": [ + "curve25519", + "secp256k1" + ], + "supportedDerivationPathSchemes": [ + "cap26", + "bip44Olympia" + ] + }, + "lastUsedOn": "2023-09-11T17:19:41.000Z" + }, + "hint": { + "name": "Scratched 24", + "model": "nanoS" + } + }, + "discriminator": "ledgerHQHardwareWallet" + }, + { + "ledgerHQHardwareWallet": { + "id": { + "kind": "ledgerHQHardwareWallet", + "body": "9e2e0a2b4b96e8729f5553ffa8865eaac10088569ef8bcd7b3fa61b89fde1764" + }, + "common": { + "flags": [], + "addedOn": "2023-09-11T16:38:12.000Z", + "cryptoParameters": { + "supportedCurves": [ + "curve25519", + "secp256k1" + ], + "supportedDerivationPathSchemes": [ + "cap26", + "bip44Olympia" + ] + }, + "lastUsedOn": "2023-09-11T19:51:11.000Z" + }, + "hint": { + "name": "Orange 25", + "model": "nanoS+" + } + }, + "discriminator": "ledgerHQHardwareWallet" + } + ] +} \ No newline at end of file diff --git a/crates/sargon/fixtures/vector/profile_encrypted_by_password_empty.json b/crates/sargon-profile/fixtures/vector/profile_encrypted_by_password_empty.json similarity index 100% rename from crates/sargon/fixtures/vector/profile_encrypted_by_password_empty.json rename to crates/sargon-profile/fixtures/vector/profile_encrypted_by_password_empty.json diff --git a/crates/sargon/fixtures/vector/profile_encrypted_by_password_of_babylon.json b/crates/sargon-profile/fixtures/vector/profile_encrypted_by_password_of_babylon.json similarity index 100% rename from crates/sargon/fixtures/vector/profile_encrypted_by_password_of_babylon.json rename to crates/sargon-profile/fixtures/vector/profile_encrypted_by_password_of_babylon.json diff --git a/crates/sargon/src/profile/encrypted/encrypted_profile/encrypted_profile_snapshot.rs b/crates/sargon-profile/src/encrypted/encrypted_profile/encrypted_profile_snapshot.rs similarity index 100% rename from crates/sargon/src/profile/encrypted/encrypted_profile/encrypted_profile_snapshot.rs rename to crates/sargon-profile/src/encrypted/encrypted_profile/encrypted_profile_snapshot.rs diff --git a/crates/sargon/src/profile/encrypted/encrypted_profile/mod.rs b/crates/sargon-profile/src/encrypted/encrypted_profile/mod.rs similarity index 100% rename from crates/sargon/src/profile/encrypted/encrypted_profile/mod.rs rename to crates/sargon-profile/src/encrypted/encrypted_profile/mod.rs diff --git a/crates/sargon/src/profile/encrypted/key_derivation/mod.rs b/crates/sargon-profile/src/encrypted/key_derivation/mod.rs similarity index 100% rename from crates/sargon/src/profile/encrypted/key_derivation/mod.rs rename to crates/sargon-profile/src/encrypted/key_derivation/mod.rs diff --git a/crates/sargon/src/profile/encrypted/key_derivation/password_based_key_derivation_scheme.rs b/crates/sargon-profile/src/encrypted/key_derivation/password_based_key_derivation_scheme.rs similarity index 97% rename from crates/sargon/src/profile/encrypted/key_derivation/password_based_key_derivation_scheme.rs rename to crates/sargon-profile/src/encrypted/key_derivation/password_based_key_derivation_scheme.rs index 9f72402e4..7044fd6e1 100644 --- a/crates/sargon/src/profile/encrypted/key_derivation/password_based_key_derivation_scheme.rs +++ b/crates/sargon-profile/src/encrypted/key_derivation/password_based_key_derivation_scheme.rs @@ -5,7 +5,6 @@ pub enum PasswordBasedKeyDerivationScheme { Version1(PbHkdfSha256), } -#[cfg(not(tarpaulin_include))] // false negative impl Serialize for PasswordBasedKeyDerivationScheme { fn serialize(&self, serializer: S) -> Result where @@ -19,7 +18,6 @@ impl Serialize for PasswordBasedKeyDerivationScheme { } } -#[cfg(not(tarpaulin_include))] // false negative impl<'de> Deserialize<'de> for PasswordBasedKeyDerivationScheme { fn deserialize>( deserializer: D, diff --git a/crates/sargon/src/profile/encrypted/key_derivation/password_based_key_derivation_scheme_version.rs b/crates/sargon-profile/src/encrypted/key_derivation/password_based_key_derivation_scheme_version.rs similarity index 100% rename from crates/sargon/src/profile/encrypted/key_derivation/password_based_key_derivation_scheme_version.rs rename to crates/sargon-profile/src/encrypted/key_derivation/password_based_key_derivation_scheme_version.rs diff --git a/crates/sargon/src/profile/encrypted/key_derivation/versioned_password_based_key_derivation.rs b/crates/sargon-profile/src/encrypted/key_derivation/versioned_password_based_key_derivation.rs similarity index 100% rename from crates/sargon/src/profile/encrypted/key_derivation/versioned_password_based_key_derivation.rs rename to crates/sargon-profile/src/encrypted/key_derivation/versioned_password_based_key_derivation.rs diff --git a/crates/sargon/src/profile/encrypted/mod.rs b/crates/sargon-profile/src/encrypted/mod.rs similarity index 100% rename from crates/sargon/src/profile/encrypted/mod.rs rename to crates/sargon-profile/src/encrypted/mod.rs diff --git a/crates/sargon/src/profile/encrypted/pb_hkdf_sha256.rs b/crates/sargon-profile/src/encrypted/pb_hkdf_sha256.rs similarity index 100% rename from crates/sargon/src/profile/encrypted/pb_hkdf_sha256.rs rename to crates/sargon-profile/src/encrypted/pb_hkdf_sha256.rs diff --git a/crates/sargon/src/profile/encrypted/versioned_algorithm.rs b/crates/sargon-profile/src/encrypted/versioned_algorithm.rs similarity index 100% rename from crates/sargon/src/profile/encrypted/versioned_algorithm.rs rename to crates/sargon-profile/src/encrypted/versioned_algorithm.rs diff --git a/crates/sargon-profile/src/lib.rs b/crates/sargon-profile/src/lib.rs new file mode 100644 index 000000000..acad24e95 --- /dev/null +++ b/crates/sargon-profile/src/lib.rs @@ -0,0 +1,28 @@ +#![allow(trivial_bounds)] +#![allow(incomplete_features)] +#![feature(trivial_bounds)] +#![feature(let_chains)] +#![feature(generic_const_exprs)] + +mod encrypted; +mod profilesnapshot_version; +mod samples; +mod supporting_types; +mod v100; + +pub mod prelude { + + pub use identified_vec_of::prelude::*; + pub use sargon_addresses::prelude::*; + pub use sargon_core::prelude::*; + pub use sargon_factors::prelude::*; + pub use sargon_hierarchical_deterministic::prelude::*; + pub use sargon_profile_app_preferences::prelude::*; + pub use sargon_transaction_models::prelude::*; + + pub use crate::encrypted::*; + pub use crate::profilesnapshot_version::*; + pub use crate::samples::*; + pub use crate::supporting_types::*; + pub use crate::v100::*; +} diff --git a/crates/sargon/src/profile/profilesnapshot_version.rs b/crates/sargon-profile/src/profilesnapshot_version.rs similarity index 94% rename from crates/sargon/src/profile/profilesnapshot_version.rs rename to crates/sargon-profile/src/profilesnapshot_version.rs index 04a7fb16c..88eebd5c3 100644 --- a/crates/sargon/src/profile/profilesnapshot_version.rs +++ b/crates/sargon-profile/src/profilesnapshot_version.rs @@ -55,12 +55,9 @@ impl HasSampleValues for ProfileSnapshotVersion { #[cfg(test)] mod tests { - use crate::{ - assert_json_value_eq_after_roundtrip, assert_json_value_fails, - }; - use serde_json::json; - use super::ProfileSnapshotVersion; + use super::*; + use serde_json::json; #[test] fn json() { diff --git a/crates/sargon/src/types/samples/access_controller_address_samples.rs b/crates/sargon-profile/src/samples/access_controller_address_samples.rs similarity index 90% rename from crates/sargon/src/types/samples/access_controller_address_samples.rs rename to crates/sargon-profile/src/samples/access_controller_address_samples.rs index dbe70874f..9f5be41fc 100644 --- a/crates/sargon/src/types/samples/access_controller_address_samples.rs +++ b/crates/sargon-profile/src/samples/access_controller_address_samples.rs @@ -1,7 +1,4 @@ -use crate::{ - AccessControllerAddress, AccountAddress, HasNodeId, IdentityAddress, - IsNetworkAware, -}; +use crate::prelude::*; pub trait SamplesFromAccountAddress { fn sample_from_account_address(account_address: AccountAddress) -> Self; diff --git a/crates/sargon/src/types/samples/account_address_samples.rs b/crates/sargon-profile/src/samples/account_address_samples.rs similarity index 81% rename from crates/sargon/src/types/samples/account_address_samples.rs rename to crates/sargon-profile/src/samples/account_address_samples.rs index 619546fe4..f7724a93a 100644 --- a/crates/sargon/src/types/samples/account_address_samples.rs +++ b/crates/sargon-profile/src/samples/account_address_samples.rs @@ -1,5 +1,4 @@ use crate::prelude::*; -use crate::types::samples::{HasIndexedSampleValues, HasManySampleValues}; impl HasIndexedSampleValues for AccountAddress { fn sample_at(index: usize) -> Self { diff --git a/crates/sargon/src/types/samples/account_samples.rs b/crates/sargon-profile/src/samples/account_samples.rs similarity index 93% rename from crates/sargon/src/types/samples/account_samples.rs rename to crates/sargon-profile/src/samples/account_samples.rs index f50e37e77..f11e2bbe4 100644 --- a/crates/sargon/src/types/samples/account_samples.rs +++ b/crates/sargon-profile/src/samples/account_samples.rs @@ -1,6 +1,5 @@ use crate::prelude::*; -use crate::types::samples::access_controller_address_samples::SamplesFromAccountAddress; -use radix_common::address; +use once_cell::sync::Lazy; static ALL_ACCOUNT_SAMPLES: Lazy<[Account; 10]> = Lazy::new(|| { [ @@ -167,17 +166,21 @@ impl Account { let role = make_role(); assert_eq!(role.get_role_kind(), RoleKind::Primary, "If this tests fails you can update the code below to not be hardcoded to set the primary role..."); let mut matrix = MatrixOfFactorInstances::sample(); - matrix.primary_role = PrimaryRoleWithFactorInstances::with_factors( - role.get_threshold(), - role.get_threshold_factors() - .into_iter() - .map(FactorInstance::from) - .collect_vec(), - role.get_override_factors() - .into_iter() - .map(FactorInstance::from) - .collect_vec(), - ); + unsafe { + matrix.set_primary_role( + PrimaryRoleWithFactorInstances::with_factors( + role.get_threshold(), + role.get_threshold_factors() + .into_iter() + .map(FactorInstance::from) + .collect_vec(), + role.get_override_factors() + .into_iter() + .map(FactorInstance::from) + .collect_vec(), + ), + ); + } let network_id = NetworkID::Mainnet; let address = diff --git a/crates/sargon/src/types/samples/identity_address_samples.rs b/crates/sargon-profile/src/samples/identity_address_samples.rs similarity index 100% rename from crates/sargon/src/types/samples/identity_address_samples.rs rename to crates/sargon-profile/src/samples/identity_address_samples.rs diff --git a/crates/sargon/src/types/samples/mod.rs b/crates/sargon-profile/src/samples/mod.rs similarity index 51% rename from crates/sargon/src/types/samples/mod.rs rename to crates/sargon-profile/src/samples/mod.rs index 0681ba86f..479dffe70 100644 --- a/crates/sargon/src/types/samples/mod.rs +++ b/crates/sargon-profile/src/samples/mod.rs @@ -1,15 +1,9 @@ mod access_controller_address_samples; mod account_address_samples; mod account_samples; -mod general_role_with_hd_factor_instance_samples; mod identity_address_samples; mod persona_samples; mod profile_samples; pub use access_controller_address_samples::*; -pub use account_address_samples::*; -pub use account_samples::*; -pub use general_role_with_hd_factor_instance_samples::*; pub use identity_address_samples::*; -pub use persona_samples::*; -pub use profile_samples::*; diff --git a/crates/sargon/src/types/samples/persona_samples.rs b/crates/sargon-profile/src/samples/persona_samples.rs similarity index 92% rename from crates/sargon/src/types/samples/persona_samples.rs rename to crates/sargon-profile/src/samples/persona_samples.rs index 13c172620..c82f74f87 100644 --- a/crates/sargon/src/types/samples/persona_samples.rs +++ b/crates/sargon-profile/src/samples/persona_samples.rs @@ -1,5 +1,5 @@ use crate::prelude::*; -use crate::types::samples::access_controller_address_samples::SamplesFromIdentityAddress; +use once_cell::sync::Lazy; static ALL_PERSONA_SAMPLES: Lazy<[Persona; 8]> = Lazy::new(|| { [ @@ -132,7 +132,7 @@ impl UnsafeHardcodingDerivationPathAsPersona unsafe fn invalid_hard_coding_derivation_path_as_persona(&self) -> Self { unsafe { Self::new( - self.factor_source_id(), + self.factor_source_id, HierarchicalDeterministicPublicKey::new( self.public_key(), self.derivation_path().as_persona(), @@ -175,19 +175,22 @@ impl Persona { let role = make_role(); assert_eq!(role.get_role_kind(), RoleKind::Primary, "If this tests fails you can update the code below to not be hardcoded to set the primary role..."); let mut matrix = MatrixOfFactorInstances::sample(); - matrix.primary_role = PrimaryRoleWithFactorInstances::with_factors( - role.get_threshold(), - role.get_threshold_factors() - .into_iter() - .map(FactorInstance::from) - .collect_vec(), - role.get_override_factors() - .into_iter() - .map(FactorInstance::from) - .collect_vec(), - ); + unsafe { - matrix.recovery_role = + matrix.set_primary_role( + PrimaryRoleWithFactorInstances::with_factors( + role.get_threshold(), + role.get_threshold_factors() + .into_iter() + .map(FactorInstance::from) + .collect_vec(), + role.get_override_factors() + .into_iter() + .map(FactorInstance::from) + .collect_vec(), + ), + ); + matrix.set_recovery_role( RecoveryRoleWithFactorInstances::with_factors( 0, [], @@ -201,8 +204,9 @@ impl Persona { }) .map(FactorInstance::from) .collect_vec(), - ); - matrix.confirmation_role = + ), + ); + matrix.set_confirmation_role( ConfirmationRoleWithFactorInstances::with_factors( 0, [], @@ -216,7 +220,8 @@ impl Persona { }) .map(FactorInstance::from) .collect_vec(), - ); + ), + ); } let address = IdentityAddress::new(veci.public_key(), NetworkID::Mainnet); diff --git a/crates/sargon/src/types/samples/profile_samples.rs b/crates/sargon-profile/src/samples/profile_samples.rs similarity index 100% rename from crates/sargon/src/types/samples/profile_samples.rs rename to crates/sargon-profile/src/samples/profile_samples.rs diff --git a/crates/sargon/src/profile/supporting_types/account_for_display.rs b/crates/sargon-profile/src/supporting_types/account_for_display.rs similarity index 100% rename from crates/sargon/src/profile/supporting_types/account_for_display.rs rename to crates/sargon-profile/src/supporting_types/account_for_display.rs diff --git a/crates/sargon/src/profile/supporting_types/account_or_persona.rs b/crates/sargon-profile/src/supporting_types/account_or_persona.rs similarity index 97% rename from crates/sargon/src/profile/supporting_types/account_or_persona.rs rename to crates/sargon-profile/src/supporting_types/account_or_persona.rs index ecadf2e5d..21025b226 100644 --- a/crates/sargon/src/profile/supporting_types/account_or_persona.rs +++ b/crates/sargon-profile/src/supporting_types/account_or_persona.rs @@ -20,6 +20,11 @@ impl HasEntityKindObjectSafe for AccountOrPersona { } } } +impl HasFactorInstances for AccountOrPersona { + fn unique_tx_signing_factor_instances(&self) -> IndexSet { + self.security_state().unique_tx_signing_factor_instances() + } +} impl HasSecurityState for AccountOrPersona { fn security_state(&self) -> EntitySecurityState { match self { diff --git a/crates/sargon/src/profile/supporting_types/accounts_for_display.rs b/crates/sargon-profile/src/supporting_types/accounts_for_display.rs similarity index 100% rename from crates/sargon/src/profile/supporting_types/accounts_for_display.rs rename to crates/sargon-profile/src/supporting_types/accounts_for_display.rs diff --git a/crates/sargon/src/profile/supporting_types/accounts_or_personas.rs b/crates/sargon-profile/src/supporting_types/accounts_or_personas.rs similarity index 100% rename from crates/sargon/src/profile/supporting_types/accounts_or_personas.rs rename to crates/sargon-profile/src/supporting_types/accounts_or_personas.rs diff --git a/crates/sargon/src/profile/supporting_types/authorized_dapp_detailed.rs b/crates/sargon-profile/src/supporting_types/authorized_dapp_detailed.rs similarity index 100% rename from crates/sargon/src/profile/supporting_types/authorized_dapp_detailed.rs rename to crates/sargon-profile/src/supporting_types/authorized_dapp_detailed.rs diff --git a/crates/sargon/src/profile/supporting_types/authorized_persona_detailed.rs b/crates/sargon-profile/src/supporting_types/authorized_persona_detailed.rs similarity index 100% rename from crates/sargon/src/profile/supporting_types/authorized_persona_detailed.rs rename to crates/sargon-profile/src/supporting_types/authorized_persona_detailed.rs diff --git a/crates/sargon/src/profile/supporting_types/detailed_authorized_personas.rs b/crates/sargon-profile/src/supporting_types/detailed_authorized_personas.rs similarity index 100% rename from crates/sargon/src/profile/supporting_types/detailed_authorized_personas.rs rename to crates/sargon-profile/src/supporting_types/detailed_authorized_personas.rs diff --git a/crates/sargon/src/profile/supporting_types/mod.rs b/crates/sargon-profile/src/supporting_types/mod.rs similarity index 100% rename from crates/sargon/src/profile/supporting_types/mod.rs rename to crates/sargon-profile/src/supporting_types/mod.rs diff --git a/crates/sargon/src/profile/supporting_types/on_same_network_validating.rs b/crates/sargon-profile/src/supporting_types/on_same_network_validating.rs similarity index 100% rename from crates/sargon/src/profile/supporting_types/on_same_network_validating.rs rename to crates/sargon-profile/src/supporting_types/on_same_network_validating.rs diff --git a/crates/sargon/src/profile/v100/entities_linked_to_factor_source/entities_linked_to_factor_source.rs b/crates/sargon-profile/src/v100/entities_linked_to_factor_source/entities_linked_to_factor_source.rs similarity index 100% rename from crates/sargon/src/profile/v100/entities_linked_to_factor_source/entities_linked_to_factor_source.rs rename to crates/sargon-profile/src/v100/entities_linked_to_factor_source/entities_linked_to_factor_source.rs diff --git a/crates/sargon/src/profile/v100/entities_linked_to_factor_source/integrity/device.rs b/crates/sargon-profile/src/v100/entities_linked_to_factor_source/integrity/device.rs similarity index 100% rename from crates/sargon/src/profile/v100/entities_linked_to_factor_source/integrity/device.rs rename to crates/sargon-profile/src/v100/entities_linked_to_factor_source/integrity/device.rs diff --git a/crates/sargon/src/profile/v100/entities_linked_to_factor_source/integrity/integrity.rs b/crates/sargon-profile/src/v100/entities_linked_to_factor_source/integrity/integrity.rs similarity index 100% rename from crates/sargon/src/profile/v100/entities_linked_to_factor_source/integrity/integrity.rs rename to crates/sargon-profile/src/v100/entities_linked_to_factor_source/integrity/integrity.rs diff --git a/crates/sargon/src/profile/v100/entities_linked_to_factor_source/integrity/mod.rs b/crates/sargon-profile/src/v100/entities_linked_to_factor_source/integrity/mod.rs similarity index 100% rename from crates/sargon/src/profile/v100/entities_linked_to_factor_source/integrity/mod.rs rename to crates/sargon-profile/src/v100/entities_linked_to_factor_source/integrity/mod.rs diff --git a/crates/sargon/src/profile/v100/entities_linked_to_factor_source/mod.rs b/crates/sargon-profile/src/v100/entities_linked_to_factor_source/mod.rs similarity index 100% rename from crates/sargon/src/profile/v100/entities_linked_to_factor_source/mod.rs rename to crates/sargon-profile/src/v100/entities_linked_to_factor_source/mod.rs diff --git a/crates/sargon/src/profile/v100/entities_linked_to_factor_source/profile_to_check.rs b/crates/sargon-profile/src/v100/entities_linked_to_factor_source/profile_to_check.rs similarity index 100% rename from crates/sargon/src/profile/v100/entities_linked_to_factor_source/profile_to_check.rs rename to crates/sargon-profile/src/v100/entities_linked_to_factor_source/profile_to_check.rs diff --git a/crates/sargon/src/profile/v100/entity/abstract_entity_type.rs b/crates/sargon-profile/src/v100/entity/abstract_entity_type.rs similarity index 100% rename from crates/sargon/src/profile/v100/entity/abstract_entity_type.rs rename to crates/sargon-profile/src/v100/entity/abstract_entity_type.rs diff --git a/crates/sargon/src/profile/v100/entity/account/account.rs b/crates/sargon-profile/src/v100/entity/account/account.rs similarity index 96% rename from crates/sargon/src/profile/v100/entity/account/account.rs rename to crates/sargon-profile/src/v100/entity/account/account.rs index 352669dd8..ef0510cb2 100644 --- a/crates/sargon/src/profile/v100/entity/account/account.rs +++ b/crates/sargon-profile/src/v100/entity/account/account.rs @@ -78,6 +78,12 @@ impl HasEntityKind for Account { } } +impl HasFactorInstances for Account { + fn unique_tx_signing_factor_instances(&self) -> IndexSet { + self.security_state().unique_tx_signing_factor_instances() + } +} + impl HasSecurityState for Account { fn security_state(&self) -> EntitySecurityState { self.security_state.clone() @@ -113,29 +119,6 @@ impl IsBaseEntity for Account { impl IsEntity for Account { type Path = AccountPath; - fn profile_modified_event( - is_update: bool, - addresses: IndexSet, - ) -> Option { - let address = addresses.iter().last().cloned()?; - let addresses = addresses.clone().into_iter().collect_vec(); - let is_many = addresses.len() > 1; - match (is_update, is_many) { - (true, true) => { - Some(EventProfileModified::AccountsUpdated { addresses }) - } - (false, true) => { - Some(EventProfileModified::AccountsAdded { addresses }) - } - (true, false) => { - Some(EventProfileModified::AccountUpdated { address }) - } - (false, false) => { - Some(EventProfileModified::AccountAdded { address }) - } - } - } - fn with_veci_and_name( veci: HDFactorInstanceTransactionSigning, name: DisplayName, diff --git a/crates/sargon/src/profile/v100/entity/account/mod.rs b/crates/sargon-profile/src/v100/entity/account/mod.rs similarity index 100% rename from crates/sargon/src/profile/v100/entity/account/mod.rs rename to crates/sargon-profile/src/v100/entity/account/mod.rs diff --git a/crates/sargon-profile/src/v100/entity/account/on_ledger_settings/mod.rs b/crates/sargon-profile/src/v100/entity/account/on_ledger_settings/mod.rs new file mode 100644 index 000000000..46488527c --- /dev/null +++ b/crates/sargon-profile/src/v100/entity/account/on_ledger_settings/mod.rs @@ -0,0 +1,3 @@ +mod on_ledger_settings; + +pub use on_ledger_settings::*; diff --git a/crates/sargon/src/profile/v100/entity/account/on_ledger_settings/on_ledger_settings.rs b/crates/sargon-profile/src/v100/entity/account/on_ledger_settings/on_ledger_settings.rs similarity index 100% rename from crates/sargon/src/profile/v100/entity/account/on_ledger_settings/on_ledger_settings.rs rename to crates/sargon-profile/src/v100/entity/account/on_ledger_settings/on_ledger_settings.rs diff --git a/crates/sargon/src/profile/v100/entity/entity_flag.rs b/crates/sargon-profile/src/v100/entity/entity_flag.rs similarity index 100% rename from crates/sargon/src/profile/v100/entity/entity_flag.rs rename to crates/sargon-profile/src/v100/entity/entity_flag.rs diff --git a/crates/sargon/src/profile/v100/entity/entity_flags.rs b/crates/sargon-profile/src/v100/entity/entity_flags.rs similarity index 100% rename from crates/sargon/src/profile/v100/entity/entity_flags.rs rename to crates/sargon-profile/src/v100/entity/entity_flags.rs diff --git a/crates/sargon/src/profile/v100/entity/has_security_state.rs b/crates/sargon-profile/src/v100/entity/has_security_state.rs similarity index 96% rename from crates/sargon/src/profile/v100/entity/has_security_state.rs rename to crates/sargon-profile/src/v100/entity/has_security_state.rs index 2f79b4df2..6c47dbb39 100644 --- a/crates/sargon/src/profile/v100/entity/has_security_state.rs +++ b/crates/sargon-profile/src/v100/entity/has_security_state.rs @@ -54,12 +54,6 @@ pub trait HasSecurityState: HasFactorInstances + IsSecurityStateAware { } } -impl HasFactorInstances for T { - fn unique_tx_signing_factor_instances(&self) -> IndexSet { - self.security_state().unique_tx_signing_factor_instances() - } -} - #[cfg(test)] mod tests { diff --git a/crates/sargon/src/profile/v100/entity/is_entity.rs b/crates/sargon-profile/src/v100/entity/is_entity.rs similarity index 82% rename from crates/sargon/src/profile/v100/entity/is_entity.rs rename to crates/sargon-profile/src/v100/entity/is_entity.rs index 01ca22433..17da4188b 100644 --- a/crates/sargon/src/profile/v100/entity/is_entity.rs +++ b/crates/sargon-profile/src/v100/entity/is_entity.rs @@ -30,12 +30,6 @@ pub trait IsBaseEntity: } } -// impl IsNetworkAware for T { -// fn network_id(&self) -> NetworkID { -// self.address().network_id() -// } -// } - /// A trait bridging Account and Persona. pub trait IsEntity: IsBaseEntity @@ -50,11 +44,6 @@ pub trait IsEntity: { type Path: IsEntityPath; - fn profile_modified_event( - is_update: bool, - addresses: IndexSet, - ) -> Option; - fn with_veci_and_name( veci: HDFactorInstanceTransactionSigning, name: DisplayName, diff --git a/crates/sargon/src/profile/v100/entity/mod.rs b/crates/sargon-profile/src/v100/entity/mod.rs similarity index 100% rename from crates/sargon/src/profile/v100/entity/mod.rs rename to crates/sargon-profile/src/v100/entity/mod.rs diff --git a/crates/sargon/src/profile/v100/entity/persona/mod.rs b/crates/sargon-profile/src/v100/entity/persona/mod.rs similarity index 100% rename from crates/sargon/src/profile/v100/entity/persona/mod.rs rename to crates/sargon-profile/src/v100/entity/persona/mod.rs diff --git a/crates/sargon/src/profile/v100/entity/persona/persona.rs b/crates/sargon-profile/src/v100/entity/persona/persona.rs similarity index 96% rename from crates/sargon/src/profile/v100/entity/persona/persona.rs rename to crates/sargon-profile/src/v100/entity/persona/persona.rs index 0e2ef4e6e..b6be8e40e 100644 --- a/crates/sargon/src/profile/v100/entity/persona/persona.rs +++ b/crates/sargon-profile/src/v100/entity/persona/persona.rs @@ -71,6 +71,13 @@ impl IsSecurityStateAware for Persona { self.security_state().is_securified() } } + +impl HasFactorInstances for Persona { + fn unique_tx_signing_factor_instances(&self) -> IndexSet { + self.security_state().unique_tx_signing_factor_instances() + } +} + impl HasSecurityState for Persona { fn security_state(&self) -> EntitySecurityState { self.security_state.clone() @@ -114,28 +121,6 @@ impl IsNetworkAware for Persona { impl IsEntity for Persona { type Path = IdentityPath; - fn profile_modified_event( - is_update: bool, - addresses: IndexSet, - ) -> Option { - let address = addresses.iter().last().cloned()?; - let addresses = addresses.clone().into_iter().collect_vec(); - let is_many = addresses.len() > 1; - match (is_update, is_many) { - (true, true) => { - Some(EventProfileModified::PersonasUpdated { addresses }) - } - (false, true) => { - Some(EventProfileModified::PersonasAdded { addresses }) - } - (true, false) => { - Some(EventProfileModified::PersonaUpdated { address }) - } - (false, false) => { - Some(EventProfileModified::PersonaAdded { address }) - } - } - } fn with_veci_and_name( veci: HDFactorInstanceTransactionSigning, name: DisplayName, @@ -178,7 +163,6 @@ impl Persona { } impl Persona { - #[cfg(not(tarpaulin_include))] // false negative fn sample_at_index_name_network( network_id: NetworkID, index: u32, @@ -235,7 +219,6 @@ impl Persona { persona } - #[cfg(not(tarpaulin_include))] // false negative fn sample_at_index_name( index: u32, display_name: &str, diff --git a/crates/sargon/src/profile/v100/entity/persona/persona_data/collection_of_email_addresses.rs b/crates/sargon-profile/src/v100/entity/persona/persona_data/collection_of_email_addresses.rs similarity index 100% rename from crates/sargon/src/profile/v100/entity/persona/persona_data/collection_of_email_addresses.rs rename to crates/sargon-profile/src/v100/entity/persona/persona_data/collection_of_email_addresses.rs diff --git a/crates/sargon/src/profile/v100/entity/persona/persona_data/collection_of_phone_numbers.rs b/crates/sargon-profile/src/v100/entity/persona/persona_data/collection_of_phone_numbers.rs similarity index 100% rename from crates/sargon/src/profile/v100/entity/persona/persona_data/collection_of_phone_numbers.rs rename to crates/sargon-profile/src/v100/entity/persona/persona_data/collection_of_phone_numbers.rs diff --git a/crates/sargon/src/profile/v100/entity/persona/persona_data/entry_kinds/mod.rs b/crates/sargon-profile/src/v100/entity/persona/persona_data/entry_kinds/mod.rs similarity index 100% rename from crates/sargon/src/profile/v100/entity/persona/persona_data/entry_kinds/mod.rs rename to crates/sargon-profile/src/v100/entity/persona/persona_data/entry_kinds/mod.rs diff --git a/crates/sargon/src/profile/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_email_address.rs b/crates/sargon-profile/src/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_email_address.rs similarity index 100% rename from crates/sargon/src/profile/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_email_address.rs rename to crates/sargon-profile/src/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_email_address.rs diff --git a/crates/sargon/src/profile/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_name.rs b/crates/sargon-profile/src/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_name.rs similarity index 100% rename from crates/sargon/src/profile/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_name.rs rename to crates/sargon-profile/src/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_name.rs diff --git a/crates/sargon/src/profile/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_phone_number.rs b/crates/sargon-profile/src/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_phone_number.rs similarity index 100% rename from crates/sargon/src/profile/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_phone_number.rs rename to crates/sargon-profile/src/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_phone_number.rs diff --git a/crates/sargon/src/profile/v100/entity/persona/persona_data/mod.rs b/crates/sargon-profile/src/v100/entity/persona/persona_data/mod.rs similarity index 87% rename from crates/sargon/src/profile/v100/entity/persona/persona_data/mod.rs rename to crates/sargon-profile/src/v100/entity/persona/persona_data/mod.rs index b53f57212..129056592 100644 --- a/crates/sargon/src/profile/v100/entity/persona/persona_data/mod.rs +++ b/crates/sargon-profile/src/v100/entity/persona/persona_data/mod.rs @@ -11,5 +11,5 @@ pub use collection_of_phone_numbers::*; pub use entry_kinds::*; pub use persona_data::*; pub use persona_data_entry_id::*; -pub use persona_data_identified_collection_types::*; +pub(crate) use persona_data_identified_collection_types::*; pub use persona_data_identified_entry_types::*; diff --git a/crates/sargon/src/profile/v100/entity/persona/persona_data/persona_data.rs b/crates/sargon-profile/src/v100/entity/persona/persona_data/persona_data.rs similarity index 100% rename from crates/sargon/src/profile/v100/entity/persona/persona_data/persona_data.rs rename to crates/sargon-profile/src/v100/entity/persona/persona_data/persona_data.rs diff --git a/crates/sargon/src/profile/v100/entity/persona/persona_data/persona_data_entry_id.rs b/crates/sargon-profile/src/v100/entity/persona/persona_data/persona_data_entry_id.rs similarity index 100% rename from crates/sargon/src/profile/v100/entity/persona/persona_data/persona_data_entry_id.rs rename to crates/sargon-profile/src/v100/entity/persona/persona_data/persona_data_entry_id.rs diff --git a/crates/sargon/src/profile/v100/entity/persona/persona_data/persona_data_identified_collection_types.rs b/crates/sargon-profile/src/v100/entity/persona/persona_data/persona_data_identified_collection_types.rs similarity index 100% rename from crates/sargon/src/profile/v100/entity/persona/persona_data/persona_data_identified_collection_types.rs rename to crates/sargon-profile/src/v100/entity/persona/persona_data/persona_data_identified_collection_types.rs diff --git a/crates/sargon/src/profile/v100/entity/persona/persona_data/persona_data_identified_entry_types.rs b/crates/sargon-profile/src/v100/entity/persona/persona_data/persona_data_identified_entry_types.rs similarity index 100% rename from crates/sargon/src/profile/v100/entity/persona/persona_data/persona_data_identified_entry_types.rs rename to crates/sargon-profile/src/v100/entity/persona/persona_data/persona_data_identified_entry_types.rs diff --git a/crates/sargon/src/profile/v100/entity_security_state/entity_security_state.rs b/crates/sargon-profile/src/v100/entity_security_state/entity_security_state.rs similarity index 99% rename from crates/sargon/src/profile/v100/entity_security_state/entity_security_state.rs rename to crates/sargon-profile/src/v100/entity_security_state/entity_security_state.rs index 1bab332e7..e901e2f9a 100644 --- a/crates/sargon/src/profile/v100/entity_security_state/entity_security_state.rs +++ b/crates/sargon-profile/src/v100/entity_security_state/entity_security_state.rs @@ -50,7 +50,6 @@ impl HasProvisionalSecurifiedConfig for EntitySecurityState { } impl<'de> Deserialize<'de> for EntitySecurityState { - #[cfg(not(tarpaulin_include))] // false negative fn deserialize>( deserializer: D, ) -> Result { @@ -65,7 +64,6 @@ impl<'de> Deserialize<'de> for EntitySecurityState { } impl Serialize for EntitySecurityState { - #[cfg(not(tarpaulin_include))] // false negative fn serialize(&self, serializer: S) -> Result where S: Serializer, @@ -125,6 +123,7 @@ impl HasFactorInstances for EntitySecurityState { } } } + fn unique_all_factor_instances(&self) -> IndexSet { match self { EntitySecurityState::Unsecured { value } => { diff --git a/crates/sargon/src/profile/v100/entity_security_state/mod.rs b/crates/sargon-profile/src/v100/entity_security_state/mod.rs similarity index 100% rename from crates/sargon/src/profile/v100/entity_security_state/mod.rs rename to crates/sargon-profile/src/v100/entity_security_state/mod.rs diff --git a/crates/sargon/src/profile/v100/entity_security_state/provisional_securified_config.rs b/crates/sargon-profile/src/v100/entity_security_state/provisional_securified_config.rs similarity index 100% rename from crates/sargon/src/profile/v100/entity_security_state/provisional_securified_config.rs rename to crates/sargon-profile/src/v100/entity_security_state/provisional_securified_config.rs diff --git a/crates/sargon/src/profile/v100/entity_security_state/provisional_securified_transaction_queued.rs b/crates/sargon-profile/src/v100/entity_security_state/provisional_securified_transaction_queued.rs similarity index 100% rename from crates/sargon/src/profile/v100/entity_security_state/provisional_securified_transaction_queued.rs rename to crates/sargon-profile/src/v100/entity_security_state/provisional_securified_transaction_queued.rs diff --git a/crates/sargon/src/profile/v100/entity_security_state/unsecured_entity_control.rs b/crates/sargon-profile/src/v100/entity_security_state/unsecured_entity_control.rs similarity index 98% rename from crates/sargon/src/profile/v100/entity_security_state/unsecured_entity_control.rs rename to crates/sargon-profile/src/v100/entity_security_state/unsecured_entity_control.rs index 481ac357b..77700d8df 100644 --- a/crates/sargon/src/profile/v100/entity_security_state/unsecured_entity_control.rs +++ b/crates/sargon-profile/src/v100/entity_security_state/unsecured_entity_control.rs @@ -51,7 +51,6 @@ impl UnsecuredEntityControl { } } - #[cfg(not(tarpaulin_include))] // false negative pub fn new( transaction_signing: HierarchicalDeterministicFactorInstance, provisional_securified_config: impl Into< diff --git a/crates/sargon/src/profile/v100/header/content_hint.rs b/crates/sargon-profile/src/v100/header/content_hint.rs similarity index 100% rename from crates/sargon/src/profile/v100/header/content_hint.rs rename to crates/sargon-profile/src/v100/header/content_hint.rs diff --git a/crates/sargon/src/profile/v100/header/device_info.rs b/crates/sargon-profile/src/v100/header/device_info.rs similarity index 100% rename from crates/sargon/src/profile/v100/header/device_info.rs rename to crates/sargon-profile/src/v100/header/device_info.rs diff --git a/crates/sargon/src/profile/v100/header/header.rs b/crates/sargon-profile/src/v100/header/header.rs similarity index 100% rename from crates/sargon/src/profile/v100/header/header.rs rename to crates/sargon-profile/src/v100/header/header.rs diff --git a/crates/sargon/src/profile/v100/header/mod.rs b/crates/sargon-profile/src/v100/header/mod.rs similarity index 100% rename from crates/sargon/src/profile/v100/header/mod.rs rename to crates/sargon-profile/src/v100/header/mod.rs diff --git a/crates/sargon/src/profile/v100/header/profile_id.rs b/crates/sargon-profile/src/v100/header/profile_id.rs similarity index 100% rename from crates/sargon/src/profile/v100/header/profile_id.rs rename to crates/sargon-profile/src/v100/header/profile_id.rs diff --git a/crates/sargon/src/profile/v100/mod.rs b/crates/sargon-profile/src/v100/mod.rs similarity index 78% rename from crates/sargon/src/profile/v100/mod.rs rename to crates/sargon-profile/src/v100/mod.rs index 8c5fd0258..7eb7b9ba2 100644 --- a/crates/sargon/src/profile/v100/mod.rs +++ b/crates/sargon-profile/src/v100/mod.rs @@ -1,4 +1,3 @@ -mod app_preferences; mod entities_linked_to_factor_source; mod entity; mod entity_security_state; @@ -6,10 +5,9 @@ mod header; mod networks; mod profile; mod profile_file_contents; -mod profile_legacy_state_bugs; mod proto_profile_maybe_with_legacy_p2p_links; +mod secured_entity_control; -pub use app_preferences::*; pub use entities_linked_to_factor_source::*; pub use entity::*; pub use entity_security_state::*; @@ -17,5 +15,5 @@ pub use header::*; pub use networks::*; pub use profile::*; pub use profile_file_contents::*; -pub use profile_legacy_state_bugs::*; pub use proto_profile_maybe_with_legacy_p2p_links::*; +pub use secured_entity_control::*; diff --git a/crates/sargon/src/profile/v100/networks/mod.rs b/crates/sargon-profile/src/v100/networks/mod.rs similarity index 100% rename from crates/sargon/src/profile/v100/networks/mod.rs rename to crates/sargon-profile/src/v100/networks/mod.rs diff --git a/crates/sargon/src/profile/v100/networks/network/accounts.rs b/crates/sargon-profile/src/v100/networks/network/accounts.rs similarity index 100% rename from crates/sargon/src/profile/v100/networks/network/accounts.rs rename to crates/sargon-profile/src/v100/networks/network/accounts.rs diff --git a/crates/sargon/src/profile/v100/networks/network/authorized_dapp/authorized_dapp.rs b/crates/sargon-profile/src/v100/networks/network/authorized_dapp/authorized_dapp.rs similarity index 96% rename from crates/sargon/src/profile/v100/networks/network/authorized_dapp/authorized_dapp.rs rename to crates/sargon-profile/src/v100/networks/network/authorized_dapp/authorized_dapp.rs index 49bd58589..bca80141f 100644 --- a/crates/sargon/src/profile/v100/networks/network/authorized_dapp/authorized_dapp.rs +++ b/crates/sargon-profile/src/v100/networks/network/authorized_dapp/authorized_dapp.rs @@ -40,19 +40,6 @@ pub struct AuthorizedDapp { pub preferences: AuthorizedDappPreferences, } -impl AuthorizedDapp { - /// Removes the referenced account for this dApp - pub(crate) fn remove_referenced_account( - &mut self, - account_address: &AccountAddress, - ) { - self.references_to_authorized_personas - .update_all_with(|persona| { - persona.remove_shared_account(account_address); - }); - } -} - impl IsNetworkAware for AuthorizedDapp { fn network_id(&self) -> NetworkID { self.network_id @@ -104,8 +91,6 @@ impl Identifiable for AuthorizedDapp { } } -pub type DappDefinitionAddress = AccountAddress; - impl AuthorizedDapp { pub fn sample_mainnet_dashboard() -> Self { Self::new( diff --git a/crates/sargon/src/profile/v100/networks/network/authorized_dapp/authorized_persona_simple.rs b/crates/sargon-profile/src/v100/networks/network/authorized_dapp/authorized_persona_simple.rs similarity index 99% rename from crates/sargon/src/profile/v100/networks/network/authorized_dapp/authorized_persona_simple.rs rename to crates/sargon-profile/src/v100/networks/network/authorized_dapp/authorized_persona_simple.rs index d8a611588..8a1e5e0b3 100644 --- a/crates/sargon/src/profile/v100/networks/network/authorized_dapp/authorized_persona_simple.rs +++ b/crates/sargon-profile/src/v100/networks/network/authorized_dapp/authorized_persona_simple.rs @@ -38,7 +38,7 @@ pub struct AuthorizedPersonaSimple { impl AuthorizedPersonaSimple { /// Removes the referenced account from the shared accounts - pub(crate) fn remove_shared_account( + pub fn remove_shared_account( &mut self, account_address: &AccountAddress, ) -> bool { diff --git a/crates/sargon/src/profile/v100/networks/network/authorized_dapp/mod.rs b/crates/sargon-profile/src/v100/networks/network/authorized_dapp/mod.rs similarity index 93% rename from crates/sargon/src/profile/v100/networks/network/authorized_dapp/mod.rs rename to crates/sargon-profile/src/v100/networks/network/authorized_dapp/mod.rs index 715998394..5e1fcb1aa 100644 --- a/crates/sargon/src/profile/v100/networks/network/authorized_dapp/mod.rs +++ b/crates/sargon-profile/src/v100/networks/network/authorized_dapp/mod.rs @@ -14,4 +14,4 @@ pub use references_to_authorized_personas::*; pub use shared_persona_data::*; pub use shared_to_dapp_with_persona_account_addresses::*; pub use shared_to_dapp_with_persona_ids_of_persona_data_entries::*; -pub use shared_with_dapp::*; +pub(crate) use shared_with_dapp::*; diff --git a/crates/sargon/src/profile/v100/networks/network/authorized_dapp/preferences/authorized_dapp_preference_deposits.rs b/crates/sargon-profile/src/v100/networks/network/authorized_dapp/preferences/authorized_dapp_preference_deposits.rs similarity index 100% rename from crates/sargon/src/profile/v100/networks/network/authorized_dapp/preferences/authorized_dapp_preference_deposits.rs rename to crates/sargon-profile/src/v100/networks/network/authorized_dapp/preferences/authorized_dapp_preference_deposits.rs diff --git a/crates/sargon/src/profile/v100/networks/network/authorized_dapp/preferences/authorized_dapp_preferences.rs b/crates/sargon-profile/src/v100/networks/network/authorized_dapp/preferences/authorized_dapp_preferences.rs similarity index 100% rename from crates/sargon/src/profile/v100/networks/network/authorized_dapp/preferences/authorized_dapp_preferences.rs rename to crates/sargon-profile/src/v100/networks/network/authorized_dapp/preferences/authorized_dapp_preferences.rs diff --git a/crates/sargon/src/profile/v100/networks/network/authorized_dapp/preferences/mod.rs b/crates/sargon-profile/src/v100/networks/network/authorized_dapp/preferences/mod.rs similarity index 100% rename from crates/sargon/src/profile/v100/networks/network/authorized_dapp/preferences/mod.rs rename to crates/sargon-profile/src/v100/networks/network/authorized_dapp/preferences/mod.rs diff --git a/crates/sargon/src/profile/v100/networks/network/authorized_dapp/references_to_authorized_personas.rs b/crates/sargon-profile/src/v100/networks/network/authorized_dapp/references_to_authorized_personas.rs similarity index 100% rename from crates/sargon/src/profile/v100/networks/network/authorized_dapp/references_to_authorized_personas.rs rename to crates/sargon-profile/src/v100/networks/network/authorized_dapp/references_to_authorized_personas.rs diff --git a/crates/sargon/src/profile/v100/networks/network/authorized_dapp/shared_persona_data.rs b/crates/sargon-profile/src/v100/networks/network/authorized_dapp/shared_persona_data.rs similarity index 100% rename from crates/sargon/src/profile/v100/networks/network/authorized_dapp/shared_persona_data.rs rename to crates/sargon-profile/src/v100/networks/network/authorized_dapp/shared_persona_data.rs diff --git a/crates/sargon/src/profile/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_account_addresses.rs b/crates/sargon-profile/src/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_account_addresses.rs similarity index 100% rename from crates/sargon/src/profile/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_account_addresses.rs rename to crates/sargon-profile/src/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_account_addresses.rs diff --git a/crates/sargon/src/profile/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_ids_of_persona_data_entries.rs b/crates/sargon-profile/src/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_ids_of_persona_data_entries.rs similarity index 100% rename from crates/sargon/src/profile/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_ids_of_persona_data_entries.rs rename to crates/sargon-profile/src/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_ids_of_persona_data_entries.rs diff --git a/crates/sargon/src/profile/v100/networks/network/authorized_dapp/shared_with_dapp.rs b/crates/sargon-profile/src/v100/networks/network/authorized_dapp/shared_with_dapp.rs similarity index 100% rename from crates/sargon/src/profile/v100/networks/network/authorized_dapp/shared_with_dapp.rs rename to crates/sargon-profile/src/v100/networks/network/authorized_dapp/shared_with_dapp.rs diff --git a/crates/sargon/src/profile/v100/networks/network/authorized_dapps.rs b/crates/sargon-profile/src/v100/networks/network/authorized_dapps.rs similarity index 95% rename from crates/sargon/src/profile/v100/networks/network/authorized_dapps.rs rename to crates/sargon-profile/src/v100/networks/network/authorized_dapps.rs index 407423ec3..e760a010a 100644 --- a/crates/sargon/src/profile/v100/networks/network/authorized_dapps.rs +++ b/crates/sargon-profile/src/v100/networks/network/authorized_dapps.rs @@ -5,19 +5,6 @@ decl_identified_vec_of!( AuthorizedDapp ); -pub(crate) trait ReferencedAccountRemoving { - fn remove_referenced_account(&mut self, account_address: &AccountAddress); -} - -impl ReferencedAccountRemoving for AuthorizedDapps { - /// Remove referenced account from all the dApps - fn remove_referenced_account(&mut self, account_address: &AccountAddress) { - self.update_all_with(|dapp| { - dapp.remove_referenced_account(account_address); - }) - } -} - impl HasSampleValues for AuthorizedDapps { /// A sample used to facilitate unit tests. fn sample() -> Self { diff --git a/crates/sargon/src/profile/v100/networks/network/mod.rs b/crates/sargon-profile/src/v100/networks/network/mod.rs similarity index 100% rename from crates/sargon/src/profile/v100/networks/network/mod.rs rename to crates/sargon-profile/src/v100/networks/network/mod.rs diff --git a/crates/sargon/src/profile/v100/networks/network/personas.rs b/crates/sargon-profile/src/v100/networks/network/personas.rs similarity index 100% rename from crates/sargon/src/profile/v100/networks/network/personas.rs rename to crates/sargon-profile/src/v100/networks/network/personas.rs diff --git a/crates/sargon/src/profile/v100/networks/network/profile_network.rs b/crates/sargon-profile/src/v100/networks/network/profile_network.rs similarity index 91% rename from crates/sargon/src/profile/v100/networks/network/profile_network.rs rename to crates/sargon-profile/src/v100/networks/network/profile_network.rs index dc0551206..2ca38157c 100644 --- a/crates/sargon/src/profile/v100/networks/network/profile_network.rs +++ b/crates/sargon-profile/src/v100/networks/network/profile_network.rs @@ -158,94 +158,6 @@ impl ProfileNetwork { } } -impl ProfileNetwork { - pub fn update_entities( - &mut self, - updated_entities: IdentifiedVecOf, - ) -> Result<()> { - self.update_entities_erased( - updated_entities.into_iter().map(Into::into).collect(), - ) - } - - pub fn update_entities_erased( - &mut self, - updated_entities: IdentifiedVecOf, - ) -> Result<()> { - for entity in updated_entities { - match entity { - AccountOrPersona::AccountEntity(account) => self - .accounts - .try_update_with(&account.id(), |a| *a = account.clone()) - .map_err(|_| CommonError::UnknownAccount), - AccountOrPersona::PersonaEntity(persona) => self - .personas - .try_update_with(&persona.id(), |p| *p = persona.clone()) - .map_err(|_| CommonError::UnknownPersona), - }?; - } - Ok(()) - } - - /// Returns a clone of the updated account if found, else None. - pub fn update_account( - &mut self, - address: &AccountAddress, - mutate: F, - ) -> Option - where - F: FnMut(&mut Account), - { - if self.accounts.update_with(address, mutate) { - self.accounts.get_id(address).cloned() - } else { - None - } - } - - /// Hides the account associated with the `account_address` - pub(crate) fn hide_account( - &mut self, - account_address: &AccountAddress, - ) -> Option { - let account = self.update_account(account_address, |account| { - account.mark_as_hidden(); - }); - self.authorized_dapps - .remove_referenced_account(account_address); - account - } - - /// Tombstones the account associated with the `account_address` - pub(crate) fn tombstone_account( - &mut self, - account_address: &AccountAddress, - ) -> Option { - let account = self.update_account(account_address, |account| { - account.mark_as_tombstoned(); - }); - self.authorized_dapps - .remove_referenced_account(account_address); - account - } - - /// Returns a clone of the updated persona if found, else None. - pub fn update_persona( - &mut self, - address: &IdentityAddress, - mutate: F, - ) -> Option - where - F: FnMut(&mut Persona), - { - if self.personas.update_with(address, mutate) { - self.personas.get_id(address).cloned() - } else { - None - } - } -} - impl HasSampleValues for ProfileNetwork { /// A sample used to facilitate unit tests. fn sample() -> Self { diff --git a/crates/sargon/src/profile/v100/networks/network/resource_preferences/hidden_resources.rs b/crates/sargon-profile/src/v100/networks/network/resource_preferences/hidden_resources.rs similarity index 100% rename from crates/sargon/src/profile/v100/networks/network/resource_preferences/hidden_resources.rs rename to crates/sargon-profile/src/v100/networks/network/resource_preferences/hidden_resources.rs diff --git a/crates/sargon/src/profile/v100/networks/network/resource_preferences/mod.rs b/crates/sargon-profile/src/v100/networks/network/resource_preferences/mod.rs similarity index 100% rename from crates/sargon/src/profile/v100/networks/network/resource_preferences/mod.rs rename to crates/sargon-profile/src/v100/networks/network/resource_preferences/mod.rs diff --git a/crates/sargon/src/profile/v100/networks/network/resource_preferences/resource_app_preference.rs b/crates/sargon-profile/src/v100/networks/network/resource_preferences/resource_app_preference.rs similarity index 100% rename from crates/sargon/src/profile/v100/networks/network/resource_preferences/resource_app_preference.rs rename to crates/sargon-profile/src/v100/networks/network/resource_preferences/resource_app_preference.rs diff --git a/crates/sargon/src/profile/v100/networks/network/resource_preferences/resource_identifier.rs b/crates/sargon-profile/src/v100/networks/network/resource_preferences/resource_identifier.rs similarity index 100% rename from crates/sargon/src/profile/v100/networks/network/resource_preferences/resource_identifier.rs rename to crates/sargon-profile/src/v100/networks/network/resource_preferences/resource_identifier.rs diff --git a/crates/sargon/src/profile/v100/networks/network/resource_preferences/resource_preferences.rs b/crates/sargon-profile/src/v100/networks/network/resource_preferences/resource_preferences.rs similarity index 98% rename from crates/sargon/src/profile/v100/networks/network/resource_preferences/resource_preferences.rs rename to crates/sargon-profile/src/v100/networks/network/resource_preferences/resource_preferences.rs index c1335d5f5..d59fe993b 100644 --- a/crates/sargon/src/profile/v100/networks/network/resource_preferences/resource_preferences.rs +++ b/crates/sargon-profile/src/v100/networks/network/resource_preferences/resource_preferences.rs @@ -1,6 +1,5 @@ use crate::prelude::*; use core::hash::Hash; -use std::{hash::Hasher, ops::Index}; decl_identified_vec_of!( /// User off-ledger preferences regarding resources. @@ -90,7 +89,6 @@ mod tests { #[test] fn hidden_resources() { - use crate::ResourceIdentifier::*; let mut sut = SUT::new(); // Test with no resources hidden diff --git a/crates/sargon/src/profile/v100/networks/network/resource_preferences/resource_visibility.rs b/crates/sargon-profile/src/v100/networks/network/resource_preferences/resource_visibility.rs similarity index 100% rename from crates/sargon/src/profile/v100/networks/network/resource_preferences/resource_visibility.rs rename to crates/sargon-profile/src/v100/networks/network/resource_preferences/resource_visibility.rs diff --git a/crates/sargon/src/profile/v100/networks/profile_networks.rs b/crates/sargon-profile/src/v100/networks/profile_networks.rs similarity index 81% rename from crates/sargon/src/profile/v100/networks/profile_networks.rs rename to crates/sargon-profile/src/v100/networks/profile_networks.rs index b54e37420..db1ecc6ba 100644 --- a/crates/sargon/src/profile/v100/networks/profile_networks.rs +++ b/crates/sargon-profile/src/v100/networks/profile_networks.rs @@ -7,126 +7,8 @@ decl_identified_vec_of!( ProfileNetwork ); -pub trait EntityOnNetworkHandling { - fn get_account(&self, address: &AccountAddress) -> Option; - fn get_persona(&self, address: &IdentityAddress) -> Option; - fn update_entities( - &mut self, - updated_entities: IdentifiedVecOf, - ) -> Result<()>; - fn update_entities_erased( - &mut self, - updated_entities: IdentifiedVecOf, - ) -> Result<()>; - - fn update_account( - &mut self, - address: &AccountAddress, - mutate: F, - ) -> Option - where - F: FnMut(&mut Account); - - fn hide_account(&mut self, account_address: &AccountAddress) -> bool; - - fn tombstone_account(&mut self, account_address: &AccountAddress) -> bool; - - /// Tombstones the accounts - fn tombstone_accounts(&mut self, account_addresses: &Vec) { - for account_address in account_addresses { - self.tombstone_account(account_address); - } - } - - fn update_persona( - &mut self, - address: &IdentityAddress, - mutate: F, - ) -> Option - where - F: FnMut(&mut Persona); - - fn content_hint(&self) -> ContentHint; -} - -impl EntityOnNetworkHandling for ProfileNetworks { - fn get_account(&self, address: &AccountAddress) -> Option { - self.get_id(address.network_id()) - .and_then(|n| n.accounts.get_id(address)) - .cloned() - } - - fn get_persona(&self, address: &IdentityAddress) -> Option { - self.get_id(address.network_id()) - .and_then(|n| n.personas.get_id(address)) - .cloned() - } - - fn update_entities( - &mut self, - updated_entities: IdentifiedVecOf, - ) -> Result<()> { - self.update_entities_erased( - updated_entities.into_iter().map(Into::into).collect(), - ) - } - - fn update_entities_erased( - &mut self, - updated_entities: IdentifiedVecOf, - ) -> Result<()> { - let network = - updated_entities.assert_elements_not_empty_and_on_same_network()?; - self.try_try_update_with(&network, |n| { - n.update_entities_erased(updated_entities.clone()) - }) - } - - /// Returns a clone of the updated account if found, else None. - fn update_account( - &mut self, - address: &AccountAddress, - mut mutate: F, - ) -> Option - where - F: FnMut(&mut Account), - { - self.update_with(address.network_id(), |n| { - _ = n.update_account(address, |a| mutate(a)) - }); - self.get_account(address) - } - - /// Hides the account associated with the `account_address` - fn hide_account(&mut self, account_address: &AccountAddress) -> bool { - self.update_with(account_address.network_id(), |n| { - n.hide_account(account_address); - }) - } - - /// Tombstones the account associated with the `account_address` - fn tombstone_account(&mut self, account_address: &AccountAddress) -> bool { - self.update_with(account_address.network_id(), |n| { - n.tombstone_account(account_address); - }) - } - - /// Returns a clone of the updated persona if found, else None. - fn update_persona( - &mut self, - address: &IdentityAddress, - mut mutate: F, - ) -> Option - where - F: FnMut(&mut Persona), - { - self.update_with(address.network_id(), |n| { - _ = n.update_persona(address, |a| mutate(a)) - }); - self.get_persona(address) - } - - fn content_hint(&self) -> ContentHint { +impl ProfileNetworks { + pub fn content_hint(&self) -> ContentHint { let number_of_accounts = self.iter().fold(0, |acc, x| acc + x.accounts.len()); let number_of_personas = @@ -231,78 +113,6 @@ mod tests { ); } - #[test] - fn update_account() { - let mut sut = SUT::sample(); - let id = &NetworkID::Mainnet; - let account_address = Account::sample().address; - assert_eq!( - sut.get_id(id) - .unwrap() - .accounts - .get_id(account_address) - .unwrap() - .display_name - .value(), - "Alice" - ); - - sut.update_account(&account_address, |a| { - a.display_name = DisplayName::new("Stella").unwrap() - }); - - assert_eq!( - sut.get_id(id) - .unwrap() - .accounts - .get_id(account_address) - .unwrap() - .display_name - .value(), - "Stella" - ); - } - - #[test] - fn update_account_unknown_network() { - let mut sut = SUT::sample(); - let id = &NetworkID::Mainnet; - let account_address = Account::sample_nebunet().address; - assert_eq!( - sut.get_id(id).unwrap().accounts.get_id(account_address), - None - ); - - assert!(sut - .update_account(&account_address, |a| { - a.display_name = DisplayName::new("will fail").unwrap() - }) - .is_none()); - - // Assert unchanged - assert_eq!(sut, SUT::sample()); - } - - #[test] - fn update_account_unknown_account() { - let mut sut = SUT::sample(); - let id = &NetworkID::Mainnet; - let account_address = Account::sample_mainnet_carol().address; - assert_eq!( - sut.get_id(id).unwrap().accounts.get_id(account_address), - None - ); - - assert!(sut - .update_account(&account_address, |a| { - a.display_name = DisplayName::new("will fail").unwrap() - }) - .is_none()); - - // Assert unchanged - assert_eq!(sut, SUT::sample()); - } - #[test] fn with_network() { let network = ProfileNetwork::new( diff --git a/crates/sargon/src/profile/v100/profile.rs b/crates/sargon-profile/src/v100/profile.rs similarity index 76% rename from crates/sargon/src/profile/v100/profile.rs rename to crates/sargon-profile/src/v100/profile.rs index 2a1eab412..418b0c1bb 100644 --- a/crates/sargon/src/profile/v100/profile.rs +++ b/crates/sargon-profile/src/v100/profile.rs @@ -55,6 +55,14 @@ impl Profile { } } +impl Identifiable for Profile { + type ID = ProfileID; + /// Returns the unique ID of this Profile (just an alias for `header.id`). + fn id(&self) -> ProfileID { + self.header.id + } +} + impl Profile { pub fn to_json_string(&self, pretty_printed: bool) -> String { if pretty_printed { @@ -244,19 +252,19 @@ impl EntitiesErased for IdentifiedVecOf { /// /// Where: `entity1.address() != entity2.address()` #[derive(Clone, Debug, PartialEq, Eq, Hash)] -pub(crate) struct DuplicateInstances { +pub struct DuplicateInstances { /// One of the entities containing `factor_instance` /// /// `entity1.address() != entity2.address()` - pub(crate) entity1: AccountOrPersona, + pub entity1: AccountOrPersona, /// The other entity containing `factor_instance` /// /// `entity1.address() != entity2.address()` - pub(crate) entity2: AccountOrPersona, + pub entity2: AccountOrPersona, /// The FactorInstance which is shared between `entity1` and `entity2` - pub(crate) factor_instance: FactorInstance, + pub factor_instance: FactorInstance, } impl Identifiable for DuplicateInstances { type ID = FactorInstance; @@ -266,7 +274,7 @@ impl Identifiable for DuplicateInstances { } impl DuplicateInstances { - pub(crate) fn into_error(self) -> CommonError { + pub fn into_error(self) -> CommonError { CommonError::FactorInstancesDiscrepancy { address_of_entity1: self.entity1.address().to_string(), address_of_entity2: self.entity2.address().to_string(), @@ -275,241 +283,6 @@ impl DuplicateInstances { } } -impl Profile { - /// Returns the unique ID of this Profile (just an alias for `header.id`). - pub fn id(&self) -> ProfileID { - self.header.id - } - - /// Like `check_for_duplicated_instances` but does not check all entities in profile against - /// all entities in profile, instead checks `instances_of_new_entities` against all entities - /// in profile. Also this is throwing. - pub fn assert_new_factor_instances_not_already_used< - E: Into - + Clone - + std::fmt::Debug - + std::cmp::Eq - + Identifiable, - >( - &self, - entities: impl IntoIterator, - ) -> Result<()> { - let entities = entities - .into_iter() - .map(Into::::into) - .collect::>(); - - self.assert_new_factor_instances_not_already_used_erased(entities) - } - - pub fn assert_new_factor_instances_not_already_used_erased( - &self, - entities: impl IntoIterator, - ) -> Result<()> { - let instances_of_new_entities = entities - .into_iter() - .map(|e| (e.clone(), e.unique_all_factor_instances())) - .collect::>>(); - - let Some(duplicate_instances) = self - .find_all_duplicate_instances_matching_against( - instances_of_new_entities, - ) - .into_iter() - .next() - else { - return Ok(()); - }; - - Err(duplicate_instances.into_error()) - } - - /// Returns ALL entities on ALL network, both account and persona, mixed. - /// Including hidden/deleted entities. - pub fn all_entities_on_all_networks(&self) -> IndexSet { - self.networks - .iter() - .flat_map(|n| { - let mut entities = IndexSet::::new(); - entities.extend(n.accounts.erased()); - entities.extend(n.personas.erased()); - entities - }) - .collect::>() - } - - /// Returns ALL FactorInstances for ALL Personas and Accounts on ALL networks as keys - /// and their factor instances as values. - pub fn instances_of_each_entity_on_all_networks( - &self, - ) -> IndexMap> { - self.all_entities_on_all_networks() - .into_iter() - .map(|e| (e.clone(), e.unique_all_factor_instances())) - .collect() - } - - /// Checks ALL FactorInstances for ALL Personas and Accounts on ALL networks, - /// returns `Some(DuplicateInstances)`` if the same - /// FactorInstances is used between any entity. - pub(crate) fn check_for_duplicated_instances( - &self, - ) -> Option { - let whole_profile = self.instances_of_each_entity_on_all_networks(); - self.find_all_duplicate_instances_matching_against(whole_profile) - .into_iter() - .next() - } - - /// Returns a list of `DuplicateInstances` where the same `FactorInstance` is used between - /// entities in this profile, matched against `against`. - fn find_all_duplicate_instances_matching_against( - &self, - against: IndexMap>, - ) -> IdentifiedVecOf { - let mut instances_per_entity = - self.instances_of_each_entity_on_all_networks(); - - let mut duplicates = IdentifiedVecOf::::new(); - - let mut check = - |entity: AccountOrPersona, to_check: IndexSet| { - for (e, existing) in instances_per_entity.iter() { - // We don't want to compare an entity against itself - if e.address() == entity.address() { - continue; - } - let intersection = existing - .intersection(&to_check) - .collect::>(); - - intersection.into_iter().for_each(|duplicate| { - let duplicate = DuplicateInstances { - entity1: e.clone(), - entity2: entity.clone(), - factor_instance: (*duplicate).clone(), - }; - duplicates.insert(duplicate); - }); - } - instances_per_entity.insert(entity.clone(), to_check); - }; - - for (entity, instances) in against { - check(entity, instances) - } - - duplicates - } - - pub fn update_entities( - &mut self, - updated_entities: IdentifiedVecOf, - ) -> Result<()> { - self.update_entities_erased( - updated_entities.into_iter().map(Into::into).collect(), - ) - } - - pub fn update_entities_erased( - &mut self, - updated_entities: IdentifiedVecOf, - ) -> Result<()> { - self.networks.update_entities_erased(updated_entities) - } - - /// Returns a clone of the updated account if found, else None. - pub fn update_account( - &mut self, - address: &AccountAddress, - mutate: F, - ) -> Option - where - F: FnMut(&mut Account), - { - self.networks.update_account(address, mutate) - } - - /// Returns a clone of the updated persona if found, else None. - pub fn update_persona( - &mut self, - address: &IdentityAddress, - mutate: F, - ) -> Option - where - F: FnMut(&mut Persona), - { - self.networks.update_persona(address, mutate) - } - - pub fn update_last_used_of_factor_source( - &mut self, - id: &FactorSourceID, - ) -> Result<()> { - self.update_any_factor_source_common(id, |common| { - common.last_used_on = now(); - }) - } - - pub fn update_factor_source_remove_flag_main( - &mut self, - id: &FactorSourceID, - ) -> Result<()> { - self.update_any_factor_source_common(id, |common| { - common.flags.remove_id(&FactorSourceFlag::Main); - }) - } - - pub fn update_any_factor_source_common( - &mut self, - factor_source_id: &FactorSourceID, - mut mutate: F, - ) -> Result<()> - where - F: FnMut(&mut FactorSourceCommon), - { - self.update_any_factor_source(factor_source_id, |fs| { - let mut common = fs.common_properties(); - mutate(&mut common); - fs.set_common_properties(common); - }) - } - - pub fn update_factor_source( - &mut self, - factor_source_id: &FactorSourceID, - mut mutate: M, - ) -> Result - where - S: IsFactorSource, - M: FnMut(S) -> Result, - { - self.factor_sources - .maybe_update_with(factor_source_id, |f| { - S::try_from(f.clone()) - .map_err(|_| CommonError::CastFactorSourceWrongKind { - expected: S::kind().to_string(), - found: f.factor_source_kind().to_string(), - }) - .and_then(|element| { - mutate(element).map(|modified| modified.into()) - }) - }) - } - - pub fn update_any_factor_source( - &mut self, - factor_source_id: &FactorSourceID, - mutate: F, - ) -> Result<()> - where - F: FnMut(&mut FactorSource), - { - self.factor_sources - .try_update_with(factor_source_id, mutate) - } -} - impl ProtoProfileMaybeWithLegacyP2PLinks { pub fn contains_legacy_links(&self) -> bool { !self.app_preferences.p2p_links.is_empty() @@ -659,19 +432,6 @@ mod tests { ); } - #[test] - fn new_from_main_bdfs_with_accounts() { - let accounts = Accounts::sample_mainnet(); - let profile = SUT::from_device_factor_source( - DeviceFactorSource::sample(), - HostId::sample(), - HostInfo::sample(), - Some(accounts), - ); - - assert!(profile.has_any_account_on_any_network()) - } - #[test] #[should_panic( expected = "Discrepancy, found an Account on other network than mainnet" @@ -686,126 +446,6 @@ mod tests { ); } - #[test] - fn update_factor_source_not_update_when_factor_source_not_found() { - let mut sut = SUT::sample(); - let wrong_id: &FactorSourceID = - &LedgerHardwareWalletFactorSource::sample_other().id.into(); - - assert_eq!( - sut.update_factor_source( - wrong_id, - |lfs: LedgerHardwareWalletFactorSource| { Ok(lfs) } - ), - Ok(false) - ); - } - - #[test] - fn change_supported_curve_of_factor_source() { - let mut sut = SUT::sample(); - let id: &FactorSourceID = &DeviceFactorSource::sample().id.into(); - assert!(sut.factor_sources.contains_id(FactorSourceID::from( - DeviceFactorSource::sample().id - ))); - - assert_eq!( - sut.factor_sources - .get_id(id) - .unwrap() - .as_device() - .unwrap() - .common - .crypto_parameters - .supported_curves - .items(), - [SLIP10Curve::Curve25519] - ); - - assert_eq!( - sut.update_factor_source(id, |mut dfs: DeviceFactorSource| { - dfs.common.crypto_parameters = - FactorSourceCryptoParameters::babylon_olympia_compatible(); - Ok(dfs) - }), - Ok(true) - ); - - // test failure - assert_eq!( - sut.update_factor_source(id, |_: DeviceFactorSource| { - Err(CommonError::UpdateFactorSourceMutateFailed) - }), - Err(CommonError::UpdateFactorSourceMutateFailed) - ); - - assert_eq!( - sut.factor_sources - .get_id(id) - .unwrap() - .as_device() - .unwrap() - .common - .crypto_parameters - .supported_curves - .items(), - [SLIP10Curve::Curve25519, SLIP10Curve::Secp256k1] - ); - } - - #[test] - fn add_supported_curve_to_factor_source_failure_cast_wrong_factor_source_kind( - ) { - let mut sut = SUT::sample(); - let id: &FactorSourceID = &DeviceFactorSource::sample().id.into(); - - assert!(sut.factor_sources.contains_id(FactorSourceID::from( - DeviceFactorSource::sample().id - ))); - - assert_eq!( - sut.factor_sources - .get_id(id) - .unwrap() - .as_device() - .unwrap() - .common - .crypto_parameters - .supported_curves - .items(), - [SLIP10Curve::Curve25519] - ); - - assert_eq!( - sut.update_factor_source( - id, - |mut lfs: LedgerHardwareWalletFactorSource| { - lfs.common.crypto_parameters = - FactorSourceCryptoParameters::babylon_olympia_compatible(); - Ok(lfs) - } - ), - Err(CommonError::CastFactorSourceWrongKind { - expected: FactorSourceKind::LedgerHQHardwareWallet.to_string(), - found: FactorSourceKind::Device.to_string() - }) - ); - - // Remains unchanged - assert_eq!( - sut.factor_sources - .get_id(id) - .unwrap() - .as_device() - .unwrap() - .common - .crypto_parameters - .supported_curves - .items(), - [SLIP10Curve::Curve25519] - ); - } - #[test] fn test_analyze_contents_of_file_plaintext_profile() { let sut = SUT::sample(); @@ -828,68 +468,6 @@ mod tests { assert_eq!(contents, ProfileFileContents::NotProfile); } - #[test] - fn update_name_of_accounts() { - let mut sut = SUT::sample(); - let account = sut - .networks - .get_id(NetworkID::Mainnet) - .unwrap() - .accounts - .get_at_index(0) - .unwrap() - .clone(); - - assert_eq!(account.display_name.value(), "Alice"); - assert!(sut - .update_account(&account.address, |a| a.display_name = - DisplayName::new("Bob").unwrap()) - .is_some()); - - assert_eq!( - sut.networks - .get_id(NetworkID::Mainnet) - .unwrap() - .accounts - .get_at_index(0) - .unwrap() - .display_name - .value(), - "Bob" - ); - } - - #[test] - fn update_name_of_persona() { - let mut sut = SUT::sample(); - let persona = sut - .networks - .get_id(NetworkID::Mainnet) - .unwrap() - .personas - .get_at_index(0) - .unwrap() - .clone(); - - assert_eq!(persona.display_name.value(), "Satoshi"); - assert!(sut - .update_persona(&persona.address, |a| a.display_name = - DisplayName::new("Batman").unwrap()) - .is_some()); - - assert_eq!( - sut.networks - .get_id(NetworkID::Mainnet) - .unwrap() - .personas - .get_at_index(0) - .unwrap() - .display_name - .value(), - "Batman" - ); - } - #[test] fn hash() { let n = 100; diff --git a/crates/sargon/src/profile/v100/profile_file_contents.rs b/crates/sargon-profile/src/v100/profile_file_contents.rs similarity index 100% rename from crates/sargon/src/profile/v100/profile_file_contents.rs rename to crates/sargon-profile/src/v100/profile_file_contents.rs diff --git a/crates/sargon/src/profile/v100/proto_profile_maybe_with_legacy_p2p_links.rs b/crates/sargon-profile/src/v100/proto_profile_maybe_with_legacy_p2p_links.rs similarity index 100% rename from crates/sargon/src/profile/v100/proto_profile_maybe_with_legacy_p2p_links.rs rename to crates/sargon-profile/src/v100/proto_profile_maybe_with_legacy_p2p_links.rs diff --git a/crates/sargon/src/profile/mfa/secured_entity_control/mod.rs b/crates/sargon-profile/src/v100/secured_entity_control/mod.rs similarity index 100% rename from crates/sargon/src/profile/mfa/secured_entity_control/mod.rs rename to crates/sargon-profile/src/v100/secured_entity_control/mod.rs diff --git a/crates/sargon/src/profile/mfa/secured_entity_control/secured_entity_control.rs b/crates/sargon-profile/src/v100/secured_entity_control/secured_entity_control.rs similarity index 100% rename from crates/sargon/src/profile/mfa/secured_entity_control/secured_entity_control.rs rename to crates/sargon-profile/src/v100/secured_entity_control/secured_entity_control.rs diff --git a/crates/sargon-transaction-models/Cargo.toml b/crates/sargon-transaction-models/Cargo.toml new file mode 100644 index 000000000..237276d3f --- /dev/null +++ b/crates/sargon-transaction-models/Cargo.toml @@ -0,0 +1,54 @@ +[package] +name = "sargon-transaction-models" +version = "1.1.99" +edition = "2021" +build = "build.rs" + +[dependencies] +# === SARGON CRATES === +sargon-core = { path = "../sargon-core" } +identified-vec-of = { path = "../identified-vec-of" } +sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } +sargon-factors = { path = "../sargon-factors" } +sargon-addresses = { path = "../sargon-addresses" } + +# === RADIX DEPENDENCIES === +radix-common = { workspace = true } +radix-common-derive = { workspace = true } +radix-engine = { workspace = true } +radix-engine-interface = { workspace = true } +radix-engine-toolkit = { workspace = true } +radix-engine-toolkit-common = { workspace = true } +radix-rust = { workspace = true } +radix-transactions = { workspace = true } +sbor = { workspace = true } + +# === EXTERNAL DEPENDENCIES === +assert-json-diff = { workspace = true } +async-trait = { workspace = true } +delegate = { workspace = true } +derive_more = { workspace = true } +enum-as-inner = { workspace = true } +enum-iterator = { workspace = true } +hex = { workspace = true } +iota-crypto = { workspace = true } +iso8601-timestamp = { workspace = true } +itertools = { workspace = true } +k256 = { workspace = true } +log = { workspace = true } +once_cell = { workspace = true } +paste = { workspace = true } +pretty_assertions = { workspace = true } +rand = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +serde_repr = { workspace = true } +serde_with = { workspace = true } +strum = { workspace = true } +thiserror = { workspace = true } +url = { workspace = true } +uuid = { workspace = true } +zeroize = { workspace = true } + +[build-dependencies] +cargo_toml = { workspace = true } diff --git a/crates/sargon-transaction-models/build.rs b/crates/sargon-transaction-models/build.rs new file mode 100644 index 000000000..50acb5395 --- /dev/null +++ b/crates/sargon-transaction-models/build.rs @@ -0,0 +1,14 @@ +use std::env; +use std::path::Path; + +pub fn main() { + // Paths for reading fixtures used by tests + let fixtures_path = Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures"); + println!("cargo:rustc-env=FIXTURES={}/", fixtures_path.display()); + + let fixtures_tx_path = fixtures_path.join("transaction"); + println!( + "cargo:rustc-env=FIXTURES_TX={}/", + fixtures_tx_path.display() + ); +} diff --git a/crates/sargon/fixtures/transaction/account_delete.dat b/crates/sargon-transaction-models/fixtures/transaction/account_delete.dat similarity index 100% rename from crates/sargon/fixtures/transaction/account_delete.dat rename to crates/sargon-transaction-models/fixtures/transaction/account_delete.dat diff --git a/crates/sargon/fixtures/transaction/account_delete.rtm b/crates/sargon-transaction-models/fixtures/transaction/account_delete.rtm similarity index 100% rename from crates/sargon/fixtures/transaction/account_delete.rtm rename to crates/sargon-transaction-models/fixtures/transaction/account_delete.rtm diff --git a/crates/sargon/fixtures/transaction/account_locker_claim_fungibles_and_non_fungibles.dat b/crates/sargon-transaction-models/fixtures/transaction/account_locker_claim_fungibles_and_non_fungibles.dat similarity index 100% rename from crates/sargon/fixtures/transaction/account_locker_claim_fungibles_and_non_fungibles.dat rename to crates/sargon-transaction-models/fixtures/transaction/account_locker_claim_fungibles_and_non_fungibles.dat diff --git a/crates/sargon/fixtures/transaction/account_locker_claim_fungibles_and_non_fungibles.rtm b/crates/sargon-transaction-models/fixtures/transaction/account_locker_claim_fungibles_and_non_fungibles.rtm similarity index 100% rename from crates/sargon/fixtures/transaction/account_locker_claim_fungibles_and_non_fungibles.rtm rename to crates/sargon-transaction-models/fixtures/transaction/account_locker_claim_fungibles_and_non_fungibles.rtm diff --git a/crates/sargon/fixtures/transaction/claim_two_stakes_from_one_validator.dat b/crates/sargon-transaction-models/fixtures/transaction/claim_two_stakes_from_one_validator.dat similarity index 100% rename from crates/sargon/fixtures/transaction/claim_two_stakes_from_one_validator.dat rename to crates/sargon-transaction-models/fixtures/transaction/claim_two_stakes_from_one_validator.dat diff --git a/crates/sargon/fixtures/transaction/claim_two_stakes_from_one_validator.rtm b/crates/sargon-transaction-models/fixtures/transaction/claim_two_stakes_from_one_validator.rtm similarity index 100% rename from crates/sargon/fixtures/transaction/claim_two_stakes_from_one_validator.rtm rename to crates/sargon-transaction-models/fixtures/transaction/claim_two_stakes_from_one_validator.rtm diff --git a/crates/sargon/fixtures/transaction/contribute_to_bi_pool.dat b/crates/sargon-transaction-models/fixtures/transaction/contribute_to_bi_pool.dat similarity index 100% rename from crates/sargon/fixtures/transaction/contribute_to_bi_pool.dat rename to crates/sargon-transaction-models/fixtures/transaction/contribute_to_bi_pool.dat diff --git a/crates/sargon/fixtures/transaction/contribute_to_bi_pool.rtm b/crates/sargon-transaction-models/fixtures/transaction/contribute_to_bi_pool.rtm similarity index 100% rename from crates/sargon/fixtures/transaction/contribute_to_bi_pool.rtm rename to crates/sargon-transaction-models/fixtures/transaction/contribute_to_bi_pool.rtm diff --git a/crates/sargon-transaction-models/fixtures/transaction/create_3_nft_collections.rtm b/crates/sargon-transaction-models/fixtures/transaction/create_3_nft_collections.rtm new file mode 100644 index 000000000..bc0c04ddf --- /dev/null +++ b/crates/sargon-transaction-models/fixtures/transaction/create_3_nft_collections.rtm @@ -0,0 +1,1506 @@ +CREATE_NON_FUNGIBLE_RESOURCE_WITH_INITIAL_SUPPLY + Enum<2u8>( + Enum<0u8>() + ) + Enum<1u8>() + true + Enum<0u8>( + Enum<0u8>( + Tuple( + Array( + Enum<14u8>( + Array( + Enum<0u8>( + 12u8 + ) + ) + ) + ), + Array( + Tuple( + Enum<1u8>( + "NonFungibleTokenData" + ), + Enum<1u8>( + Enum<0u8>( + Array( + "name" + ) + ) + ) + ) + ), + Array( + Enum<0u8>() + ) + ) + ), + Enum<1u8>( + 0u64 + ), + Array( + "name" + ) + ) + Map( + NonFungibleLocalId("#0#") => Tuple( + Tuple( + "nf-number-0" + ) + ), + NonFungibleLocalId("#1#") => Tuple( + Tuple( + "nf-number-1" + ) + ) + ) + Tuple( + Enum<1u8>( + Tuple( + Enum<1u8>( + Enum<0u8>() + ), + Enum<1u8>( + Enum<1u8>() + ) + ) + ), + Enum<1u8>( + Tuple( + Enum<1u8>( + Enum<0u8>() + ), + Enum<1u8>( + Enum<1u8>() + ) + ) + ), + Enum<1u8>( + Tuple( + Enum<1u8>( + Enum<0u8>() + ), + Enum<1u8>( + Enum<1u8>() + ) + ) + ), + Enum<1u8>( + Tuple( + Enum<1u8>( + Enum<0u8>() + ), + Enum<1u8>( + Enum<1u8>() + ) + ) + ), + Enum<1u8>( + Tuple( + Enum<1u8>( + Enum<0u8>() + ), + Enum<1u8>( + Enum<1u8>() + ) + ) + ), + Enum<1u8>( + Tuple( + Enum<1u8>( + Enum<0u8>() + ), + Enum<1u8>( + Enum<1u8>() + ) + ) + ), + Enum<1u8>( + Tuple( + Enum<1u8>( + Enum<0u8>() + ), + Enum<1u8>( + Enum<1u8>() + ) + ) + ) + ) + Tuple( + Map( + "description" => Tuple( + Enum<1u8>( + Enum<0u8>( + "Abandon: An amazingly innovative and rare NFT collection" + ) + ), + false + ), + "extra_bool" => Tuple( + Enum<1u8>( + Enum<1u8>( + true + ) + ), + false + ), + "extra_bool_array" => Tuple( + Enum<1u8>( + Enum<129u8>( + Array( + true, + false + ) + ) + ), + false + ), + "extra_decimal" => Tuple( + Enum<1u8>( + Enum<7u8>( + Decimal("8") + ) + ), + false + ), + "extra_decimal_array" => Tuple( + Enum<1u8>( + Enum<135u8>( + Array( + Decimal("1"), + Decimal("2") + ) + ) + ), + false + ), + "extra_global_address" => Tuple( + Enum<1u8>( + Enum<8u8>( + Address("account_tdx_2_128y6j78mt0aqv6372evz28hrxp8mn06ccddkr7xppc88hyvyqrllae") + ) + ), + false + ), + "extra_global_address_array" => Tuple( + Enum<1u8>( + Enum<136u8>( + Array
( + Address("account_tdx_2_128jx5fmru80v38a7hun8tdhajf2exef756c92tfg4atwl3y4pqn48m"), + Address("account_tdx_2_12xvlee7xtg7dx599yv69tzkpeqzn4wr2nlnn3gpsm0zu0v9luqdpnp") + ) + ) + ), + false + ), + "extra_i32" => Tuple( + Enum<1u8>( + Enum<5u8>( + 32i32 + ) + ), + false + ), + "extra_i32_array" => Tuple( + Enum<1u8>( + Enum<133u8>( + Array( + 32i32, + 33i32, + 34i32, + 35i32 + ) + ) + ), + false + ), + "extra_i64" => Tuple( + Enum<1u8>( + Enum<6u8>( + 64i64 + ) + ), + false + ), + "extra_i64_array" => Tuple( + Enum<1u8>( + Enum<134u8>( + Array( + 64i64, + 65i64, + 66i64, + 67i64 + ) + ) + ), + false + ), + "extra_instant" => Tuple( + Enum<1u8>( + Enum<12u8>( + 1891i64 + ) + ), + false + ), + "extra_instant_array" => Tuple( + Enum<1u8>( + Enum<140u8>( + Array( + 5i64, + 1891i64 + ) + ) + ), + false + ), + "extra_non_fungible_global_id" => Tuple( + Enum<1u8>( + Enum<10u8>( + NonFungibleGlobalId("resource_tdx_2_1ng6aanl0nw98dgqxtja3mx4kpa8rzwhyt4q22sy9uul0vf9frs528x:#1#") + ) + ), + false + ), + "extra_non_fungible_global_id_array" => Tuple( + Enum<1u8>( + Enum<138u8>( + Array( + NonFungibleGlobalId("resource_tdx_2_1ng6aanl0nw98dgqxtja3mx4kpa8rzwhyt4q22sy9uul0vf9frs528x:#1#"), + NonFungibleGlobalId("resource_tdx_2_1ng6aanl0nw98dgqxtja3mx4kpa8rzwhyt4q22sy9uul0vf9frs528x:#2#") + ) + ) + ), + false + ), + "extra_non_fungible_local_id" => Tuple( + Enum<1u8>( + Enum<11u8>( + NonFungibleLocalId("#1#") + ) + ), + false + ), + "extra_non_fungible_local_id_array" => Tuple( + Enum<1u8>( + Enum<139u8>( + Array( + NonFungibleLocalId("#1#"), + NonFungibleLocalId("#2#") + ) + ) + ), + false + ), + "extra_origin" => Tuple( + Enum<1u8>( + Enum<14u8>( + "https://radixdlt.com" + ) + ), + false + ), + "extra_origin_array" => Tuple( + Enum<1u8>( + Enum<142u8>( + Array( + "https://radixdlt.com", + "https://ociswap.com" + ) + ) + ), + false + ), + "extra_public_key" => Tuple( + Enum<1u8>( + Enum<9u8>( + Enum<1u8>( + Bytes("ec172b93ad5e563bf4932c70e1245034c35467ef2efd4d64ebf819683467e2bf") + ) + ) + ), + false + ), + "extra_public_key_array" => Tuple( + Enum<1u8>( + Enum<137u8>( + Array( + Enum<1u8>( + Bytes("ec172b93ad5e563bf4932c70e1245034c35467ef2efd4d64ebf819683467e2bf") + ), + Enum<0u8>( + Bytes("033083620d1596d3f8988ff3270e42970dd2a031e2b9b6488052a4170ff999f3e8") + ) + ) + ) + ), + false + ), + "extra_public_key_hash" => Tuple( + Enum<1u8>( + Enum<15u8>( + Enum<1u8>( + Bytes("f4e18c034e069baee91ada4764fdfcf2438b8f976861df00557d4cc9e7") + ) + ) + ), + false + ), + "extra_public_key_hash_array" => Tuple( + Enum<1u8>( + Enum<143u8>( + Array( + Enum<1u8>( + Bytes("f4e18c034e069baee91ada4764fdfcf2438b8f976861df00557d4cc9e7") + ), + Enum<0u8>( + Bytes("4a5004504dbbc08c65ba86fcd7592a3ac48db81d217fe2356e75b37f31") + ) + ) + ) + ), + false + ), + "extra_string" => Tuple( + Enum<1u8>( + Enum<0u8>( + "foo bar" + ) + ), + false + ), + "extra_string_array" => Tuple( + Enum<1u8>( + Enum<128u8>( + Array( + "foo", + "bar" + ) + ) + ), + false + ), + "extra_u32" => Tuple( + Enum<1u8>( + Enum<3u8>( + 32u32 + ) + ), + false + ), + "extra_u32_array" => Tuple( + Enum<1u8>( + Enum<131u8>( + Array( + 32u32, + 33u32, + 34u32, + 35u32 + ) + ) + ), + false + ), + "extra_u64" => Tuple( + Enum<1u8>( + Enum<4u8>( + 64u64 + ) + ), + false + ), + "extra_u64_array" => Tuple( + Enum<1u8>( + Enum<132u8>( + Array( + 64u64, + 65u64, + 66u64, + 67u64 + ) + ) + ), + false + ), + "extra_u8" => Tuple( + Enum<1u8>( + Enum<2u8>( + 8u8 + ) + ), + false + ), + "extra_u8_array" => Tuple( + Enum<1u8>( + Enum<130u8>( + Bytes("08090a0b") + ) + ), + false + ), + "extra_url" => Tuple( + Enum<1u8>( + Enum<13u8>( + "https://radixdlt.com" + ) + ), + false + ), + "extra_url_array" => Tuple( + Enum<1u8>( + Enum<141u8>( + Array( + "https://radixdlt.com", + "https://ociswap.com" + ) + ) + ), + false + ), + "icon_url" => Tuple( + Enum<1u8>( + Enum<13u8>( + "https://image-service-test-images.s3.eu-west-2.amazonaws.com/wallet_test_images/scryptonaut_patch.svg" + ) + ), + false + ), + "name" => Tuple( + Enum<1u8>( + Enum<0u8>( + "Abandon" + ) + ), + false + ), + "symbol" => Tuple( + Enum<1u8>( + Enum<0u8>( + "ABANDON" + ) + ), + false + ), + "tags" => Tuple( + Enum<1u8>( + Enum<128u8>( + Array( + "Unique", + "FOMO", + "Advanced" + ) + ) + ), + false + ) + ), + Map() + ) + Enum<0u8>() +; +CREATE_NON_FUNGIBLE_RESOURCE_WITH_INITIAL_SUPPLY + Enum<2u8>( + Enum<0u8>() + ) + Enum<1u8>() + true + Enum<0u8>( + Enum<0u8>( + Tuple( + Array( + Enum<14u8>( + Array( + Enum<0u8>( + 12u8 + ) + ) + ) + ), + Array( + Tuple( + Enum<1u8>( + "NonFungibleTokenData" + ), + Enum<1u8>( + Enum<0u8>( + Array( + "name" + ) + ) + ) + ) + ), + Array( + Enum<0u8>() + ) + ) + ), + Enum<1u8>( + 0u64 + ), + Array( + "name" + ) + ) + Map( + NonFungibleLocalId("#0#") => Tuple( + Tuple( + "nf-number-0" + ) + ), + NonFungibleLocalId("#1#") => Tuple( + Tuple( + "nf-number-1" + ) + ) + ) + Tuple( + Enum<1u8>( + Tuple( + Enum<1u8>( + Enum<0u8>() + ), + Enum<1u8>( + Enum<1u8>() + ) + ) + ), + Enum<1u8>( + Tuple( + Enum<1u8>( + Enum<0u8>() + ), + Enum<1u8>( + Enum<1u8>() + ) + ) + ), + Enum<1u8>( + Tuple( + Enum<1u8>( + Enum<0u8>() + ), + Enum<1u8>( + Enum<1u8>() + ) + ) + ), + Enum<1u8>( + Tuple( + Enum<1u8>( + Enum<0u8>() + ), + Enum<1u8>( + Enum<1u8>() + ) + ) + ), + Enum<1u8>( + Tuple( + Enum<1u8>( + Enum<0u8>() + ), + Enum<1u8>( + Enum<1u8>() + ) + ) + ), + Enum<1u8>( + Tuple( + Enum<1u8>( + Enum<0u8>() + ), + Enum<1u8>( + Enum<1u8>() + ) + ) + ), + Enum<1u8>( + Tuple( + Enum<1u8>( + Enum<0u8>() + ), + Enum<1u8>( + Enum<1u8>() + ) + ) + ) + ) + Tuple( + Map( + "description" => Tuple( + Enum<1u8>( + Enum<0u8>( + "Ability: An amazingly innovative and rare NFT collection" + ) + ), + false + ), + "extra_bool" => Tuple( + Enum<1u8>( + Enum<1u8>( + true + ) + ), + false + ), + "extra_bool_array" => Tuple( + Enum<1u8>( + Enum<129u8>( + Array( + true, + false + ) + ) + ), + false + ), + "extra_decimal" => Tuple( + Enum<1u8>( + Enum<7u8>( + Decimal("8") + ) + ), + false + ), + "extra_decimal_array" => Tuple( + Enum<1u8>( + Enum<135u8>( + Array( + Decimal("1"), + Decimal("2") + ) + ) + ), + false + ), + "extra_global_address" => Tuple( + Enum<1u8>( + Enum<8u8>( + Address("account_tdx_2_128y6j78mt0aqv6372evz28hrxp8mn06ccddkr7xppc88hyvyqrllae") + ) + ), + false + ), + "extra_global_address_array" => Tuple( + Enum<1u8>( + Enum<136u8>( + Array
( + Address("account_tdx_2_128jx5fmru80v38a7hun8tdhajf2exef756c92tfg4atwl3y4pqn48m"), + Address("account_tdx_2_12xvlee7xtg7dx599yv69tzkpeqzn4wr2nlnn3gpsm0zu0v9luqdpnp") + ) + ) + ), + false + ), + "extra_i32" => Tuple( + Enum<1u8>( + Enum<5u8>( + 32i32 + ) + ), + false + ), + "extra_i32_array" => Tuple( + Enum<1u8>( + Enum<133u8>( + Array( + 32i32, + 33i32, + 34i32, + 35i32 + ) + ) + ), + false + ), + "extra_i64" => Tuple( + Enum<1u8>( + Enum<6u8>( + 64i64 + ) + ), + false + ), + "extra_i64_array" => Tuple( + Enum<1u8>( + Enum<134u8>( + Array( + 64i64, + 65i64, + 66i64, + 67i64 + ) + ) + ), + false + ), + "extra_instant" => Tuple( + Enum<1u8>( + Enum<12u8>( + 1891i64 + ) + ), + false + ), + "extra_instant_array" => Tuple( + Enum<1u8>( + Enum<140u8>( + Array( + 5i64, + 1891i64 + ) + ) + ), + false + ), + "extra_non_fungible_global_id" => Tuple( + Enum<1u8>( + Enum<10u8>( + NonFungibleGlobalId("resource_tdx_2_1ng6aanl0nw98dgqxtja3mx4kpa8rzwhyt4q22sy9uul0vf9frs528x:#1#") + ) + ), + false + ), + "extra_non_fungible_global_id_array" => Tuple( + Enum<1u8>( + Enum<138u8>( + Array( + NonFungibleGlobalId("resource_tdx_2_1ng6aanl0nw98dgqxtja3mx4kpa8rzwhyt4q22sy9uul0vf9frs528x:#1#"), + NonFungibleGlobalId("resource_tdx_2_1ng6aanl0nw98dgqxtja3mx4kpa8rzwhyt4q22sy9uul0vf9frs528x:#2#") + ) + ) + ), + false + ), + "extra_non_fungible_local_id" => Tuple( + Enum<1u8>( + Enum<11u8>( + NonFungibleLocalId("#1#") + ) + ), + false + ), + "extra_non_fungible_local_id_array" => Tuple( + Enum<1u8>( + Enum<139u8>( + Array( + NonFungibleLocalId("#1#"), + NonFungibleLocalId("#2#") + ) + ) + ), + false + ), + "extra_origin" => Tuple( + Enum<1u8>( + Enum<14u8>( + "https://radixdlt.com" + ) + ), + false + ), + "extra_origin_array" => Tuple( + Enum<1u8>( + Enum<142u8>( + Array( + "https://radixdlt.com", + "https://ociswap.com" + ) + ) + ), + false + ), + "extra_public_key" => Tuple( + Enum<1u8>( + Enum<9u8>( + Enum<1u8>( + Bytes("ec172b93ad5e563bf4932c70e1245034c35467ef2efd4d64ebf819683467e2bf") + ) + ) + ), + false + ), + "extra_public_key_array" => Tuple( + Enum<1u8>( + Enum<137u8>( + Array( + Enum<1u8>( + Bytes("ec172b93ad5e563bf4932c70e1245034c35467ef2efd4d64ebf819683467e2bf") + ), + Enum<0u8>( + Bytes("033083620d1596d3f8988ff3270e42970dd2a031e2b9b6488052a4170ff999f3e8") + ) + ) + ) + ), + false + ), + "extra_public_key_hash" => Tuple( + Enum<1u8>( + Enum<15u8>( + Enum<1u8>( + Bytes("f4e18c034e069baee91ada4764fdfcf2438b8f976861df00557d4cc9e7") + ) + ) + ), + false + ), + "extra_public_key_hash_array" => Tuple( + Enum<1u8>( + Enum<143u8>( + Array( + Enum<1u8>( + Bytes("f4e18c034e069baee91ada4764fdfcf2438b8f976861df00557d4cc9e7") + ), + Enum<0u8>( + Bytes("4a5004504dbbc08c65ba86fcd7592a3ac48db81d217fe2356e75b37f31") + ) + ) + ) + ), + false + ), + "extra_string" => Tuple( + Enum<1u8>( + Enum<0u8>( + "foo bar" + ) + ), + false + ), + "extra_string_array" => Tuple( + Enum<1u8>( + Enum<128u8>( + Array( + "foo", + "bar" + ) + ) + ), + false + ), + "extra_u32" => Tuple( + Enum<1u8>( + Enum<3u8>( + 32u32 + ) + ), + false + ), + "extra_u32_array" => Tuple( + Enum<1u8>( + Enum<131u8>( + Array( + 32u32, + 33u32, + 34u32, + 35u32 + ) + ) + ), + false + ), + "extra_u64" => Tuple( + Enum<1u8>( + Enum<4u8>( + 64u64 + ) + ), + false + ), + "extra_u64_array" => Tuple( + Enum<1u8>( + Enum<132u8>( + Array( + 64u64, + 65u64, + 66u64, + 67u64 + ) + ) + ), + false + ), + "extra_u8" => Tuple( + Enum<1u8>( + Enum<2u8>( + 8u8 + ) + ), + false + ), + "extra_u8_array" => Tuple( + Enum<1u8>( + Enum<130u8>( + Bytes("08090a0b") + ) + ), + false + ), + "extra_url" => Tuple( + Enum<1u8>( + Enum<13u8>( + "https://radixdlt.com" + ) + ), + false + ), + "extra_url_array" => Tuple( + Enum<1u8>( + Enum<141u8>( + Array( + "https://radixdlt.com", + "https://ociswap.com" + ) + ) + ), + false + ), + "icon_url" => Tuple( + Enum<1u8>( + Enum<13u8>( + "https://image-service-test-images.s3.eu-west-2.amazonaws.com/wallet_test_images/Filling+Station+Breakfast-large.jpg" + ) + ), + false + ), + "name" => Tuple( + Enum<1u8>( + Enum<0u8>( + "Ability" + ) + ), + false + ), + "symbol" => Tuple( + Enum<1u8>( + Enum<0u8>( + "ABILITY" + ) + ), + false + ), + "tags" => Tuple( + Enum<1u8>( + Enum<128u8>( + Array( + "Unique", + "FOMO", + "Advanced" + ) + ) + ), + false + ) + ), + Map() + ) + Enum<0u8>() +; +CREATE_NON_FUNGIBLE_RESOURCE_WITH_INITIAL_SUPPLY + Enum<2u8>( + Enum<0u8>() + ) + Enum<1u8>() + true + Enum<0u8>( + Enum<0u8>( + Tuple( + Array( + Enum<14u8>( + Array( + Enum<0u8>( + 12u8 + ) + ) + ) + ), + Array( + Tuple( + Enum<1u8>( + "NonFungibleTokenData" + ), + Enum<1u8>( + Enum<0u8>( + Array( + "name" + ) + ) + ) + ) + ), + Array( + Enum<0u8>() + ) + ) + ), + Enum<1u8>( + 0u64 + ), + Array( + "name" + ) + ) + Map( + NonFungibleLocalId("#0#") => Tuple( + Tuple( + "nf-number-0" + ) + ), + NonFungibleLocalId("#1#") => Tuple( + Tuple( + "nf-number-1" + ) + ) + ) + Tuple( + Enum<1u8>( + Tuple( + Enum<1u8>( + Enum<0u8>() + ), + Enum<1u8>( + Enum<1u8>() + ) + ) + ), + Enum<1u8>( + Tuple( + Enum<1u8>( + Enum<0u8>() + ), + Enum<1u8>( + Enum<1u8>() + ) + ) + ), + Enum<1u8>( + Tuple( + Enum<1u8>( + Enum<0u8>() + ), + Enum<1u8>( + Enum<1u8>() + ) + ) + ), + Enum<1u8>( + Tuple( + Enum<1u8>( + Enum<0u8>() + ), + Enum<1u8>( + Enum<1u8>() + ) + ) + ), + Enum<1u8>( + Tuple( + Enum<1u8>( + Enum<0u8>() + ), + Enum<1u8>( + Enum<1u8>() + ) + ) + ), + Enum<1u8>( + Tuple( + Enum<1u8>( + Enum<0u8>() + ), + Enum<1u8>( + Enum<1u8>() + ) + ) + ), + Enum<1u8>( + Tuple( + Enum<1u8>( + Enum<0u8>() + ), + Enum<1u8>( + Enum<1u8>() + ) + ) + ) + ) + Tuple( + Map( + "description" => Tuple( + Enum<1u8>( + Enum<0u8>( + "Able: An amazingly innovative and rare NFT collection" + ) + ), + false + ), + "extra_bool" => Tuple( + Enum<1u8>( + Enum<1u8>( + true + ) + ), + false + ), + "extra_bool_array" => Tuple( + Enum<1u8>( + Enum<129u8>( + Array( + true, + false + ) + ) + ), + false + ), + "extra_decimal" => Tuple( + Enum<1u8>( + Enum<7u8>( + Decimal("8") + ) + ), + false + ), + "extra_decimal_array" => Tuple( + Enum<1u8>( + Enum<135u8>( + Array( + Decimal("1"), + Decimal("2") + ) + ) + ), + false + ), + "extra_global_address" => Tuple( + Enum<1u8>( + Enum<8u8>( + Address("account_tdx_2_128y6j78mt0aqv6372evz28hrxp8mn06ccddkr7xppc88hyvyqrllae") + ) + ), + false + ), + "extra_global_address_array" => Tuple( + Enum<1u8>( + Enum<136u8>( + Array
( + Address("account_tdx_2_128jx5fmru80v38a7hun8tdhajf2exef756c92tfg4atwl3y4pqn48m"), + Address("account_tdx_2_12xvlee7xtg7dx599yv69tzkpeqzn4wr2nlnn3gpsm0zu0v9luqdpnp") + ) + ) + ), + false + ), + "extra_i32" => Tuple( + Enum<1u8>( + Enum<5u8>( + 32i32 + ) + ), + false + ), + "extra_i32_array" => Tuple( + Enum<1u8>( + Enum<133u8>( + Array( + 32i32, + 33i32, + 34i32, + 35i32 + ) + ) + ), + false + ), + "extra_i64" => Tuple( + Enum<1u8>( + Enum<6u8>( + 64i64 + ) + ), + false + ), + "extra_i64_array" => Tuple( + Enum<1u8>( + Enum<134u8>( + Array( + 64i64, + 65i64, + 66i64, + 67i64 + ) + ) + ), + false + ), + "extra_instant" => Tuple( + Enum<1u8>( + Enum<12u8>( + 1891i64 + ) + ), + false + ), + "extra_instant_array" => Tuple( + Enum<1u8>( + Enum<140u8>( + Array( + 5i64, + 1891i64 + ) + ) + ), + false + ), + "extra_non_fungible_global_id" => Tuple( + Enum<1u8>( + Enum<10u8>( + NonFungibleGlobalId("resource_tdx_2_1ng6aanl0nw98dgqxtja3mx4kpa8rzwhyt4q22sy9uul0vf9frs528x:#1#") + ) + ), + false + ), + "extra_non_fungible_global_id_array" => Tuple( + Enum<1u8>( + Enum<138u8>( + Array( + NonFungibleGlobalId("resource_tdx_2_1ng6aanl0nw98dgqxtja3mx4kpa8rzwhyt4q22sy9uul0vf9frs528x:#1#"), + NonFungibleGlobalId("resource_tdx_2_1ng6aanl0nw98dgqxtja3mx4kpa8rzwhyt4q22sy9uul0vf9frs528x:#2#") + ) + ) + ), + false + ), + "extra_non_fungible_local_id" => Tuple( + Enum<1u8>( + Enum<11u8>( + NonFungibleLocalId("#1#") + ) + ), + false + ), + "extra_non_fungible_local_id_array" => Tuple( + Enum<1u8>( + Enum<139u8>( + Array( + NonFungibleLocalId("#1#"), + NonFungibleLocalId("#2#") + ) + ) + ), + false + ), + "extra_origin" => Tuple( + Enum<1u8>( + Enum<14u8>( + "https://radixdlt.com" + ) + ), + false + ), + "extra_origin_array" => Tuple( + Enum<1u8>( + Enum<142u8>( + Array( + "https://radixdlt.com", + "https://ociswap.com" + ) + ) + ), + false + ), + "extra_public_key" => Tuple( + Enum<1u8>( + Enum<9u8>( + Enum<1u8>( + Bytes("ec172b93ad5e563bf4932c70e1245034c35467ef2efd4d64ebf819683467e2bf") + ) + ) + ), + false + ), + "extra_public_key_array" => Tuple( + Enum<1u8>( + Enum<137u8>( + Array( + Enum<1u8>( + Bytes("ec172b93ad5e563bf4932c70e1245034c35467ef2efd4d64ebf819683467e2bf") + ), + Enum<0u8>( + Bytes("033083620d1596d3f8988ff3270e42970dd2a031e2b9b6488052a4170ff999f3e8") + ) + ) + ) + ), + false + ), + "extra_public_key_hash" => Tuple( + Enum<1u8>( + Enum<15u8>( + Enum<1u8>( + Bytes("f4e18c034e069baee91ada4764fdfcf2438b8f976861df00557d4cc9e7") + ) + ) + ), + false + ), + "extra_public_key_hash_array" => Tuple( + Enum<1u8>( + Enum<143u8>( + Array( + Enum<1u8>( + Bytes("f4e18c034e069baee91ada4764fdfcf2438b8f976861df00557d4cc9e7") + ), + Enum<0u8>( + Bytes("4a5004504dbbc08c65ba86fcd7592a3ac48db81d217fe2356e75b37f31") + ) + ) + ) + ), + false + ), + "extra_string" => Tuple( + Enum<1u8>( + Enum<0u8>( + "foo bar" + ) + ), + false + ), + "extra_string_array" => Tuple( + Enum<1u8>( + Enum<128u8>( + Array( + "foo", + "bar" + ) + ) + ), + false + ), + "extra_u32" => Tuple( + Enum<1u8>( + Enum<3u8>( + 32u32 + ) + ), + false + ), + "extra_u32_array" => Tuple( + Enum<1u8>( + Enum<131u8>( + Array( + 32u32, + 33u32, + 34u32, + 35u32 + ) + ) + ), + false + ), + "extra_u64" => Tuple( + Enum<1u8>( + Enum<4u8>( + 64u64 + ) + ), + false + ), + "extra_u64_array" => Tuple( + Enum<1u8>( + Enum<132u8>( + Array( + 64u64, + 65u64, + 66u64, + 67u64 + ) + ) + ), + false + ), + "extra_u8" => Tuple( + Enum<1u8>( + Enum<2u8>( + 8u8 + ) + ), + false + ), + "extra_u8_array" => Tuple( + Enum<1u8>( + Enum<130u8>( + Bytes("08090a0b") + ) + ), + false + ), + "extra_url" => Tuple( + Enum<1u8>( + Enum<13u8>( + "https://radixdlt.com" + ) + ), + false + ), + "extra_url_array" => Tuple( + Enum<1u8>( + Enum<141u8>( + Array( + "https://radixdlt.com", + "https://ociswap.com" + ) + ) + ), + false + ), + "icon_url" => Tuple( + Enum<1u8>( + Enum<13u8>( + "https://image-service-test-images.s3.eu-west-2.amazonaws.com/wallet_test_images/Filling+Station+Breakfast-medium.jpg" + ) + ), + false + ), + "name" => Tuple( + Enum<1u8>( + Enum<0u8>( + "Able" + ) + ), + false + ), + "symbol" => Tuple( + Enum<1u8>( + Enum<0u8>( + "ABLE" + ) + ), + false + ), + "tags" => Tuple( + Enum<1u8>( + Enum<128u8>( + Array( + "Unique", + "FOMO", + "Advanced" + ) + ) + ), + false + ) + ), + Map() + ) + Enum<0u8>() +; +CALL_METHOD + Address("account_tdx_2_128jx5fmru80v38a7hun8tdhajf2exef756c92tfg4atwl3y4pqn48m") + "try_deposit_batch_or_abort" + Expression("ENTIRE_WORKTOP") + Enum<0u8>() +; \ No newline at end of file diff --git a/crates/sargon-transaction-models/fixtures/transaction/create_access_controller_for_account.rtm b/crates/sargon-transaction-models/fixtures/transaction/create_access_controller_for_account.rtm new file mode 100644 index 000000000..feecabe59 --- /dev/null +++ b/crates/sargon-transaction-models/fixtures/transaction/create_access_controller_for_account.rtm @@ -0,0 +1,98 @@ +CALL_METHOD + Address("account_rdx128dtethfy8ujrsfdztemyjk0kvhnah6dafr57frz85dcw2c8z0td87") + "securify" +; +TAKE_FROM_WORKTOP + Address("resource_rdx1nfxxxxxxxxxxaccwnrxxxxxxxxx006664022062xxxxxxxxxaccwnr") + Decimal("1") + Bucket("bucket1") +; +CREATE_ACCESS_CONTROLLER + Bucket("bucket1") + Tuple( + Enum<2u8>( + Enum<1u8>( + Array( + Enum<0u8>( + Enum<2u8>( + 2u8, + Array( + Enum<0u8>( + NonFungibleGlobalId("resource_rdx1nfxxxxxxxxxxed25sgxxxxxxxxx002236757237xxxxxxxxxed25sg:[2dabcc6872c45a625bccc21be9e666bfbc62b1f87a16f3848dd877ba22]") + ), + Enum<0u8>( + NonFungibleGlobalId("resource_rdx1nfxxxxxxxxxxed25sgxxxxxxxxx002236757237xxxxxxxxxed25sg:[7225b29de13d7d06e0e9f406fe15165677573c9106ee036ad52bee2864]") + ) + ) + ) + ), + Enum<0u8>( + Enum<4u8>( + Array() + ) + ) + ) + ) + ), + Enum<2u8>( + Enum<1u8>( + Array( + Enum<0u8>( + Enum<2u8>( + 0u8, + Array() + ) + ), + Enum<0u8>( + Enum<4u8>( + Array( + Enum<0u8>( + NonFungibleGlobalId("resource_rdx1nfxxxxxxxxxxed25sgxxxxxxxxx002236757237xxxxxxxxxed25sg:[2dabcc6872c45a625bccc21be9e666bfbc62b1f87a16f3848dd877ba22]") + ), + Enum<0u8>( + NonFungibleGlobalId("resource_rdx1nfxxxxxxxxxxed25sgxxxxxxxxx002236757237xxxxxxxxxed25sg:[7225b29de13d7d06e0e9f406fe15165677573c9106ee036ad52bee2864]") + ) + ) + ) + ) + ) + ) + ), + Enum<2u8>( + Enum<1u8>( + Array( + Enum<0u8>( + Enum<2u8>( + 0u8, + Array() + ) + ), + Enum<0u8>( + Enum<4u8>( + Array( + Enum<0u8>( + NonFungibleGlobalId("resource_rdx1nfxxxxxxxxxxed25sgxxxxxxxxx002236757237xxxxxxxxxed25sg:[31262cc8dc5e9a49d1fe0ea8e60a17ef36d1ea857db94cca3e1e2a52dd]") + ) + ) + ) + ) + ) + ) + ) + ) + Enum<1u8>( + 20160u32 + ) + Enum<0u8>() +; +SET_METADATA + Address("account_rdx128dtethfy8ujrsfdztemyjk0kvhnah6dafr57frz85dcw2c8z0td87") + "owner_keys" + Enum<143u8>( + Array( + Enum<1u8>( + Bytes("cb3f6086cd08a1d0ab10139a9c6d191783edb534059f7b4716dc5d239e") + ) + ) + ) +; \ No newline at end of file diff --git a/crates/sargon-transaction-models/fixtures/transaction/create_access_controller_for_persona.rtm b/crates/sargon-transaction-models/fixtures/transaction/create_access_controller_for_persona.rtm new file mode 100644 index 000000000..c4809655d --- /dev/null +++ b/crates/sargon-transaction-models/fixtures/transaction/create_access_controller_for_persona.rtm @@ -0,0 +1,92 @@ +CALL_METHOD + Address("identity_rdx12tw6rt9c4l56rz6p866e35tmzp556nymxmpj8hagfewq82kspctdyw") + "securify" +; +TAKE_FROM_WORKTOP + Address("resource_rdx1nfxxxxxxxxxxdntwnrxxxxxxxxx002876444928xxxxxxxxxdntwnr") + Decimal("1") + Bucket("bucket1") +; +CREATE_ACCESS_CONTROLLER + Bucket("bucket1") + Tuple( + Enum<2u8>( + Enum<1u8>( + Array( + Enum<0u8>( + Enum<2u8>( + 1u8, + Array( + Enum<0u8>( + NonFungibleGlobalId("resource_rdx1nfxxxxxxxxxxed25sgxxxxxxxxx002236757237xxxxxxxxxed25sg:[99b417749d9022e73a6d2e025648a928ffbc499be8dc9e55eda900b11f]") + ) + ) + ) + ), + Enum<0u8>( + Enum<4u8>( + Array() + ) + ) + ) + ) + ), + Enum<2u8>( + Enum<1u8>( + Array( + Enum<0u8>( + Enum<2u8>( + 0u8, + Array() + ) + ), + Enum<0u8>( + Enum<4u8>( + Array( + Enum<0u8>( + NonFungibleGlobalId("resource_rdx1nfxxxxxxxxxxed25sgxxxxxxxxx002236757237xxxxxxxxxed25sg:[97d5d7196e49781708520322aaf5872214d854122600dd0125c837aefe]") + ) + ) + ) + ) + ) + ) + ), + Enum<2u8>( + Enum<1u8>( + Array( + Enum<0u8>( + Enum<2u8>( + 0u8, + Array() + ) + ), + Enum<0u8>( + Enum<4u8>( + Array( + Enum<0u8>( + NonFungibleGlobalId("resource_rdx1nfxxxxxxxxxxed25sgxxxxxxxxx002236757237xxxxxxxxxed25sg:[0b9bdb05d848b70041d7ed45c28dd9d6743a19eb129524d1c623b31784]") + ) + ) + ) + ) + ) + ) + ) + ) + Enum<1u8>( + 20160u32 + ) + Enum<0u8>() +; +SET_METADATA + Address("identity_rdx12tw6rt9c4l56rz6p866e35tmzp556nymxmpj8hagfewq82kspctdyw") + "owner_keys" + Enum<143u8>( + Array( + Enum<1u8>( + Bytes("675506ad8d7ce4c602cb06c593c0f10e1cc4dcdf2c4144360ef33ebeef") + ) + ) + ) +; \ No newline at end of file diff --git a/crates/sargon/fixtures/transaction/create_nft_collection.dat b/crates/sargon-transaction-models/fixtures/transaction/create_nft_collection.dat similarity index 100% rename from crates/sargon/fixtures/transaction/create_nft_collection.dat rename to crates/sargon-transaction-models/fixtures/transaction/create_nft_collection.dat diff --git a/crates/sargon/fixtures/transaction/create_nft_collection.rtm b/crates/sargon-transaction-models/fixtures/transaction/create_nft_collection.rtm similarity index 100% rename from crates/sargon/fixtures/transaction/create_nft_collection.rtm rename to crates/sargon-transaction-models/fixtures/transaction/create_nft_collection.rtm diff --git a/crates/sargon/fixtures/transaction/create_pool.dat b/crates/sargon-transaction-models/fixtures/transaction/create_pool.dat similarity index 100% rename from crates/sargon/fixtures/transaction/create_pool.dat rename to crates/sargon-transaction-models/fixtures/transaction/create_pool.dat diff --git a/crates/sargon/fixtures/transaction/create_pool.rtm b/crates/sargon-transaction-models/fixtures/transaction/create_pool.rtm similarity index 100% rename from crates/sargon/fixtures/transaction/create_pool.rtm rename to crates/sargon-transaction-models/fixtures/transaction/create_pool.rtm diff --git a/crates/sargon/fixtures/transaction/create_single_fungible.dat b/crates/sargon-transaction-models/fixtures/transaction/create_single_fungible.dat similarity index 100% rename from crates/sargon/fixtures/transaction/create_single_fungible.dat rename to crates/sargon-transaction-models/fixtures/transaction/create_single_fungible.dat diff --git a/crates/sargon/fixtures/transaction/create_single_fungible.rtm b/crates/sargon-transaction-models/fixtures/transaction/create_single_fungible.rtm similarity index 100% rename from crates/sargon/fixtures/transaction/create_single_fungible.rtm rename to crates/sargon-transaction-models/fixtures/transaction/create_single_fungible.rtm diff --git a/crates/sargon/fixtures/transaction/mint_nft_gumball_card.dat b/crates/sargon-transaction-models/fixtures/transaction/mint_nft_gumball_card.dat similarity index 100% rename from crates/sargon/fixtures/transaction/mint_nft_gumball_card.dat rename to crates/sargon-transaction-models/fixtures/transaction/mint_nft_gumball_card.dat diff --git a/crates/sargon/fixtures/transaction/mint_nft_gumball_card.rtm b/crates/sargon-transaction-models/fixtures/transaction/mint_nft_gumball_card.rtm similarity index 100% rename from crates/sargon/fixtures/transaction/mint_nft_gumball_card.rtm rename to crates/sargon-transaction-models/fixtures/transaction/mint_nft_gumball_card.rtm diff --git a/crates/sargon/fixtures/transaction/multi_account_resource_transfer.rtm b/crates/sargon-transaction-models/fixtures/transaction/multi_account_resource_transfer.rtm similarity index 100% rename from crates/sargon/fixtures/transaction/multi_account_resource_transfer.rtm rename to crates/sargon-transaction-models/fixtures/transaction/multi_account_resource_transfer.rtm diff --git a/crates/sargon/fixtures/transaction/multi_account_resource_transfer_subintent.rtm b/crates/sargon-transaction-models/fixtures/transaction/multi_account_resource_transfer_subintent.rtm similarity index 100% rename from crates/sargon/fixtures/transaction/multi_account_resource_transfer_subintent.rtm rename to crates/sargon-transaction-models/fixtures/transaction/multi_account_resource_transfer_subintent.rtm diff --git a/crates/sargon/fixtures/transaction/open_subintent_fungibles.rtm b/crates/sargon-transaction-models/fixtures/transaction/open_subintent_fungibles.rtm similarity index 100% rename from crates/sargon/fixtures/transaction/open_subintent_fungibles.rtm rename to crates/sargon-transaction-models/fixtures/transaction/open_subintent_fungibles.rtm diff --git a/crates/sargon/fixtures/transaction/open_subintent_mix_multiple_deposits.rtm b/crates/sargon-transaction-models/fixtures/transaction/open_subintent_mix_multiple_deposits.rtm similarity index 100% rename from crates/sargon/fixtures/transaction/open_subintent_mix_multiple_deposits.rtm rename to crates/sargon-transaction-models/fixtures/transaction/open_subintent_mix_multiple_deposits.rtm diff --git a/crates/sargon/fixtures/transaction/open_subintent_non_fungibles_no_certain_ids.rtm b/crates/sargon-transaction-models/fixtures/transaction/open_subintent_non_fungibles_no_certain_ids.rtm similarity index 100% rename from crates/sargon/fixtures/transaction/open_subintent_non_fungibles_no_certain_ids.rtm rename to crates/sargon-transaction-models/fixtures/transaction/open_subintent_non_fungibles_no_certain_ids.rtm diff --git a/crates/sargon/fixtures/transaction/open_subintent_non_fungibles_with_certain_ids.rtm b/crates/sargon-transaction-models/fixtures/transaction/open_subintent_non_fungibles_with_certain_ids.rtm similarity index 100% rename from crates/sargon/fixtures/transaction/open_subintent_non_fungibles_with_certain_ids.rtm rename to crates/sargon-transaction-models/fixtures/transaction/open_subintent_non_fungibles_with_certain_ids.rtm diff --git a/crates/sargon/fixtures/transaction/open_subintent_pool_stakes_stake_claim.rtm b/crates/sargon-transaction-models/fixtures/transaction/open_subintent_pool_stakes_stake_claim.rtm similarity index 100% rename from crates/sargon/fixtures/transaction/open_subintent_pool_stakes_stake_claim.rtm rename to crates/sargon-transaction-models/fixtures/transaction/open_subintent_pool_stakes_stake_claim.rtm diff --git a/crates/sargon/fixtures/transaction/present_proof_swap_candy.dat b/crates/sargon-transaction-models/fixtures/transaction/present_proof_swap_candy.dat similarity index 100% rename from crates/sargon/fixtures/transaction/present_proof_swap_candy.dat rename to crates/sargon-transaction-models/fixtures/transaction/present_proof_swap_candy.dat diff --git a/crates/sargon/fixtures/transaction/present_proof_swap_candy.rtm b/crates/sargon-transaction-models/fixtures/transaction/present_proof_swap_candy.rtm similarity index 100% rename from crates/sargon/fixtures/transaction/present_proof_swap_candy.rtm rename to crates/sargon-transaction-models/fixtures/transaction/present_proof_swap_candy.rtm diff --git a/crates/sargon/fixtures/transaction/redeem_from_bi_pool.dat b/crates/sargon-transaction-models/fixtures/transaction/redeem_from_bi_pool.dat similarity index 100% rename from crates/sargon/fixtures/transaction/redeem_from_bi_pool.dat rename to crates/sargon-transaction-models/fixtures/transaction/redeem_from_bi_pool.dat diff --git a/crates/sargon/fixtures/transaction/redeem_from_bi_pool.rtm b/crates/sargon-transaction-models/fixtures/transaction/redeem_from_bi_pool.rtm similarity index 100% rename from crates/sargon/fixtures/transaction/redeem_from_bi_pool.rtm rename to crates/sargon-transaction-models/fixtures/transaction/redeem_from_bi_pool.rtm diff --git a/crates/sargon/fixtures/transaction/resource_transfer.rtm b/crates/sargon-transaction-models/fixtures/transaction/resource_transfer.rtm similarity index 100% rename from crates/sargon/fixtures/transaction/resource_transfer.rtm rename to crates/sargon-transaction-models/fixtures/transaction/resource_transfer.rtm diff --git a/crates/sargon/fixtures/transaction/resource_transfer_subintent.rtm b/crates/sargon-transaction-models/fixtures/transaction/resource_transfer_subintent.rtm similarity index 100% rename from crates/sargon/fixtures/transaction/resource_transfer_subintent.rtm rename to crates/sargon-transaction-models/fixtures/transaction/resource_transfer_subintent.rtm diff --git a/crates/sargon/fixtures/transaction/stake_to_three_validators.dat b/crates/sargon-transaction-models/fixtures/transaction/stake_to_three_validators.dat similarity index 100% rename from crates/sargon/fixtures/transaction/stake_to_three_validators.dat rename to crates/sargon-transaction-models/fixtures/transaction/stake_to_three_validators.dat diff --git a/crates/sargon/fixtures/transaction/stake_to_three_validators.rtm b/crates/sargon-transaction-models/fixtures/transaction/stake_to_three_validators.rtm similarity index 100% rename from crates/sargon/fixtures/transaction/stake_to_three_validators.rtm rename to crates/sargon-transaction-models/fixtures/transaction/stake_to_three_validators.rtm diff --git a/crates/sargon/fixtures/transaction/third_party_deposits_update.dat b/crates/sargon-transaction-models/fixtures/transaction/third_party_deposits_update.dat similarity index 100% rename from crates/sargon/fixtures/transaction/third_party_deposits_update.dat rename to crates/sargon-transaction-models/fixtures/transaction/third_party_deposits_update.dat diff --git a/crates/sargon/fixtures/transaction/third_party_deposits_update.rtm b/crates/sargon-transaction-models/fixtures/transaction/third_party_deposits_update.rtm similarity index 100% rename from crates/sargon/fixtures/transaction/third_party_deposits_update.rtm rename to crates/sargon-transaction-models/fixtures/transaction/third_party_deposits_update.rtm diff --git a/crates/sargon/fixtures/transaction/transfer_1to2_multiple_nf_and_f_tokens.dat b/crates/sargon-transaction-models/fixtures/transaction/transfer_1to2_multiple_nf_and_f_tokens.dat similarity index 100% rename from crates/sargon/fixtures/transaction/transfer_1to2_multiple_nf_and_f_tokens.dat rename to crates/sargon-transaction-models/fixtures/transaction/transfer_1to2_multiple_nf_and_f_tokens.dat diff --git a/crates/sargon/fixtures/transaction/transfer_1to2_multiple_nf_and_f_tokens.rtm b/crates/sargon-transaction-models/fixtures/transaction/transfer_1to2_multiple_nf_and_f_tokens.rtm similarity index 100% rename from crates/sargon/fixtures/transaction/transfer_1to2_multiple_nf_and_f_tokens.rtm rename to crates/sargon-transaction-models/fixtures/transaction/transfer_1to2_multiple_nf_and_f_tokens.rtm diff --git a/crates/sargon/fixtures/transaction/unstake_partially_from_one_validator.dat b/crates/sargon-transaction-models/fixtures/transaction/unstake_partially_from_one_validator.dat similarity index 100% rename from crates/sargon/fixtures/transaction/unstake_partially_from_one_validator.dat rename to crates/sargon-transaction-models/fixtures/transaction/unstake_partially_from_one_validator.dat diff --git a/crates/sargon/fixtures/transaction/unstake_partially_from_one_validator.rtm b/crates/sargon-transaction-models/fixtures/transaction/unstake_partially_from_one_validator.rtm similarity index 100% rename from crates/sargon/fixtures/transaction/unstake_partially_from_one_validator.rtm rename to crates/sargon-transaction-models/fixtures/transaction/unstake_partially_from_one_validator.rtm diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/assert_manifest.rs b/crates/sargon-transaction-models/src/assert_manifest.rs similarity index 99% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/assert_manifest.rs rename to crates/sargon-transaction-models/src/assert_manifest.rs index 9a72c0a2d..3057855bf 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/assert_manifest.rs +++ b/crates/sargon-transaction-models/src/assert_manifest.rs @@ -17,7 +17,6 @@ use crate::prelude::*; /// string without this test method since every space need to be correct. /// This function also allows for prettier formatting of the manifest string /// we assert against, since we can use any number of tabs. -#[cfg(test)] pub fn manifest_eq(manifest: TransactionManifest, expected: impl AsRef) { let trim = |s: &str| s.replace(' ', "").replace('\t', " ").trim().to_owned(); @@ -44,7 +43,6 @@ pub fn manifest_eq(manifest: TransactionManifest, expected: impl AsRef) { /// string without this test method since every space need to be correct. /// This function also allows for prettier formatting of the Instructions set string /// we assert against, since we can use any number of tabs. -#[cfg(test)] pub fn instructions_eq( instructions_string: impl AsRef, expected: impl AsRef, diff --git a/crates/sargon/src/error_from.rs b/crates/sargon-transaction-models/src/error_from.rs similarity index 100% rename from crates/sargon/src/error_from.rs rename to crates/sargon-transaction-models/src/error_from.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/is_intent_signing.rs b/crates/sargon-transaction-models/src/is_intent_signing.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/is_intent_signing.rs rename to crates/sargon-transaction-models/src/is_intent_signing.rs diff --git a/crates/sargon-transaction-models/src/lib.rs b/crates/sargon-transaction-models/src/lib.rs new file mode 100644 index 000000000..55a34d075 --- /dev/null +++ b/crates/sargon-transaction-models/src/lib.rs @@ -0,0 +1,198 @@ +mod assert_manifest; +mod error_from; +mod is_intent_signing; +mod low_level; +mod profile_models; +mod unvalidated_transaction_manifest; + +pub mod prelude { + pub use identified_vec_of::prelude::*; + pub use sargon_addresses::prelude::*; + pub use sargon_core::prelude::*; + pub use sargon_factors::prelude::*; + pub use sargon_hierarchical_deterministic::prelude::*; + + pub use crate::assert_manifest::*; + pub use crate::error_from::*; + pub use crate::is_intent_signing::*; + pub use crate::low_level::*; + pub use crate::profile_models::*; + pub use crate::unvalidated_transaction_manifest::*; + + pub(crate) use radix_engine::{ + blueprints::consensus_manager::UnstakeData as ScryptoUnstakeData, + system::system_modules::execution_trace::ResourceSpecifier as ScryptoResourceSpecifier, + transaction::FeeLocks as ScryptoFeeLocks, + }; + + pub(crate) use radix_common::{ + crypto::Secp256k1PrivateKey as ScryptoSecp256k1PrivateKey, + math::Decimal as ScryptoDecimal192, + prelude::UpperBound as ScryptoUpperBound, + }; + + pub(crate) use radix_engine_toolkit_common::receipt::RuntimeToolkitTransactionReceipt as ScryptoRuntimeToolkitTransactionReceipt; + + pub(crate) use radix_engine_toolkit_common::receipt::SerializableToolkitTransactionReceipt as ScryptoSerializableToolkitTransactionReceipt; + + pub(crate) use radix_engine_interface::prelude::MetadataValue as ScryptoMetadataValue; + + pub use radix_engine_toolkit::{ + functions::{ + transaction_v1::{ + instructions::extract_addresses as RET_ins_extract_addresses, + intent::{ + from_payload_bytes as RET_intent_from_payload_bytes, + hash as ret_hash_intent, + to_payload_bytes as RET_intent_to_payload_bytes, + }, + manifest::{ + from_payload_bytes as RET_from_payload_bytes_manifest_v1, + statically_analyze_and_validate as RET_statically_analyze_and_validate, + to_payload_bytes as RET_to_payload_bytes_manifest_v1, + }, + notarized_transaction::{ + from_payload_bytes as RET_decompile_notarize_tx, + to_payload_bytes as RET_compile_notarized_tx, + }, + signed_intent::hash as RET_signed_intent_hash, + }, + transaction_v2::{ + instructions::extract_addresses as RET_ins_extract_addresses_v2, + notarized_transaction::{ + from_payload_bytes as RET_decompile_notarize_tx_v2, + to_payload_bytes as RET_compile_notarized_tx_v2, + }, + signed_partial_transaction::{ + from_payload_bytes as RET_decompile_signed_partial_tx, + to_payload_bytes as RET_compile_signed_partial_tx, + }, + signed_transaction_intent::hash as RET_signed_intent_hash_v2, + subintent::{ + from_payload_bytes as RET_subintent_from_payload_bytes, + hash as ret_hash_subintent, + to_payload_bytes as RET_subintent_to_payload_bytes, + }, + subintent_manifest::{ + as_enclosed as RET_subintent_manifest_as_enclosed, + from_payload_bytes as RET_from_payload_bytes_subintent_manifest, + statically_analyze_and_validate as RET_statically_analyze_and_validate_subintent_manifest, + to_payload_bytes as RET_to_payload_bytes_subintent_manifest, + }, + transaction_intent::{ + hash as ret_hash_transaction_intent_v2, + to_payload_bytes as RET_transaction_intent_to_payload_bytes_v2, + }, + transaction_manifest::{ + dynamically_analyze as RET_dynamically_analyze_v2, + from_payload_bytes as RET_from_payload_bytes_manifest_v2, + statically_analyze_and_validate as RET_statically_analyze_and_validate_v2, + to_payload_bytes as RET_to_payload_bytes_manifest_v2, + }, + }, + }, + models::{ + canonical_address_types::{ + CanonicalAccessControllerAddress as RetAccessControllerAddress, + CanonicalAccountAddress as RetAccountAddress, + CanonicalAddress as RetIsAddressTrait, + CanonicalComponentAddress as RetComponentAddress, + CanonicalIdentityAddress as RetIdentityAddress, + CanonicalLockerAddress as RetLockerAddress, + CanonicalPackageAddress as RetPackageAddress, + CanonicalPoolAddress as RetPoolAddress, + CanonicalResourceAddress as RetResourceAddress, + CanonicalValidatorAddress as RetValidatorAddress, + CanonicalVaultAddress as RetVaultAddress, + }, + node_id::TypedNodeId as RetTypedNodeId, + }, + transaction_types::{ + DetailedManifestClass as RetDetailedManifestClass, + DynamicAnalysis as RetDynamicAnalysis, FeeSummary as RetFeeSummary, + FungibleResourceIndicator as RetFungibleResourceIndicator, + ManifestClass as RetManifestClass, NewEntities as RetNewEntities, + NonFungibleResourceIndicator as RetNonFungibleResourceIndicator, + Operation as RetOperation, Predicted as RetPredicted, + ReservedInstruction as RetReservedInstruction, + ResourceIndicator as RetResourceIndicator, + StaticAnalysisWithResourceMovements as RetStaticAnalysisWithResourceMovements, + TrackedPoolContribution as RetTrackedPoolContribution, + TrackedPoolRedemption as RetTrackedPoolRedemption, + TrackedValidatorClaim as RetTrackedValidatorClaim, + TrackedValidatorStake as RetTrackedValidatorStake, + TransactionTypesError as RetTransactionTypesError, + Update as RetUpdate, + }, + }; + + pub(crate) use radix_engine_interface::blueprints::account::{ + DefaultDepositRule as ScryptoDefaultDepositRule, + ResourcePreference as ScryptoResourcePreference, + }; + + pub(crate) use radix_transactions::{ + manifest::{ + compile as scrypto_compile, + compile_error_diagnostics as scrypto_compile_error_diagnostics, + compile_manifest as scrypto_compile_manifest, + decompile as scrypto_decompile, + generator::{GeneratorError, GeneratorErrorKind}, + static_resource_movements::{ + AccountDeposit as ScryptoAccountDeposit, + AccountWithdraw as ScryptoAccountWithdraw, + ChangeSource as ScryptoChangeSource, + SimpleFungibleResourceBounds as ScryptoSimpleFungibleResourceBounds, + SimpleNonFungibleResourceBounds as ScryptoSimpleNonFungibleResourceBounds, + SimpleResourceBounds as ScryptoSimpleResourceBounds, + UnspecifiedResources as ScryptoUnspecifiedResources, + }, + CompileError as ScryptoCompileError, + CompileErrorDiagnosticsStyle as ScryptoCompileErrorDiagnosticsStyle, + MockBlobProvider as ScryptoMockBlobProvider, + }, + model::{ + BlobV1 as ScryptoBlob, BlobsV1 as ScryptoBlobs, + ChildSubintentSpecifier as ScryptoChildSubintentSpecifier, + ChildSubintentSpecifiersV2 as ScryptoChildSubintentSpecifiers, + InstructionV1 as ScryptoInstruction, + InstructionV2 as ScryptoInstructionV2, + InstructionsV1 as ScryptoInstructions, + InstructionsV2 as ScryptoInstructionsV2, + IntentCoreV2 as ScryptoIntentCoreV2, + IntentHeaderV2 as ScryptoIntentHeaderV2, + IntentSignatureV1 as ScryptoIntentSignature, + IntentSignaturesV1 as ScryptoIntentSignatures, + IntentSignaturesV2 as ScryptoIntentSignaturesV2, + IntentV1 as ScryptoIntent, + IsTransactionHashWithStaticHrp as ScryptoIsTransactionHashWithStaticHrp, + MessageContentsV1 as ScryptoMessageContents, + MessageV1 as ScryptoMessage, MessageV2 as ScryptoMessageV2, + NonRootSubintentSignaturesV2 as ScryptoNonRootSubintentSignatures, + NonRootSubintentsV2 as ScryptoNonRootSubintents, + NotarizedTransactionV1 as ScryptoNotarizedTransaction, + NotarySignatureV1 as ScryptoNotarySignature, + PartialTransactionV2 as ScryptoPartialTransaction, + PlaintextMessageV1 as ScryptoPlaintextMessage, + SignedIntentV1 as ScryptoSignedIntent, + SignedPartialTransactionV2 as ScryptoSignedPartialTransaction, + SignedTransactionIntentHash as ScryptoSignedTransactionIntentHash, + SubintentHash as ScryptoSubintentHash, + SubintentV2 as ScryptoSubintent, + TransactionHashBech32Decoder as ScryptoTransactionHashBech32Decoder, + TransactionHashBech32Encoder as ScryptoTransactionHashBech32Encoder, + TransactionHeaderV1 as ScryptoTransactionHeader, + TransactionIntentHash as ScryptoTransactionIntentHash, + }, + prelude::{ + SubintentManifestV2 as ScryptoSubintentManifestV2, + SubintentManifestV2Builder as ScryptoSubintentManifestV2Builder, + TransactionManifestV1 as ScryptoTransactionManifest, + TransactionManifestV1Builder as ScryptoTransactionManifestBuilder, + TransactionManifestV2 as ScryptoTransactionManifestV2, + TransactionManifestV2Builder as ScryptoTransactionManifestV2Builder, + }, + }; +} + +pub use prelude::*; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/compiled_notarized_intent.rs b/crates/sargon-transaction-models/src/low_level/compiled_notarized_intent.rs similarity index 99% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/compiled_notarized_intent.rs rename to crates/sargon-transaction-models/src/low_level/compiled_notarized_intent.rs index c31d0da85..622d40e2f 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/compiled_notarized_intent.rs +++ b/crates/sargon-transaction-models/src/low_level/compiled_notarized_intent.rs @@ -1,4 +1,6 @@ use crate::prelude::*; + +#[cfg(test)] use radix_transactions::manifest::CallMethod; #[derive( @@ -64,7 +66,9 @@ impl HasSampleValues for CompiledNotarizedIntent { } } +#[cfg(test)] use sbor::ValueKind as ScryptoValueKind; + #[cfg(test)] pub(crate) fn invalid_signed_intent() -> ScryptoSignedIntent { let invalid_value = ScryptoManifestValue::Tuple { diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/compiled_transaction_intent.rs b/crates/sargon-transaction-models/src/low_level/compiled_transaction_intent.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/compiled_transaction_intent.rs rename to crates/sargon-transaction-models/src/low_level/compiled_transaction_intent.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/dynamically_analyzable_manifest.rs b/crates/sargon-transaction-models/src/low_level/dynamically_analyzable_manifest.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/dynamically_analyzable_manifest.rs rename to crates/sargon-transaction-models/src/low_level/dynamically_analyzable_manifest.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/execution_summary.rs b/crates/sargon-transaction-models/src/low_level/execution_summary/execution_summary.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/execution_summary.rs rename to crates/sargon-transaction-models/src/low_level/execution_summary/execution_summary.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/fee_locks.rs b/crates/sargon-transaction-models/src/low_level/execution_summary/fee_locks.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/fee_locks.rs rename to crates/sargon-transaction-models/src/low_level/execution_summary/fee_locks.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/fee_summary.rs b/crates/sargon-transaction-models/src/low_level/execution_summary/fee_summary.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/fee_summary.rs rename to crates/sargon-transaction-models/src/low_level/execution_summary/fee_summary.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/mod.rs b/crates/sargon-transaction-models/src/low_level/execution_summary/mod.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/mod.rs rename to crates/sargon-transaction-models/src/low_level/execution_summary/mod.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/new_entities.rs b/crates/sargon-transaction-models/src/low_level/execution_summary/new_entities.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/new_entities.rs rename to crates/sargon-transaction-models/src/low_level/execution_summary/new_entities.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/newly_created_resource.rs b/crates/sargon-transaction-models/src/low_level/execution_summary/newly_created_resource.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/newly_created_resource.rs rename to crates/sargon-transaction-models/src/low_level/execution_summary/newly_created_resource.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/reserved_instruction.rs b/crates/sargon-transaction-models/src/low_level/execution_summary/reserved_instruction.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/reserved_instruction.rs rename to crates/sargon-transaction-models/src/low_level/execution_summary/reserved_instruction.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/fungible_resource_indicator.rs b/crates/sargon-transaction-models/src/low_level/execution_summary/resource_indicator/fungible_resource_indicator.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/fungible_resource_indicator.rs rename to crates/sargon-transaction-models/src/low_level/execution_summary/resource_indicator/fungible_resource_indicator.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/mod.rs b/crates/sargon-transaction-models/src/low_level/execution_summary/resource_indicator/mod.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/mod.rs rename to crates/sargon-transaction-models/src/low_level/execution_summary/resource_indicator/mod.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/non_fungible_resource_indicator.rs b/crates/sargon-transaction-models/src/low_level/execution_summary/resource_indicator/non_fungible_resource_indicator.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/non_fungible_resource_indicator.rs rename to crates/sargon-transaction-models/src/low_level/execution_summary/resource_indicator/non_fungible_resource_indicator.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/predicted.rs b/crates/sargon-transaction-models/src/low_level/execution_summary/resource_indicator/predicted.rs similarity index 98% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/predicted.rs rename to crates/sargon-transaction-models/src/low_level/execution_summary/resource_indicator/predicted.rs index 5e41ad57d..a5f607e2b 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/predicted.rs +++ b/crates/sargon-transaction-models/src/low_level/execution_summary/resource_indicator/predicted.rs @@ -1,4 +1,4 @@ -use radix_rust::prelude::{IndexMap, IndexSet}; +use radix_rust::prelude::IndexSet; use crate::prelude::*; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/resource_indicator.rs b/crates/sargon-transaction-models/src/low_level/execution_summary/resource_indicator/resource_indicator.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/resource_indicator.rs rename to crates/sargon-transaction-models/src/low_level/execution_summary/resource_indicator/resource_indicator.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_specifier/mod.rs b/crates/sargon-transaction-models/src/low_level/execution_summary/resource_specifier/mod.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_specifier/mod.rs rename to crates/sargon-transaction-models/src/low_level/execution_summary/resource_specifier/mod.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_specifier/resource_specifier.rs b/crates/sargon-transaction-models/src/low_level/execution_summary/resource_specifier/resource_specifier.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_specifier/resource_specifier.rs rename to crates/sargon-transaction-models/src/low_level/execution_summary/resource_specifier/resource_specifier.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/intent_signature.rs b/crates/sargon-transaction-models/src/low_level/intent_signature.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/intent_signature.rs rename to crates/sargon-transaction-models/src/low_level/intent_signature.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/manifest_encountered_component_address.rs b/crates/sargon-transaction-models/src/low_level/manifest_encountered_component_address.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/manifest_encountered_component_address.rs rename to crates/sargon-transaction-models/src/low_level/manifest_encountered_component_address.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/account_deposits.rs b/crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/account_deposits.rs similarity index 98% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/account_deposits.rs rename to crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/account_deposits.rs index bdb657b59..2c5a6bc06 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/account_deposits.rs +++ b/crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/account_deposits.rs @@ -1,5 +1,4 @@ use crate::prelude::*; -use std::collections::HashMap; /// Represents an account deposit, which includes specified and unspecified resources. #[derive(Clone, Debug, PartialEq, Eq)] diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/change_source.rs b/crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/change_source.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/change_source.rs rename to crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/change_source.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/mod.rs b/crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/mod.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/mod.rs rename to crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/mod.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/simple_counted_resource_bounds.rs b/crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/simple_counted_resource_bounds.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/simple_counted_resource_bounds.rs rename to crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/simple_counted_resource_bounds.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/simple_non_fungible_resource_bounds.rs b/crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/simple_non_fungible_resource_bounds.rs similarity index 99% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/simple_non_fungible_resource_bounds.rs rename to crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/simple_non_fungible_resource_bounds.rs index 8d9757dd6..79ee754c7 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/simple_non_fungible_resource_bounds.rs +++ b/crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/simple_non_fungible_resource_bounds.rs @@ -1,5 +1,3 @@ -use uuid::fmt::Simple; - use crate::prelude::*; #[derive(Clone, Debug, PartialEq, Eq)] diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/simple_resource_bounds.rs b/crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/simple_resource_bounds.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/simple_resource_bounds.rs rename to crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/simple_resource_bounds.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/unspecified_resources.rs b/crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/unspecified_resources.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/unspecified_resources.rs rename to crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/unspecified_resources.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_withdraw/account_withdraw.rs b/crates/sargon-transaction-models/src/low_level/manifest_summary/account_withdraw/account_withdraw.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_withdraw/account_withdraw.rs rename to crates/sargon-transaction-models/src/low_level/manifest_summary/account_withdraw/account_withdraw.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_withdraw/mod.rs b/crates/sargon-transaction-models/src/low_level/manifest_summary/account_withdraw/mod.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_withdraw/mod.rs rename to crates/sargon-transaction-models/src/low_level/manifest_summary/account_withdraw/mod.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/manifest_summary.rs b/crates/sargon-transaction-models/src/low_level/manifest_summary/manifest_summary.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/manifest_summary.rs rename to crates/sargon-transaction-models/src/low_level/manifest_summary/manifest_summary.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/mod.rs b/crates/sargon-transaction-models/src/low_level/manifest_summary/mod.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/mod.rs rename to crates/sargon-transaction-models/src/low_level/manifest_summary/mod.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/mod.rs b/crates/sargon-transaction-models/src/low_level/mod.rs similarity index 92% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/mod.rs rename to crates/sargon-transaction-models/src/low_level/mod.rs index 36085b203..38a75e552 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/mod.rs +++ b/crates/sargon-transaction-models/src/low_level/mod.rs @@ -3,6 +3,7 @@ mod compiled_transaction_intent; mod dynamically_analyzable_manifest; mod execution_summary; mod intent_signature; +mod manifest_encountered_component_address; mod manifest_summary; mod notarized_transaction; mod notary_signature; @@ -19,10 +20,10 @@ pub use compiled_transaction_intent::*; pub use dynamically_analyzable_manifest::*; pub use execution_summary::*; pub use intent_signature::*; +pub use manifest_encountered_component_address::*; pub use manifest_summary::*; pub use notarized_transaction::*; pub use notary_signature::*; -pub(crate) use sbor_depth_validation::*; pub use signed_intent::*; pub use statically_analyzable_manifest::*; pub use transaction_classes::*; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/notarized_transaction.rs b/crates/sargon-transaction-models/src/low_level/notarized_transaction.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/notarized_transaction.rs rename to crates/sargon-transaction-models/src/low_level/notarized_transaction.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/notary_signature.rs b/crates/sargon-transaction-models/src/low_level/notary_signature.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/notary_signature.rs rename to crates/sargon-transaction-models/src/low_level/notary_signature.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/sbor_depth_validation.rs b/crates/sargon-transaction-models/src/low_level/sbor_depth_validation.rs similarity index 92% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/sbor_depth_validation.rs rename to crates/sargon-transaction-models/src/low_level/sbor_depth_validation.rs index ffc60a4be..1f02659f3 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/sbor_depth_validation.rs +++ b/crates/sargon-transaction-models/src/low_level/sbor_depth_validation.rs @@ -1,10 +1,10 @@ -use crate::prelude::*; - +#[cfg(test)] use radix_common::prelude::{ manifest_encode as Scrypto_manifest_encode, ScryptoValue as ScryptoScryptoValue, MANIFEST_SBOR_V1_MAX_DEPTH, SCRYPTO_SBOR_V1_MAX_DEPTH, }; +#[cfg(test)] use sbor::{ CustomValue as ScryptoCustomValue, CustomValueKind as ScryptoCustomValueKind, Value as ScryptoValue, @@ -32,6 +32,9 @@ pub(crate) fn scrypto_value_with_sbor_depth( sbor_value_with_depth(depth) } +#[cfg(test)] +use radix_common::prelude::ManifestValue as ScryptoManifestValue; + #[cfg(test)] pub(crate) fn manifest_value_with_sbor_depth( depth: usize, @@ -41,6 +44,8 @@ pub(crate) fn manifest_value_with_sbor_depth( #[cfg(test)] mod sbor_depth_validation_tests { + use sargon_addresses::Scrypto_scrypto_encode; + use super::*; #[test] diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/signed_intent.rs b/crates/sargon-transaction-models/src/low_level/signed_intent.rs similarity index 96% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/signed_intent.rs rename to crates/sargon-transaction-models/src/low_level/signed_intent.rs index 5989cfb56..1b5e14428 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/signed_intent.rs +++ b/crates/sargon-transaction-models/src/low_level/signed_intent.rs @@ -8,6 +8,20 @@ pub struct SignedIntent { pub intent_signatures: IntentSignatures, } +impl IntoIterator for SignedIntent { + type Item = SignatureWithPublicKey; + type IntoIter = as IntoIterator>::IntoIter; + + fn into_iter(self) -> Self::IntoIter { + self.intent_signatures + .signatures + .into_iter() + .map(|s| s.0) + .collect_vec() + .into_iter() + } +} + impl SignedIntent { pub fn new( intent: TransactionIntent, diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/statically_analyzable_manifest.rs b/crates/sargon-transaction-models/src/low_level/statically_analyzable_manifest.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/statically_analyzable_manifest.rs rename to crates/sargon-transaction-models/src/low_level/statically_analyzable_manifest.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/detailed_manifest_class.rs b/crates/sargon-transaction-models/src/low_level/transaction_classes/detailed_manifest_class.rs similarity index 99% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/detailed_manifest_class.rs rename to crates/sargon-transaction-models/src/low_level/transaction_classes/detailed_manifest_class.rs index 78dbcc92e..014e8c74d 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/detailed_manifest_class.rs +++ b/crates/sargon-transaction-models/src/low_level/transaction_classes/detailed_manifest_class.rs @@ -136,7 +136,7 @@ impl std::fmt::Display for DetailedManifestClass { impl DetailedManifestClass { /// Checks the manifest class is reserved for Wallet interactions only - pub(crate) fn is_reserved(&self) -> bool { + pub fn is_reserved(&self) -> bool { self.kind() == DetailedManifestClassKind::DeleteAccounts } } diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/detailed_manifest_class_kind.rs b/crates/sargon-transaction-models/src/low_level/transaction_classes/detailed_manifest_class_kind.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/detailed_manifest_class_kind.rs rename to crates/sargon-transaction-models/src/low_level/transaction_classes/detailed_manifest_class_kind.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/mod.rs b/crates/sargon-transaction-models/src/low_level/transaction_classes/mod.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/mod.rs rename to crates/sargon-transaction-models/src/low_level/transaction_classes/mod.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/mod.rs b/crates/sargon-transaction-models/src/low_level/transaction_classes/types/mod.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/mod.rs rename to crates/sargon-transaction-models/src/low_level/transaction_classes/types/mod.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/resource_preference_update.rs b/crates/sargon-transaction-models/src/low_level/transaction_classes/types/resource_preference_update.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/resource_preference_update.rs rename to crates/sargon-transaction-models/src/low_level/transaction_classes/types/resource_preference_update.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/tracked_pool_contribution.rs b/crates/sargon-transaction-models/src/low_level/transaction_classes/types/tracked_pool_contribution.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/tracked_pool_contribution.rs rename to crates/sargon-transaction-models/src/low_level/transaction_classes/types/tracked_pool_contribution.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/tracked_pool_redemption.rs b/crates/sargon-transaction-models/src/low_level/transaction_classes/types/tracked_pool_redemption.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/tracked_pool_redemption.rs rename to crates/sargon-transaction-models/src/low_level/transaction_classes/types/tracked_pool_redemption.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/tracked_validator_claim.rs b/crates/sargon-transaction-models/src/low_level/transaction_classes/types/tracked_validator_claim.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/tracked_validator_claim.rs rename to crates/sargon-transaction-models/src/low_level/transaction_classes/types/tracked_validator_claim.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/tracked_validator_stake.rs b/crates/sargon-transaction-models/src/low_level/transaction_classes/types/tracked_validator_stake.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/tracked_validator_stake.rs rename to crates/sargon-transaction-models/src/low_level/transaction_classes/types/tracked_validator_stake.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/unstake_data.rs b/crates/sargon-transaction-models/src/low_level/transaction_classes/types/unstake_data.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/unstake_data.rs rename to crates/sargon-transaction-models/src/low_level/transaction_classes/types/unstake_data.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/intent_hash.rs b/crates/sargon-transaction-models/src/low_level/transaction_hashes/intent_hash.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/intent_hash.rs rename to crates/sargon-transaction-models/src/low_level/transaction_hashes/intent_hash.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/mod.rs b/crates/sargon-transaction-models/src/low_level/transaction_hashes/mod.rs similarity index 64% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/mod.rs rename to crates/sargon-transaction-models/src/low_level/transaction_hashes/mod.rs index 9c0ab5382..6c81e3637 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/mod.rs +++ b/crates/sargon-transaction-models/src/low_level/transaction_hashes/mod.rs @@ -4,7 +4,4 @@ mod subintent_hash; mod transaction_hashes; mod validate_and_decode_hash; -pub use intent_hash::*; -pub use signed_intent_hash::*; -pub use subintent_hash::*; pub use transaction_hashes::*; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/signed_intent_hash.rs b/crates/sargon-transaction-models/src/low_level/transaction_hashes/signed_intent_hash.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/signed_intent_hash.rs rename to crates/sargon-transaction-models/src/low_level/transaction_hashes/signed_intent_hash.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/subintent_hash.rs b/crates/sargon-transaction-models/src/low_level/transaction_hashes/subintent_hash.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/subintent_hash.rs rename to crates/sargon-transaction-models/src/low_level/transaction_hashes/subintent_hash.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/transaction_hashes.rs b/crates/sargon-transaction-models/src/low_level/transaction_hashes/transaction_hashes.rs similarity index 97% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/transaction_hashes.rs rename to crates/sargon-transaction-models/src/low_level/transaction_hashes/transaction_hashes.rs index 76cab7a91..d4c076a1d 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/transaction_hashes.rs +++ b/crates/sargon-transaction-models/src/low_level/transaction_hashes/transaction_hashes.rs @@ -1,6 +1,6 @@ use crate::prelude::*; -use crate::wrapped_radix_engine_toolkit::low_level::transaction_hashes::validate_and_decode_hash::validate_and_decode_hash; +use crate::low_level::transaction_hashes::validate_and_decode_hash::validate_and_decode_hash; macro_rules! decl_tx_hash { ( diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/validate_and_decode_hash.rs b/crates/sargon-transaction-models/src/low_level/transaction_hashes/validate_and_decode_hash.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/validate_and_decode_hash.rs rename to crates/sargon-transaction-models/src/low_level/transaction_hashes/validate_and_decode_hash.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/intent_signatures.rs b/crates/sargon-transaction-models/src/low_level/v1/intent_signatures.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/intent_signatures.rs rename to crates/sargon-transaction-models/src/low_level/v1/intent_signatures.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/message/message.rs b/crates/sargon-transaction-models/src/low_level/v1/message/message.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/message/message.rs rename to crates/sargon-transaction-models/src/low_level/v1/message/message.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/message/mod.rs b/crates/sargon-transaction-models/src/low_level/v1/message/mod.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/message/mod.rs rename to crates/sargon-transaction-models/src/low_level/v1/message/mod.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/message/plaintext_message/mod.rs b/crates/sargon-transaction-models/src/low_level/v1/message/plaintext_message/mod.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/message/plaintext_message/mod.rs rename to crates/sargon-transaction-models/src/low_level/v1/message/plaintext_message/mod.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/message/plaintext_message/plaintext_message.rs b/crates/sargon-transaction-models/src/low_level/v1/message/plaintext_message/plaintext_message.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/message/plaintext_message/plaintext_message.rs rename to crates/sargon-transaction-models/src/low_level/v1/message/plaintext_message/plaintext_message.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/message/plaintext_message/plaintext_message_contents.rs b/crates/sargon-transaction-models/src/low_level/v1/message/plaintext_message/plaintext_message_contents.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/message/plaintext_message/plaintext_message_contents.rs rename to crates/sargon-transaction-models/src/low_level/v1/message/plaintext_message/plaintext_message_contents.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/mod.rs b/crates/sargon-transaction-models/src/low_level/v1/mod.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/mod.rs rename to crates/sargon-transaction-models/src/low_level/v1/mod.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_header.rs b/crates/sargon-transaction-models/src/low_level/v1/transaction_header.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_header.rs rename to crates/sargon-transaction-models/src/low_level/v1/transaction_header.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_intent.rs b/crates/sargon-transaction-models/src/low_level/v1/transaction_intent.rs similarity index 98% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_intent.rs rename to crates/sargon-transaction-models/src/low_level/v1/transaction_intent.rs index 9957d8285..f28b5a7c6 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_intent.rs +++ b/crates/sargon-transaction-models/src/low_level/v1/transaction_intent.rs @@ -9,6 +9,12 @@ pub struct TransactionIntent { pub message: Message, } +impl From for TransactionIntent { + fn from(val: SignedIntent) -> Self { + val.intent + } +} + impl TransactionIntent { pub fn new( header: TransactionHeader, diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/blobs/blob.rs b/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/blobs/blob.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/blobs/blob.rs rename to crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/blobs/blob.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/blobs/blobs.rs b/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/blobs/blobs.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/blobs/blobs.rs rename to crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/blobs/blobs.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/blobs/mod.rs b/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/blobs/mod.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/blobs/mod.rs rename to crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/blobs/mod.rs diff --git a/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/execution_summary/mod.rs b/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/execution_summary/mod.rs new file mode 100644 index 000000000..119c9ef3c --- /dev/null +++ b/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/execution_summary/mod.rs @@ -0,0 +1 @@ +mod transaction_manifest_execution_summary; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/execution_summary/transaction_manifest_execution_summary.rs b/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/execution_summary/transaction_manifest_execution_summary.rs similarity index 99% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/execution_summary/transaction_manifest_execution_summary.rs rename to crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/execution_summary/transaction_manifest_execution_summary.rs index 40b0ca07f..0cd465091 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/execution_summary/transaction_manifest_execution_summary.rs +++ b/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/execution_summary/transaction_manifest_execution_summary.rs @@ -27,11 +27,14 @@ impl DynamicallyAnalyzableManifest for TransactionManifest { } } +impl Default for FeeLocks { + fn default() -> Self { + Self::new(0, 0) + } +} + #[cfg(test)] mod tests { - use radix_engine::transaction::{ - AbortReason, AbortResult, TransactionResult, - }; use super::*; @@ -53,12 +56,6 @@ mod tests { ); } - impl Default for FeeLocks { - fn default() -> Self { - Self::new(0, 0) - } - } - #[test] fn transfer_1to2_multiple_nf_and_f_tokens() { let instructions_string = include_str!(concat!( diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/instructions/instructions.rs b/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/instructions/instructions.rs similarity index 98% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/instructions/instructions.rs rename to crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/instructions/instructions.rs index 94dd64fe3..95efa062e 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/instructions/instructions.rs +++ b/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/instructions/instructions.rs @@ -1,8 +1,7 @@ use crate::prelude::*; -use radix_common::prelude::MANIFEST_SBOR_V1_MAX_DEPTH; -use radix_engine_toolkit::functions::address::decode as RET_decode_address; -use radix_transactions::manifest::CallMethod; +#[cfg(test)] +use crate::low_level::sbor_depth_validation::manifest_value_with_sbor_depth; #[derive(Clone, Debug, PartialEq, Eq, derive_more::Display)] #[display("{}", self.instructions_string())] @@ -177,6 +176,12 @@ impl Instructions { } } +#[cfg(test)] +use radix_common::prelude::MANIFEST_SBOR_V1_MAX_DEPTH; + +#[cfg(test)] +use radix_transactions::manifest::CallMethod; + #[cfg(test)] impl Instructions { /// Utility function which uses `Instructions::new(, )` @@ -209,6 +214,8 @@ impl Instructions { mod tests { use super::*; use radix_transactions::manifest::{ + lexer::{LexerError, LexerErrorKind}, + token::{Position, Span}, DropAuthZoneProofs, DropAuthZoneRegularProofs, }; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/instructions/mod.rs b/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/instructions/mod.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/instructions/mod.rs rename to crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/instructions/mod.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/mod.rs b/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/mod.rs similarity index 83% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/mod.rs rename to crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/mod.rs index 70b2d5900..33571531e 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/mod.rs +++ b/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/mod.rs @@ -4,6 +4,5 @@ mod instructions; mod transaction_manifest; pub use blobs::*; -pub use execution_summary::*; pub use instructions::*; pub use transaction_manifest::*; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/transaction_manifest.rs b/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/transaction_manifest.rs similarity index 98% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/transaction_manifest.rs rename to crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/transaction_manifest.rs index 8b66a77b9..145391090 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/transaction_manifest.rs +++ b/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/transaction_manifest.rs @@ -1,6 +1,4 @@ use crate::prelude::*; -use radix_common::prelude::ManifestBucket; -use radix_transactions::manifest::KnownManifestObjectNames; #[derive(Clone, Debug, PartialEq, Eq, derive_more::Display)] #[display("{}", self.manifest_string())] // TODO add blobs to Display @@ -44,7 +42,7 @@ impl StaticallyAnalyzableManifest for TransactionManifest { } impl TransactionManifest { - pub(crate) fn empty(network_id: NetworkID) -> Self { + pub fn empty(network_id: NetworkID) -> Self { Self { instructions: Instructions::empty(network_id), blobs: Blobs::default(), @@ -200,7 +198,7 @@ impl HasSampleValues for TransactionManifest { #[allow(unused)] impl TransactionManifest { - pub(crate) fn sample_mainnet_without_lock_fee() -> Self { + pub fn sample_mainnet_without_lock_fee() -> Self { let instructions = Instructions::sample_mainnet_without_lock_fee(); Self::with_instructions_and_blobs(instructions, Blobs::default()) } @@ -209,14 +207,12 @@ impl TransactionManifest { #[cfg(test)] mod tests { use super::*; - use radix_common::prelude::ManifestBucket; use radix_rust::hashmap; use radix_transactions::manifest::{ CallMethod, DropAllProofs, DropAuthZoneProofs, }; use radix_transactions::model::InstructionV1; use sbor::ValueKind as ScryptoValueKind; - use std::collections::BTreeMap; impl FromStr for TransactionManifest { type Err = crate::CommonError; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/compiled_subintent.rs b/crates/sargon-transaction-models/src/low_level/v2/compiled_subintent.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/compiled_subintent.rs rename to crates/sargon-transaction-models/src/low_level/v2/compiled_subintent.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/intent_header_v2.rs b/crates/sargon-transaction-models/src/low_level/v2/intent_header_v2.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/intent_header_v2.rs rename to crates/sargon-transaction-models/src/low_level/v2/intent_header_v2.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/message_v2/message_v2.rs b/crates/sargon-transaction-models/src/low_level/v2/message_v2/message_v2.rs similarity index 96% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/message_v2/message_v2.rs rename to crates/sargon-transaction-models/src/low_level/v2/message_v2/message_v2.rs index a2cb935c4..9b813cc05 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/message_v2/message_v2.rs +++ b/crates/sargon-transaction-models/src/low_level/v2/message_v2/message_v2.rs @@ -73,8 +73,6 @@ impl HasSampleValues for MessageV2 { mod tests { use super::*; - use radix_transactions::model::{EncryptedMessageV1, EncryptedMessageV2}; - #[allow(clippy::upper_case_acronyms)] type SUT = MessageV2; @@ -128,7 +126,7 @@ mod tests { #[test] fn encrypted_msg_are_not_yet_supported() { - let dummy = EncryptedMessageV2 { + let dummy = radix_transactions::model::EncryptedMessageV2 { encrypted: radix_transactions::prelude::AesGcmPayload(vec![]), decryptors_by_curve: [].into(), }; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/message_v2/mod.rs b/crates/sargon-transaction-models/src/low_level/v2/message_v2/mod.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/message_v2/mod.rs rename to crates/sargon-transaction-models/src/low_level/v2/message_v2/mod.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/mod.rs b/crates/sargon-transaction-models/src/low_level/v2/mod.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/mod.rs rename to crates/sargon-transaction-models/src/low_level/v2/mod.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/signed_partial_transaction.rs b/crates/sargon-transaction-models/src/low_level/v2/signed_partial_transaction.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/signed_partial_transaction.rs rename to crates/sargon-transaction-models/src/low_level/v2/signed_partial_transaction.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/signed_subintent.rs b/crates/sargon-transaction-models/src/low_level/v2/signed_subintent.rs similarity index 95% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/signed_subintent.rs rename to crates/sargon-transaction-models/src/low_level/v2/signed_subintent.rs index 2bc6c57ea..5c23ca40a 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/signed_subintent.rs +++ b/crates/sargon-transaction-models/src/low_level/v2/signed_subintent.rs @@ -6,6 +6,20 @@ pub struct SignedSubintent { pub subintent_signatures: IntentSignatures, } +impl IntoIterator for SignedSubintent { + type Item = SignatureWithPublicKey; + type IntoIter = as IntoIterator>::IntoIter; + + fn into_iter(self) -> Self::IntoIter { + self.subintent_signatures + .signatures + .into_iter() + .map(|s| s.0) + .collect_vec() + .into_iter() + } +} + impl SignedSubintent { pub fn new( subintent: Subintent, diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/subintent.rs b/crates/sargon-transaction-models/src/low_level/v2/subintent.rs similarity index 97% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/subintent.rs rename to crates/sargon-transaction-models/src/low_level/v2/subintent.rs index f04ad375d..2a7160553 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/subintent.rs +++ b/crates/sargon-transaction-models/src/low_level/v2/subintent.rs @@ -1,5 +1,4 @@ use crate::prelude::*; -use delegate::delegate; use std::hash::Hasher; #[derive(Clone, PartialEq, Eq, derive_more::Debug)] @@ -10,6 +9,12 @@ pub struct Subintent { pub message: MessageV2, } +impl From for Subintent { + fn from(val: SignedSubintent) -> Self { + val.subintent + } +} + impl Subintent { pub fn new( header: IntentHeaderV2, @@ -141,11 +146,8 @@ impl HasSampleValues for Subintent { #[cfg(test)] mod tests { - use std::process::Child; use super::*; - use radix_transactions::manifest::CallMethod; - use sbor::ValueKind as ScryptoValueKind; #[allow(clippy::upper_case_acronyms)] type SUT = Subintent; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/child_subintent_specifier.rs b/crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/child_subintent_specifier.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/child_subintent_specifier.rs rename to crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/child_subintent_specifier.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/child_subintent_specifiers.rs b/crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/child_subintent_specifiers.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/child_subintent_specifiers.rs rename to crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/child_subintent_specifiers.rs diff --git a/crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/execution_summary_v2/mod.rs b/crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/execution_summary_v2/mod.rs new file mode 100644 index 000000000..a182eb61c --- /dev/null +++ b/crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/execution_summary_v2/mod.rs @@ -0,0 +1 @@ +mod transaction_manifest_execution_summary_v2; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/execution_summary_v2/transaction_manifest_execution_summary_v2.rs b/crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/execution_summary_v2/transaction_manifest_execution_summary_v2.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/execution_summary_v2/transaction_manifest_execution_summary_v2.rs rename to crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/execution_summary_v2/transaction_manifest_execution_summary_v2.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/instructions_v2/instructions_v2.rs b/crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/instructions_v2/instructions_v2.rs similarity index 98% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/instructions_v2/instructions_v2.rs rename to crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/instructions_v2/instructions_v2.rs index 512bff84c..839b030ba 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/instructions_v2/instructions_v2.rs +++ b/crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/instructions_v2/instructions_v2.rs @@ -1,6 +1,8 @@ use crate::prelude::*; +#[cfg(test)] use radix_common::prelude::MANIFEST_SBOR_V1_MAX_DEPTH; +#[cfg(test)] use radix_transactions::manifest::CallMethod; #[derive(Clone, Debug, PartialEq, Eq, derive_more::Display)] @@ -100,6 +102,9 @@ impl InstructionsV2 { } } +#[cfg(test)] +use crate::low_level::sbor_depth_validation::manifest_value_with_sbor_depth; + #[cfg(test)] impl InstructionsV2 { /// Utility function which uses `InstructionsV2::new(, )` @@ -210,6 +215,8 @@ impl InstructionsV2 { mod tests { use super::*; use radix_transactions::manifest::{ + lexer::{LexerError, LexerErrorKind}, + token::{Position, Span}, DropAuthZoneProofs, DropAuthZoneRegularProofs, }; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/instructions_v2/mod.rs b/crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/instructions_v2/mod.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/instructions_v2/mod.rs rename to crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/instructions_v2/mod.rs diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/mod.rs b/crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/mod.rs similarity index 91% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/mod.rs rename to crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/mod.rs index b95141595..fa4ee0403 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/mod.rs +++ b/crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/mod.rs @@ -7,7 +7,6 @@ mod transaction_manifest_v2; pub use child_subintent_specifier::*; pub use child_subintent_specifiers::*; -pub use execution_summary_v2::*; pub use instructions_v2::*; pub use subintent_manifest::*; pub use transaction_manifest_v2::*; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/subintent_manifest.rs b/crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/subintent_manifest.rs similarity index 99% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/subintent_manifest.rs rename to crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/subintent_manifest.rs index cc143fe7d..daba8852e 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/subintent_manifest.rs +++ b/crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/subintent_manifest.rs @@ -250,9 +250,7 @@ mod tests { use radix_rust::hashmap; use radix_transactions::manifest::{ BlobProvider, CallMethod, DropAllProofs, DropAuthZoneProofs, - YieldToParent, }; - use radix_transactions::model::InstructionV1; use sbor::ValueKind as ScryptoValueKind; #[allow(clippy::upper_case_acronyms)] diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/transaction_manifest_v2.rs b/crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/transaction_manifest_v2.rs similarity index 99% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/transaction_manifest_v2.rs rename to crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/transaction_manifest_v2.rs index 08ec33355..ed201ae4b 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/transaction_manifest_v2.rs +++ b/crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/transaction_manifest_v2.rs @@ -1,6 +1,4 @@ use crate::prelude::*; -use radix_common::prelude::ManifestBucket; -use radix_transactions::manifest::KnownManifestObjectNames; impl StaticallyAnalyzableManifest for ScryptoTransactionManifestV2 { fn summary(&self, network_id: NetworkID) -> Result { @@ -206,7 +204,6 @@ mod tests { use radix_transactions::manifest::{ CallMethod, DropAllProofs, DropAuthZoneProofs, }; - use radix_transactions::model::InstructionV1; use sbor::ValueKind as ScryptoValueKind; #[allow(clippy::upper_case_acronyms)] diff --git a/crates/sargon/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/deposit_rule.rs b/crates/sargon-transaction-models/src/profile_models/deposit_rule.rs similarity index 100% rename from crates/sargon/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/deposit_rule.rs rename to crates/sargon-transaction-models/src/profile_models/deposit_rule.rs diff --git a/crates/sargon/src/profile/v100/entity/account/on_ledger_settings/mod.rs b/crates/sargon-transaction-models/src/profile_models/mod.rs similarity index 52% rename from crates/sargon/src/profile/v100/entity/account/on_ledger_settings/mod.rs rename to crates/sargon-transaction-models/src/profile_models/mod.rs index 23b78a995..badc466ce 100644 --- a/crates/sargon/src/profile/v100/entity/account/on_ledger_settings/mod.rs +++ b/crates/sargon-transaction-models/src/profile_models/mod.rs @@ -1,5 +1,5 @@ -mod on_ledger_settings; +mod deposit_rule; mod third_party_deposits; -pub use on_ledger_settings::*; +pub use deposit_rule::*; pub use third_party_deposits::*; diff --git a/crates/sargon/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/asset_exception.rs b/crates/sargon-transaction-models/src/profile_models/third_party_deposits/asset_exception.rs similarity index 79% rename from crates/sargon/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/asset_exception.rs rename to crates/sargon-transaction-models/src/profile_models/third_party_deposits/asset_exception.rs index f76b3a36b..c3f6b9730 100644 --- a/crates/sargon/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/asset_exception.rs +++ b/crates/sargon-transaction-models/src/profile_models/third_party_deposits/asset_exception.rs @@ -1,5 +1,7 @@ use crate::prelude::*; +use radix_engine_interface::blueprints::account::AccountSetResourcePreferenceInput as ScryptoAccountSetResourcePreferenceInput; + /// The specific Asset exception rule, which overrides the general /// `deposit_rule` of a `ThirdPartyDeposits` settings. #[derive( @@ -23,6 +25,34 @@ pub struct AssetException { pub exception_rule: DepositAddressExceptionRule, } +impl From for ScryptoAccountSetResourcePreferenceInput { + fn from(value: AssetException) -> Self { + Self { + resource_address: value.address.into(), + resource_preference: value.exception_rule.into(), + } + } +} + +impl From for ScryptoManifestValue { + fn from(value: AssetException) -> Self { + ScryptoManifestValue::from(value.address) + } +} + +impl From for ScryptoResourcePreference { + fn from(value: DepositAddressExceptionRule) -> Self { + match value { + DepositAddressExceptionRule::Allow => { + ScryptoResourcePreference::Allowed + } + DepositAddressExceptionRule::Deny => { + ScryptoResourcePreference::Disallowed + } + } + } +} + impl HasSampleValues for AssetException { fn sample() -> Self { Self::new( diff --git a/crates/sargon/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/assets_exception_list.rs b/crates/sargon-transaction-models/src/profile_models/third_party_deposits/assets_exception_list.rs similarity index 100% rename from crates/sargon/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/assets_exception_list.rs rename to crates/sargon-transaction-models/src/profile_models/third_party_deposits/assets_exception_list.rs diff --git a/crates/sargon/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/deposit_address_exception_rule.rs b/crates/sargon-transaction-models/src/profile_models/third_party_deposits/deposit_address_exception_rule.rs similarity index 100% rename from crates/sargon/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/deposit_address_exception_rule.rs rename to crates/sargon-transaction-models/src/profile_models/third_party_deposits/deposit_address_exception_rule.rs diff --git a/crates/sargon/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/depositors_allow_list.rs b/crates/sargon-transaction-models/src/profile_models/third_party_deposits/depositors_allow_list.rs similarity index 100% rename from crates/sargon/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/depositors_allow_list.rs rename to crates/sargon-transaction-models/src/profile_models/third_party_deposits/depositors_allow_list.rs diff --git a/crates/sargon/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/mod.rs b/crates/sargon-transaction-models/src/profile_models/third_party_deposits/mod.rs similarity index 87% rename from crates/sargon/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/mod.rs rename to crates/sargon-transaction-models/src/profile_models/third_party_deposits/mod.rs index 47e6ce3bc..bc4608b65 100644 --- a/crates/sargon/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/mod.rs +++ b/crates/sargon-transaction-models/src/profile_models/third_party_deposits/mod.rs @@ -1,13 +1,11 @@ mod asset_exception; mod assets_exception_list; mod deposit_address_exception_rule; -mod deposit_rule; mod depositors_allow_list; mod third_party_deposits; pub use asset_exception::*; pub use assets_exception_list::*; pub use deposit_address_exception_rule::*; -pub use deposit_rule::*; pub use depositors_allow_list::*; pub use third_party_deposits::*; diff --git a/crates/sargon/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/third_party_deposits.rs b/crates/sargon-transaction-models/src/profile_models/third_party_deposits/third_party_deposits.rs similarity index 100% rename from crates/sargon/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/third_party_deposits.rs rename to crates/sargon-transaction-models/src/profile_models/third_party_deposits/third_party_deposits.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/unvalidated_transaction_manifest.rs b/crates/sargon-transaction-models/src/unvalidated_transaction_manifest.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/unvalidated_transaction_manifest.rs rename to crates/sargon-transaction-models/src/unvalidated_transaction_manifest.rs diff --git a/crates/sargon-uniffi/Cargo.toml b/crates/sargon-uniffi/Cargo.toml index 3d85ca5ad..44b061d18 100644 --- a/crates/sargon-uniffi/Cargo.toml +++ b/crates/sargon-uniffi/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sargon-uniffi" # Don't forget to update version in crates/sargon/Cargo.toml -version = "1.2.1" +version = "1.1.99" edition = "2021" build = "build.rs" @@ -14,91 +14,66 @@ crate-type = ["staticlib", "cdylib", "lib"] [[bin]] name = "sargon-bindgen" path = "src/bindgen/bin.rs" -required-features = ["build-binary"] +# required-features = ["build-binary"] [dependencies] +# === SARGON CRATES === sargon-core = { path = "../sargon-core" } +identified-vec-of = { path = "../identified-vec-of" } +sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } +sargon-factors = { path = "../sargon-factors" } +sargon-keys-collector = { path = "../sargon-keys-collector" } +sargon-addresses = { path = "../sargon-addresses" } +sargon-transaction-models = { path = "../sargon-transaction-models" } +sargon-manifests = { path = "../sargon-manifests" } +sargon-profile = { path = "../sargon-profile" } +sargon-profile-logic = { path = "../sargon-profile-logic" } +sargon-profile-security-structures = { path = "../sargon-profile-security-structures" } +sargon-factor-instances-provider = { path = "../sargon-factor-instances-provider" } +gateway-models = { path = "../gateway-models" } +sargon-clients = { path = "../sargon-clients" } +sargon-drivers = { path = "../sargon-drivers" } +gateway-client-and-api = { path = "../gateway-client-and-api" } + sargon = { path = "../sargon" } sargon-uniffi-conversion-macros = { path = "../sargon-uniffi-conversion-macros" } +# === RADIX DEPENDENCIES === radix-engine-toolkit = { workspace = true } -zeroize = { workspace = true } - - -log = { workspace = true } - -# pretty_env_logger = "0.5.0" -pretty_env_logger = { git = "https://github.com/seanmonstar/pretty-env-logger/", rev = "0e238400e18649415dc710c025e99c009a1bb744" } - +# === EXTERNAL DEPENDENCIES === +assert-json-diff = { workspace = true } +async-trait = { workspace = true } +base64 = { workspace = true } +camino = { workspace = true } +clap = { workspace = true } +delegate = { workspace = true } derive_more = { workspace = true } - -thiserror = { workspace = true } - -iso8601-timestamp = { workspace = true } - - -uuid = { workspace = true } - -strum = { workspace = true } +enum-as-inner = { workspace = true } enum-iterator = { workspace = true } - -rand = { workspace = true } hex = { workspace = true } - -delegate = { workspace = true } - +iso8601-timestamp = { workspace = true } itertools = { workspace = true } - -enum-as-inner = { workspace = true } - -# uniffi = "0.28.3" -uniffi = { git = "https://github.com/mozilla/uniffi-rs/", rev = "9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d", features = [ - "cli", -] } -assert-json-diff = { workspace = true } - -url = { workspace = true } - +log = { workspace = true } paste = { workspace = true } - -# regex = "1.9.3" -regex = { git = "https://github.com/rust-lang/regex/", rev = "72f889ef3cca59ebac6a026f3646e8d92f056d88", optional = true } - -# clap = "4.5.1" -clap = { git = "https://github.com/clap-rs/clap/", rev = "8a7a13a5618cfdc4ff328624a5266e7b4d88649a", default-features = false, features = [ - "std", - "derive", -], optional = true } - -# camino = "1.0.8" -camino = { git = "https://github.com/camino-rs/camino/", rev = "afa51b1b4c684b7e6698a6717ccda3affd0abd42", optional = true } - -async-trait = { workspace = true } - +preinterpret = { workspace = true } pretty_assertions = { workspace = true } - -base64 = { git = "https://github.com/marshallpierce/rust-base64.git", rev = "e14400697453bcc85997119b874bc03d9601d0af" } - -# preinterpret = "0.2.0" -preinterpret = { git = "https://github.com/dhedey/preinterpret", rev = "6754b92bdead0ddd6f69fbee7d782180d6351605" } - +pretty_env_logger = { workspace = true } +rand = { workspace = true } +regex = { workspace = true } +strum = { workspace = true } +thiserror = { workspace = true } +uniffi = { workspace = true } +url = { workspace = true } +uuid = { workspace = true } +zeroize = { workspace = true } [dev-dependencies] -# uniffi = "0.28.3" -uniffi = { git = "https://github.com/mozilla/uniffi-rs/", rev = "9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d", features = [ - "bindgen-tests", -] } - actix-rt = { workspace = true } -[build-dependencies] -# uniffi = "0.28.3" -uniffi = { git = "https://github.com/mozilla/uniffi-rs/", rev = "9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d", features = [ - "build", -] } +uniffi = { workspace = true, features = ["bindgen-tests"] } -[features] -build-binary = ["camino", "clap", "regex"] +[build-dependencies] +uniffi = { workspace = true, features = ["build"] } [lints.rust] unexpected_cfgs = { level = "forbid", check-cfg = ['cfg(tarpaulin_include)'] } diff --git a/crates/sargon-uniffi/src/core/result/result.rs b/crates/sargon-uniffi/src/core/result/result.rs index bd16907de..2b582de32 100644 --- a/crates/sargon-uniffi/src/core/result/result.rs +++ b/crates/sargon-uniffi/src/core/result/result.rs @@ -1,5 +1,4 @@ use crate::prelude::*; -use sargon::IdentifiedVecOf; use sargon::Result as InternalResult; pub type Result = std::result::Result; diff --git a/crates/sargon-uniffi/src/core/types/bag_of_bytes.rs b/crates/sargon-uniffi/src/core/types/bag_of_bytes.rs index 40923ae5a..d12080fe9 100644 --- a/crates/sargon-uniffi/src/core/types/bag_of_bytes.rs +++ b/crates/sargon-uniffi/src/core/types/bag_of_bytes.rs @@ -1,5 +1,3 @@ -use std::ops::{Deref, DerefMut, Neg}; - use crate::prelude::*; use sargon::BagOfBytes as InternalBagOfBytes; diff --git a/crates/sargon-uniffi/src/core/types/exactly_n_bytes.rs b/crates/sargon-uniffi/src/core/types/exactly_n_bytes.rs index 1bc1f5a75..c33a1ac52 100644 --- a/crates/sargon-uniffi/src/core/types/exactly_n_bytes.rs +++ b/crates/sargon-uniffi/src/core/types/exactly_n_bytes.rs @@ -1,5 +1,4 @@ use crate::prelude::*; -use sargon::BagOfBytes as InternalBagOfBytes; /// Small macro to facilitate generation of UniFFI exported functions. macro_rules! decl_exactly_n_bytes { diff --git a/crates/sargon-uniffi/src/core/types/keys/public_key.rs b/crates/sargon-uniffi/src/core/types/keys/public_key.rs index f46739763..7d3e97123 100644 --- a/crates/sargon-uniffi/src/core/types/keys/public_key.rs +++ b/crates/sargon-uniffi/src/core/types/keys/public_key.rs @@ -1,5 +1,4 @@ use crate::prelude::*; -use sargon::BagOfBytes as InternalBagOfBytes; use sargon::PublicKey as InternalPublicKey; /// A tagged union of supported public keys on different curves, supported diff --git a/crates/sargon-uniffi/src/core/types/mod.rs b/crates/sargon-uniffi/src/core/types/mod.rs index 7cedb2fdb..93843b155 100644 --- a/crates/sargon-uniffi/src/core/types/mod.rs +++ b/crates/sargon-uniffi/src/core/types/mod.rs @@ -34,6 +34,6 @@ pub use nonce::*; pub use requested_number_quantifier::*; pub use requested_quantity::*; pub use rounding_mode::*; -pub use secret_bytes::*; +pub(crate) use secret_bytes::*; pub use signatures::*; -pub use version_type::*; +pub(crate) use version_type::*; diff --git a/crates/sargon-uniffi/src/core/types/version_type.rs b/crates/sargon-uniffi/src/core/types/version_type.rs index ddf1bfeca..c1c970666 100644 --- a/crates/sargon-uniffi/src/core/types/version_type.rs +++ b/crates/sargon-uniffi/src/core/types/version_type.rs @@ -1,5 +1,4 @@ use crate::prelude::*; -use paste::paste; /// A macro that generates a XYZVersion type, which is a typed version of `u64`. macro_rules! decl_version_type { diff --git a/crates/sargon-uniffi/src/core/utils/constants.rs b/crates/sargon-uniffi/src/core/utils/constants.rs index 1d85c862e..7e9177d8d 100644 --- a/crates/sargon-uniffi/src/core/utils/constants.rs +++ b/crates/sargon-uniffi/src/core/utils/constants.rs @@ -1,5 +1,3 @@ -use crate::prelude::*; - #[uniffi::export] pub fn constant_entity_name_max_length() -> u64 { sargon::DisplayName::MAX_LEN as u64 diff --git a/crates/sargon-uniffi/src/core/utils/mod.rs b/crates/sargon-uniffi/src/core/utils/mod.rs index d1faedfe7..1ad740560 100644 --- a/crates/sargon-uniffi/src/core/utils/mod.rs +++ b/crates/sargon-uniffi/src/core/utils/mod.rs @@ -4,7 +4,7 @@ mod conversion_tests_macro; mod delegate_debug_display_impl; mod image_url_utils_uniffi_fn; -pub use builder_arc_map::*; -pub use conversion_tests_macro::*; -pub use delegate_debug_display_impl::*; +pub(crate) use builder_arc_map::*; +pub(crate) use conversion_tests_macro::*; +pub(crate) use delegate_debug_display_impl::*; pub use image_url_utils_uniffi_fn::*; diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/hd_path_component.rs b/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/hd_path_component.rs index a45a82c02..f83482306 100644 --- a/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/hd_path_component.rs +++ b/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/hd_path_component.rs @@ -4,10 +4,7 @@ use sargon::{ IsKeySpaceAware, }; -use sargon::{ - FromGlobalKeySpace, FromLocalKeySpace, IsInLocalKeySpace, - IsMappableToGlobalKeySpace, ToBIP32Str, -}; +use sargon::{FromGlobalKeySpace, IsMappableToGlobalKeySpace, ToBIP32Str}; #[derive(Clone, Debug, PartialEq, Eq, Hash, uniffi::Enum)] pub enum HDPathComponent { diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/securified.rs b/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/securified.rs index 0ef268a4e..c930ef6cd 100644 --- a/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/securified.rs +++ b/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/securified.rs @@ -2,8 +2,7 @@ use crate::prelude::*; use sargon::{HasIndexInLocalKeySpace, SecurifiedU30 as InternalSecurifiedU30}; use sargon::{ - FromGlobalKeySpace, FromLocalKeySpace, IsInLocalKeySpace, - IsMappableToGlobalKeySpace, ToBIP32Str, + FromGlobalKeySpace, FromLocalKeySpace, IsMappableToGlobalKeySpace, }; #[derive(Clone, Debug, PartialEq, Eq, Hash, uniffi::Record)] diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/unhardened.rs b/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/unhardened.rs index 631723583..7dc8bba3a 100644 --- a/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/unhardened.rs +++ b/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/unhardened.rs @@ -3,7 +3,7 @@ use sargon::Unhardened as InternalUnhardened; use sargon::{ FromGlobalKeySpace, FromLocalKeySpace, HasIndexInLocalKeySpace, - IsMappableToGlobalKeySpace, ToBIP32Str, + IsMappableToGlobalKeySpace, }; #[derive(Clone, Debug, PartialEq, Eq, Hash, uniffi::Record)] diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/unsecurified.rs b/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/unsecurified.rs index daa51818b..bfef05e65 100644 --- a/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/unsecurified.rs +++ b/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/unsecurified.rs @@ -1,11 +1,6 @@ use crate::prelude::*; use sargon::Unsecurified as InternalUnsecurified; -use sargon::{ - FromGlobalKeySpace, FromLocalKeySpace, IsInLocalKeySpace, - IsMappableToGlobalKeySpace, ToBIP32Str, -}; - #[derive(Clone, Debug, PartialEq, Eq, Hash, uniffi::Enum)] pub enum Unsecurified { UnhardenedComponent(Unhardened), diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/unsecurified_hardened.rs b/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/unsecurified_hardened.rs index 1faa59e0c..a8573d64f 100644 --- a/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/unsecurified_hardened.rs +++ b/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/unsecurified_hardened.rs @@ -3,7 +3,7 @@ use sargon::UnsecurifiedHardened as InternalUnsecurifiedHardened; use sargon::{ FromGlobalKeySpace, FromLocalKeySpace, HasIndexInLocalKeySpace, - IsMappableToGlobalKeySpace, ToBIP32Str, + IsMappableToGlobalKeySpace, }; #[derive(Clone, Debug, PartialEq, Eq, Hash, uniffi::Record)] diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/bip39/bip39_word/bip39_word.rs b/crates/sargon-uniffi/src/hierarchical_deterministic/bip39/bip39_word/bip39_word.rs index 06f6a01d0..ddfa5c8f6 100644 --- a/crates/sargon-uniffi/src/hierarchical_deterministic/bip39/bip39_word/bip39_word.rs +++ b/crates/sargon-uniffi/src/hierarchical_deterministic/bip39/bip39_word/bip39_word.rs @@ -1,6 +1,5 @@ use crate::prelude::*; use sargon::BIP39Word as InternalBIP39Word; -use sargon::U11 as InternalU11; /// A word in the BIP39 word list of `language` at known `index` (0-2047). #[derive(Clone, PartialEq, Eq, Hash, InternalConversion, uniffi::Record)] diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/derivation/derivation_path.rs b/crates/sargon-uniffi/src/hierarchical_deterministic/derivation/derivation_path.rs index 8883b1412..1b84092b9 100644 --- a/crates/sargon-uniffi/src/hierarchical_deterministic/derivation/derivation_path.rs +++ b/crates/sargon-uniffi/src/hierarchical_deterministic/derivation/derivation_path.rs @@ -1,5 +1,4 @@ use crate::prelude::*; -use sargon::Derivation; use sargon::DerivationPath as InternalDerivationPath; /// A derivation path on either supported schemes, either Babylon (CAP26) or Olympia (BIP44Like). diff --git a/crates/sargon-uniffi/src/lib.rs b/crates/sargon-uniffi/src/lib.rs index 9d8cbc3c5..0bcfecbe1 100644 --- a/crates/sargon-uniffi/src/lib.rs +++ b/crates/sargon-uniffi/src/lib.rs @@ -48,34 +48,24 @@ pub mod prelude { }; pub(crate) use sargon_uniffi_conversion_macros::*; - + // pub(crate) use sargon_manifests::prelude::*; pub(crate) use sargon::prelude::{ - DeserializeBytes, DeserializeStr, HasSampleValues, HashMap, HashSet, + DeserializeBytes, DeserializeStr, HasSampleValues, HashMap, SerializeToBytes, SerializeToString, }; - pub(crate) use ::hex::decode as hex_decode; - pub(crate) use ::hex::encode as hex_encode; pub(crate) use iso8601_timestamp::Timestamp; pub(crate) use itertools::Itertools; - pub(crate) use log::{debug, error, info, trace, warn}; + pub(crate) use log::error; - pub(crate) use std::cmp::Ordering; - pub(crate) use std::collections::BTreeMap; - pub(crate) use std::fmt::{Debug, Display, Formatter}; - pub(crate) use std::fs; - pub(crate) use std::hash::Hash as StdHash; + pub(crate) use std::fmt::Debug; pub use std::ops::{Add, AddAssign, Deref, Div, Mul, Neg, Sub}; pub(crate) use std::str::FromStr; - pub(crate) use std::sync::{Arc, RwLock}; + pub(crate) use std::sync::Arc; - pub(crate) use strum::FromRepr; - pub(crate) use strum::IntoEnumIterator; pub(crate) use url::Url; pub(crate) use uuid::Uuid; - pub(crate) use enum_as_inner::EnumAsInner; - pub(crate) use enum_iterator::all; pub(crate) use paste::*; } @@ -97,7 +87,7 @@ uniffi::custom_type!(Timestamp, String, { remote, try_lift: |val| { Timestamp::parse(val.as_str()) - .ok_or(CommonError::InvalidISO8601String { bad_value: val }) + .ok_or(crate::CommonError::InvalidISO8601String { bad_value: val }) .map_err(|e| e.into()) }, lower: |obj| obj.to_string(), diff --git a/crates/sargon-uniffi/src/profile/mfa/security_structures/roles/decl_role_macro.rs b/crates/sargon-uniffi/src/profile/mfa/security_structures/roles/decl_role_macro.rs index f27547b08..34426b0df 100644 --- a/crates/sargon-uniffi/src/profile/mfa/security_structures/roles/decl_role_macro.rs +++ b/crates/sargon-uniffi/src/profile/mfa/security_structures/roles/decl_role_macro.rs @@ -1,5 +1,3 @@ -use crate::prelude::*; - // This macro generates "Role" types, for each RoleKind: Primary, Recovery, Confirmation // for the specified "Factor Level", so input is `FactorSource` or `FactorInstance` // or `FactorSourceID` etc. @@ -190,5 +188,3 @@ macro_rules! role_conversion_inner { } }; } - -pub(crate) use role_conversion_inner; diff --git a/crates/sargon-uniffi/src/profile/mfa/security_structures/security_shield_builder.rs b/crates/sargon-uniffi/src/profile/mfa/security_structures/security_shield_builder.rs index 290e0f8d3..5f6856688 100644 --- a/crates/sargon-uniffi/src/profile/mfa/security_structures/security_shield_builder.rs +++ b/crates/sargon-uniffi/src/profile/mfa/security_structures/security_shield_builder.rs @@ -2,17 +2,10 @@ #![allow(dead_code)] #![allow(unused_variables)] -use std::{ - borrow::Borrow, - future::Future, - sync::{Arc, RwLock}, -}; - -use sargon::{ - FactorSourceWithExtraSampleValues, - SecurityShieldBuilder as InternalSecurityShieldBuilder, - SelectedFactorSourcesForRoleStatus as InternalSelectedFactorSourcesForRoleStatus, -}; +use std::{borrow::Borrow, sync::Arc}; + +#[cfg(test)] +use sargon::FactorSourceWithExtraSampleValues; use crate::prelude::*; @@ -430,8 +423,6 @@ impl SecurityShieldBuilder { } } -use sargon::FactorSource as InternalFactorSource; - #[uniffi::export] impl SecurityShieldBuilder { pub fn auto_assign_factors_to_recovery_and_confirmation_based_on_primary( diff --git a/crates/sargon-uniffi/src/profile/mfa/security_structures/security_structures/security_structure_of_factor_sources.rs b/crates/sargon-uniffi/src/profile/mfa/security_structures/security_structures/security_structure_of_factor_sources.rs index 0ebd22f7d..d27949b2b 100644 --- a/crates/sargon-uniffi/src/profile/mfa/security_structures/security_structures/security_structure_of_factor_sources.rs +++ b/crates/sargon-uniffi/src/profile/mfa/security_structures/security_structures/security_structure_of_factor_sources.rs @@ -1,6 +1,5 @@ use crate::prelude::*; -use sargon::MatrixOfFactorSources as InternalMatrixOfFactorSources; use sargon::SecurityStructureOfFactorSources as InternalSecurityStructureOfFactorSources; #[derive(Clone, PartialEq, Eq, Hash, InternalConversion, uniffi::Record)] diff --git a/crates/sargon-uniffi/src/profile/supporting_types/decl_vec_samples_for.rs b/crates/sargon-uniffi/src/profile/supporting_types/decl_vec_samples_for.rs index af2b31f59..acff44f43 100644 --- a/crates/sargon-uniffi/src/profile/supporting_types/decl_vec_samples_for.rs +++ b/crates/sargon-uniffi/src/profile/supporting_types/decl_vec_samples_for.rs @@ -11,7 +11,6 @@ macro_rules! decl_vec_samples_for { paste! { use sargon::$collection_type as [< Internal $collection_type >]; - use sargon::Result as InternalResult; impl IntoInternal, [< Internal $collection_type >]> diff --git a/crates/sargon-uniffi/src/profile/supporting_types/mod.rs b/crates/sargon-uniffi/src/profile/supporting_types/mod.rs index 5944f019a..626bfd562 100644 --- a/crates/sargon-uniffi/src/profile/supporting_types/mod.rs +++ b/crates/sargon-uniffi/src/profile/supporting_types/mod.rs @@ -12,7 +12,7 @@ pub use account_for_display::*; pub use account_or_persona::*; pub use authorized_dapp_detailed::*; pub use authorized_persona_detailed::*; -pub use decl_vec_samples_for::*; +pub(crate) use decl_vec_samples_for::*; pub use email_address::*; pub use host_id::*; pub use host_info::*; diff --git a/crates/sargon-uniffi/src/profile/v100/address/mod.rs b/crates/sargon-uniffi/src/profile/v100/address/mod.rs index d1e251a7b..56b1dc919 100644 --- a/crates/sargon-uniffi/src/profile/v100/address/mod.rs +++ b/crates/sargon-uniffi/src/profile/v100/address/mod.rs @@ -34,4 +34,4 @@ pub use pool_address::*; pub use resource_address::*; pub use validator_address::*; pub use vault_address::*; -pub use wrap_ret_address::*; +pub(crate) use wrap_ret_address::*; diff --git a/crates/sargon-uniffi/src/profile/v100/app_preferences/gateways/saved_gateways.rs b/crates/sargon-uniffi/src/profile/v100/app_preferences/gateways/saved_gateways.rs index ad0c1e1bf..708682288 100644 --- a/crates/sargon-uniffi/src/profile/v100/app_preferences/gateways/saved_gateways.rs +++ b/crates/sargon-uniffi/src/profile/v100/app_preferences/gateways/saved_gateways.rs @@ -1,5 +1,6 @@ use crate::prelude::*; use sargon::SavedGateways as InternalSavedGateways; +use sargon_profile_logic::prelude::SavedGatewaysChangeCurrent as _; decl_vec_samples_for!(Gateways, Gateway); diff --git a/crates/sargon-uniffi/src/profile/v100/entity/persona/persona_data/mod.rs b/crates/sargon-uniffi/src/profile/v100/entity/persona/persona_data/mod.rs index b53f57212..129056592 100644 --- a/crates/sargon-uniffi/src/profile/v100/entity/persona/persona_data/mod.rs +++ b/crates/sargon-uniffi/src/profile/v100/entity/persona/persona_data/mod.rs @@ -11,5 +11,5 @@ pub use collection_of_phone_numbers::*; pub use entry_kinds::*; pub use persona_data::*; pub use persona_data_entry_id::*; -pub use persona_data_identified_collection_types::*; +pub(crate) use persona_data_identified_collection_types::*; pub use persona_data_identified_entry_types::*; diff --git a/crates/sargon-uniffi/src/profile/v100/factors/factor_source.rs b/crates/sargon-uniffi/src/profile/v100/factors/factor_source.rs index 2f7e3a222..856222204 100644 --- a/crates/sargon-uniffi/src/profile/v100/factors/factor_source.rs +++ b/crates/sargon-uniffi/src/profile/v100/factors/factor_source.rs @@ -1,6 +1,5 @@ use crate::prelude::*; use sargon::BaseBaseIsFactorSource; -use sargon::BaseIsFactorSource; use sargon::FactorSource as InternalFactorSource; decl_vec_samples_for!(FactorSources, FactorSource); diff --git a/crates/sargon-uniffi/src/profile/v100/factors/factor_sources/private_hierarchical_deterministic_factor_source.rs b/crates/sargon-uniffi/src/profile/v100/factors/factor_sources/private_hierarchical_deterministic_factor_source.rs index 7c7611a98..11a408f36 100644 --- a/crates/sargon-uniffi/src/profile/v100/factors/factor_sources/private_hierarchical_deterministic_factor_source.rs +++ b/crates/sargon-uniffi/src/profile/v100/factors/factor_sources/private_hierarchical_deterministic_factor_source.rs @@ -1,5 +1,4 @@ use crate::prelude::*; -use sargon::BIP39Entropy as InternalBIP39Entropy; use sargon::PrivateHierarchicalDeterministicFactorSource as InternalPrivateHierarchicalDeterministicFactorSource; #[derive(Clone, PartialEq, Eq, Hash, InternalConversion, uniffi::Record)] diff --git a/crates/sargon-uniffi/src/profile/v100/mod.rs b/crates/sargon-uniffi/src/profile/v100/mod.rs index 3c62257e1..227617c58 100644 --- a/crates/sargon-uniffi/src/profile/v100/mod.rs +++ b/crates/sargon-uniffi/src/profile/v100/mod.rs @@ -17,7 +17,7 @@ pub use entity::*; pub use entity_security_state::*; pub use factors::*; pub use header::*; -pub use json_data_convertible::*; +pub(crate) use json_data_convertible::*; pub use networks::*; pub use profile::*; pub use profile_file_contents::*; diff --git a/crates/sargon-uniffi/src/profile/v100/networks/network/authorized_dapp/mod.rs b/crates/sargon-uniffi/src/profile/v100/networks/network/authorized_dapp/mod.rs index 3f7f081e2..aef157b03 100644 --- a/crates/sargon-uniffi/src/profile/v100/networks/network/authorized_dapp/mod.rs +++ b/crates/sargon-uniffi/src/profile/v100/networks/network/authorized_dapp/mod.rs @@ -12,4 +12,4 @@ pub use preferences::*; pub use shared_persona_data::*; pub use shared_to_dapp_with_persona_account_addresses::*; pub use shared_to_dapp_with_persona_ids_of_persona_data_entries::*; -pub use shared_with_dapp::*; +pub(crate) use shared_with_dapp::*; diff --git a/crates/sargon-uniffi/src/profile/v100/networks/network/profile_network.rs b/crates/sargon-uniffi/src/profile/v100/networks/network/profile_network.rs index 19b7f541d..26874b88c 100644 --- a/crates/sargon-uniffi/src/profile/v100/networks/network/profile_network.rs +++ b/crates/sargon-uniffi/src/profile/v100/networks/network/profile_network.rs @@ -1,5 +1,6 @@ use crate::prelude::*; use sargon::ProfileNetwork as InternalProfileNetwork; +use sargon_profile_logic::prelude::ProfileNetworkDetailsForAuthorizedDapp as _; decl_vec_samples_for!(ProfileNetworks, ProfileNetwork); diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_unvalidated.rs b/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_unvalidated.rs index f72479574..47311aadd 100644 --- a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_unvalidated.rs +++ b/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_unvalidated.rs @@ -41,7 +41,6 @@ pub(crate) fn new_dapp_to_wallet_interaction_unvalidated_sample_other( #[cfg(test)] mod test { - use super::*; #[test] fn test_dapp_to_wallet_interaction_unvalidated() { diff --git a/crates/sargon-uniffi/src/security_center/support/backup_result.rs b/crates/sargon-uniffi/src/security_center/support/backup_result.rs index a90d93685..dc67599c0 100644 --- a/crates/sargon-uniffi/src/security_center/support/backup_result.rs +++ b/crates/sargon-uniffi/src/security_center/support/backup_result.rs @@ -1,4 +1,3 @@ -use crate::prelude::*; use sargon::BackupResult as InternalBackupResult; use sargon::IsBackupResultCurrent; use sargon::IsBackupResultFailed; diff --git a/crates/sargon-uniffi/src/security_center/support/input.rs b/crates/sargon-uniffi/src/security_center/support/input.rs index 414a78ef2..70ad51e2a 100644 --- a/crates/sargon-uniffi/src/security_center/support/input.rs +++ b/crates/sargon-uniffi/src/security_center/support/input.rs @@ -1,6 +1,5 @@ use crate::prelude::*; use sargon::CheckSecurityProblemsInput as InternalCheckSecurityProblemsInput; -use sargon::IsCloudProfileSyncEnabled; #[derive(Clone, PartialEq, Eq, uniffi::Record, InternalConversion)] pub struct CheckSecurityProblemsInput { diff --git a/crates/sargon-uniffi/src/signing/sign_request.rs b/crates/sargon-uniffi/src/signing/sign_request.rs index 9f337733f..ea42e7d64 100644 --- a/crates/sargon-uniffi/src/signing/sign_request.rs +++ b/crates/sargon-uniffi/src/signing/sign_request.rs @@ -83,7 +83,6 @@ macro_rules! decl_sign_request { (signable: $signable:ty, signable_id: $signable_id:ty) => { paste! { use sargon::[< $signable >] as [< Internal $signable >]; - use sargon::[< $signable_id >] as [< Internal $signable_id >]; type [< InternalSignRequestOf $signable >] = sargon::SignRequest<[< Internal $signable >]>; diff --git a/crates/sargon-uniffi/src/signing/sign_response.rs b/crates/sargon-uniffi/src/signing/sign_response.rs index 5e186c224..904d72088 100644 --- a/crates/sargon-uniffi/src/signing/sign_response.rs +++ b/crates/sargon-uniffi/src/signing/sign_response.rs @@ -1,6 +1,5 @@ use crate::prelude::*; use paste::paste; -use sargon::IndexMap; macro_rules! decl_sign_response { ( diff --git a/crates/sargon-uniffi/src/signing/signatures_per_fractor_source.rs b/crates/sargon-uniffi/src/signing/signatures_per_fractor_source.rs index 9241ba332..ae757eb46 100644 --- a/crates/sargon-uniffi/src/signing/signatures_per_fractor_source.rs +++ b/crates/sargon-uniffi/src/signing/signatures_per_fractor_source.rs @@ -27,7 +27,6 @@ macro_rules! decl_signatures_per_factor_source { }; ($signable_id:ty) => { paste! { - use sargon::[< $signable_id >] as [< Internal $signable_id >]; decl_signatures_per_factor_source!( struct_name: [< SignaturesPerFactorSourceOf $signable_id >], diff --git a/crates/sargon-uniffi/src/signing/transaction_sign_request_input.rs b/crates/sargon-uniffi/src/signing/transaction_sign_request_input.rs index 9f717b9aa..bf47e0c76 100644 --- a/crates/sargon-uniffi/src/signing/transaction_sign_request_input.rs +++ b/crates/sargon-uniffi/src/signing/transaction_sign_request_input.rs @@ -27,7 +27,6 @@ macro_rules! decl_transaction_sign_request_input { (signable: $signable:ty, payload: $payload:ty) => { paste! { use sargon::[< $signable >] as [< Internal $signable >]; - use sargon::[< $payload >] as [< Internal $payload >]; type [< InternalTransactionSignRequestInputOf $signable >] = sargon::TransactionSignRequestInput<[< Internal $signable >]>; diff --git a/crates/sargon-uniffi/src/signing/transactions_to_sign_per_factor_source.rs b/crates/sargon-uniffi/src/signing/transactions_to_sign_per_factor_source.rs index 75ea6d535..25a036653 100644 --- a/crates/sargon-uniffi/src/signing/transactions_to_sign_per_factor_source.rs +++ b/crates/sargon-uniffi/src/signing/transactions_to_sign_per_factor_source.rs @@ -46,8 +46,6 @@ macro_rules! decl_transaction_to_sign_per_factor_source { }; (signable: $signable:ty, signable_id: $signable_id:ty) => { paste! { - use sargon::[< $signable >] as [< Internal $signable >]; - use sargon::[< $signable_id >] as [< Internal $signable_id >]; decl_transaction_to_sign_per_factor_source!( struct_name: [< TransactionToSignPerFactorSourceOf $signable >], diff --git a/crates/sargon-uniffi/src/system/drivers/unsafe_storage_driver/support/mod.rs b/crates/sargon-uniffi/src/system/drivers/unsafe_storage_driver/support/mod.rs index 25fb683bc..a499204a5 100644 --- a/crates/sargon-uniffi/src/system/drivers/unsafe_storage_driver/support/mod.rs +++ b/crates/sargon-uniffi/src/system/drivers/unsafe_storage_driver/support/mod.rs @@ -1,5 +1,4 @@ mod test; mod unsafe_storage_key; -pub use test::*; pub use unsafe_storage_key::*; diff --git a/crates/sargon-uniffi/src/system/sargon_os/sargon_os.rs b/crates/sargon-uniffi/src/system/sargon_os/sargon_os.rs index 4a15696e0..308e39e2c 100644 --- a/crates/sargon-uniffi/src/system/sargon_os/sargon_os.rs +++ b/crates/sargon-uniffi/src/system/sargon_os/sargon_os.rs @@ -1,9 +1,6 @@ -use std::sync::Once; - use crate::prelude::*; +use sargon::Interactors; use sargon::SargonOS as InternalSargonOS; -use sargon::UseFactorSourcesInteractor as InternalHostInteractor; -use sargon::{Bios as InternalBios, Interactors}; /// The Sargon "Operating System" is the root "manager" of the Sargon library /// which holds an in-memory Profile and a collection of "clients" which are diff --git a/crates/sargon-uniffi/src/system/sargon_os/sargon_os_profile.rs b/crates/sargon-uniffi/src/system/sargon_os/sargon_os_profile.rs index 4312a3dd7..3dc9dec9b 100644 --- a/crates/sargon-uniffi/src/system/sargon_os/sargon_os_profile.rs +++ b/crates/sargon-uniffi/src/system/sargon_os/sargon_os_profile.rs @@ -1,7 +1,5 @@ #![allow(deprecated)] -use std::sync::RwLockWriteGuard; - use crate::prelude::*; #[uniffi::export] diff --git a/crates/sargon-uniffi/src/system/sargon_os/sargon_os_signing.rs b/crates/sargon-uniffi/src/system/sargon_os/sargon_os_signing.rs index 80e52697a..644315f7c 100644 --- a/crates/sargon-uniffi/src/system/sargon_os/sargon_os_signing.rs +++ b/crates/sargon-uniffi/src/system/sargon_os/sargon_os_signing.rs @@ -1,7 +1,5 @@ use crate::prelude::*; use sargon::AuthIntent as InternalAuthIntent; -use sargon::Subintent as InternalSubintent; -use sargon::TransactionIntent as InternalTransactionIntent; #[uniffi::export] impl SargonOS { diff --git a/crates/sargon-uniffi/src/system/sargon_os/transactions/sargon_os_transaction_analysis.rs b/crates/sargon-uniffi/src/system/sargon_os/transactions/sargon_os_transaction_analysis.rs index 306dd3b9a..466c25bea 100644 --- a/crates/sargon-uniffi/src/system/sargon_os/transactions/sargon_os_transaction_analysis.rs +++ b/crates/sargon-uniffi/src/system/sargon_os/transactions/sargon_os_transaction_analysis.rs @@ -1,5 +1,4 @@ use crate::prelude::*; -use std::sync::RwLockWriteGuard; #[uniffi::export] impl SargonOS { diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/ret_api.rs b/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/ret_api.rs index 8ae636a0d..4785d1123 100644 --- a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/ret_api.rs +++ b/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/ret_api.rs @@ -3,6 +3,18 @@ use sargon::ResourceAddress as InternalResourceAddress; use sargon::SargonBuildInformation as InternalSargonBuildInformation; use sargon::TransactionManifest as InternalTransactionManifest; +use sargon::{ + // sargon_manifests crate + ManifestForAccountLockerClaim as _, + TransactionManifestAssetTransfers as _, + TransactionManifestFaucet as _, + TransactionManifestMetadataSetting as _, + TransactionManifestModifying as _, + TransactionManifestStakeClaim as _, + TransactionManifestThirdPartyDepositUpdating as _, + TransactionManifestTokenCreating as _, +}; + #[uniffi::export] pub fn manifest_for_faucet( include_lock_fee_instruction: bool, diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/account_or_address_of.rs b/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/account_or_address_of.rs deleted file mode 100644 index 56dc18f6c..000000000 --- a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/account_or_address_of.rs +++ /dev/null @@ -1,26 +0,0 @@ -use crate::prelude::*; -use sargon::AccountOrAddressOf as InternalAccountOrAddressOf; - -#[derive(Clone, PartialEq, Eq, Hash, InternalConversion, uniffi::Enum)] -#[allow(clippy::large_enum_variant)] // we cannot Box, since Box is not UniFFI compatible. -pub enum AccountOrAddressOf { - ProfileAccount { value: Account }, - AddressOfExternalAccount { value: AccountAddress }, -} - -#[uniffi::export] -pub fn new_account_or_address_of_sample() -> AccountOrAddressOf { - InternalAccountOrAddressOf::sample().into() -} - -#[uniffi::export] -pub fn new_account_or_address_of_sample_other() -> AccountOrAddressOf { - InternalAccountOrAddressOf::sample_other().into() -} - -#[uniffi::export] -pub fn account_or_address_of_account_address( - recipient: &AccountOrAddressOf, -) -> AccountAddress { - (*recipient.into_internal().account_address()).into() -} diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/mod.rs b/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/mod.rs index 2235168c5..1abd5ac33 100644 --- a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/mod.rs +++ b/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/mod.rs @@ -1,9 +1,9 @@ -mod account_or_address_of; +mod owned_or_third_party_account_address; mod per_asset; mod per_recipient; mod transfer_types; -pub use account_or_address_of::*; +pub use owned_or_third_party_account_address::*; pub use per_asset::*; pub use per_recipient::*; pub use transfer_types::*; diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/owned_or_third_party_account_address.rs b/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/owned_or_third_party_account_address.rs new file mode 100644 index 000000000..5caef3d1d --- /dev/null +++ b/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/owned_or_third_party_account_address.rs @@ -0,0 +1,27 @@ +use crate::prelude::*; +use sargon::OwnedOrThirdPartyAccountAddress as InternalOwnedOrThirdPartyAccountAddress; + +#[derive(Clone, PartialEq, Eq, Hash, InternalConversion, uniffi::Enum)] +#[allow(clippy::large_enum_variant)] // we cannot Box, since Box is not UniFFI compatible. +pub enum OwnedOrThirdPartyAccountAddress { + OwnedAccount { value: AccountAddress }, + ThirdPartyAccount { value: AccountAddress }, +} + +#[uniffi::export] +pub fn new_account_or_address_of_sample() -> OwnedOrThirdPartyAccountAddress { + InternalOwnedOrThirdPartyAccountAddress::sample().into() +} + +#[uniffi::export] +pub fn new_account_or_address_of_sample_other( +) -> OwnedOrThirdPartyAccountAddress { + InternalOwnedOrThirdPartyAccountAddress::sample_other().into() +} + +#[uniffi::export] +pub fn account_or_address_of_account_address( + recipient: &OwnedOrThirdPartyAccountAddress, +) -> AccountAddress { + (*recipient.into_internal().account_address()).into() +} diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfer.rs b/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfer.rs index eb0171daf..dbbe36419 100644 --- a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfer.rs +++ b/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfer.rs @@ -3,7 +3,7 @@ use sargon::PerRecipientAssetTransfer as InternalPerRecipientAssetTransfer; #[derive(Clone, PartialEq, Eq, Hash, InternalConversion, uniffi::Record)] pub struct PerRecipientAssetTransfer { - pub recipient: AccountOrAddressOf, + pub recipient: OwnedOrThirdPartyAccountAddress, pub fungibles: Vec, pub non_fungibles: Vec, } diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/transfer_types.rs b/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/transfer_types.rs index 33517b531..7c410e086 100644 --- a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/transfer_types.rs +++ b/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/transfer_types.rs @@ -18,7 +18,7 @@ macro_rules! decl_transfer_of { /// If `true` the `try_deposit_batch_or_abort` method will be used instead of `deposit`, /// typically wallets sets this to try if and only if the recipient is a self-owned account - /// (`AccountOrAddressOf::ProfileAccount`) controlled by a DeviceFactorSource thy have + /// (`OwnedOrThirdPartyAccountAddress::OwnedAccount`) controlled by a DeviceFactorSource thy have /// access to and which third party deposit setting's `DepositRule` is `AcceptKnown` and /// which resource is known (`resource_address` is owned or has been owned before). pub(crate) use_try_deposit_or_abort: bool, @@ -47,7 +47,7 @@ macro_rules! decl_per_asset_transfer_of { $struct_name, $($fields)* /// The account or account address to send the tokens to. - pub recipient: AccountOrAddressOf, + pub recipient: OwnedOrThirdPartyAccountAddress, ); }; } diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/mod.rs b/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/mod.rs index ea4082752..3bfac0f43 100644 --- a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/mod.rs +++ b/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/mod.rs @@ -14,8 +14,6 @@ pub use address_of_account_or_persona::*; pub use assets_transfers::*; pub use build_information::*; -pub use address_union::*; - pub use stake_claim::*; pub use transaction::*; pub use transaction_guarantee::*; diff --git a/crates/sargon/Cargo.toml b/crates/sargon/Cargo.toml index 46820b5b5..8098eb06e 100644 --- a/crates/sargon/Cargo.toml +++ b/crates/sargon/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "sargon" -# Don't forget to update version in crates/sargon-uniffi/Cargo.toml -version = "1.2.1" +version = "1.1.99" edition = "2021" build = "build.rs" @@ -12,97 +11,69 @@ name = "vectors" crate-type = ["staticlib", "cdylib", "lib"] [dependencies] +# === SARGON CRATES === sargon-core = { path = "../sargon-core" } identified-vec-of = { path = "../identified-vec-of" } sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } sargon-factors = { path = "../sargon-factors" } sargon-keys-collector = { path = "../sargon-keys-collector" } sargon-addresses = { path = "../sargon-addresses" } - -zeroize = { workspace = true } - -log = { workspace = true } -# pretty_env_logger = "0.5.0" -pretty_env_logger = { git = "https://github.com/seanmonstar/pretty-env-logger/", rev = "0e238400e18649415dc710c025e99c009a1bb744" } - -derive_more = { workspace = true } - -serde = { workspace = true } - -serde_json = { workspace = true } - -serde_with = { workspace = true } - -serde_repr = { workspace = true } - -once_cell = { workspace = true } - -thiserror = { workspace = true } - -iso8601-timestamp = { workspace = true } - -uuid = { workspace = true } - -strum = { workspace = true } -sbor = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } -radix-rust = { workspace = true } +sargon-transaction-models = { path = "../sargon-transaction-models" } +sargon-manifests = { path = "../sargon-manifests" } +sargon-profile = { path = "../sargon-profile" } +sargon-profile-logic = { path = "../sargon-profile-logic" } +sargon-profile-security-structures = { path = "../sargon-profile-security-structures" } +sargon-factor-instances-provider = { path = "../sargon-factor-instances-provider" } +gateway-models = { path = "../gateway-models" } +sargon-clients = { path = "../sargon-clients" } +sargon-drivers = { path = "../sargon-drivers" } +gateway-client-and-api = { path = "../gateway-client-and-api" } + +# === RADIX DEPENDENCIES === radix-engine = { workspace = true } radix-common = { workspace = true } -radix-common-derive = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } +radix-common-derive = { workspace = true } radix-engine-interface = { workspace = true } -radix-engine-toolkit-common = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } - -radix-transactions = { workspace = true } - radix-engine-toolkit = { workspace = true } +radix-engine-toolkit-common = { workspace = true } +radix-transactions = { workspace = true } +radix-rust = { workspace = true } +sbor = { workspace = true } -enum-iterator = { workspace = true } - -rand = { workspace = true } - -hex = { workspace = true } - +# === EXTERNAL DEPENDENCIES === +aes-gcm = { workspace = true } +assert-json-diff = { workspace = true } +async-std = { workspace = true } +async-trait = { workspace = true } +base64 = { workspace = true } +camino = { workspace = true } delegate = { workspace = true } - -itertools = { workspace = true } - +derive_more = { workspace = true } enum-as-inner = { workspace = true } - -# SLIP10 implementation +enum-iterator = { workspace = true } +futures = { workspace = true } +hex = { workspace = true } +hkdf = { workspace = true } iota-crypto = { workspace = true } -# Transitive dependency of iota_crypto - used to construct PubKey from uncompressed bytes. +iso8601-timestamp = { workspace = true } +itertools = { workspace = true } k256 = { workspace = true } - - -assert-json-diff = { workspace = true } - -url = { workspace = true } - - +log = { workspace = true } +once_cell = { workspace = true } paste = { workspace = true } - - -# camino = "1.0.8" -camino = { git = "https://github.com/camino-rs/camino/", rev = "afa51b1b4c684b7e6698a6717ccda3affd0abd42", optional = true } - -async-trait = { workspace = true } - pretty_assertions = { workspace = true } - -aes-gcm = { workspace = true } - -# hkdf = "0.12.4" -hkdf = { workspace = true } - -base64 = { git = "https://github.com/marshallpierce/rust-base64.git", rev = "e14400697453bcc85997119b874bc03d9601d0af" } - -# reqwest = "0.12.3" -reqwest = { git = "https://github.com/seanmonstar/reqwest", rev = "0720159f6369f54e045a1fd315e0f24b7a0b4a39", default-features = false, features = [ - "native-tls-vendored", -] } - -async-std = "1.13.0" -futures = "0.3.31" +pretty_env_logger = { workspace = true } +rand = { workspace = true } +reqwest = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +serde_repr = { workspace = true } +serde_with = { workspace = true } +strum = { workspace = true } +thiserror = { workspace = true } +url = { workspace = true } +uuid = { workspace = true } +zeroize = { workspace = true } # Fixes nasty iOS bug "_kSecMatchSubjectWholeString", see https://github.com/kornelski/rust-security-framework/issues/203 # This is a workaround to fix a bug with version 2.11.0 that added some symbols that are not available on iOS @@ -112,11 +83,9 @@ security-framework = { version = "=2.10" } security-framework-sys = "=2.10.0" [dev-dependencies] - actix-rt = { workspace = true } [build-dependencies] - cargo_toml = { workspace = true } [lints.rust] diff --git a/crates/sargon/build.rs b/crates/sargon/build.rs index 279ae309d..1ac47b6d9 100644 --- a/crates/sargon/build.rs +++ b/crates/sargon/build.rs @@ -1,63 +1,26 @@ -use cargo_toml::{Dependency, Manifest}; use std::env; use std::path::Path; pub fn main() { - let manifest_path = - Path::new(env!("CARGO_MANIFEST_DIR")).join("Cargo.toml"); - // Paths for reading fixtures used by tests let fixtures_path = Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures"); println!("cargo:rustc-env=FIXTURES={}/", fixtures_path.display()); - let fixtures_transaction_path = fixtures_path.join("transaction"); - println!( - "cargo:rustc-env=FIXTURES_TX={}/", - fixtures_transaction_path.display() - ); + let fixtures_vector_path = fixtures_path.join("vector"); println!( "cargo:rustc-env=FIXTURES_VECTOR={}/", fixtures_vector_path.display() ); + let fixtures_models_path = fixtures_path.join("models"); println!( "cargo:rustc-env=FIXTURES_MODELS={}/", fixtures_models_path.display() ); + let fixtures_gw_models_path = fixtures_models_path.join("gateway"); println!( "cargo:rustc-env=FIXTURES_MODELS_GW={}/", fixtures_gw_models_path.display() ); - - let manifest = Manifest::from_path(manifest_path).expect("Can't panic"); - let dependencies = manifest.dependencies; - let set_dep_env = |key: &str| { - let dependency = dependencies.get(key).expect("Can't panic"); - let env_var_value = match dependency { - Dependency::Simple(version) => format!("version={version}"), - Dependency::Inherited(_) => { - panic!("Inherited dependency is not supported") - } - Dependency::Detailed(detailed) => { - if let Some(ref version) = detailed.version { - format!("version={version}") - } else if let Some(ref branch) = detailed.branch { - format!("branch={branch}") - } else if let Some(ref tag) = detailed.tag { - format!("tag={tag}") - } else if let Some(ref rev) = detailed.rev { - format!("rev={rev}") - } else { - panic!("Can't find version of {key} dependency") - } - } - }; - let env_var = - format!("{}_DEPENDENCY={}", key.to_uppercase(), env_var_value); - println!("cargo:rustc-env={}", env_var); - }; - - set_dep_env("radix-engine"); - set_dep_env("radix-engine-toolkit"); } diff --git a/crates/sargon/src/factor_instances_provider/mod.rs b/crates/sargon/src/factor_instances_provider/mod.rs deleted file mode 100644 index 9ccd51fc1..000000000 --- a/crates/sargon/src/factor_instances_provider/mod.rs +++ /dev/null @@ -1,11 +0,0 @@ -mod agnostic_paths; -mod factor_instances_cache; -mod next_index_assigner; -mod provider; -mod types; - -pub use agnostic_paths::*; -pub use factor_instances_cache::*; -pub use next_index_assigner::*; -pub use provider::*; -pub use types::*; diff --git a/crates/sargon/src/factor_instances_provider/types/mod.rs b/crates/sargon/src/factor_instances_provider/types/mod.rs deleted file mode 100644 index cfe91737f..000000000 --- a/crates/sargon/src/factor_instances_provider/types/mod.rs +++ /dev/null @@ -1,19 +0,0 @@ -mod abstract_securified_entity; -mod any_securified_entity; -mod appendable_collection; -mod assert_derivation_path; -mod is_securified_entity; -mod securified_account; -mod securified_persona; -mod unsecurified_entity; -mod veci; - -pub use abstract_securified_entity::*; -pub use any_securified_entity::*; -pub use appendable_collection::*; -pub use assert_derivation_path::*; -pub use is_securified_entity::*; -pub use securified_account::*; -pub use securified_persona::*; -pub use unsecurified_entity::*; -pub use veci::*; diff --git a/crates/sargon/src/gateway_api/client/gateway_client.rs b/crates/sargon/src/gateway_api/client/gateway_client.rs deleted file mode 100644 index cdfd9bbaa..000000000 --- a/crates/sargon/src/gateway_api/client/gateway_client.rs +++ /dev/null @@ -1,72 +0,0 @@ -use crate::prelude::*; - -/// An HTTP client for consuming the Radix ⛩️ Gateway API ([docs]). -/// -/// The implementing FFI clients can then consume the Radix Gateway API to e.g. -/// fetch the XRD balance of an account address or submit a signed transaction. -/// -/// [docs]: https://radix-babylon-gateway-api.redoc.ly/ -pub struct GatewayClient { - /// The HTTP client that actually executes the network requests. - pub http_client: HttpClient, - - /// The gateway this GatewayClient talks to, which is a (URL, NetworkID) tuple - /// essentially. - pub gateway: Gateway, -} - -impl GatewayClient { - /// Constructs a new `GatewayClient` with a NetworkingDriver for a specified - /// `Gateway`. - pub fn with_gateway( - networking_driver: Arc, - gateway: Gateway, - ) -> Self { - Self { - http_client: HttpClient { - driver: networking_driver, - }, - gateway, - } - } - - /// Constructs a new `GatewayClient` with a NetworkingDriver for a specified - /// network, by looking up an Radix DLT provided Gateway on that network. - /// - /// # Panics - /// Panics if Radix DLT does not provide a Gateway for the specified - /// `network_id` - e.g. will panic if you specify `NetworkID::Simulator` (duh). - pub fn new( - networking_driver: Arc, - network_id: NetworkID, - ) -> Self { - Self::with_gateway(networking_driver, Gateway::from(network_id)) - } -} - -#[cfg(test)] -mod tests { - use super::*; - use actix_rt::time::timeout; - use reqwest::Response; - use std::time::Duration; - - const MAX: Duration = Duration::from_millis(10); - - #[allow(clippy::upper_case_acronyms)] - type SUT = GatewayClient; - - #[actix_rt::test] - async fn test_submit_notarized_transaction_mock_duplicate() { - let mock_networking_driver = - MockNetworkingDriver::with_response(TransactionSubmitResponse { - duplicate: true, - }); - let sut = - SUT::new(Arc::new(mock_networking_driver), NetworkID::Stokenet); - let req = - sut.submit_notarized_transaction(NotarizedTransaction::sample()); - let result = timeout(MAX, req).await.unwrap(); - assert_eq!(result, Err(CommonError::GatewaySubmitDuplicateTX { intent_hash: "txid_rdx198k527d5wt4ms5tvrdcu8089v4hptp7ztv388k539uzzvmw25ltsj7u4zz".to_owned() })); - } -} diff --git a/crates/sargon/src/gateway_api/endpoints/mod.rs b/crates/sargon/src/gateway_api/endpoints/mod.rs deleted file mode 100644 index be4fab757..000000000 --- a/crates/sargon/src/gateway_api/endpoints/mod.rs +++ /dev/null @@ -1,7 +0,0 @@ -mod state_endpoints; -mod status_endpoints; -mod transaction_endpoints; - -pub use state_endpoints::*; -pub use status_endpoints::*; -pub use transaction_endpoints::*; diff --git a/crates/sargon/src/gateway_api/mod.rs b/crates/sargon/src/gateway_api/mod.rs deleted file mode 100644 index ed1795d26..000000000 --- a/crates/sargon/src/gateway_api/mod.rs +++ /dev/null @@ -1,11 +0,0 @@ -mod assert_network_request; -mod client; -mod endpoints; -mod methods; -mod models; - -pub use assert_network_request::*; -pub use client::*; -pub use endpoints::*; -pub use methods::*; -pub use models::*; diff --git a/crates/sargon/src/gateway_api/models/logic/mod.rs b/crates/sargon/src/gateway_api/models/logic/mod.rs deleted file mode 100644 index b8be6322b..000000000 --- a/crates/sargon/src/gateway_api/models/logic/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -mod request; -mod response; - -pub use request::*; -pub use response::*; diff --git a/crates/sargon/src/gateway_api/models/logic/request/mod.rs b/crates/sargon/src/gateway_api/models/logic/request/mod.rs deleted file mode 100644 index 898eff12f..000000000 --- a/crates/sargon/src/gateway_api/models/logic/request/mod.rs +++ /dev/null @@ -1,7 +0,0 @@ -mod gw_public_key; -mod state; -mod transaction; - -pub use gw_public_key::*; -pub use state::*; -pub use transaction::*; diff --git a/crates/sargon/src/gateway_api/models/logic/request/state/entity/mod.rs b/crates/sargon/src/gateway_api/models/logic/request/state/entity/mod.rs deleted file mode 100644 index c2ca873c5..000000000 --- a/crates/sargon/src/gateway_api/models/logic/request/state/entity/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -mod state_entity_details; - -pub use state_entity_details::*; diff --git a/crates/sargon/src/gateway_api/models/logic/request/state/entity/state_entity_details.rs b/crates/sargon/src/gateway_api/models/logic/request/state/entity/state_entity_details.rs deleted file mode 100644 index 1932110f4..000000000 --- a/crates/sargon/src/gateway_api/models/logic/request/state/entity/state_entity_details.rs +++ /dev/null @@ -1,39 +0,0 @@ -use crate::prelude::*; - -#[cfg(test)] -mod tests { - use super::*; - - #[allow(clippy::upper_case_acronyms)] - type SUT = StateEntityDetailsRequest; - - #[test] - fn json_request_entity_details_single_account_no_assets() { - let _ = fixture_and_json::(include_str!(concat!( - env!("FIXTURES_MODELS_GW"), - "state/request_entity_details__single_account_no_assets.json" - ))) - .unwrap(); - // assert_json_value_eq_after_roundtrip(&sut, json) // FIXME: Once fully implemented - } - - #[test] - fn json_request_entity_details_single_resource() { - let _ = fixture_and_json::(include_str!(concat!( - env!("FIXTURES_MODELS_GW"), - "state/request_entity_details__single_resource.json" - ))) - .unwrap(); - // assert_json_value_eq_after_roundtrip(&sut, json) // FIXME: Once fully implemented - } - - #[test] - fn json_request_entity_details_two_accounts() { - let _ = fixture_and_json::(include_str!(concat!( - env!("FIXTURES_MODELS_GW"), - "state/request_entity_details__two_accounts.json" - ))) - .unwrap(); - // assert_json_value_eq_after_roundtrip(&sut, json) // FIXME: Once fully implemented - } -} diff --git a/crates/sargon/src/gateway_api/models/logic/request/state/mod.rs b/crates/sargon/src/gateway_api/models/logic/request/state/mod.rs deleted file mode 100644 index 135a9f2a7..000000000 --- a/crates/sargon/src/gateway_api/models/logic/request/state/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -mod entity; - -pub use entity::*; diff --git a/crates/sargon/src/gateway_api/models/logic/request/transaction/mod.rs b/crates/sargon/src/gateway_api/models/logic/request/transaction/mod.rs deleted file mode 100644 index 8a3a19527..000000000 --- a/crates/sargon/src/gateway_api/models/logic/request/transaction/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -mod preview; -mod submit; - -pub use preview::*; -pub use submit::*; diff --git a/crates/sargon/src/gateway_api/models/logic/response/ledger_state.rs b/crates/sargon/src/gateway_api/models/logic/response/ledger_state.rs deleted file mode 100644 index 001941f03..000000000 --- a/crates/sargon/src/gateway_api/models/logic/response/ledger_state.rs +++ /dev/null @@ -1,15 +0,0 @@ -use crate::prelude::*; - -#[cfg(test)] -impl LedgerState { - /// A sample used to facilitate unit tests. - pub fn sample_stokenet() -> Self { - Self { - network: NetworkID::Stokenet.logical_name(), - state_version: 80577579, - proposer_round_timestamp: "2024-10-07T15:41:07.259Z".to_string(), - epoch: 41965, - round: 894, - } - } -} diff --git a/crates/sargon/src/gateway_api/models/logic/response/mod.rs b/crates/sargon/src/gateway_api/models/logic/response/mod.rs deleted file mode 100644 index a1fedc73b..000000000 --- a/crates/sargon/src/gateway_api/models/logic/response/mod.rs +++ /dev/null @@ -1,9 +0,0 @@ -mod ledger_state; - -mod state; -mod transaction; - -pub use ledger_state::*; - -pub use state::*; -pub use transaction::*; diff --git a/crates/sargon/src/gateway_api/models/logic/response/state/entity/details/fungible/collection.rs b/crates/sargon/src/gateway_api/models/logic/response/state/entity/details/fungible/collection.rs deleted file mode 100644 index 3c72a27bf..000000000 --- a/crates/sargon/src/gateway_api/models/logic/response/state/entity/details/fungible/collection.rs +++ /dev/null @@ -1,3 +0,0 @@ -use crate::prelude::*; - -impl FungibleResourcesCollection {} diff --git a/crates/sargon/src/gateway_api/models/logic/response/state/entity/details/fungible/collection_item.rs b/crates/sargon/src/gateway_api/models/logic/response/state/entity/details/fungible/collection_item.rs deleted file mode 100644 index 14dbd4c9f..000000000 --- a/crates/sargon/src/gateway_api/models/logic/response/state/entity/details/fungible/collection_item.rs +++ /dev/null @@ -1,28 +0,0 @@ -use crate::prelude::*; - -impl FungibleResourcesCollectionItem { - pub fn resource_address(&self) -> ResourceAddress { - match self { - Self::Global(item) => item.resource_address, - } - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[allow(clippy::upper_case_acronyms)] - type SUT = FungibleResourcesCollectionItem; - - #[test] - fn inequality() { - let resource_address = ResourceAddress::sample(); - let sut = - SUT::Global(FungibleResourcesCollectionItemGloballyAggregated { - amount: Decimal192::zero(), - resource_address, - }); - assert_eq!(sut.resource_address(), resource_address); - } -} diff --git a/crates/sargon/src/gateway_api/models/logic/response/state/entity/details/fungible/collection_item_global.rs b/crates/sargon/src/gateway_api/models/logic/response/state/entity/details/fungible/collection_item_global.rs deleted file mode 100644 index b9ec6ac01..000000000 --- a/crates/sargon/src/gateway_api/models/logic/response/state/entity/details/fungible/collection_item_global.rs +++ /dev/null @@ -1,3 +0,0 @@ -use crate::prelude::*; - -impl FungibleResourcesCollectionItemGloballyAggregated {} diff --git a/crates/sargon/src/gateway_api/models/logic/response/state/entity/details/mod.rs b/crates/sargon/src/gateway_api/models/logic/response/state/entity/details/mod.rs deleted file mode 100644 index febab0e68..000000000 --- a/crates/sargon/src/gateway_api/models/logic/response/state/entity/details/mod.rs +++ /dev/null @@ -1,7 +0,0 @@ -mod fungible; -mod state_entity_details_response; -mod state_entity_details_response_item; - -pub use fungible::*; -pub use state_entity_details_response::*; -pub use state_entity_details_response_item::*; diff --git a/crates/sargon/src/gateway_api/models/logic/response/state/entity/mod.rs b/crates/sargon/src/gateway_api/models/logic/response/state/entity/mod.rs deleted file mode 100644 index 973598716..000000000 --- a/crates/sargon/src/gateway_api/models/logic/response/state/entity/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -mod details; -pub use details::*; diff --git a/crates/sargon/src/gateway_api/models/logic/response/state/mod.rs b/crates/sargon/src/gateway_api/models/logic/response/state/mod.rs deleted file mode 100644 index 135a9f2a7..000000000 --- a/crates/sargon/src/gateway_api/models/logic/response/state/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -mod entity; - -pub use entity::*; diff --git a/crates/sargon/src/gateway_api/models/logic/response/transaction/preview/logs_inner.rs b/crates/sargon/src/gateway_api/models/logic/response/transaction/preview/logs_inner.rs deleted file mode 100644 index 44a5aee7d..000000000 --- a/crates/sargon/src/gateway_api/models/logic/response/transaction/preview/logs_inner.rs +++ /dev/null @@ -1,3 +0,0 @@ -use crate::prelude::*; - -impl TransactionPreviewResponseLogsInner {} diff --git a/crates/sargon/src/gateway_api/models/logic/response/transaction/preview/mod.rs b/crates/sargon/src/gateway_api/models/logic/response/transaction/preview/mod.rs deleted file mode 100644 index 3b23abab6..000000000 --- a/crates/sargon/src/gateway_api/models/logic/response/transaction/preview/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -mod logs_inner; -mod transaction_preview_response; - -pub use logs_inner::*; -pub use transaction_preview_response::*; diff --git a/crates/sargon/src/gateway_api/models/logic/response/transaction/status/mod.rs b/crates/sargon/src/gateway_api/models/logic/response/transaction/status/mod.rs deleted file mode 100644 index 5429fb306..000000000 --- a/crates/sargon/src/gateway_api/models/logic/response/transaction/status/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -mod payload_item; -mod transaction_status; diff --git a/crates/sargon/src/gateway_api/models/logic/response/transaction/subintent_status/mod.rs b/crates/sargon/src/gateway_api/models/logic/response/transaction/subintent_status/mod.rs deleted file mode 100644 index a2f9ab147..000000000 --- a/crates/sargon/src/gateway_api/models/logic/response/transaction/subintent_status/mod.rs +++ /dev/null @@ -1 +0,0 @@ -mod subintent_status; diff --git a/crates/sargon/src/gateway_api/models/logic/response/transaction/subintent_status/subintent_status.rs b/crates/sargon/src/gateway_api/models/logic/response/transaction/subintent_status/subintent_status.rs deleted file mode 100644 index 97d95290f..000000000 --- a/crates/sargon/src/gateway_api/models/logic/response/transaction/subintent_status/subintent_status.rs +++ /dev/null @@ -1,42 +0,0 @@ -use crate::prelude::*; - -impl SubintentStatusResponse { - pub fn new( - ledger_state: LedgerState, - subintent_status: SubintentStatus, - finalized_at_transaction_intent_hash: Option, - ) -> Self { - Self { - ledger_state, - subintent_status, - finalized_at_transaction_intent_hash, - } - } -} - -#[cfg(test)] -impl SubintentStatusResponse { - // Helper functions to create sample responses - - pub fn sample_unknown() -> Self { - Self::new( - LedgerState::sample_stokenet(), - SubintentStatus::Unknown, - None, - ) - } - - pub fn sample_committed_success() -> Self { - Self::committed_success(TransactionIntentHash::sample().to_string()) - } - - pub fn committed_success( - finalized_at_transaction_intent_hash: impl Into>, - ) -> Self { - Self::new( - LedgerState::sample_stokenet(), - SubintentStatus::CommittedSuccess, - finalized_at_transaction_intent_hash.into(), - ) - } -} diff --git a/crates/sargon/src/gateway_api/models/mod.rs b/crates/sargon/src/gateway_api/models/mod.rs deleted file mode 100644 index 87aa1beec..000000000 --- a/crates/sargon/src/gateway_api/models/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -mod logic; -mod types; - -pub use logic::*; -pub use types::*; diff --git a/crates/sargon/src/gateway_api/models/types/request/transaction/preview/mod.rs b/crates/sargon/src/gateway_api/models/types/request/transaction/preview/mod.rs deleted file mode 100644 index 8a2de63f1..000000000 --- a/crates/sargon/src/gateway_api/models/types/request/transaction/preview/mod.rs +++ /dev/null @@ -1,11 +0,0 @@ -mod opt_ins; -mod opt_ins_v2; -mod request_flags; -mod transaction_preview; -mod transaction_preview_v2; - -pub use opt_ins::*; -pub use opt_ins_v2::*; -pub use request_flags::*; -pub use transaction_preview::*; -pub use transaction_preview_v2::*; diff --git a/crates/sargon/src/gateway_api/models/types/request/transaction/preview/opt_ins.rs b/crates/sargon/src/gateway_api/models/types/request/transaction/preview/opt_ins.rs deleted file mode 100644 index afe970601..000000000 --- a/crates/sargon/src/gateway_api/models/types/request/transaction/preview/opt_ins.rs +++ /dev/null @@ -1,15 +0,0 @@ -use crate::prelude::*; - -#[derive( - Clone, - Copy, - Debug, - PartialEq, - Eq, - Serialize, - Deserialize, /* Deserialize so we can test roundtrip of JSON vectors */ -)] -pub struct TransactionPreviewRequestOptIns { - /** This flag controls whether the preview response will include a Radix Engine Toolkit serializable receipt or not. */ - pub(crate) radix_engine_toolkit_receipt: bool, -} diff --git a/crates/sargon/src/gateway_api/models/types/request/transaction/preview/opt_ins_v2.rs b/crates/sargon/src/gateway_api/models/types/request/transaction/preview/opt_ins_v2.rs deleted file mode 100644 index f4ee447db..000000000 --- a/crates/sargon/src/gateway_api/models/types/request/transaction/preview/opt_ins_v2.rs +++ /dev/null @@ -1,30 +0,0 @@ -use crate::prelude::*; - -#[derive( - Clone, - Copy, - Debug, - PartialEq, - Eq, - Serialize, - Deserialize, /* Deserialize so we can test roundtrip of JSON vectors */ -)] -pub struct TransactionPreviewRequestOptInsV2 { - /** - * This flag controls whether the preview response will include a Core API receipt or not. - * If not provided, this defaults to false and no core api receipt is provided in the response. - */ - pub core_api_receipt: bool, - - /** - * This flag controls whether the preview response will include a Radix Engine Toolkit serializable receipt or not. - * If not provided, this defaults to false and no toolkit receipt is provided in the response. - */ - pub radix_engine_toolkit_receipt: bool, - - /** - * This flag controls whether the preview response will include execution logs. - * If not provided, this defaults to false and no logs will be provided in the response. - */ - pub logs: bool, -} diff --git a/crates/sargon/src/gateway_api/models/types/request/transaction/preview/request_flags.rs b/crates/sargon/src/gateway_api/models/types/request/transaction/preview/request_flags.rs deleted file mode 100644 index 3e9272d11..000000000 --- a/crates/sargon/src/gateway_api/models/types/request/transaction/preview/request_flags.rs +++ /dev/null @@ -1,21 +0,0 @@ -use sargon_core::decl_bool_type; - -use crate::prelude::*; - -#[derive( - Clone, - Debug, - PartialEq, - Eq, - Serialize, - Deserialize, /* Deserialize so we can test roundtrip of JSON vectors */ -)] -pub struct TransactionPreviewRequestFlags { - pub(crate) use_free_credit: UseFreeCredit, - pub(crate) assume_all_signature_proofs: AssumeAllSignatureProofs, - pub(crate) skip_epoch_check: SkipEpochCheck, -} - -decl_bool_type!(UseFreeCredit, true); -decl_bool_type!(AssumeAllSignatureProofs, false); -decl_bool_type!(SkipEpochCheck, false); diff --git a/crates/sargon/src/gateway_api/models/types/request/transaction/preview/transaction_preview.rs b/crates/sargon/src/gateway_api/models/types/request/transaction/preview/transaction_preview.rs deleted file mode 100644 index 6d4769e66..000000000 --- a/crates/sargon/src/gateway_api/models/types/request/transaction/preview/transaction_preview.rs +++ /dev/null @@ -1,42 +0,0 @@ -use crate::prelude::*; - -#[derive( - Serialize, - Deserialize, /* Deserialize so we can test roundtrip of JSON vectors */ - Clone, - Debug, - PartialEq, - Eq, -)] -pub(crate) struct TransactionPreviewRequest { - /** A text-representation of a transaction manifest */ - pub(crate) manifest: String, - - /** An array of hex-encoded blob data (optional) */ - pub(crate) blobs_hex: Option>, - - /** An integer between `0` and `10^10`, marking the epoch at which the transaction starts being valid */ - pub(crate) start_epoch_inclusive: u64, - - /** An integer between `0` and `10^10`, marking the epoch at which the transaction is no longer valid */ - pub(crate) end_epoch_exclusive: u64, - - pub(crate) notary_public_key: Option, - - /** Whether the notary should count as a signatory (optional, default false) */ - pub(crate) notary_is_signatory: bool, - - /** An integer between `0` and `65535`, giving the validator tip as a percentage amount. A value of `1` corresponds to 1% of the fee. */ - pub(crate) tip_percentage: u16, - - /** A decimal-string-encoded integer between `0` and `2^32 - 1`, used to ensure the transaction intent is unique. */ - pub(crate) nonce: u32, - - /** A list of public keys to be used as transaction signers */ - pub(crate) signer_public_keys: Vec, - - pub(crate) flags: TransactionPreviewRequestFlags, - - /** A set of flags to configure the response of the transaction preview. */ - pub(crate) opt_ins: TransactionPreviewRequestOptIns, -} diff --git a/crates/sargon/src/gateway_api/models/types/request/transaction/preview/transaction_preview_v2.rs b/crates/sargon/src/gateway_api/models/types/request/transaction/preview/transaction_preview_v2.rs deleted file mode 100644 index 7b224c341..000000000 --- a/crates/sargon/src/gateway_api/models/types/request/transaction/preview/transaction_preview_v2.rs +++ /dev/null @@ -1,47 +0,0 @@ -use crate::prelude::*; - -#[derive( - Serialize, - Deserialize, /* Deserialize so we can test roundtrip of JSON vectors */ - Clone, - Debug, - PartialEq, - Eq, -)] -pub(crate) struct TransactionPreviewRequestV2 { - /** - * A hex-encoded, compiled RawPreviewTransaction. - */ - pub(crate) preview_transaction: PreviewTransactionV2, - - pub(crate) flags: TransactionPreviewRequestFlags, - - /** A set of flags to configure the response of the transaction preview. */ - pub(crate) opt_ins: TransactionPreviewRequestOptInsV2, -} - -#[derive( - Serialize, - Deserialize, /* Deserialize so we can test roundtrip of JSON vectors */ - Clone, - Debug, - PartialEq, - Eq, -)] -pub(crate) struct PreviewTransactionV2 { - #[serde(rename = "type")] - pub(crate) transaction_type: PreviewTransactionTypeV2, - pub(crate) preview_transaction_hex: String, -} - -#[derive( - Serialize, - Deserialize, /* Deserialize so we can test roundtrip of JSON vectors */ - Clone, - Debug, - PartialEq, - Eq, -)] -pub(crate) enum PreviewTransactionTypeV2 { - Compiled, -} diff --git a/crates/sargon/src/gateway_api/models/types/request/transaction/submit/mod.rs b/crates/sargon/src/gateway_api/models/types/request/transaction/submit/mod.rs deleted file mode 100644 index 9492d61e5..000000000 --- a/crates/sargon/src/gateway_api/models/types/request/transaction/submit/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -mod transaction_submit; - -pub use transaction_submit::*; diff --git a/crates/sargon/src/gateway_api/models/types/request/transaction/submit/transaction_submit.rs b/crates/sargon/src/gateway_api/models/types/request/transaction/submit/transaction_submit.rs deleted file mode 100644 index 61f833c6e..000000000 --- a/crates/sargon/src/gateway_api/models/types/request/transaction/submit/transaction_submit.rs +++ /dev/null @@ -1,14 +0,0 @@ -use crate::prelude::*; - -#[derive( - Clone, - Debug, - PartialEq, - Eq, - Serialize, - Deserialize, /* Deserialize so we can test roundtrip of JSON vectors */ -)] -pub struct TransactionSubmitRequest { - /** Hex-encoded notarized transaction payload which can be submitted. */ - pub(crate) notarized_transaction_hex: String, -} diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/fungible/collection_item.rs b/crates/sargon/src/gateway_api/models/types/response/state/entity/details/fungible/collection_item.rs deleted file mode 100644 index 81caf2390..000000000 --- a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/fungible/collection_item.rs +++ /dev/null @@ -1,27 +0,0 @@ -use crate::prelude::*; - -#[derive( - Deserialize, - Serialize, /* Serialize so we can test roundtrip of JSON vectors */ - Clone, - PartialEq, - Eq, - Debug, - EnumAsInner, -)] -#[serde(untagged)] -pub enum FungibleResourcesCollectionItem { - Global(FungibleResourcesCollectionItemGloballyAggregated), -} - -impl HasSampleValues for FungibleResourcesCollectionItem { - fn sample() -> Self { - Self::Global(FungibleResourcesCollectionItemGloballyAggregated::sample()) - } - - fn sample_other() -> Self { - Self::Global( - FungibleResourcesCollectionItemGloballyAggregated::sample_other(), - ) - } -} diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/non_fungible/mod.rs b/crates/sargon/src/gateway_api/models/types/response/state/entity/details/non_fungible/mod.rs deleted file mode 100644 index aaed90fec..000000000 --- a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/non_fungible/mod.rs +++ /dev/null @@ -1,7 +0,0 @@ -mod collection; -mod collection_item; -mod collection_item_global; - -pub use collection::*; -pub use collection_item::*; -pub use collection_item_global::*; diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/response.rs b/crates/sargon/src/gateway_api/models/types/response/state/entity/details/response.rs deleted file mode 100644 index 3ed647e1f..000000000 --- a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/response.rs +++ /dev/null @@ -1,21 +0,0 @@ -use crate::prelude::*; - -/// The response a call to the REST Endpoint: -/// `https://mainnet.radixdlt.com/state/entity/details` -/// -/// Which contains token balances of an account. -#[derive( - Deserialize, - Serialize, /* Serialize so we can test roundtrip of JSON vectors */ - Clone, - PartialEq, - Eq, - Debug, -)] -pub struct StateEntityDetailsResponse { - /// The ledger state against which the response was generated. - pub ledger_state: Option, - - /// The details for the requested entities. - pub items: Vec, -} diff --git a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/response_item.rs b/crates/sargon/src/gateway_api/models/types/response/state/entity/details/response_item.rs deleted file mode 100644 index 05d874875..000000000 --- a/crates/sargon/src/gateway_api/models/types/response/state/entity/details/response_item.rs +++ /dev/null @@ -1,44 +0,0 @@ -use crate::prelude::*; - -#[derive( - Deserialize, - Serialize, /* Serialize so we can test roundtrip of JSON vectors */ - Clone, - PartialEq, - Eq, - Debug, -)] -pub struct StateEntityDetailsResponseItem { - /// Bech32m-encoded human readable version of the address. - pub address: Address, - - /// Fungible resources collection. - pub fungible_resources: Option, - - /// Non-fungible resources collection. - pub non_fungible_resources: Option, - - /// Entity metadata collection. - pub metadata: EntityMetadataCollection, - - /// More details of this entity. - pub details: Option, -} - -impl StateEntityDetailsResponseItem { - pub fn new( - address: Address, - fungible_resources: impl Into>, - non_fungible_resources: impl Into>, - metadata: EntityMetadataCollection, - details: impl Into>, - ) -> StateEntityDetailsResponseItem { - StateEntityDetailsResponseItem { - address, - fungible_resources: fungible_resources.into(), - non_fungible_resources: non_fungible_resources.into(), - metadata, - details: details.into(), - } - } -} diff --git a/crates/sargon/src/gateway_api/models/types/response/transaction/construction/mod.rs b/crates/sargon/src/gateway_api/models/types/response/transaction/construction/mod.rs deleted file mode 100644 index ff9fcd584..000000000 --- a/crates/sargon/src/gateway_api/models/types/response/transaction/construction/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -mod transaction_construction_response; - -pub use transaction_construction_response::*; diff --git a/crates/sargon/src/gateway_api/models/types/response/transaction/construction/transaction_construction_response.rs b/crates/sargon/src/gateway_api/models/types/response/transaction/construction/transaction_construction_response.rs deleted file mode 100644 index f44274843..000000000 --- a/crates/sargon/src/gateway_api/models/types/response/transaction/construction/transaction_construction_response.rs +++ /dev/null @@ -1,13 +0,0 @@ -use crate::prelude::*; - -#[derive( - Deserialize, - Serialize, /* Serialize so we can test roundtrip of JSON vectors */ - Clone, - PartialEq, - Eq, - Debug, -)] -pub struct TransactionConstructionResponse { - pub ledger_state: LedgerState, -} diff --git a/crates/sargon/src/gateway_api/models/types/response/transaction/mod.rs b/crates/sargon/src/gateway_api/models/types/response/transaction/mod.rs deleted file mode 100644 index 415ec2287..000000000 --- a/crates/sargon/src/gateway_api/models/types/response/transaction/mod.rs +++ /dev/null @@ -1,11 +0,0 @@ -mod construction; -mod preview; -mod status; -mod subintent_status; -mod submit; - -pub use construction::*; -pub use preview::*; -pub use status::*; -pub use subintent_status::*; -pub use submit::*; diff --git a/crates/sargon/src/gateway_api/models/types/response/transaction/preview/transaction_preview_response.rs b/crates/sargon/src/gateway_api/models/types/response/transaction/preview/transaction_preview_response.rs deleted file mode 100644 index 9859dbefb..000000000 --- a/crates/sargon/src/gateway_api/models/types/response/transaction/preview/transaction_preview_response.rs +++ /dev/null @@ -1,18 +0,0 @@ -use crate::prelude::*; - -#[derive( - Deserialize, - Serialize, /* Serialize so we can test roundtrip of JSON vectors */ - Clone, - PartialEq, - Eq, - Debug, -)] -pub struct TransactionPreviewResponse { - /** Hex-encoded binary blob. */ - pub encoded_receipt: String, - pub radix_engine_toolkit_receipt: - Option, - pub logs: Vec, - pub receipt: TransactionReceipt, -} diff --git a/crates/sargon/src/gateway_api/models/types/response/transaction/status/payload_item.rs b/crates/sargon/src/gateway_api/models/types/response/transaction/status/payload_item.rs deleted file mode 100644 index 7c493be9c..000000000 --- a/crates/sargon/src/gateway_api/models/types/response/transaction/status/payload_item.rs +++ /dev/null @@ -1,6 +0,0 @@ -use crate::prelude::*; - -#[derive(Deserialize, Serialize, Clone, PartialEq, Eq, Debug)] -pub struct TransactionStatusResponsePayloadItem { - pub payload_status: Option, -} diff --git a/crates/sargon/src/gateway_api/models/types/response/transaction/status/transaction_status.rs b/crates/sargon/src/gateway_api/models/types/response/transaction/status/transaction_status.rs deleted file mode 100644 index 3f775d694..000000000 --- a/crates/sargon/src/gateway_api/models/types/response/transaction/status/transaction_status.rs +++ /dev/null @@ -1,8 +0,0 @@ -use crate::prelude::*; - -#[derive(Deserialize, Serialize, Clone, PartialEq, Eq, Debug)] -pub struct TransactionStatusResponse { - pub ledger_state: LedgerState, - pub known_payloads: Vec, - pub error_message: Option, -} diff --git a/crates/sargon/src/gateway_api/models/types/response/transaction/subintent_status/response.rs b/crates/sargon/src/gateway_api/models/types/response/transaction/subintent_status/response.rs deleted file mode 100644 index 6ad0a9a0c..000000000 --- a/crates/sargon/src/gateway_api/models/types/response/transaction/subintent_status/response.rs +++ /dev/null @@ -1,16 +0,0 @@ -use crate::prelude::*; - -#[derive(Deserialize, Serialize, Clone, PartialEq, Eq, Debug)] -pub struct SubintentStatusResponse { - /// The ledger state against which the response was generated. Can be used to detect if the Network Gateway is returning up-to-date information. - pub ledger_state: LedgerState, - - /// The finalization status of this subintent. - /// Each subintent can only be successfully committed once, but unlike a transaction intent, - /// could be committed as a failure zero or more times first. - pub subintent_status: SubintentStatus, - - /// The Transaction ID in which the subintent was included. - /// This field is only present if the status is `CommittedSuccess` - pub finalized_at_transaction_intent_hash: Option, -} diff --git a/crates/sargon/src/gateway_api/models/types/response/transaction/submit/mod.rs b/crates/sargon/src/gateway_api/models/types/response/transaction/submit/mod.rs deleted file mode 100644 index a66c097b8..000000000 --- a/crates/sargon/src/gateway_api/models/types/response/transaction/submit/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -mod submit; - -pub use submit::*; diff --git a/crates/sargon/src/gateway_api/models/types/response/transaction/submit/submit.rs b/crates/sargon/src/gateway_api/models/types/response/transaction/submit/submit.rs deleted file mode 100644 index ac4cb7a40..000000000 --- a/crates/sargon/src/gateway_api/models/types/response/transaction/submit/submit.rs +++ /dev/null @@ -1,14 +0,0 @@ -use crate::prelude::*; - -#[derive( - Deserialize, - Serialize, /* Serialize so we can test roundtrip of JSON vectors */ - Clone, - PartialEq, - Eq, - Debug, -)] -pub struct TransactionSubmitResponse { - /** Is true if the transaction is a duplicate of an existing pending transaction. */ - pub duplicate: bool, -} diff --git a/crates/sargon/src/home_cards/home_card.rs b/crates/sargon/src/home_cards/home_card.rs index f0311d559..a65f78036 100644 --- a/crates/sargon/src/home_cards/home_card.rs +++ b/crates/sargon/src/home_cards/home_card.rs @@ -1,5 +1,4 @@ use crate::prelude::*; -use std::cmp::Ordering; #[derive( Serialize, diff --git a/crates/sargon/src/lib.rs b/crates/sargon/src/lib.rs index c754d6419..0d5627cc6 100644 --- a/crates/sargon/src/lib.rs +++ b/crates/sargon/src/lib.rs @@ -1,4 +1,4 @@ -#![allow(unused_imports)] +#![allow(async_fn_in_trait)] #![allow(internal_features)] #![allow(incomplete_features)] #![feature(async_closure)] @@ -11,181 +11,33 @@ #![feature(trivial_bounds)] #![allow(trivial_bounds)] -mod error_from; -mod factor_instances_provider; -mod gateway_api; mod home_cards; -mod profile; +mod needs_a_new_home_dumping_ground; mod radix_connect; mod security_center; mod signing; mod system; mod types; -mod wrapped_radix_engine_toolkit; pub mod prelude { - pub use identified_vec_of::prelude::*; - pub use sargon_addresses::prelude::*; - pub use sargon_core::prelude::*; - pub use sargon_factors::prelude::*; - pub use sargon_hierarchical_deterministic::prelude::*; + pub use gateway_client_and_api::prelude::*; + pub use sargon_clients::prelude::*; + pub use sargon_factor_instances_provider::prelude::*; pub use sargon_keys_collector::prelude::*; + pub use sargon_manifests::prelude::*; + pub use sargon_profile_logic::prelude::*; - pub use crate::error_from::*; - pub use crate::factor_instances_provider::*; - pub use crate::gateway_api::*; pub use crate::home_cards::*; - pub use crate::profile::*; pub use crate::radix_connect::*; pub use crate::security_center::*; pub use crate::signing::*; pub use crate::system::*; pub use crate::types::*; - pub use crate::wrapped_radix_engine_toolkit::*; - pub(crate) use once_cell::sync::Lazy; + pub(crate) use radix_engine_interface::prelude::MetadataValue as ScryptoMetadataValue; - pub(crate) use futures::future::join_all; - - pub(crate) use radix_engine::{ - blueprints::consensus_manager::UnstakeData as ScryptoUnstakeData, - system::system_modules::execution_trace::ResourceSpecifier as ScryptoResourceSpecifier, - transaction::{ - FeeLocks as ScryptoFeeLocks, - TransactionReceiptV1 as ScryptoTransactionReceipt, - }, - }; - pub(crate) use radix_engine_toolkit_common::receipt::RuntimeToolkitTransactionReceipt as ScryptoRuntimeToolkitTransactionReceipt; - pub(crate) use radix_engine_toolkit_common::receipt::SerializableToolkitTransactionReceipt as ScryptoSerializableToolkitTransactionReceipt; - pub(crate) use sbor::Versioned; - - pub(crate) use radix_common::{ - crypto::{ - blake2b_256_hash, verify_ed25519 as scrypto_verify_ed25519, - verify_secp256k1 as scrypto_verify_secp256k1, - Ed25519PrivateKey as ScryptoEd25519PrivateKey, - Ed25519Signature as ScryptoEd25519Signature, - Secp256k1PrivateKey as ScryptoSecp256k1PrivateKey, - Secp256k1PublicKey as ScryptoSecp256k1PublicKey, - Secp256k1Signature as ScryptoSecp256k1Signature, - }, - math::{ - Decimal as ScryptoDecimal192, RoundingMode as ScryptoRoundingMode, - }, - network::NetworkDefinition as ScryptoNetworkDefinition, - prelude::{ - UpperBound as ScryptoUpperBound, - ACCOUNT_OWNER_BADGE as SCRYPTO_ACCOUNT_OWNER_BADGE, - IDENTITY_OWNER_BADGE as SCRYPTO_IDENTITY_OWNER_BADGE, - }, - ManifestSbor as ScryptoManifestSbor, ScryptoSbor, - }; - - pub(crate) use radix_engine_interface::blueprints::{ - access_controller::{ - RecoveryProposal as ScryptoRecoveryProposal, - RuleSet as ScryptoRuleSet, - }, - account::{ - DefaultDepositRule as ScryptoDefaultDepositRule, - ResourcePreference as ScryptoResourcePreference, - ACCOUNT_SECURIFY_IDENT as SCRYPTO_ACCOUNT_SECURIFY_IDENT, - }, - identity::IDENTITY_SECURIFY_IDENT as SCRYPTO_IDENTITY_SECURIFY_IDENT, - resource::ResourceOrNonFungible as ScryptoResourceOrNonFungible, - }; - pub(crate) use radix_engine_interface::prelude::{ - AccessRule as ScryptoAccessRule, - BasicRequirement as ScryptoBasicRequirement, - CompositeRequirement as ScryptoCompositeRequirement, - FungibleResourceRoles as ScryptoFungibleResourceRoles, - MetadataInit as ScryptoMetadataInit, - MetadataValue as ScryptoMetadataValue, - ModuleConfig as ScryptoModuleConfig, - NonFungibleResourceRoles as ScryptoNonFungibleResourceRoles, - OwnerRole as ScryptoOwnerRole, - RoleAssignmentInit as ScryptoRoleAssignmentInit, - ToMetadataEntry as ScryptoToMetadataEntry, - UncheckedUrl as ScryptoUncheckedUrl, - }; - - pub(crate) use enum_iterator::all; - - pub(crate) use radix_transactions::{ - builder::{ - ManifestNameRegistrar as ScryptoManifestNameRegistrar, - NewManifestBucket as ScryptoNewManifestBucket, - PartialTransactionV2Builder as ScryptoPartialTransactionV2Builder, - ResolvableArguments as ScryptoResolvableArguments, - TransactionV2Builder as ScryptoTransactionV2Builder, - }, - manifest::{ - compile as scrypto_compile, - compile_error_diagnostics as scrypto_compile_error_diagnostics, - compile_manifest as scrypto_compile_manifest, - decompile as scrypto_decompile, - generator::{GeneratorError, GeneratorErrorKind}, - lexer::{LexerError, LexerErrorKind}, - static_resource_movements::{ - AccountDeposit as ScryptoAccountDeposit, - AccountWithdraw as ScryptoAccountWithdraw, - ChangeSource as ScryptoChangeSource, - SimpleFungibleResourceBounds as ScryptoSimpleFungibleResourceBounds, - SimpleNonFungibleResourceBounds as ScryptoSimpleNonFungibleResourceBounds, - SimpleResourceBounds as ScryptoSimpleResourceBounds, - UnspecifiedResources as ScryptoUnspecifiedResources, - }, - token::{Position, Span}, - CompileError as ScryptoCompileError, - CompileErrorDiagnosticsStyle as ScryptoCompileErrorDiagnosticsStyle, - KnownManifestObjectNames as ScryptoKnownManifestObjectNames, - ManifestObjectNames as ScryptoManifestObjectNames, - MockBlobProvider as ScryptoMockBlobProvider, - }, - model::{ - BlobV1 as ScryptoBlob, BlobsV1 as ScryptoBlobs, - ChildSubintentSpecifier as ScryptoChildSubintentSpecifier, - ChildSubintentSpecifiersV2 as ScryptoChildSubintentSpecifiers, - InstructionV1 as ScryptoInstruction, - InstructionV2 as ScryptoInstructionV2, - InstructionsV1 as ScryptoInstructions, - InstructionsV2 as ScryptoInstructionsV2, - IntentCoreV2 as ScryptoIntentCoreV2, - IntentHash as ScryptoIntentHash, - IntentHeaderV2 as ScryptoIntentHeaderV2, - IntentSignatureV1 as ScryptoIntentSignature, - IntentSignaturesV1 as ScryptoIntentSignatures, - IntentSignaturesV2 as ScryptoIntentSignaturesV2, - IntentV1 as ScryptoIntent, - IsTransactionHashWithStaticHrp as ScryptoIsTransactionHashWithStaticHrp, - MessageContentsV1 as ScryptoMessageContents, - MessageV1 as ScryptoMessage, MessageV2 as ScryptoMessageV2, - NonRootSubintentSignaturesV2 as ScryptoNonRootSubintentSignatures, - NonRootSubintentsV2 as ScryptoNonRootSubintents, - NotarizedTransactionV1 as ScryptoNotarizedTransaction, - NotarySignatureV1 as ScryptoNotarySignature, - PartialTransactionV2 as ScryptoPartialTransaction, - PlaintextMessageV1 as ScryptoPlaintextMessage, - SignedIntentV1 as ScryptoSignedIntent, - SignedPartialTransactionV2 as ScryptoSignedPartialTransaction, - SignedTransactionIntentHash as ScryptoSignedTransactionIntentHash, - SubintentHash as ScryptoSubintentHash, - SubintentV2 as ScryptoSubintent, - TransactionHashBech32Decoder as ScryptoTransactionHashBech32Decoder, - TransactionHashBech32Encoder as ScryptoTransactionHashBech32Encoder, - TransactionHeaderV1 as ScryptoTransactionHeader, - TransactionHeaderV2 as ScryptoTransactionHeaderV2, - TransactionIntentHash as ScryptoTransactionIntentHash, - }, - prelude::{ - SubintentManifestV2 as ScryptoSubintentManifestV2, - SubintentManifestV2Builder as ScryptoSubintentManifestV2Builder, - TransactionManifestV1 as ScryptoTransactionManifest, - TransactionManifestV1Builder as ScryptoTransactionManifestBuilder, - TransactionManifestV2 as ScryptoTransactionManifestV2, - TransactionManifestV2Builder as ScryptoTransactionManifestV2Builder, - }, - }; + #[cfg(test)] + pub(crate) use radix_common::math::Decimal as ScryptoDecimal192; pub use radix_engine_toolkit::{ functions::{ diff --git a/crates/sargon/src/needs_a_new_home_dumping_ground/diagnose_instance_duplicates.rs b/crates/sargon/src/needs_a_new_home_dumping_ground/diagnose_instance_duplicates.rs new file mode 100644 index 000000000..61cd3a8f7 --- /dev/null +++ b/crates/sargon/src/needs_a_new_home_dumping_ground/diagnose_instance_duplicates.rs @@ -0,0 +1,276 @@ +#[cfg(test)] +use crate::prelude::*; + +#[cfg(test)] +fn with_android_bug_with_shared_pubkey_between_account_and_persona() -> Profile +{ + let mwp = MnemonicWithPassphrase::sample_device(); + let mut sut = Profile::from_mnemonic_with_passphrase( + mwp.clone(), + HostId::sample(), + HostInfo::sample(), + ); + let seed = mwp.clone().to_seed(); + let fsid = FactorSourceIDFromHash::new_for_device(&mwp); + let path = AccountPath::sample(); + let public_key = seed + .derive_ed25519_private_key(path.clone().to_hd_path()) + .public_key(); + let hd_fi = HierarchicalDeterministicFactorInstance::new( + fsid, + HierarchicalDeterministicPublicKey::new(public_key.into(), path.into()), + ); + let veci = HDFactorInstanceAccountCreation::new(hd_fi.clone()).unwrap(); + let account = + Account::new(veci, DisplayName::sample(), AppearanceID::sample()); + let mut persona = Persona::sample(); + persona.address = + IdentityAddress::new(public_key.into(), NetworkID::Mainnet); + persona.security_state = EntitySecurityState::Unsecured { + value: UnsecuredEntityControl::new(hd_fi, None).unwrap(), + }; + assert_eq!( + account.unique_tx_signing_factor_instances(), + persona.unique_tx_signing_factor_instances() + ); + sut.networks = ProfileNetworks::just(ProfileNetwork::new( + NetworkID::Mainnet, + Accounts::just(account), + Personas::just(persona), + AuthorizedDapps::default(), + ResourcePreferences::default(), + )); + sut +} + +#[cfg(test)] +fn with_instance_collision_both_accounts() -> Profile { + let mwp = MnemonicWithPassphrase::sample_device(); + let mut sut = Profile::from_mnemonic_with_passphrase( + mwp.clone(), + HostId::sample(), + HostInfo::sample(), + ); + let seed = mwp.clone().to_seed(); + let fsid = FactorSourceIDFromHash::new_for_device(&mwp); + let path = AccountPath::sample(); + let public_key = seed + .derive_ed25519_private_key(path.clone().to_hd_path()) + .public_key(); + let hd_fi = HierarchicalDeterministicFactorInstance::new( + fsid, + HierarchicalDeterministicPublicKey::new(public_key.into(), path.into()), + ); + let veci = HDFactorInstanceAccountCreation::new(hd_fi.clone()).unwrap(); + let account = + Account::new(veci, DisplayName::sample(), AppearanceID::sample()); + + let mut account2 = Account::sample_other(); + account2.security_state = EntitySecurityState::Unsecured { + value: UnsecuredEntityControl::new(hd_fi, None).unwrap(), + }; + + assert_eq!( + account.unique_tx_signing_factor_instances(), + account2.unique_tx_signing_factor_instances() + ); + sut.networks = ProfileNetworks::just(ProfileNetwork::new( + NetworkID::Mainnet, + Accounts::from_iter([account, account2]), + Personas::default(), + AuthorizedDapps::default(), + ResourcePreferences::default(), + )); + sut +} + +#[cfg(test)] +fn with_instance_collision_securified() -> Profile { + let mwp = MnemonicWithPassphrase::sample_device(); + let mut sut = Profile::from_mnemonic_with_passphrase( + mwp.clone(), + HostId::sample(), + HostInfo::sample(), + ); + let mut account1 = Account::sample(); + let mut account2 = Account::sample_other(); + account1.security_state = EntitySecurityState::Securified { + value: SecuredEntityControl::sample(), + }; + account2.security_state = EntitySecurityState::Securified { + value: SecuredEntityControl::sample(), + }; + + sut.networks = ProfileNetworks::just(ProfileNetwork::new( + NetworkID::Mainnet, + Accounts::from_iter([account1, account2]), + Personas::default(), + AuthorizedDapps::default(), + ResourcePreferences::default(), + )); + sut +} + +#[cfg(test)] +fn with_instance_collision_both_personas() -> Profile { + let mwp = MnemonicWithPassphrase::sample_device(); + let mut sut = Profile::from_mnemonic_with_passphrase( + mwp.clone(), + HostId::sample(), + HostInfo::sample(), + ); + let seed = mwp.clone().to_seed(); + let fsid = FactorSourceIDFromHash::new_for_device(&mwp); + let path = IdentityPath::sample(); + let public_key = seed + .derive_ed25519_private_key(path.clone().to_hd_path()) + .public_key(); + let hd_fi = HierarchicalDeterministicFactorInstance::new( + fsid, + HierarchicalDeterministicPublicKey::new(public_key.into(), path.into()), + ); + let mut persona1 = Persona::sample(); + persona1.address = + IdentityAddress::new(public_key.into(), NetworkID::Mainnet); + persona1.security_state = EntitySecurityState::Unsecured { + value: UnsecuredEntityControl::new(hd_fi.clone(), None).unwrap(), + }; + + let mut persona2 = Persona::sample_other(); + persona2.security_state = EntitySecurityState::Unsecured { + value: UnsecuredEntityControl::new(hd_fi, None).unwrap(), + }; + + assert_eq!( + persona1.unique_tx_signing_factor_instances(), + persona2.unique_tx_signing_factor_instances() + ); + sut.networks = ProfileNetworks::just(ProfileNetwork::new( + NetworkID::Mainnet, + Accounts::default(), + Personas::from_iter([persona1, persona2]), + AuthorizedDapps::default(), + ResourcePreferences::default(), + )); + sut +} + +#[cfg(test)] +mod tests { + use super::*; + + #[allow(clippy::upper_case_acronyms)] + type SUT = Profile; + + #[test] + fn unfortunate_android_bug_detection() { + let sut = + with_android_bug_with_shared_pubkey_between_account_and_persona(); + + #[derive(Debug)] + struct NotAndroidLog; + impl LoggingDriver for NotAndroidLog { + fn log(&self, level: LogLevel, msg: String) { + assert_eq!(level, LogLevel::Error); + assert!(msg.contains("Duplicated FactorInstances found")); + } + } + install_logger(Arc::new(NotAndroidLog)); + let accounts = sut.accounts_on_current_network().unwrap(); + let acc = accounts.first().unwrap(); + let factor_instance = acc + .unique_tx_signing_factor_instances() + .into_iter() + .next() + .clone() + .unwrap(); + let duplicate_instances = DuplicateInstances { + entity1: acc.clone().into(), + entity2: sut + .personas_on_current_network() + .unwrap() + .first() + .unwrap() + .clone() + .into(), + factor_instance, + }; + + let mut detected = Option::::None; + + sut.diagnostics_for_factor_instances_valid_with_handler(|d| { + detected = Some(d) + }); + + pretty_assertions::assert_eq!(detected.unwrap(), duplicate_instances); + } + + #[test] + fn instance_detection_both_accounts() { + let sut = with_instance_collision_both_accounts(); + let accounts = sut.accounts_on_current_network().unwrap(); + let acc1 = accounts.clone().first().unwrap().clone(); + let acc2 = accounts.items().into_iter().next_back().unwrap(); + + instance_detection(sut, acc1, acc2) + } + + #[test] + fn instance_detection_securified() { + let sut = with_instance_collision_securified(); + let accounts = sut.accounts_on_current_network().unwrap(); + let acc1 = accounts.clone().first().unwrap().clone(); + let acc2 = accounts.items().into_iter().next_back().unwrap(); + + instance_detection(sut, acc1, acc2) + } + + #[test] + fn instance_detection_both_personas() { + let sut = with_instance_collision_both_personas(); + let personas = sut.personas_on_current_network().unwrap(); + let p1 = personas.clone().first().unwrap().clone(); + let p2 = personas.items().into_iter().next_back().unwrap(); + + instance_detection(sut, p1, p2) + } + + fn instance_detection( + sut: SUT, + e1: impl Into, + e2: impl Into, + ) { + #[derive(Debug)] + struct NotAndroidLog; + impl LoggingDriver for NotAndroidLog { + fn log(&self, level: LogLevel, msg: String) { + assert_eq!(level, LogLevel::Error); + assert!(msg.contains("Duplicated FactorInstances found")); + assert!(!msg.contains("due to Android bug")); + } + } + install_logger(Arc::new(NotAndroidLog)); + + let e1 = e1.into(); + let factor_instance = e1 + .unique_tx_signing_factor_instances() + .into_iter() + .next() + .clone() + .unwrap(); + + let duplicate_instances = DuplicateInstances { + entity1: e1, + entity2: e2.into(), + factor_instance, + }; + + let mut detected = Option::::None; + + sut.diagnostics_for_factor_instances_valid_with_handler(|d| { + detected = Some(d) + }); + + pretty_assertions::assert_eq!(detected.unwrap(), duplicate_instances); + } +} diff --git a/crates/sargon/src/needs_a_new_home_dumping_ground/mod.rs b/crates/sargon/src/needs_a_new_home_dumping_ground/mod.rs new file mode 100644 index 000000000..23196acfc --- /dev/null +++ b/crates/sargon/src/needs_a_new_home_dumping_ground/mod.rs @@ -0,0 +1 @@ +mod diagnose_instance_duplicates; diff --git a/crates/sargon/src/profile/logic/account/create_account.rs b/crates/sargon/src/profile/logic/account/create_account.rs deleted file mode 100644 index 5b49285eb..000000000 --- a/crates/sargon/src/profile/logic/account/create_account.rs +++ /dev/null @@ -1,179 +0,0 @@ -use crate::prelude::*; -use std::{future::Future, pin::Pin}; - -impl Profile { - pub async fn create_unsaved_account_with_factor_source_with_derivation_outcome( - &self, - factor_source: FactorSource, - network_id: NetworkID, - name: DisplayName, - factor_instances_cache_client: Arc, - key_derivation_interactor: Arc, - ) -> Result<( - FactorSourceID, - Account, - InstancesInCacheConsumer, - FactorInstancesProviderOutcomeForFactor, - )> { - let ( - factor_source_id, - accounts, - instances_in_cache_consumer, - derivation_outcome, - ) = self - .create_unsaved_accounts_with_factor_source_with_derivation_outcome( - factor_source, - network_id, - 1, - factor_instances_cache_client, - key_derivation_interactor, - |_| name, - ) - .await?; - - let account = accounts - .into_iter() - .last() - .expect("Should have created one account"); - - Ok(( - factor_source_id, - account, - instances_in_cache_consumer, - derivation_outcome, - )) - } - - pub async fn create_unsaved_accounts_with_factor_source( - &self, - factor_source: FactorSource, - network_id: NetworkID, - count: u16, - factor_instances_cache_client: Arc, - key_derivation_interactor: Arc, - get_name: impl Fn(u32) -> DisplayName, // name of account at index - ) -> Result<(FactorSourceID, Accounts, InstancesInCacheConsumer)> { - self.create_unsaved_accounts_with_factor_source_with_derivation_outcome( - factor_source, - network_id, - count, - factor_instances_cache_client, - key_derivation_interactor, - get_name, - ) - .await - .map(|(x, y, z, _)| (x, y, z)) - } - - pub async fn create_unsaved_accounts_with_factor_source_with_derivation_outcome( - &self, - factor_source: FactorSource, - network_id: NetworkID, - count: u16, - factor_instances_cache_client: Arc, - key_derivation_interactor: Arc, - get_name: impl Fn(u32) -> DisplayName, // name of account at index - ) -> Result<( - FactorSourceID, - Accounts, - InstancesInCacheConsumer, - FactorInstancesProviderOutcomeForFactor, - )> { - let number_of_accounts_on_network = self - .networks - .get_id(network_id) - .map(|n| n.accounts.len()) - .unwrap_or(0); - - let (factor_source_id, accounts, instances_in_cache_consumer, derivation_outcome) = self - .create_unsaved_entities_with_factor_source_with_derivation_outcome::( - factor_source, - network_id, - count, - factor_instances_cache_client, - key_derivation_interactor, - get_name, - ) - .await?; - - let accounts_with_appearance_ids_set = accounts - .into_iter() - .enumerate() - .map(|(offset, account)| { - let mut account = account; - let appearance_id = - AppearanceID::from_number_of_accounts_on_network( - number_of_accounts_on_network + offset, - ); - account.appearance_id = appearance_id; - account - }) - .collect::(); - - Ok(( - factor_source_id, - accounts_with_appearance_ids_set, - instances_in_cache_consumer, - derivation_outcome, - )) - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[actix_rt::test] - async fn test_create_unsaved_accounts() { - let fs = PrivateHierarchicalDeterministicFactorSource::sample(); - let sut = Profile::from_device_factor_source( - fs.factor_source.clone(), - HostId::sample(), - HostInfo::sample(), - None::, - ); - - let cache_client = Arc::new(FactorInstancesCacheClient::in_memory()); - let (secure_storage_client, _) = SecureStorageClient::ephemeral(); - secure_storage_client - .save_private_hd_factor_source(&fs) - .await - .unwrap(); - let secure_storage_client = Arc::new(secure_storage_client); - let interactors = Arc::new(TestDerivationInteractor::new( - false, - secure_storage_client.clone(), - )); - - let (_, accounts, consumer) = sut - .create_unsaved_accounts_with_factor_source( - fs.factor_source.clone().into(), - NetworkID::Mainnet, - 3, - cache_client, - interactors, - |i| { - DisplayName::new(if i == 0 { - "Alice" - } else if i == 1 { - "Bob" - } else { - "Carol" - }) - .unwrap() - }, - ) - .await - .unwrap(); - consumer.consume().await.unwrap(); - - pretty_assertions::assert_eq!( - accounts, - Accounts::from_iter([ - Account::sample_mainnet_alice(), - Account::sample_mainnet_bob(), - Account::sample_mainnet_carol() - ]) - ) - } -} diff --git a/crates/sargon/src/profile/logic/create_entity.rs b/crates/sargon/src/profile/logic/create_entity.rs deleted file mode 100644 index 25838fc9f..000000000 --- a/crates/sargon/src/profile/logic/create_entity.rs +++ /dev/null @@ -1,81 +0,0 @@ -use crate::prelude::*; - -impl Profile { - /// Creates `count` many new virtual entities of type `E` on `network_id` with `factor_source` as the factor source. - /// Setting the names according to `get_name`, loading pre-derived FactorInstances from the - /// FactorInstancesCache if possible, else derives more using the FactorInstancesProvider. - /// - /// Returns the FactorSourceID, the entities, the InstancesInCacheConsumer, and the FactorInstancesProviderOutcomeForFactor. - /// - /// The `FactorInstancesProviderOutcomeForFactor` is primarily useful for testing. - /// - /// The `InstancesInCacheConsumer` SHOULD be called by the caller, once you know it - /// is safe to delete the instances from the cache - e.g. after having saved the new - /// entities into the Profile and persisted it into SecureStorage. - pub async fn create_unsaved_entities_with_factor_source_with_derivation_outcome< - E: IsEntity + Identifiable, - >( - &self, - factor_source: FactorSource, - network_id: NetworkID, - count: u16, - factor_instances_cache_client: Arc, - key_derivation_interactor: Arc, - get_name: impl Fn(u32) -> DisplayName, // name of entity at index - ) -> Result<( - FactorSourceID, - IdentifiedVecOf, - InstancesInCacheConsumer, - FactorInstancesProviderOutcomeForFactor, - )> { - let count = count as usize; - - let fsid = factor_source.factor_source_id(); - let entity_kind = E::entity_kind(); - - let (instances_in_cache_consumer, outcome) = - VirtualEntityCreatingInstanceProvider::for_many_entity_vecis( - count, - entity_kind, - factor_instances_cache_client, - Arc::new(self.clone()), - factor_source.clone(), - network_id, - key_derivation_interactor, - ) - .await?; - - let outcome = outcome - .per_derivation_preset - .get(&DerivationPreset::veci_entity_kind(entity_kind)) - .unwrap() - .per_factor - .get(&factor_source.id_from_hash()) - .cloned() - .unwrap(); - - let instances_to_use_directly = outcome.clone().to_use_directly; - - assert_eq!(instances_to_use_directly.len(), count); - - let entities = instances_to_use_directly - .into_iter() - .map(|f| { - HDFactorInstanceTransactionSigning::::new(f).unwrap() - }) - .map(|veci| { - let idx = u32::from( - veci.path - .derivation_path() - .index() - .index_in_local_key_space(), - ); - let name = get_name(idx); - - E::with_veci_and_name(veci, name) - }) - .collect::>(); - - Ok((fsid, entities, instances_in_cache_consumer, outcome)) - } -} diff --git a/crates/sargon/src/profile/logic/persona/create_persona.rs b/crates/sargon/src/profile/logic/persona/create_persona.rs deleted file mode 100644 index c5fac1585..000000000 --- a/crates/sargon/src/profile/logic/persona/create_persona.rs +++ /dev/null @@ -1,70 +0,0 @@ -use crate::prelude::*; - -impl Profile { - pub async fn create_unsaved_persona_with_factor_source_with_derivation_outcome( - &self, - factor_source: FactorSource, - network_id: NetworkID, - name: DisplayName, - factor_instances_cache_client: Arc, - key_derivation_interactor: Arc, - ) -> Result<( - FactorSourceID, - Persona, - InstancesInCacheConsumer, - FactorInstancesProviderOutcomeForFactor, - )> { - let ( - factor_source_id, - personas, - instances_in_cache_consumer, - derivation_outcome, - ) = self - .create_unsaved_personas_with_factor_source_with_derivation_outcome( - factor_source, - network_id, - 1, - factor_instances_cache_client, - key_derivation_interactor, - |_| name, - ) - .await?; - - let persona = personas - .into_iter() - .last() - .expect("Should have created one persona"); - - Ok(( - factor_source_id, - persona, - instances_in_cache_consumer, - derivation_outcome, - )) - } - - pub async fn create_unsaved_personas_with_factor_source_with_derivation_outcome( - &self, - factor_source: FactorSource, - network_id: NetworkID, - count: u16, - factor_instances_cache_client: Arc, - key_derivation_interactor: Arc, - get_name: impl Fn(u32) -> DisplayName, // name of persona at index - ) -> Result<( - FactorSourceID, - Personas, - InstancesInCacheConsumer, - FactorInstancesProviderOutcomeForFactor, - )> { - self.create_unsaved_entities_with_factor_source_with_derivation_outcome::( - factor_source, - network_id, - count, - factor_instances_cache_client, - key_derivation_interactor, - get_name, - ) - .await.map(|(a, b, c, d)| (a, b.into_iter().collect(), c, d)) - } -} diff --git a/crates/sargon/src/profile/logic/profile_networks.rs b/crates/sargon/src/profile/logic/profile_networks.rs deleted file mode 100644 index 85aedbabf..000000000 --- a/crates/sargon/src/profile/logic/profile_networks.rs +++ /dev/null @@ -1,43 +0,0 @@ -use crate::prelude::*; - -impl Profile { - /// If the user has **any** accounts on any network at all, including hidden - /// accounts. This can be used by host devices to prompt user to create their - /// first account or not, e.g. if user starts app after fresh install, the - /// SargonOS will create an "empty" Profile and BDFS and save it, before user - /// has had the chance to create their first account. If the user force quits - /// the app and then restart it, the app can still prompt user to create their - /// first account - as if no force-restart happened. - pub fn has_any_account_on_any_network(&self) -> bool { - self.networks.iter().any(|n| !n.accounts.is_empty()) - } - pub fn contains_entity_by_address( - &self, - entity_address: &AddressOfAccountOrPersona, - ) -> bool { - self.networks.iter().any(|n: ProfileNetwork| { - n.contains_entity_by_address(entity_address) - }) - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[allow(clippy::upper_case_acronyms)] - type SUT = Profile; - - #[test] - fn test_empty_profile_has_any_account_on_any_network_is_false() { - let sut = - SUT::new(Mnemonic::sample(), HostId::sample(), HostInfo::sample()); - assert!(!sut.has_any_account_on_any_network()); - } - - #[test] - fn test_sample_profile_has_any_account_on_any_network() { - assert!(SUT::sample().has_any_account_on_any_network()); - assert!(SUT::sample_other().has_any_account_on_any_network()); - } -} diff --git a/crates/sargon/src/profile/mfa/mod.rs b/crates/sargon/src/profile/mfa/mod.rs deleted file mode 100644 index b39fbbfa8..000000000 --- a/crates/sargon/src/profile/mfa/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -mod secured_entity_control; -mod security_structures; - -pub use secured_entity_control::*; -pub use security_structures::*; diff --git a/crates/sargon/src/profile/mod.rs b/crates/sargon/src/profile/mod.rs deleted file mode 100644 index eea91d699..000000000 --- a/crates/sargon/src/profile/mod.rs +++ /dev/null @@ -1,13 +0,0 @@ -mod encrypted; -mod logic; -mod mfa; -mod profilesnapshot_version; -mod supporting_types; -mod v100; - -pub use encrypted::*; -pub use logic::*; -pub use mfa::*; -pub use profilesnapshot_version::*; -pub use supporting_types::*; -pub use v100::*; diff --git a/crates/sargon/src/profile/v100/app_preferences/gateways/mod.rs b/crates/sargon/src/profile/v100/app_preferences/gateways/mod.rs deleted file mode 100644 index 6eb8be907..000000000 --- a/crates/sargon/src/profile/v100/app_preferences/gateways/mod.rs +++ /dev/null @@ -1,7 +0,0 @@ -mod gateway; -mod network_definition; -mod saved_gateways; - -pub use gateway::*; -pub use network_definition::*; -pub use saved_gateways::*; diff --git a/crates/sargon/src/profile/v100/app_preferences/mod.rs b/crates/sargon/src/profile/v100/app_preferences/mod.rs deleted file mode 100644 index 233c4b05c..000000000 --- a/crates/sargon/src/profile/v100/app_preferences/mod.rs +++ /dev/null @@ -1,11 +0,0 @@ -mod app_display_settings; -mod app_preferences; -mod gateways; -mod security; -mod transaction_preferences; - -pub use app_display_settings::*; -pub use app_preferences::*; -pub use gateways::*; -pub use security::*; -pub use transaction_preferences::*; diff --git a/crates/sargon/src/profile/v100/profile_legacy_state_bugs.rs b/crates/sargon/src/profile/v100/profile_legacy_state_bugs.rs deleted file mode 100644 index ea3fa8367..000000000 --- a/crates/sargon/src/profile/v100/profile_legacy_state_bugs.rs +++ /dev/null @@ -1,309 +0,0 @@ -use crate::prelude::*; - -impl Profile { - // TODO: Sometimes later it would be nice to remove this method - // and only use `diagnostics_for_factor_instances_valid_with_handler` and then - // send a handler from SargonOS which has access to some new driver which - // can use Swift Issue Reporting API: - // https://github.com/pointfreeco/swift-issue-reporting - // which will cause execution to halt with a runtime issue, which will be great - // for debugging and finding issues! - // Maybe android host can raise an exception..? - pub(crate) fn diagnostics_for_factor_instances_valid(&self) { - self.diagnostics_for_factor_instances_valid_with_handler(|_| {}); - } - - pub(crate) fn diagnostics_for_factor_instances_valid_with_handler( - &self, - mut on_duplicate: impl FnMut(DuplicateInstances), - ) { - let Some(duplicate_instances) = self.check_for_duplicated_instances() - else { - return; - }; - - error!("Duplicated FactorInstances found {:?}", duplicate_instances); - on_duplicate(duplicate_instances); - } -} - -#[cfg(test)] -impl Profile { - fn with_android_bug_with_shared_pubkey_between_account_and_persona() -> Self - { - let mwp = MnemonicWithPassphrase::sample_device(); - let mut sut = Profile::from_mnemonic_with_passphrase( - mwp.clone(), - HostId::sample(), - HostInfo::sample(), - ); - let seed = mwp.clone().to_seed(); - let fsid = FactorSourceIDFromHash::new_for_device(&mwp); - let path = AccountPath::sample(); - let public_key = seed - .derive_ed25519_private_key(path.clone().to_hd_path()) - .public_key(); - let hd_fi = HierarchicalDeterministicFactorInstance::new( - fsid, - HierarchicalDeterministicPublicKey::new( - public_key.into(), - path.into(), - ), - ); - let veci = HDFactorInstanceAccountCreation::new(hd_fi.clone()).unwrap(); - let account = - Account::new(veci, DisplayName::sample(), AppearanceID::sample()); - let mut persona = Persona::sample(); - persona.address = - IdentityAddress::new(public_key.into(), NetworkID::Mainnet); - persona.security_state = EntitySecurityState::Unsecured { - value: UnsecuredEntityControl::new(hd_fi, None).unwrap(), - }; - assert_eq!( - account.unique_tx_signing_factor_instances(), - persona.unique_tx_signing_factor_instances() - ); - sut.networks = ProfileNetworks::just(ProfileNetwork::new( - NetworkID::Mainnet, - Accounts::just(account), - Personas::just(persona), - AuthorizedDapps::default(), - ResourcePreferences::default(), - )); - sut - } - - fn with_instance_collision_both_accounts() -> Self { - let mwp = MnemonicWithPassphrase::sample_device(); - let mut sut = Profile::from_mnemonic_with_passphrase( - mwp.clone(), - HostId::sample(), - HostInfo::sample(), - ); - let seed = mwp.clone().to_seed(); - let fsid = FactorSourceIDFromHash::new_for_device(&mwp); - let path = AccountPath::sample(); - let public_key = seed - .derive_ed25519_private_key(path.clone().to_hd_path()) - .public_key(); - let hd_fi = HierarchicalDeterministicFactorInstance::new( - fsid, - HierarchicalDeterministicPublicKey::new( - public_key.into(), - path.into(), - ), - ); - let veci = HDFactorInstanceAccountCreation::new(hd_fi.clone()).unwrap(); - let account = - Account::new(veci, DisplayName::sample(), AppearanceID::sample()); - - let mut account2 = Account::sample_other(); - account2.security_state = EntitySecurityState::Unsecured { - value: UnsecuredEntityControl::new(hd_fi, None).unwrap(), - }; - - assert_eq!( - account.unique_tx_signing_factor_instances(), - account2.unique_tx_signing_factor_instances() - ); - sut.networks = ProfileNetworks::just(ProfileNetwork::new( - NetworkID::Mainnet, - Accounts::from_iter([account, account2]), - Personas::default(), - AuthorizedDapps::default(), - ResourcePreferences::default(), - )); - sut - } - - fn with_instance_collision_securified() -> Self { - let mwp = MnemonicWithPassphrase::sample_device(); - let mut sut = Profile::from_mnemonic_with_passphrase( - mwp.clone(), - HostId::sample(), - HostInfo::sample(), - ); - let mut account1 = Account::sample(); - let mut account2 = Account::sample_other(); - account1.security_state = EntitySecurityState::Securified { - value: SecuredEntityControl::sample(), - }; - account2.security_state = EntitySecurityState::Securified { - value: SecuredEntityControl::sample(), - }; - - sut.networks = ProfileNetworks::just(ProfileNetwork::new( - NetworkID::Mainnet, - Accounts::from_iter([account1, account2]), - Personas::default(), - AuthorizedDapps::default(), - ResourcePreferences::default(), - )); - sut - } - - fn with_instance_collision_both_personas() -> Self { - let mwp = MnemonicWithPassphrase::sample_device(); - let mut sut = Profile::from_mnemonic_with_passphrase( - mwp.clone(), - HostId::sample(), - HostInfo::sample(), - ); - let seed = mwp.clone().to_seed(); - let fsid = FactorSourceIDFromHash::new_for_device(&mwp); - let path = IdentityPath::sample(); - let public_key = seed - .derive_ed25519_private_key(path.clone().to_hd_path()) - .public_key(); - let hd_fi = HierarchicalDeterministicFactorInstance::new( - fsid, - HierarchicalDeterministicPublicKey::new( - public_key.into(), - path.into(), - ), - ); - let mut persona1 = Persona::sample(); - persona1.address = - IdentityAddress::new(public_key.into(), NetworkID::Mainnet); - persona1.security_state = EntitySecurityState::Unsecured { - value: UnsecuredEntityControl::new(hd_fi.clone(), None).unwrap(), - }; - - let mut persona2 = Persona::sample_other(); - persona2.security_state = EntitySecurityState::Unsecured { - value: UnsecuredEntityControl::new(hd_fi, None).unwrap(), - }; - - assert_eq!( - persona1.unique_tx_signing_factor_instances(), - persona2.unique_tx_signing_factor_instances() - ); - sut.networks = ProfileNetworks::just(ProfileNetwork::new( - NetworkID::Mainnet, - Accounts::default(), - Personas::from_iter([persona1, persona2]), - AuthorizedDapps::default(), - ResourcePreferences::default(), - )); - sut - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[allow(clippy::upper_case_acronyms)] - type SUT = Profile; - - #[test] - fn unfortunate_android_bug_detection() { - let sut = SUT::with_android_bug_with_shared_pubkey_between_account_and_persona(); - - #[derive(Debug)] - struct NotAndroidLog; - impl LoggingDriver for NotAndroidLog { - fn log(&self, level: LogLevel, msg: String) { - assert_eq!(level, LogLevel::Error); - assert!(msg.contains("Duplicated FactorInstances found")); - } - } - install_logger(Arc::new(NotAndroidLog)); - let accounts = sut.accounts_on_current_network().unwrap(); - let acc = accounts.first().unwrap(); - let factor_instance = acc - .unique_tx_signing_factor_instances() - .into_iter() - .next() - .clone() - .unwrap(); - let duplicate_instances = DuplicateInstances { - entity1: acc.clone().into(), - entity2: sut - .personas_on_current_network() - .unwrap() - .first() - .unwrap() - .clone() - .into(), - factor_instance, - }; - - let mut detected = Option::::None; - - sut.diagnostics_for_factor_instances_valid_with_handler(|d| { - detected = Some(d) - }); - - pretty_assertions::assert_eq!(detected.unwrap(), duplicate_instances); - } - - #[test] - fn instance_detection_both_accounts() { - let sut = SUT::with_instance_collision_both_accounts(); - let accounts = sut.accounts_on_current_network().unwrap(); - let acc1 = accounts.clone().first().unwrap().clone(); - let acc2 = accounts.items().into_iter().next_back().unwrap(); - - instance_detection(sut, acc1, acc2) - } - - #[test] - fn instance_detection_securified() { - let sut = SUT::with_instance_collision_securified(); - let accounts = sut.accounts_on_current_network().unwrap(); - let acc1 = accounts.clone().first().unwrap().clone(); - let acc2 = accounts.items().into_iter().next_back().unwrap(); - - instance_detection(sut, acc1, acc2) - } - - #[test] - fn instance_detection_both_personas() { - let sut = SUT::with_instance_collision_both_personas(); - let personas = sut.personas_on_current_network().unwrap(); - let p1 = personas.clone().first().unwrap().clone(); - let p2 = personas.items().into_iter().next_back().unwrap(); - - instance_detection(sut, p1, p2) - } - - fn instance_detection( - sut: SUT, - e1: impl Into, - e2: impl Into, - ) { - #[derive(Debug)] - struct NotAndroidLog; - impl LoggingDriver for NotAndroidLog { - fn log(&self, level: LogLevel, msg: String) { - assert_eq!(level, LogLevel::Error); - assert!(msg.contains("Duplicated FactorInstances found")); - assert!(!msg.contains("due to Android bug")); - } - } - install_logger(Arc::new(NotAndroidLog)); - - let e1 = e1.into(); - let factor_instance = e1 - .unique_tx_signing_factor_instances() - .into_iter() - .next() - .clone() - .unwrap(); - - let duplicate_instances = DuplicateInstances { - entity1: e1, - entity2: e2.into(), - factor_instance, - }; - - let mut detected = Option::::None; - - sut.diagnostics_for_factor_instances_valid_with_handler(|d| { - detected = Some(d) - }); - - pretty_assertions::assert_eq!(detected.unwrap(), duplicate_instances); - } -} diff --git a/crates/sargon/src/radix_connect/mobile/client.rs b/crates/sargon/src/radix_connect/mobile/client.rs index 2ecc3241f..794135cc2 100644 --- a/crates/sargon/src/radix_connect/mobile/client.rs +++ b/crates/sargon/src/radix_connect/mobile/client.rs @@ -1,10 +1,7 @@ -use std::borrow::BorrowMut; - use super::deep_link_parsing::*; use super::relay_service::Service as RelayService; use super::relay_service::WalletInteractionTransport; use crate::prelude::*; -use hex::ToHex; use std::sync::RwLock; /// The Radix Connect Mobile client that handles the interaction with dApps on mobile through deepLinks. diff --git a/crates/sargon/src/radix_connect/mobile/deep_link_parsing/parser.rs b/crates/sargon/src/radix_connect/mobile/deep_link_parsing/parser.rs index 9d489ac00..3febd6168 100644 --- a/crates/sargon/src/radix_connect/mobile/deep_link_parsing/parser.rs +++ b/crates/sargon/src/radix_connect/mobile/deep_link_parsing/parser.rs @@ -1,14 +1,7 @@ use super::request::RadixConnectMobileDappRequest; use crate::prelude::*; -use base64::engine::general_purpose::URL_SAFE; -use base64::engine::general_purpose::URL_SAFE_NO_PAD; -use base64::Engine; -use crypto::signatures::ed25519::Signature; -use sargon_core::parse_url; -use url::form_urlencoded; -use url::Url; -use super::*; +use sargon_core::parse_url; const CONNECT_URL_PARAM_SESSION_ID: &str = "sessionId"; const CONNECT_URL_PARAM_ORIGIN: &str = "origin"; @@ -19,6 +12,9 @@ const CONNECT_URL_PARAM_IDENTITY_KEY: &str = "identity"; const CONNECT_URL_PARAM_DAPP_DEFINITION_ADDRESS: &str = "dAppDefinitionAddress"; const APP_SCHEME: &str = "radixwallet"; +use base64::engine::general_purpose::URL_SAFE_NO_PAD; +use base64::engine::Engine as _; + pub fn parse_mobile_connect_request( url: impl AsRef, ) -> Result { @@ -216,8 +212,6 @@ impl SampleRequestParams { #[cfg(test)] mod tests { - use hex::ToHex; - use rand::random; use sargon_core::parse_url; use super::*; @@ -246,6 +240,8 @@ mod tests { pretty_assertions::assert_eq!(APP_SCHEME, "radixwallet"); } + use base64::engine::general_purpose::URL_SAFE_NO_PAD; + #[test] fn parse_url_into_request() { let request_params = SampleRequestParams::new_from_text_vector(); diff --git a/crates/sargon/src/radix_connect/mobile/deep_link_parsing/request.rs b/crates/sargon/src/radix_connect/mobile/deep_link_parsing/request.rs index 3ad43786e..3fc4a9e3a 100644 --- a/crates/sargon/src/radix_connect/mobile/deep_link_parsing/request.rs +++ b/crates/sargon/src/radix_connect/mobile/deep_link_parsing/request.rs @@ -1,5 +1,3 @@ -use crypto::signatures::ed25519::Signature; - use super::super::session::session_id::SessionID; use crate::prelude::*; use hex::ToHex; diff --git a/crates/sargon/src/radix_connect/mobile/relay_service/service.rs b/crates/sargon/src/radix_connect/mobile/relay_service/service.rs index 00817560a..a472eab16 100644 --- a/crates/sargon/src/radix_connect/mobile/relay_service/service.rs +++ b/crates/sargon/src/radix_connect/mobile/relay_service/service.rs @@ -1,5 +1,3 @@ -use hex::ToHex; - use super::super::session::*; use super::success_response::SuccessResponse; use crate::prelude::*; @@ -38,18 +36,21 @@ impl Service { const SERVICE_PATH: &str = "https://radix-connect-relay.radixdlt.com/api/v1"; -impl NetworkRequest { - fn radix_connect_relay_request() -> Self { - NetworkRequest::new_post(Url::from_str(SERVICE_PATH).unwrap()) - } - +pub trait NetworkRequestsForRadixConnect { + fn radix_connect_relay_request() -> NetworkRequest; fn radix_connect_success_response( response: SuccessResponse, - ) -> Result { + ) -> Result { Self::radix_connect_relay_request().with_serializing_body(response) } } +impl NetworkRequestsForRadixConnect for NetworkRequest { + fn radix_connect_relay_request() -> Self { + NetworkRequest::new_post(Url::from_str(SERVICE_PATH).unwrap()) + } +} + #[async_trait::async_trait] impl WalletInteractionTransport for Service { async fn send_wallet_interaction_response( @@ -97,7 +98,6 @@ impl Service { mod tests { use super::*; use actix_rt::time::timeout; - use hex::ToHex; use std::time::Duration; const MAX: Duration = Duration::from_millis(10); diff --git a/crates/sargon/src/radix_connect/mobile/session/session.rs b/crates/sargon/src/radix_connect/mobile/session/session.rs index 2dfcc5886..9fe198c15 100644 --- a/crates/sargon/src/radix_connect/mobile/session/session.rs +++ b/crates/sargon/src/radix_connect/mobile/session/session.rs @@ -104,7 +104,6 @@ impl HasSampleValues for Session { #[cfg(test)] mod tests { - use hex::ToHex; use super::*; diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/mod.rs b/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/mod.rs index cabbf5292..653d08017 100644 --- a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/mod.rs +++ b/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/mod.rs @@ -1,5 +1,3 @@ mod transaction; -mod unvalidated_transaction_manifest; pub use transaction::*; -pub use unvalidated_transaction_manifest::*; diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/pre_authorization.rs b/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/pre_authorization.rs index 8102a6a5c..1c621465f 100644 --- a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/pre_authorization.rs +++ b/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/pre_authorization.rs @@ -1,5 +1,4 @@ use crate::prelude::*; -use radix_transactions::model::TransactionPayload; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] pub struct WalletToDappInteractionPreAuthorizationResponseItems { diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/subintent_response.rs b/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/subintent_response.rs index 867f41958..dea59a5f9 100644 --- a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/subintent_response.rs +++ b/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/subintent_response.rs @@ -1,5 +1,4 @@ use crate::prelude::*; -use std::time::Duration; #[derive(Debug, Clone, PartialEq)] pub struct WalletToDappInteractionSubintentResponseItem { @@ -70,7 +69,6 @@ impl Serialize for WalletToDappInteractionSubintentResponseItem { } impl<'de> Deserialize<'de> for WalletToDappInteractionSubintentResponseItem { - #[cfg(not(tarpaulin_include))] // false negative fn deserialize>( deserializer: D, ) -> Result { diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/transaction.rs b/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/transaction.rs index c5b51f33e..d072bfd2c 100644 --- a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/transaction.rs +++ b/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/transaction.rs @@ -21,7 +21,6 @@ pub struct WalletToDappInteractionSendTransactionResponseItem { } impl Serialize for WalletToDappInteractionSendTransactionResponseItem { - #[cfg(not(tarpaulin_include))] // false negative fn serialize(&self, serializer: S) -> Result where S: Serializer, @@ -41,7 +40,6 @@ impl Serialize for WalletToDappInteractionSendTransactionResponseItem { impl<'de> Deserialize<'de> for WalletToDappInteractionSendTransactionResponseItem { - #[cfg(not(tarpaulin_include))] // false negative fn deserialize>( deserializer: D, ) -> Result { diff --git a/crates/sargon/src/radix_connect/well_known_client/client.rs b/crates/sargon/src/radix_connect/well_known_client/client.rs index 3f13ff16b..f257886a8 100644 --- a/crates/sargon/src/radix_connect/well_known_client/client.rs +++ b/crates/sargon/src/radix_connect/well_known_client/client.rs @@ -21,10 +21,14 @@ impl WellKnownClient { } } -impl NetworkRequest { - fn get_well_known(url: Url) -> Self { +pub trait NetworkRequestWellKnownFile { + fn get_well_known(url: Url) -> NetworkRequest; +} + +impl NetworkRequestWellKnownFile for NetworkRequest { + fn get_well_known(url: Url) -> NetworkRequest { let well_known_url = url.join(SUFFIX_WELL_KNOWN_FILE).unwrap(); - NetworkRequest::new_get(well_known_url) + Self::new_get(well_known_url) } } diff --git a/crates/sargon/src/signing/collector/mod.rs b/crates/sargon/src/signing/collector/mod.rs index 9eb142339..47613ec8e 100644 --- a/crates/sargon/src/signing/collector/mod.rs +++ b/crates/sargon/src/signing/collector/mod.rs @@ -11,5 +11,4 @@ pub(crate) use signatures_collector_preprocessor::*; pub use signatures_collecting_continuation::*; pub use signatures_collector::*; -pub use signatures_collector_dependencies::*; pub use signing_finish_early_strategy::*; diff --git a/crates/sargon/src/signing/collector/signatures_collector.rs b/crates/sargon/src/signing/collector/signatures_collector.rs index 579babec6..1d0e9c056 100644 --- a/crates/sargon/src/signing/collector/signatures_collector.rs +++ b/crates/sargon/src/signing/collector/signatures_collector.rs @@ -1550,7 +1550,13 @@ mod tests { } } - impl AccountOrPersona { + trait EntityTXSigningFI { + fn transaction_signing_factor_instances( + &self, + ) -> IndexSet; + } + + impl EntityTXSigningFI for AccountOrPersona { fn transaction_signing_factor_instances( &self, ) -> IndexSet { diff --git a/crates/sargon/src/signing/collector/signatures_collector_preprocessor.rs b/crates/sargon/src/signing/collector/signatures_collector_preprocessor.rs index a5fefd8df..0714209fd 100644 --- a/crates/sargon/src/signing/collector/signatures_collector_preprocessor.rs +++ b/crates/sargon/src/signing/collector/signatures_collector_preprocessor.rs @@ -13,7 +13,7 @@ impl SignaturesCollectorPreprocessor { } } - pub(super) fn analyzing_signables( + pub fn analyzing_signables( profile: &Profile, signables: Vec, ) -> Result { diff --git a/crates/sargon/src/signing/petition_types/mod.rs b/crates/sargon/src/signing/petition_types/mod.rs index 00f0590d9..fec017e74 100644 --- a/crates/sargon/src/signing/petition_types/mod.rs +++ b/crates/sargon/src/signing/petition_types/mod.rs @@ -1,18 +1,14 @@ -mod factor_list_kind; mod petition_for_entity; mod petition_for_factors_types; mod petition_for_transaction; mod petition_status; mod petitions; -mod role_kind; mod signing_purpose; -pub(crate) use factor_list_kind::*; pub(crate) use petition_for_entity::*; pub(crate) use petition_for_transaction::*; pub(crate) use petition_status::*; pub(crate) use petitions::*; pub use petition_for_factors_types::*; -pub use role_kind::*; pub use signing_purpose::*; diff --git a/crates/sargon/src/signing/petition_types/petition_for_factors_types/factor_source_referencing.rs b/crates/sargon/src/signing/petition_types/petition_for_factors_types/factor_source_referencing.rs index 2e537d380..1ead9f2e0 100644 --- a/crates/sargon/src/signing/petition_types/petition_for_factors_types/factor_source_referencing.rs +++ b/crates/sargon/src/signing/petition_types/petition_for_factors_types/factor_source_referencing.rs @@ -1,18 +1,5 @@ use crate::prelude::*; -/// A trait for types which reference a factor source. -pub(crate) trait FactorSourceReferencing: - std::hash::Hash + PartialEq + Eq + Clone -{ - fn factor_source_id(&self) -> FactorSourceIDFromHash; -} - -impl FactorSourceReferencing for HierarchicalDeterministicFactorInstance { - fn factor_source_id(&self) -> FactorSourceIDFromHash { - self.factor_source_id - } -} - impl FactorSourceReferencing for HDSignature { fn factor_source_id(&self) -> FactorSourceIDFromHash { self.owned_factor_instance() diff --git a/crates/sargon/src/signing/petition_types/petition_for_factors_types/mod.rs b/crates/sargon/src/signing/petition_types/petition_for_factors_types/mod.rs index fabdddcf0..c5d21dd6b 100644 --- a/crates/sargon/src/signing/petition_types/petition_for_factors_types/mod.rs +++ b/crates/sargon/src/signing/petition_types/petition_for_factors_types/mod.rs @@ -2,7 +2,6 @@ mod factor_source_referencing; mod neglected_factor_instance; mod petition_for_factors; -pub(crate) use factor_source_referencing::*; pub(crate) use petition_for_factors::*; pub use neglected_factor_instance::*; diff --git a/crates/sargon/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state.rs b/crates/sargon/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state.rs index 178723115..e751910f2 100644 --- a/crates/sargon/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state.rs +++ b/crates/sargon/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state.rs @@ -1,5 +1,3 @@ -use std::cell::Ref; - use super::*; use crate::prelude::*; @@ -137,7 +135,6 @@ impl PetitionForFactorsState { #[cfg(test)] mod tests { use super::*; - use crate::DependencyInformation::Tag; #[allow(clippy::upper_case_acronyms)] type SUT = PetitionForFactorsState; diff --git a/crates/sargon/src/signing/signables/mod.rs b/crates/sargon/src/signing/signables/mod.rs index 61feda80a..52c58dc30 100644 --- a/crates/sargon/src/signing/signables/mod.rs +++ b/crates/sargon/src/signing/signables/mod.rs @@ -4,6 +4,3 @@ mod signable_subintent; mod signable_transaction_intent; pub use signable::*; -pub use signable_auth_intent::*; -pub use signable_subintent::*; -pub use signable_transaction_intent::*; diff --git a/crates/sargon/src/signing/signables/signable.rs b/crates/sargon/src/signing/signables/signable.rs index 73bea311a..6e7a19217 100644 --- a/crates/sargon/src/signing/signables/signable.rs +++ b/crates/sargon/src/signing/signables/signable.rs @@ -1,5 +1,4 @@ use crate::prelude::*; -use std::hash::Hasher; /// Any type conforming to `Signable` can be used with `SignaturesCollector` and collect /// signatures from all involved entities according to their security structure. diff --git a/crates/sargon/src/signing/signables/signable_subintent.rs b/crates/sargon/src/signing/signables/signable_subintent.rs index 78db57555..a714b4cbf 100644 --- a/crates/sargon/src/signing/signables/signable_subintent.rs +++ b/crates/sargon/src/signing/signables/signable_subintent.rs @@ -1,5 +1,4 @@ use crate::prelude::*; -use radix_transactions::prelude::TransactionManifestV2Builder; impl Signable for Subintent { type ID = SubintentHash; @@ -33,26 +32,6 @@ impl Signable for Subintent { } } -impl From for Subintent { - fn from(val: SignedSubintent) -> Self { - val.subintent - } -} - -impl IntoIterator for SignedSubintent { - type Item = SignatureWithPublicKey; - type IntoIter = as IntoIterator>::IntoIter; - - fn into_iter(self) -> Self::IntoIter { - self.subintent_signatures - .signatures - .into_iter() - .map(|s| s.0) - .collect_vec() - .into_iter() - } -} - impl SignableID for SubintentHash {} impl ProvidesSamplesByBuildingManifest for Subintent { diff --git a/crates/sargon/src/signing/signables/signable_transaction_intent.rs b/crates/sargon/src/signing/signables/signable_transaction_intent.rs index fe4a4b9fb..f0177efa1 100644 --- a/crates/sargon/src/signing/signables/signable_transaction_intent.rs +++ b/crates/sargon/src/signing/signables/signable_transaction_intent.rs @@ -32,26 +32,6 @@ impl Signable for TransactionIntent { } } -impl From for TransactionIntent { - fn from(val: SignedIntent) -> Self { - val.intent - } -} - -impl IntoIterator for SignedIntent { - type Item = SignatureWithPublicKey; - type IntoIter = as IntoIterator>::IntoIter; - - fn into_iter(self) -> Self::IntoIter { - self.intent_signatures - .signatures - .into_iter() - .map(|s| s.0) - .collect_vec() - .into_iter() - } -} - impl SignableID for TransactionIntentHash {} impl ProvidesSamplesByBuildingManifest for TransactionIntent { diff --git a/crates/sargon/src/signing/signatures_outecome_types/mod.rs b/crates/sargon/src/signing/signatures_outecome_types/mod.rs index bcabf423a..7342ea650 100644 --- a/crates/sargon/src/signing/signatures_outecome_types/mod.rs +++ b/crates/sargon/src/signing/signatures_outecome_types/mod.rs @@ -4,6 +4,6 @@ mod sign_with_factors_outcome; mod signatures_outcome; pub use maybe_signed_transactions::*; -pub use petition_transaction_outcome::*; +pub(crate) use petition_transaction_outcome::*; pub use sign_with_factors_outcome::*; pub use signatures_outcome::*; diff --git a/crates/sargon/src/signing/testing/mod.rs b/crates/sargon/src/signing/testing/mod.rs index aaa986a00..b49b7271e 100644 --- a/crates/sargon/src/signing/testing/mod.rs +++ b/crates/sargon/src/signing/testing/mod.rs @@ -1,5 +1,4 @@ #![allow(unused)] -#![allow(unused_imports)] mod interactors; mod simulated_user; diff --git a/crates/sargon/src/system/clients/client/http_client/mod.rs b/crates/sargon/src/system/clients/client/http_client/mod.rs deleted file mode 100644 index 73bcdca8d..000000000 --- a/crates/sargon/src/system/clients/client/http_client/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -mod http_client; - -pub use http_client::*; diff --git a/crates/sargon/src/system/drivers/unsafe_storage_driver/support/mod.rs b/crates/sargon/src/system/drivers/unsafe_storage_driver/support/mod.rs deleted file mode 100644 index 25fb683bc..000000000 --- a/crates/sargon/src/system/drivers/unsafe_storage_driver/support/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -mod test; -mod unsafe_storage_key; - -pub use test::*; -pub use unsafe_storage_key::*; diff --git a/crates/sargon/src/system/mod.rs b/crates/sargon/src/system/mod.rs index 5748a1c84..c92f0dc03 100644 --- a/crates/sargon/src/system/mod.rs +++ b/crates/sargon/src/system/mod.rs @@ -1,13 +1,9 @@ mod bios; -mod clients; -mod drivers; mod interactors; mod sargon_os; mod subsystems; pub use bios::*; -pub use clients::*; -pub use drivers::*; pub use interactors::*; pub use sargon_os::*; pub use subsystems::*; diff --git a/crates/sargon/src/system/sargon_os/delete_account/mod.rs b/crates/sargon/src/system/sargon_os/delete_account/mod.rs index bbc1029c0..2eb7ab935 100644 --- a/crates/sargon/src/system/sargon_os/delete_account/mod.rs +++ b/crates/sargon/src/system/sargon_os/delete_account/mod.rs @@ -1,5 +1,4 @@ mod sargon_os_delete_account; mod support; -pub use sargon_os_delete_account::*; pub use support::*; diff --git a/crates/sargon/src/system/sargon_os/delete_account/sargon_os_delete_account.rs b/crates/sargon/src/system/sargon_os/delete_account/sargon_os_delete_account.rs index ecc2a4eab..b6e857361 100644 --- a/crates/sargon/src/system/sargon_os/delete_account/sargon_os_delete_account.rs +++ b/crates/sargon/src/system/sargon_os/delete_account/sargon_os_delete_account.rs @@ -3,7 +3,6 @@ use radix_engine_interface::blueprints::account::{ AccountRemoveAuthorizedDepositorInput as ScryptoAccountRemoveAuthorizedDepositorInput, AccountRemoveResourcePreferenceInput as ScryptoAccountRemoveResourcePreferenceInput, }; -use std::future::Future; // ================== // Delete Account (Public) @@ -135,56 +134,6 @@ impl SargonOS { } } -impl From - for ScryptoAccountRemoveResourcePreferenceInput -{ - fn from(value: AccountResourcePreference) -> Self { - Self { - resource_address: value.resource_address.into(), - } - } -} - -impl TryFrom - for ScryptoAccountRemoveAuthorizedDepositorInput -{ - type Error = CommonError; - fn try_from(value: AccountAuthorizedDepositor) -> Result { - let resource_or_non_fungible = ResourceOrNonFungible::try_from(value)?; - Ok(resource_or_non_fungible.into()) - } -} - -impl TryFrom for ResourceOrNonFungible { - type Error = CommonError; - fn try_from(value: AccountAuthorizedDepositor) -> Result { - match value { - AccountAuthorizedDepositor::ResourceBadge { resource_address } => { - Ok(Self::Resource { - value: resource_address, - }) - } - AccountAuthorizedDepositor::NonFungibleBadge { - resource_address, - non_fungible_id, - } => { - if let Ok(non_fungible_id) = - NonFungibleLocalId::from_str(&non_fungible_id) - { - Ok(Self::NonFungible { - value: NonFungibleGlobalId::new_unchecked( - resource_address, - non_fungible_id, - ), - }) - } else { - Err(CommonError::InvalidNonFungibleLocalIDString) - } - } - } - } -} - #[cfg(test)] mod tests { use crate::prelude::*; diff --git a/crates/sargon/src/system/sargon_os/entity_creating_with_factor_source_and_derivation_outcome.rs b/crates/sargon/src/system/sargon_os/entity_creating_with_factor_source_and_derivation_outcome.rs new file mode 100644 index 000000000..dd05fcbd9 --- /dev/null +++ b/crates/sargon/src/system/sargon_os/entity_creating_with_factor_source_and_derivation_outcome.rs @@ -0,0 +1,357 @@ +use crate::prelude::*; + +pub trait EntityCreatingWithFactorSourceAndDerivationOutcome { + async fn create_unsaved_entities_with_factor_source_with_derivation_outcome< + E: IsEntity + Identifiable, + >( + &self, + factor_source: FactorSource, + network_id: NetworkID, + count: u16, + factor_instances_cache_client: Arc, + key_derivation_interactor: Arc, + get_name: impl Fn(u32) -> DisplayName, // name of entity at index + ) -> Result<( + FactorSourceID, + IdentifiedVecOf, + InstancesInCacheConsumer, + FactorInstancesProviderOutcomeForFactor, + )>; + + async fn create_unsaved_account_with_factor_source_with_derivation_outcome( + &self, + factor_source: FactorSource, + network_id: NetworkID, + name: DisplayName, + factor_instances_cache_client: Arc, + key_derivation_interactor: Arc, + ) -> Result<( + FactorSourceID, + Account, + InstancesInCacheConsumer, + FactorInstancesProviderOutcomeForFactor, + )> { + let ( + factor_source_id, + accounts, + instances_in_cache_consumer, + derivation_outcome, + ) = self + .create_unsaved_accounts_with_factor_source_with_derivation_outcome( + factor_source, + network_id, + 1, + factor_instances_cache_client, + key_derivation_interactor, + |_| name, + ) + .await?; + + let account = accounts + .into_iter() + .last() + .expect("Should have created one account"); + + Ok(( + factor_source_id, + account, + instances_in_cache_consumer, + derivation_outcome, + )) + } + + async fn create_unsaved_accounts_with_factor_source_with_derivation_outcome( + &self, + factor_source: FactorSource, + network_id: NetworkID, + count: u16, + factor_instances_cache_client: Arc, + key_derivation_interactor: Arc, + get_name: impl Fn(u32) -> DisplayName, // name of account at index + ) -> Result<( + FactorSourceID, + Accounts, + InstancesInCacheConsumer, + FactorInstancesProviderOutcomeForFactor, + )>; + + async fn create_unsaved_accounts_with_factor_source( + &self, + factor_source: FactorSource, + network_id: NetworkID, + count: u16, + factor_instances_cache_client: Arc, + key_derivation_interactor: Arc, + get_name: impl Fn(u32) -> DisplayName, // name of account at index + ) -> Result<(FactorSourceID, Accounts, InstancesInCacheConsumer)> { + self.create_unsaved_accounts_with_factor_source_with_derivation_outcome( + factor_source, + network_id, + count, + factor_instances_cache_client, + key_derivation_interactor, + get_name, + ) + .await + .map(|(x, y, z, _)| (x, y, z)) + } + + async fn create_unsaved_persona_with_factor_source_with_derivation_outcome( + &self, + factor_source: FactorSource, + network_id: NetworkID, + name: DisplayName, + factor_instances_cache_client: Arc, + key_derivation_interactor: Arc, + ) -> Result<( + FactorSourceID, + Persona, + InstancesInCacheConsumer, + FactorInstancesProviderOutcomeForFactor, + )> { + let ( + factor_source_id, + personas, + instances_in_cache_consumer, + derivation_outcome, + ) = self + .create_unsaved_personas_with_factor_source_with_derivation_outcome( + factor_source, + network_id, + 1, + factor_instances_cache_client, + key_derivation_interactor, + |_| name, + ) + .await?; + + let persona = personas + .into_iter() + .last() + .expect("Should have created one persona"); + + Ok(( + factor_source_id, + persona, + instances_in_cache_consumer, + derivation_outcome, + )) + } + + async fn create_unsaved_personas_with_factor_source_with_derivation_outcome( + &self, + factor_source: FactorSource, + network_id: NetworkID, + count: u16, + factor_instances_cache_client: Arc, + key_derivation_interactor: Arc, + get_name: impl Fn(u32) -> DisplayName, // name of persona at index + ) -> Result<( + FactorSourceID, + Personas, + InstancesInCacheConsumer, + FactorInstancesProviderOutcomeForFactor, + )> { + self.create_unsaved_entities_with_factor_source_with_derivation_outcome::( + factor_source, + network_id, + count, + factor_instances_cache_client, + key_derivation_interactor, + get_name, + ) + .await.map(|(a, b, c, d)| (a, b.into_iter().collect(), c, d)) + } +} + +impl EntityCreatingWithFactorSourceAndDerivationOutcome for Profile { + async fn create_unsaved_accounts_with_factor_source_with_derivation_outcome( + &self, + factor_source: FactorSource, + network_id: NetworkID, + count: u16, + factor_instances_cache_client: Arc, + key_derivation_interactor: Arc, + get_name: impl Fn(u32) -> DisplayName, // name of account at index + ) -> Result<( + FactorSourceID, + Accounts, + InstancesInCacheConsumer, + FactorInstancesProviderOutcomeForFactor, + )> { + let number_of_accounts_on_network = self + .networks + .get_id(network_id) + .map(|n| n.accounts.len()) + .unwrap_or(0); + + let (factor_source_id, accounts, instances_in_cache_consumer, derivation_outcome) = self + .create_unsaved_entities_with_factor_source_with_derivation_outcome::( + factor_source, + network_id, + count, + factor_instances_cache_client, + key_derivation_interactor, + get_name, + ) + .await?; + + let accounts_with_appearance_ids_set = accounts + .into_iter() + .enumerate() + .map(|(offset, account)| { + let mut account = account; + let appearance_id = + AppearanceID::from_number_of_accounts_on_network( + number_of_accounts_on_network + offset, + ); + account.appearance_id = appearance_id; + account + }) + .collect::(); + + Ok(( + factor_source_id, + accounts_with_appearance_ids_set, + instances_in_cache_consumer, + derivation_outcome, + )) + } + + /// Creates `count` many new virtual entities of type `E` on `network_id` with `factor_source` as the factor source. + /// Setting the names according to `get_name`, loading pre-derived FactorInstances from the + /// FactorInstancesCache if possible, else derives more using the FactorInstancesProvider. + /// + /// Returns the FactorSourceID, the entities, the InstancesInCacheConsumer, and the FactorInstancesProviderOutcomeForFactor. + /// + /// The `FactorInstancesProviderOutcomeForFactor` is primarily useful for testing. + /// + /// The `InstancesInCacheConsumer` SHOULD be called by the caller, once you know it + /// is safe to delete the instances from the cache - e.g. after having saved the new + /// entities into the Profile and persisted it into SecureStorage. + async fn create_unsaved_entities_with_factor_source_with_derivation_outcome< + E: IsEntity + Identifiable, + >( + &self, + factor_source: FactorSource, + network_id: NetworkID, + count: u16, + factor_instances_cache_client: Arc, + key_derivation_interactor: Arc, + get_name: impl Fn(u32) -> DisplayName, // name of entity at index + ) -> Result<( + FactorSourceID, + IdentifiedVecOf, + InstancesInCacheConsumer, + FactorInstancesProviderOutcomeForFactor, + )> { + let count = count as usize; + + let fsid = factor_source.factor_source_id(); + let entity_kind = E::entity_kind(); + + let (instances_in_cache_consumer, outcome) = + VirtualEntityCreatingInstanceProvider::for_many_entity_vecis( + count, + entity_kind, + factor_instances_cache_client, + Arc::new(self.clone()), + factor_source.clone(), + network_id, + key_derivation_interactor, + ) + .await?; + + let outcome = outcome + .per_derivation_preset + .get(&DerivationPreset::veci_entity_kind(entity_kind)) + .unwrap() + .per_factor + .get(&factor_source.id_from_hash()) + .cloned() + .unwrap(); + + let instances_to_use_directly = outcome.clone().to_use_directly; + + assert_eq!(instances_to_use_directly.len(), count); + + let entities = instances_to_use_directly + .into_iter() + .map(|f| { + HDFactorInstanceTransactionSigning::::new(f).unwrap() + }) + .map(|veci| { + let idx = u32::from( + veci.path + .derivation_path() + .index() + .index_in_local_key_space(), + ); + let name = get_name(idx); + + E::with_veci_and_name(veci, name) + }) + .collect::>(); + + Ok((fsid, entities, instances_in_cache_consumer, outcome)) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[actix_rt::test] + async fn test_create_unsaved_accounts() { + let fs = PrivateHierarchicalDeterministicFactorSource::sample(); + let sut = Profile::from_device_factor_source( + fs.factor_source.clone(), + HostId::sample(), + HostInfo::sample(), + None::, + ); + + let cache_client = Arc::new(FactorInstancesCacheClient::in_memory()); + let (secure_storage_client, _) = SecureStorageClient::ephemeral(); + secure_storage_client + .save_private_hd_factor_source(&fs) + .await + .unwrap(); + let secure_storage_client = Arc::new(secure_storage_client); + let interactors = Arc::new(TestDerivationInteractor::new( + false, + secure_storage_client.clone(), + )); + + let (_, accounts, consumer) = sut + .create_unsaved_accounts_with_factor_source( + fs.factor_source.clone().into(), + NetworkID::Mainnet, + 3, + cache_client, + interactors, + |i| { + DisplayName::new(if i == 0 { + "Alice" + } else if i == 1 { + "Bob" + } else { + "Carol" + }) + .unwrap() + }, + ) + .await + .unwrap(); + consumer.consume().await.unwrap(); + + pretty_assertions::assert_eq!( + accounts, + Accounts::from_iter([ + Account::sample_mainnet_alice(), + Account::sample_mainnet_bob(), + Account::sample_mainnet_carol() + ]) + ) + } +} diff --git a/crates/sargon/src/factor_instances_provider/provider/factor_instances_provider_unit_tests.rs b/crates/sargon/src/system/sargon_os/factor_instances_provider_unit_tests.rs similarity index 85% rename from crates/sargon/src/factor_instances_provider/provider/factor_instances_provider_unit_tests.rs rename to crates/sargon/src/system/sargon_os/factor_instances_provider_unit_tests.rs index 411bf52db..0b85744cb 100644 --- a/crates/sargon/src/factor_instances_provider/provider/factor_instances_provider_unit_tests.rs +++ b/crates/sargon/src/system/sargon_os/factor_instances_provider_unit_tests.rs @@ -1,7 +1,5 @@ #![allow(non_snake_case)] -use std::ops::{Add, AddAssign}; - impl SargonOS { pub(crate) async fn with_bdfs() -> (Arc, FactorSource) { let os = Self::fast_boot().await; @@ -434,11 +432,13 @@ async fn adding_personas_and_clearing_cache_in_between() { ); } +trait AllHdFactorsFromRole { + fn all_hd_factors(&self) -> Vec; +} + #[cfg(test)] -impl PrimaryRoleWithFactorInstances { - pub fn all_hd_factors( - &self, - ) -> Vec { +impl AllHdFactorsFromRole for PrimaryRoleWithFactorInstances { + fn all_hd_factors(&self) -> Vec { self.all_factors() .into_iter() .map(|f| { @@ -450,10 +450,8 @@ impl PrimaryRoleWithFactorInstances { } #[cfg(test)] -impl RecoveryRoleWithFactorInstances { - pub fn all_hd_factors( - &self, - ) -> Vec { +impl AllHdFactorsFromRole for RecoveryRoleWithFactorInstances { + fn all_hd_factors(&self) -> Vec { self.all_factors() .into_iter() .map(|f| { @@ -465,10 +463,8 @@ impl RecoveryRoleWithFactorInstances { } #[cfg(test)] -impl ConfirmationRoleWithFactorInstances { - pub fn all_hd_factors( - &self, - ) -> Vec { +impl AllHdFactorsFromRole for ConfirmationRoleWithFactorInstances { + fn all_hd_factors(&self) -> Vec { self.all_factors() .into_iter() .map(|f| { @@ -502,23 +498,17 @@ async fn cache_is_unchanged_in_case_of_failure() { assert_eq!(all_accounts.len(), 3 * n); - let matrix_0 = MatrixOfFactorSources { - primary_role: PrimaryRoleWithFactorSources::with_factors( + let matrix_0 = unsafe { + MatrixOfFactorSources::unbuilt_with_roles_and_days( + PrimaryRoleWithFactorSources::with_factors(1, [bdfs.clone()], []), + RecoveryRoleWithFactorSources::with_factors(0, [], [bdfs.clone()]), + ConfirmationRoleWithFactorSources::with_factors( + 0, + [], + [bdfs.clone()], + ), 1, - [bdfs.clone()], - [], - ), - recovery_role: RecoveryRoleWithFactorSources::with_factors( - 0, - [], - [bdfs.clone()], - ), - confirmation_role: ConfirmationRoleWithFactorSources::with_factors( - 0, - [], - [bdfs.clone()], - ), - number_of_days_until_auto_confirm: 1, + ) }; let shield_0 = SecurityStructureOfFactorSources::new( @@ -571,7 +561,7 @@ async fn cache_is_unchanged_in_case_of_failure() { .map(|a| a .1 .matrix_of_factors - .primary_role + .primary() .all_hd_factors() .into_iter() .map(|f| f.derivation_entity_index()) @@ -659,23 +649,17 @@ async fn test_assert_factor_instances_invalid() { // This is NOT a valid Matrix! But for the purpose of this test, it's fine. // We are not testing valid matrices here... we are testing the factor // instances provider... - let matrix_0 = MatrixOfFactorSources { - primary_role: PrimaryRoleWithFactorSources::with_factors( + let matrix_0 = unsafe { + MatrixOfFactorSources::unbuilt_with_roles_and_days( + PrimaryRoleWithFactorSources::with_factors(1, [bdfs.clone()], []), + RecoveryRoleWithFactorSources::with_factors(0, [], [bdfs.clone()]), + ConfirmationRoleWithFactorSources::with_factors( + 0, + [], + [bdfs.clone()], + ), 1, - [bdfs.clone()], - [], - ), - recovery_role: RecoveryRoleWithFactorSources::with_factors( - 0, - [], - [bdfs.clone()], - ), - confirmation_role: ConfirmationRoleWithFactorSources::with_factors( - 0, - [], - [bdfs.clone()], - ), - number_of_days_until_auto_confirm: 1, + ) }; let shield_0 = SecurityStructureOfFactorSources::new( @@ -1000,23 +984,25 @@ async fn test_securified_accounts() { os.add_factor_source(arculus.clone()).await.unwrap(); os.add_factor_source(password.clone()).await.unwrap(); - let matrix_0 = MatrixOfFactorSources { - primary_role: PrimaryRoleWithFactorSources::with_factors( - 2, - [bdfs.clone(), ledger.clone(), arculus.clone()], - [], - ), - recovery_role: RecoveryRoleWithFactorSources::with_factors( - 0, - [], - [bdfs.clone(), ledger.clone(), arculus.clone()], - ), - confirmation_role: ConfirmationRoleWithFactorSources::with_factors( - 0, - [], - [bdfs.clone(), ledger.clone(), arculus.clone()], - ), - number_of_days_until_auto_confirm: 1, + let matrix_0 = unsafe { + MatrixOfFactorSources::unbuilt_with_roles_and_days( + PrimaryRoleWithFactorSources::with_factors( + 2, + [bdfs.clone(), ledger.clone(), arculus.clone()], + [], + ), + RecoveryRoleWithFactorSources::with_factors( + 0, + [], + [bdfs.clone(), ledger.clone(), arculus.clone()], + ), + ConfirmationRoleWithFactorSources::with_factors( + 0, + [], + [bdfs.clone(), ledger.clone(), arculus.clone()], + ), + 1, + ) }; let shield_0 = SecurityStructureOfFactorSources::new( @@ -1050,7 +1036,7 @@ async fn test_securified_accounts() { assert_eq!( alice_matrix - .primary_role + .primary() .all_factors() .into_iter() .map(|f| f.factor_source_id) @@ -1063,9 +1049,9 @@ async fn test_securified_accounts() { ); for factors_for_role in [ - &alice_matrix.primary_role.all_hd_factors(), - &alice_matrix.recovery_role.all_hd_factors(), - &alice_matrix.confirmation_role.all_hd_factors(), + &alice_matrix.primary().all_hd_factors(), + &alice_matrix.recovery().all_hd_factors(), + &alice_matrix.confirmation().all_hd_factors(), ] { assert_eq!( factors_for_role @@ -1091,7 +1077,7 @@ async fn test_securified_accounts() { assert_eq!( bob_matrix - .primary_role + .primary() .all_factors() .into_iter() .map(|f| f.factor_source_id) @@ -1104,9 +1090,9 @@ async fn test_securified_accounts() { ); for factors_for_role in [ - &bob_matrix.primary_role.all_hd_factors(), - &bob_matrix.recovery_role.all_hd_factors(), - &bob_matrix.confirmation_role.all_hd_factors(), + &bob_matrix.primary().all_hd_factors(), + &bob_matrix.recovery().all_hd_factors(), + &bob_matrix.confirmation().all_hd_factors(), ] { assert_eq!( factors_for_role @@ -1141,23 +1127,25 @@ async fn test_securified_accounts() { "First account created with ledger, should have index 0, even though this ledger was used in the shield, since we are using two different KeySpaces for Securified and Unsecurified accounts." ); - let matrix_1 = MatrixOfFactorSources { - primary_role: PrimaryRoleWithFactorSources::with_factors( + let matrix_1 = unsafe { + MatrixOfFactorSources::unbuilt_with_roles_and_days( + PrimaryRoleWithFactorSources::with_factors( + 1, + [password.clone()], + [], + ), + RecoveryRoleWithFactorSources::with_factors( + 0, + [], + [password.clone()], + ), + ConfirmationRoleWithFactorSources::with_factors( + 0, + [], + [password.clone()], + ), 1, - [password.clone()], - [], - ), - recovery_role: RecoveryRoleWithFactorSources::with_factors( - 0, - [], - [password.clone()], - ), - confirmation_role: ConfirmationRoleWithFactorSources::with_factors( - 0, - [], - [password.clone()], - ), - number_of_days_until_auto_confirm: 1, + ) }; let shield_1 = SecurityStructureOfFactorSources::new( @@ -1182,11 +1170,11 @@ async fn test_securified_accounts() { .unwrap(); let carol_matrix = carol_sec.matrix_of_factors.clone(); - assert_eq!(carol_matrix.primary_role.get_threshold_factors().len(), 1); + assert_eq!(carol_matrix.primary().get_threshold_factors().len(), 1); assert_eq!( carol_matrix - .primary_role + .primary() .all_factors() .into_iter() .map(|f| f.factor_source_id) @@ -1195,9 +1183,9 @@ async fn test_securified_accounts() { ); for factors_for_role in [ - &carol_matrix.primary_role.all_hd_factors(), - &carol_matrix.recovery_role.all_hd_factors(), - &carol_matrix.confirmation_role.all_hd_factors(), + &carol_matrix.primary().all_hd_factors(), + &carol_matrix.recovery().all_hd_factors(), + &carol_matrix.confirmation().all_hd_factors(), ] { assert_eq!( factors_for_role @@ -1233,7 +1221,7 @@ async fn test_securified_accounts() { assert_eq!( alice_matrix - .primary_role + .primary() .all_factors() .into_iter() .map(|f| f.factor_source_id) @@ -1242,9 +1230,9 @@ async fn test_securified_accounts() { ); for factors_for_role in [ - &alice_matrix.primary_role.all_hd_factors(), - &alice_matrix.recovery_role.all_hd_factors(), - &alice_matrix.confirmation_role.all_hd_factors(), + &alice_matrix.primary().all_hd_factors(), + &alice_matrix.recovery().all_hd_factors(), + &alice_matrix.confirmation().all_hd_factors(), ] { assert_eq!( factors_for_role @@ -1283,23 +1271,17 @@ async fn securify_accounts_when_cache_is_half_full_single_factor_source() { // This is NOT a valid Matrix! But for the purpose of this test, it's fine. // We are not testing valid matrices here... we are testing the factor // instances provider... - let matrix_0 = MatrixOfFactorSources { - primary_role: PrimaryRoleWithFactorSources::with_factors( + let matrix_0 = unsafe { + MatrixOfFactorSources::unbuilt_with_roles_and_days( + PrimaryRoleWithFactorSources::with_factors(1, [bdfs.clone()], []), + RecoveryRoleWithFactorSources::with_factors(0, [], [bdfs.clone()]), + ConfirmationRoleWithFactorSources::with_factors( + 0, + [], + [bdfs.clone()], + ), 1, - [bdfs.clone()], - [], - ), - recovery_role: RecoveryRoleWithFactorSources::with_factors( - 0, - [], - [bdfs.clone()], - ), - confirmation_role: ConfirmationRoleWithFactorSources::with_factors( - 0, - [], - [bdfs.clone()], - ), - number_of_days_until_auto_confirm: 1, + ) }; let shield_0 = SecurityStructureOfFactorSources::new( @@ -1349,7 +1331,7 @@ async fn securify_accounts_when_cache_is_half_full_single_factor_source() { .values() .map(|ss| ss .matrix_of_factors - .primary_role + .primary() .all_hd_factors() .into_iter() .map(|f| f.derivation_entity_index()) @@ -1387,7 +1369,7 @@ async fn securify_accounts_when_cache_is_half_full_single_factor_source() { .values() .map(|ss| ss .matrix_of_factors - .primary_role + .primary() .all_hd_factors() .into_iter() .map(|f| f.derivation_entity_index()) @@ -1435,23 +1417,25 @@ async fn securify_accounts_when_cache_is_half_full_multiple_factor_sources() { // This is NOT a valid Matrix! But for the purpose of this test, it's fine. // We are not testing valid matrices here... we are testing the factor // instances provider... - let matrix_0 = MatrixOfFactorSources { - primary_role: PrimaryRoleWithFactorSources::with_factors( - 2, - [bdfs.clone(), ledger.clone(), arculus.clone()], - [], - ), - recovery_role: RecoveryRoleWithFactorSources::with_factors( - 0, - [], - [bdfs.clone(), ledger.clone(), arculus.clone()], - ), - confirmation_role: ConfirmationRoleWithFactorSources::with_factors( - 0, - [], - [bdfs.clone(), ledger.clone(), arculus.clone()], - ), - number_of_days_until_auto_confirm: 1, + let matrix_0 = unsafe { + MatrixOfFactorSources::unbuilt_with_roles_and_days( + PrimaryRoleWithFactorSources::with_factors( + 2, + [bdfs.clone(), ledger.clone(), arculus.clone()], + [], + ), + RecoveryRoleWithFactorSources::with_factors( + 0, + [], + [bdfs.clone(), ledger.clone(), arculus.clone()], + ), + ConfirmationRoleWithFactorSources::with_factors( + 0, + [], + [bdfs.clone(), ledger.clone(), arculus.clone()], + ), + 1, + ) }; let shield_0 = SecurityStructureOfFactorSources::new( @@ -1519,7 +1503,7 @@ async fn securify_accounts_when_cache_is_half_full_multiple_factor_sources() { .values() .map(|ss| ss .matrix_of_factors - .primary_role + .primary() .all_hd_factors() .iter() .map(|f| f.derivation_entity_index()) @@ -1534,7 +1518,7 @@ async fn securify_accounts_when_cache_is_half_full_multiple_factor_sources() { .values() .map(|ss| ss .matrix_of_factors - .confirmation_role + .confirmation() .all_hd_factors() .iter() .map(|f| f.derivation_entity_index()) @@ -1549,7 +1533,7 @@ async fn securify_accounts_when_cache_is_half_full_multiple_factor_sources() { .values() .map(|ss| ss .matrix_of_factors - .recovery_role + .recovery() .all_hd_factors() .iter() .map(|f| f.derivation_entity_index()) @@ -1620,7 +1604,7 @@ async fn securify_accounts_when_cache_is_half_full_multiple_factor_sources() { .values() .map(|ss| ss .matrix_of_factors - .primary_role + .primary() .all_hd_factors() .iter() .map(|f| f.derivation_entity_index()) @@ -1635,7 +1619,7 @@ async fn securify_accounts_when_cache_is_half_full_multiple_factor_sources() { .values() .map(|ss| ss .matrix_of_factors - .recovery_role + .recovery() .all_hd_factors() .iter() .map(|f| f.derivation_entity_index()) @@ -1650,7 +1634,7 @@ async fn securify_accounts_when_cache_is_half_full_multiple_factor_sources() { .values() .map(|ss| ss .matrix_of_factors - .confirmation_role + .confirmation() .all_hd_factors() .iter() .map(|f| f.derivation_entity_index()) @@ -1677,23 +1661,17 @@ async fn securify_personas_when_cache_is_half_full_single_factor_source() { // This is NOT a valid Matrix! But for the purpose of this test, it's fine. // We are not testing valid matrices here... we are testing the factor // instances provider... - let matrix_0 = MatrixOfFactorSources { - primary_role: PrimaryRoleWithFactorSources::with_factors( + let matrix_0 = unsafe { + MatrixOfFactorSources::unbuilt_with_roles_and_days( + PrimaryRoleWithFactorSources::with_factors(1, [bdfs.clone()], []), + RecoveryRoleWithFactorSources::with_factors(0, [], [bdfs.clone()]), + ConfirmationRoleWithFactorSources::with_factors( + 0, + [], + [bdfs.clone()], + ), 1, - [bdfs.clone()], - [], - ), - recovery_role: RecoveryRoleWithFactorSources::with_factors( - 0, - [], - [bdfs.clone()], - ), - confirmation_role: ConfirmationRoleWithFactorSources::with_factors( - 0, - [], - [bdfs.clone()], - ), - number_of_days_until_auto_confirm: 1, + ) }; let shield_0 = SecurityStructureOfFactorSources::new( @@ -1746,7 +1724,7 @@ async fn securify_personas_when_cache_is_half_full_single_factor_source() { .values() .map(|ss| ss .matrix_of_factors - .primary_role + .primary() .all_hd_factors() .into_iter() .map(|f| f.derivation_entity_index()) @@ -1768,7 +1746,7 @@ async fn securify_personas_when_cache_is_half_full_single_factor_source() { .await .unwrap(); - // dont forget to consume! + // Don't forget to consume! instances_in_cache_consumer.consume().await.unwrap(); assert!( @@ -1781,7 +1759,7 @@ async fn securify_personas_when_cache_is_half_full_single_factor_source() { .values() .map(|ss| ss .matrix_of_factors - .primary_role + .primary() .all_hd_factors() .into_iter() .map(|f| f.derivation_entity_index()) @@ -1815,23 +1793,17 @@ async fn create_single_account() { // This is NOT a valid Matrix! But for the purpose of this test, it's fine. // We are not testing valid matrices here... we are testing the factor // instances provider... - let matrix_0 = MatrixOfFactorSources { - primary_role: PrimaryRoleWithFactorSources::with_factors( + let matrix_0 = unsafe { + MatrixOfFactorSources::unbuilt_with_roles_and_days( + PrimaryRoleWithFactorSources::with_factors(1, [bdfs.clone()], []), + RecoveryRoleWithFactorSources::with_factors(0, [], [bdfs.clone()]), + ConfirmationRoleWithFactorSources::with_factors( + 0, + [], + [bdfs.clone()], + ), 1, - [bdfs.clone()], - [], - ), - recovery_role: RecoveryRoleWithFactorSources::with_factors( - 0, - [], - [bdfs.clone()], - ), - confirmation_role: ConfirmationRoleWithFactorSources::with_factors( - 0, - [], - [bdfs.clone()], - ), - number_of_days_until_auto_confirm: 1, + ) }; let shield_0 = SecurityStructureOfFactorSources::new( @@ -1863,7 +1835,7 @@ async fn create_single_account() { assert_eq!( alice_matrix - .primary_role + .primary() .all_factors() .into_iter() .map(|f| f.factor_source_id) @@ -1872,9 +1844,9 @@ async fn create_single_account() { ); for factors_for_role in [ - &alice_matrix.primary_role.all_hd_factors(), - &alice_matrix.recovery_role.all_hd_factors(), - &alice_matrix.confirmation_role.all_hd_factors(), + &alice_matrix.primary().all_hd_factors(), + &alice_matrix.recovery().all_hd_factors(), + &alice_matrix.confirmation().all_hd_factors(), ] { assert_eq!( factors_for_role @@ -1908,23 +1880,25 @@ async fn securified_personas() { os.add_factor_source(arculus.clone()).await.unwrap(); os.add_factor_source(password.clone()).await.unwrap(); - let matrix_0 = MatrixOfFactorSources { - primary_role: PrimaryRoleWithFactorSources::with_factors( - 2, - [bdfs.clone(), ledger.clone(), arculus.clone()], - [], - ), - recovery_role: RecoveryRoleWithFactorSources::with_factors( - 0, - [], - [bdfs.clone(), ledger.clone(), arculus.clone()], - ), - confirmation_role: ConfirmationRoleWithFactorSources::with_factors( - 0, - [], - [bdfs.clone(), ledger.clone(), arculus.clone()], - ), - number_of_days_until_auto_confirm: 1, + let matrix_0 = unsafe { + MatrixOfFactorSources::unbuilt_with_roles_and_days( + PrimaryRoleWithFactorSources::with_factors( + 2, + [bdfs.clone(), ledger.clone(), arculus.clone()], + [], + ), + RecoveryRoleWithFactorSources::with_factors( + 0, + [], + [bdfs.clone(), ledger.clone(), arculus.clone()], + ), + ConfirmationRoleWithFactorSources::with_factors( + 0, + [], + [bdfs.clone(), ledger.clone(), arculus.clone()], + ), + 1, + ) }; let shield_0 = SecurityStructureOfFactorSources::new( @@ -1958,7 +1932,7 @@ async fn securified_personas() { assert_eq!( batman_matrix - .primary_role + .primary() .all_factors() .into_iter() .map(|f| f.factor_source_id) @@ -1971,9 +1945,9 @@ async fn securified_personas() { ); for factors_for_role in [ - &batman_matrix.primary_role.all_hd_factors(), - &batman_matrix.recovery_role.all_hd_factors(), - &batman_matrix.confirmation_role.all_hd_factors(), + &batman_matrix.primary().all_hd_factors(), + &batman_matrix.recovery().all_hd_factors(), + &batman_matrix.confirmation().all_hd_factors(), ] { assert_eq!( factors_for_role @@ -1999,7 +1973,7 @@ async fn securified_personas() { assert_eq!( satoshi_matrix - .primary_role + .primary() .all_factors() .into_iter() .map(|f| f.factor_source_id) @@ -2012,9 +1986,9 @@ async fn securified_personas() { ); for factors_for_role in [ - &satoshi_matrix.primary_role.all_hd_factors(), - &satoshi_matrix.recovery_role.all_hd_factors(), - &satoshi_matrix.confirmation_role.all_hd_factors(), + &satoshi_matrix.primary().all_hd_factors(), + &satoshi_matrix.recovery().all_hd_factors(), + &satoshi_matrix.confirmation().all_hd_factors(), ] { assert_eq!( factors_for_role @@ -2052,23 +2026,25 @@ async fn securified_personas() { // This is NOT a valid Matrix! But for the purpose of this test, it's fine. // We are not testing valid matrices here... we are testing the factor // instances provider... - let matrix_1 = MatrixOfFactorSources { - primary_role: PrimaryRoleWithFactorSources::with_factors( + let matrix_1 = unsafe { + MatrixOfFactorSources::unbuilt_with_roles_and_days( + PrimaryRoleWithFactorSources::with_factors( + 1, + [password.clone()], + [], + ), + RecoveryRoleWithFactorSources::with_factors( + 0, + [], + [password.clone()], + ), + ConfirmationRoleWithFactorSources::with_factors( + 0, + [], + [password.clone()], + ), 1, - [password.clone()], - [], - ), - recovery_role: RecoveryRoleWithFactorSources::with_factors( - 0, - [], - [password.clone()], - ), - confirmation_role: ConfirmationRoleWithFactorSources::with_factors( - 0, - [], - [password.clone()], - ), - number_of_days_until_auto_confirm: 1, + ) }; let shield_1 = SecurityStructureOfFactorSources::new( @@ -2098,11 +2074,11 @@ async fn securified_personas() { .unwrap(); let hyde_matrix = hyde_sec.matrix_of_factors.clone(); - assert_eq!(hyde_matrix.primary_role.get_threshold_factors().len(), 1); + assert_eq!(hyde_matrix.primary().get_threshold_factors().len(), 1); assert_eq!( hyde_matrix - .primary_role + .primary() .all_factors() .into_iter() .map(|f| f.factor_source_id) @@ -2111,9 +2087,9 @@ async fn securified_personas() { ); for factors_for_role in [ - &hyde_matrix.primary_role.all_hd_factors(), - &hyde_matrix.recovery_role.all_hd_factors(), - &hyde_matrix.confirmation_role.all_hd_factors(), + &hyde_matrix.primary().all_hd_factors(), + &hyde_matrix.recovery().all_hd_factors(), + &hyde_matrix.confirmation().all_hd_factors(), ] { assert_eq!( factors_for_role @@ -2148,7 +2124,7 @@ async fn securified_personas() { assert_eq!( batman_matrix - .primary_role + .primary() .all_factors() .into_iter() .map(|f| f.factor_source_id) @@ -2157,9 +2133,9 @@ async fn securified_personas() { ); for factors_for_role in [ - &batman_matrix.primary_role.all_hd_factors(), - &batman_matrix.recovery_role.all_hd_factors(), - &batman_matrix.confirmation_role.all_hd_factors(), + &batman_matrix.primary().all_hd_factors(), + &batman_matrix.recovery().all_hd_factors(), + &batman_matrix.confirmation().all_hd_factors(), ] { assert_eq!( factors_for_role @@ -2222,23 +2198,17 @@ async fn securified_all_accounts_next_veci_does_not_start_at_zero() { // This is NOT a valid Matrix! But for the purpose of this test, it's fine. // We are not testing valid matrices here... we are testing the factor // instances provider... - let matrix_0 = MatrixOfFactorSources { - primary_role: PrimaryRoleWithFactorSources::with_factors( + let matrix_0 = unsafe { + MatrixOfFactorSources::unbuilt_with_roles_and_days( + PrimaryRoleWithFactorSources::with_factors(1, [bdfs.clone()], []), + RecoveryRoleWithFactorSources::with_factors(0, [], [bdfs.clone()]), + ConfirmationRoleWithFactorSources::with_factors( + 0, + [], + [bdfs.clone()], + ), 1, - [bdfs.clone()], - [], - ), - recovery_role: RecoveryRoleWithFactorSources::with_factors( - 0, - [], - [bdfs.clone()], - ), - confirmation_role: ConfirmationRoleWithFactorSources::with_factors( - 0, - [], - [bdfs.clone()], - ), - number_of_days_until_auto_confirm: 1, + ) }; let shield_0 = SecurityStructureOfFactorSources::new( @@ -2363,9 +2333,9 @@ async fn securified_all_accounts_next_veci_does_not_start_at_zero() { let alice_sec = alice.try_get_secured_control().unwrap(); let alice_matrix = alice_sec.security_structure.matrix_of_factors.clone(); for factors_for_role in [ - &alice_matrix.primary_role.all_hd_factors(), - &alice_matrix.recovery_role.all_hd_factors(), - &alice_matrix.confirmation_role.all_hd_factors(), + &alice_matrix.primary().all_hd_factors(), + &alice_matrix.recovery().all_hd_factors(), + &alice_matrix.confirmation().all_hd_factors(), ] { assert_eq!( factors_for_role @@ -2436,23 +2406,17 @@ async fn securified_accounts_and_personas_mixed_asymmetric_indices() { // This is NOT a valid Matrix! But for the purpose of this test, it's fine. // We are not testing valid matrices here... we are testing the factor // instances provider... - let matrix_0 = MatrixOfFactorSources { - primary_role: PrimaryRoleWithFactorSources::with_factors( + let matrix_0 = unsafe { + MatrixOfFactorSources::unbuilt_with_roles_and_days( + PrimaryRoleWithFactorSources::with_factors(1, [bdfs.clone()], []), + RecoveryRoleWithFactorSources::with_factors(0, [], [bdfs.clone()]), + ConfirmationRoleWithFactorSources::with_factors( + 0, + [], + [bdfs.clone()], + ), 1, - [bdfs.clone()], - [], - ), - recovery_role: RecoveryRoleWithFactorSources::with_factors( - 0, - [], - [bdfs.clone()], - ), - confirmation_role: ConfirmationRoleWithFactorSources::with_factors( - 0, - [], - [bdfs.clone()], - ), - number_of_days_until_auto_confirm: 1, + ) }; let shield_0 = SecurityStructureOfFactorSources::new( @@ -2565,23 +2529,25 @@ async fn securified_accounts_and_personas_mixed_asymmetric_indices() { // This is NOT a valid Matrix! But for the purpose of this test, it's fine. // We are not testing valid matrices here... we are testing the factor // instances provider... - let matrix_1 = MatrixOfFactorSources { - primary_role: PrimaryRoleWithFactorSources::with_factors( - 2, - [bdfs.clone(), arculus.clone()], - [], - ), - recovery_role: RecoveryRoleWithFactorSources::with_factors( - 0, - [], - [bdfs.clone(), arculus.clone()], - ), - confirmation_role: ConfirmationRoleWithFactorSources::with_factors( - 0, - [], - [bdfs.clone(), arculus.clone()], - ), - number_of_days_until_auto_confirm: 1, + let matrix_1 = unsafe { + MatrixOfFactorSources::unbuilt_with_roles_and_days( + PrimaryRoleWithFactorSources::with_factors( + 2, + [bdfs.clone(), arculus.clone()], + [], + ), + RecoveryRoleWithFactorSources::with_factors( + 0, + [], + [bdfs.clone(), arculus.clone()], + ), + ConfirmationRoleWithFactorSources::with_factors( + 0, + [], + [bdfs.clone(), arculus.clone()], + ), + 1, + ) }; let shield_1 = SecurityStructureOfFactorSources::new( @@ -2609,7 +2575,7 @@ async fn securified_accounts_and_personas_mixed_asymmetric_indices() { .unwrap() .security_structure .matrix_of_factors - .primary_role + .primary() .all_hd_factors() .into_iter() .map(|f| (f.factor_source_id, f.derivation_entity_index())) @@ -2633,23 +2599,25 @@ async fn securified_accounts_and_personas_mixed_asymmetric_indices() { // This is NOT a valid Matrix! But for the purpose of this test, it's fine. // We are not testing valid matrices here... we are testing the factor // instances provider... - let matrix_2 = MatrixOfFactorSources { - primary_role: PrimaryRoleWithFactorSources::with_factors( - 2, - [bdfs.clone(), ledger.clone()], - [], - ), - recovery_role: RecoveryRoleWithFactorSources::with_factors( - 0, - [], - [bdfs.clone(), ledger.clone()], - ), - confirmation_role: ConfirmationRoleWithFactorSources::with_factors( - 0, - [], - [bdfs.clone(), ledger.clone()], - ), - number_of_days_until_auto_confirm: 1, + let matrix_2 = unsafe { + MatrixOfFactorSources::unbuilt_with_roles_and_days( + PrimaryRoleWithFactorSources::with_factors( + 2, + [bdfs.clone(), ledger.clone()], + [], + ), + RecoveryRoleWithFactorSources::with_factors( + 0, + [], + [bdfs.clone(), ledger.clone()], + ), + ConfirmationRoleWithFactorSources::with_factors( + 0, + [], + [bdfs.clone(), ledger.clone()], + ), + 1, + ) }; let shield_2 = SecurityStructureOfFactorSources::new( @@ -2677,7 +2645,7 @@ async fn securified_accounts_and_personas_mixed_asymmetric_indices() { .unwrap() .security_structure .matrix_of_factors - .primary_role + .primary() .all_hd_factors() .into_iter() .map(|f| (f.factor_source_id, f.derivation_entity_index())) @@ -2716,7 +2684,7 @@ async fn securified_accounts_and_personas_mixed_asymmetric_indices() { .unwrap() .security_structure .matrix_of_factors - .primary_role + .primary() .all_hd_factors() .into_iter() .map(|f| (f.factor_source_id, f.derivation_entity_index())) @@ -2743,23 +2711,25 @@ async fn securified_accounts_and_personas_mixed_asymmetric_indices() { // This is NOT a valid Matrix! But for the purpose of this test, it's fine. // We are not testing valid matrices here... we are testing the factor // instances provider... - let matrix_3fa = MatrixOfFactorSources { - primary_role: PrimaryRoleWithFactorSources::with_factors( - 2, - [bdfs.clone(), ledger.clone(), arculus.clone()], - [], - ), - recovery_role: RecoveryRoleWithFactorSources::with_factors( - 0, - [], - [bdfs.clone(), ledger.clone(), arculus.clone()], - ), - confirmation_role: ConfirmationRoleWithFactorSources::with_factors( - 0, - [], - [bdfs.clone(), ledger.clone(), arculus.clone()], - ), - number_of_days_until_auto_confirm: 1, + let matrix_3fa = unsafe { + MatrixOfFactorSources::unbuilt_with_roles_and_days( + PrimaryRoleWithFactorSources::with_factors( + 2, + [bdfs.clone(), ledger.clone(), arculus.clone()], + [], + ), + RecoveryRoleWithFactorSources::with_factors( + 0, + [], + [bdfs.clone(), ledger.clone(), arculus.clone()], + ), + ConfirmationRoleWithFactorSources::with_factors( + 0, + [], + [bdfs.clone(), ledger.clone(), arculus.clone()], + ), + 1, + ) }; let shield_3fa = SecurityStructureOfFactorSources::new( @@ -2787,7 +2757,7 @@ async fn securified_accounts_and_personas_mixed_asymmetric_indices() { .unwrap() .security_structure .matrix_of_factors - .primary_role + .primary() .all_hd_factors() .into_iter() .map(|f| (f.factor_source_id, f.derivation_entity_index())) @@ -2888,7 +2858,7 @@ async fn securified_accounts_and_personas_mixed_asymmetric_indices() { .unwrap() .security_structure .matrix_of_factors - .primary_role + .primary() .all_hd_factors() .into_iter() .map(|f| (f.factor_source_id, f.derivation_entity_index())) @@ -2918,3 +2888,83 @@ async fn securified_accounts_and_personas_mixed_asymmetric_indices() { ); } } + +#[actix_rt::test] +async fn securify_accounts_and_personas_with_override_factor() { + // this is mostly a soundness test for the two functions `for_persona_mfa` and `for_account_mfa` + // using `os` to create a profile, and BDFS because I'm lazy. + // We might in fact remove `for_persona_mfa` and `for_account_mfa` + // and only use the `for_entity_mfa` function... but we have these to get code coverage. + let (os, bdfs) = SargonOS::with_bdfs().await; + + let (batman, derivation_outcome) = os + .create_and_save_new_mainnet_persona_with_derivation_outcome("Batman") + .await + .unwrap(); + assert!(derivation_outcome.debug_was_derived.is_empty()); + + let (alice, derivation_outcome) = os + .create_and_save_new_mainnet_account_with_derivation_outcome("alice") + .await + .unwrap(); + assert!(derivation_outcome.debug_was_derived.is_empty()); + + os.add_factor_source(FactorSource::sample_ledger()) + .await + .unwrap(); + os.add_factor_source(FactorSource::sample_password()) + .await + .unwrap(); + let factor_sources = &os.profile().unwrap().factor_sources; + let matrix_ids = MatrixTemplate::config_1_4() + .materialize(factor_sources.items()) + .unwrap(); + + let matrix_0 = + MatrixOfFactorSources::new(matrix_ids, factor_sources).unwrap(); + + let shield_0 = SecurityStructureOfFactorSources::new( + DisplayName::sample(), + matrix_0, + bdfs.clone(), + ); + + let cache_client = Arc::new(os.clients.factor_instances_cache.clone()); + let profile = Arc::new(os.profile().unwrap()); + let derivation_interactors = os.keys_derivation_interactor(); + + let (instances_in_cache_consumer, outcome) = + SecurifyEntityFactorInstancesProvider::securifying_unsecurified( + cache_client.clone(), + profile, + shield_0.clone(), + IndexSet::from_iter([ + AddressOfAccountOrPersona::from(alice.address()), + AddressOfAccountOrPersona::from(batman.address()), + ]), + derivation_interactors.clone(), + ) + .await + .unwrap(); + + assert_eq!(outcome.per_derivation_preset.len(), 4); + + // don't forget to consume + instances_in_cache_consumer.consume().await.unwrap(); + + let account_outcome = outcome + .get_derivation_preset_for_factor( + DerivationPreset::AccountMfa, + &bdfs.id_from_hash(), + ) + .unwrap(); + assert_eq!(account_outcome.to_use_directly.len(), 1); + + let persona_outcome = outcome + .get_derivation_preset_for_factor( + DerivationPreset::AccountMfa, + &bdfs.id_from_hash(), + ) + .unwrap(); + assert_eq!(persona_outcome.to_use_directly.len(), 1); +} diff --git a/crates/sargon/src/system/sargon_os/mod.rs b/crates/sargon/src/system/sargon_os/mod.rs index 70aa35a50..56f1ad2fa 100644 --- a/crates/sargon/src/system/sargon_os/mod.rs +++ b/crates/sargon/src/system/sargon_os/mod.rs @@ -1,4 +1,5 @@ mod delete_account; +mod entity_creating_with_factor_source_and_derivation_outcome; mod pre_authorization; mod profile_state_holder; mod sargon_os; @@ -14,18 +15,14 @@ mod sargon_os_signing; mod sargon_os_sync_accounts; mod transactions; +#[cfg(test)] +mod factor_instances_provider_unit_tests; + pub use delete_account::*; +pub use entity_creating_with_factor_source_and_derivation_outcome::*; pub use pre_authorization::*; pub use profile_state_holder::*; pub use sargon_os::*; pub use sargon_os_accounts::*; -pub use sargon_os_entities_linked_to_factor_source::*; pub use sargon_os_factors::*; -pub use sargon_os_gateway::*; -pub use sargon_os_personas::*; -pub use sargon_os_profile::*; -pub use sargon_os_security_center::*; -pub use sargon_os_security_structures::*; -pub use sargon_os_signing::*; -pub use sargon_os_sync_accounts::*; pub use transactions::*; diff --git a/crates/sargon/src/system/sargon_os/pre_authorization/mod.rs b/crates/sargon/src/system/sargon_os/pre_authorization/mod.rs index ad4032676..601577bf0 100644 --- a/crates/sargon/src/system/sargon_os/pre_authorization/mod.rs +++ b/crates/sargon/src/system/sargon_os/pre_authorization/mod.rs @@ -2,6 +2,4 @@ mod sargon_os_create_subintent; mod sargon_os_pre_authorization_status; mod support; -pub use sargon_os_create_subintent::*; -pub use sargon_os_pre_authorization_status::*; pub use support::*; diff --git a/crates/sargon/src/system/sargon_os/pre_authorization/sargon_os_create_subintent.rs b/crates/sargon/src/system/sargon_os/pre_authorization/sargon_os_create_subintent.rs index 7f5b4b10b..85322965b 100644 --- a/crates/sargon/src/system/sargon_os/pre_authorization/sargon_os_create_subintent.rs +++ b/crates/sargon/src/system/sargon_os/pre_authorization/sargon_os_create_subintent.rs @@ -90,7 +90,7 @@ impl SargonOS { mod tests { use super::*; use actix_rt::time::timeout; - use std::{future::Future, time::Duration}; + use std::time::Duration; #[allow(clippy::upper_case_acronyms)] type SUT = SargonOS; diff --git a/crates/sargon/src/system/sargon_os/pre_authorization/sargon_os_pre_authorization_status.rs b/crates/sargon/src/system/sargon_os/pre_authorization/sargon_os_pre_authorization_status.rs index c9a6d9457..bf353fa04 100644 --- a/crates/sargon/src/system/sargon_os/pre_authorization/sargon_os_pre_authorization_status.rs +++ b/crates/sargon/src/system/sargon_os/pre_authorization/sargon_os_pre_authorization_status.rs @@ -129,11 +129,10 @@ impl SargonOS { #[cfg(test)] mod poll_pre_authorization_status_with_delays { use super::*; - use actix_rt::time::timeout; - use std::{future::Future, time::Duration}; #[allow(clippy::upper_case_acronyms)] type SUT = SargonOS; + #[allow(clippy::upper_case_acronyms)] type SSR = SubintentStatusResponse; diff --git a/crates/sargon/src/system/sargon_os/profile_state_holder.rs b/crates/sargon/src/system/sargon_os/profile_state_holder.rs index 78cd5cbe3..6f53eb94e 100644 --- a/crates/sargon/src/system/sargon_os/profile_state_holder.rs +++ b/crates/sargon/src/system/sargon_os/profile_state_holder.rs @@ -1,23 +1,5 @@ -use async_std::sync::RwLockWriteGuard; - use crate::prelude::*; -use std::{borrow::Borrow, sync::RwLock}; - -#[derive(Debug, Clone, PartialEq, EnumAsInner, derive_more::Display)] -#[allow(clippy::large_enum_variant)] -pub enum ProfileState { - /// When no profile exists in secure storage when OS is booted. - None, - - /// When the profile snapshot retrieved from secure storage failed to convert into a - /// valid Profile. - Incompatible(CommonError), - - /// When a valid 'Profile' exists. This can either happen when the os boots, or a profile is - /// restored, or the user creates a new profile. - #[display("Loaded: {}", _0.id())] - Loaded(Profile), -} +use std::sync::RwLock; #[derive(Debug)] pub struct ProfileStateHolder { @@ -198,7 +180,7 @@ impl ProfileStateHolder { #[cfg(test)] mod tests { use crate::prelude::*; - use std::sync::{Arc, RwLock}; + use std::sync::Arc; use std::thread; use std::time::Duration; diff --git a/crates/sargon/src/system/sargon_os/sargon_os.rs b/crates/sargon/src/system/sargon_os/sargon_os.rs index a9f0ee7a6..1606aabb7 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os.rs +++ b/crates/sargon/src/system/sargon_os/sargon_os.rs @@ -1,8 +1,4 @@ -use std::{cell::Cell, sync::Once}; - -use sbor::prelude::indexmap::IndexMap; - -use crate::{prelude::*, system::interactors}; +use crate::prelude::*; /// The Sargon "Operating System" is the root "manager" of the Sargon library /// which holds an in-memory Profile and a collection of "clients" which are @@ -17,6 +13,15 @@ pub struct SargonOS { pub(crate) host_id: HostId, } +pub trait WithBios: Sized { + fn new(bios: Arc) -> Self; +} +impl WithBios for Clients { + fn new(bios: Arc) -> Self { + Self::with_drivers(bios.drivers.clone()) + } +} + /// So that we do not have to go through `self.clients`, /// but can use e.g. `self.secure_storage` directly. impl Deref for SargonOS { @@ -502,7 +507,6 @@ impl SargonOS { #[cfg(test)] mod tests { - use std::time::Duration; use actix_rt::time::timeout; diff --git a/crates/sargon/src/system/sargon_os/sargon_os_accounts.rs b/crates/sargon/src/system/sargon_os/sargon_os_accounts.rs index 9f25ac777..52442ade4 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os_accounts.rs +++ b/crates/sargon/src/system/sargon_os/sargon_os_accounts.rs @@ -1,7 +1,3 @@ -use std::{borrow::Borrow, sync::RwLockWriteGuard}; - -use radix_common::address; - use crate::prelude::*; // ================== @@ -553,7 +549,12 @@ impl SargonOS { self.add_entity(account).await } - pub async fn add_entity(&self, entity: E) -> Result<()> { + pub async fn add_entity< + E: IsEntity + IsProfileModifiedEvent, + >( + &self, + entity: E, + ) -> Result<()> { let address = entity.address(); debug!("Adding entity with address: {} to profile", address); self.add_entities(IdentifiedVecOf::just(entity)).await @@ -748,7 +749,9 @@ impl SargonOS { /// # Emits /// Emits `Event::ProfileSaved` after having successfully written the JSON /// of the active profile to secure storage. - pub async fn add_entities( + pub async fn add_entities< + E: IsEntity + IsProfileModifiedEvent, + >( &self, entities: impl IntoIterator, ) -> Result<()> { @@ -841,7 +844,11 @@ impl SargonOS { if let Some(event) = E::profile_modified_event( false, - entities.clone().into_iter().map(|e| e.address()).collect(), + entities + .clone() + .into_iter() + .map(|e| e.address()) + .collect::>(), ) { self.event_bus .emit(EventNotification::profile_modified(event)) @@ -987,7 +994,7 @@ impl SargonOS { mod tests { use super::*; use actix_rt::time::timeout; - use std::{future::join, future::Future, time::Duration}; + use futures::future::join_all; #[allow(clippy::upper_case_acronyms)] type SUT = SargonOS; diff --git a/crates/sargon/src/system/sargon_os/sargon_os_factors.rs b/crates/sargon/src/system/sargon_os/sargon_os_factors.rs index 6ac077796..6848388d8 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os_factors.rs +++ b/crates/sargon/src/system/sargon_os/sargon_os_factors.rs @@ -1,6 +1,6 @@ use std::borrow::Borrow; -use crate::{prelude::*, profile}; +use crate::prelude::*; /// If we wanna create an Olympia DeviceFactorSource or /// a Babylon one, either main or not. @@ -519,7 +519,6 @@ mod tests { use super::*; use actix_rt::time::timeout; - use std::{future::Future, time::Duration}; #[allow(clippy::upper_case_acronyms)] type SUT = SargonOS; diff --git a/crates/sargon/src/system/sargon_os/sargon_os_gateway.rs b/crates/sargon/src/system/sargon_os/sargon_os_gateway.rs index 462f13318..fd87edeb9 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os_gateway.rs +++ b/crates/sargon/src/system/sargon_os/sargon_os_gateway.rs @@ -88,7 +88,6 @@ impl SargonOS { mod tests { use super::*; use actix_rt::time::timeout; - use std::{future::Future, time::Duration}; #[allow(clippy::upper_case_acronyms)] type SUT = SargonOS; diff --git a/crates/sargon/src/system/sargon_os/sargon_os_personas.rs b/crates/sargon/src/system/sargon_os/sargon_os_personas.rs index b1d372ce5..639782ce3 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os_personas.rs +++ b/crates/sargon/src/system/sargon_os/sargon_os_personas.rs @@ -1,5 +1,3 @@ -use std::{borrow::Borrow, sync::RwLockWriteGuard}; - use crate::prelude::*; // ================== @@ -540,7 +538,6 @@ impl SargonOS { mod tests { use super::*; use actix_rt::time::timeout; - use std::{future::Future, time::Duration}; #[allow(clippy::upper_case_acronyms)] type SUT = SargonOS; diff --git a/crates/sargon/src/system/sargon_os/sargon_os_profile.rs b/crates/sargon/src/system/sargon_os/sargon_os_profile.rs index 73c60c328..251142465 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os_profile.rs +++ b/crates/sargon/src/system/sargon_os/sargon_os_profile.rs @@ -1,7 +1,5 @@ #![allow(deprecated)] -use std::sync::RwLockWriteGuard; - use crate::prelude::*; impl SargonOS { diff --git a/crates/sargon/src/system/sargon_os/sargon_os_security_structures.rs b/crates/sargon/src/system/sargon_os/sargon_os_security_structures.rs index 7a809c0d0..09bbec7fb 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os_security_structures.rs +++ b/crates/sargon/src/system/sargon_os/sargon_os_security_structures.rs @@ -120,7 +120,6 @@ mod tests { use super::*; use actix_rt::time::timeout; - use std::{future::Future, time::Duration}; #[allow(clippy::upper_case_acronyms)] type SUT = SargonOS; diff --git a/crates/sargon/src/system/sargon_os/sargon_os_signing.rs b/crates/sargon/src/system/sargon_os/sargon_os_signing.rs index f4379fbbb..e1e9cbf6f 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os_signing.rs +++ b/crates/sargon/src/system/sargon_os/sargon_os_signing.rs @@ -1,5 +1,4 @@ use crate::prelude::*; -use std::ops::Index; // ================== // Sign Signables diff --git a/crates/sargon/src/system/sargon_os/sargon_os_sync_accounts.rs b/crates/sargon/src/system/sargon_os/sargon_os_sync_accounts.rs index b23fdc66c..42b103757 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os_sync_accounts.rs +++ b/crates/sargon/src/system/sargon_os/sargon_os_sync_accounts.rs @@ -71,6 +71,8 @@ mod tests { #[allow(clippy::upper_case_acronyms)] type SUT = SargonOS; + use radix_common::prelude::ACCOUNT_OWNER_BADGE as SCRYPTO_ACCOUNT_OWNER_BADGE; + #[actix_rt::test] async fn test_sync_accounts_deleted_on_ledger() { // ARRANGE diff --git a/crates/sargon/src/system/sargon_os/transactions/mod.rs b/crates/sargon/src/system/sargon_os/transactions/mod.rs index 58bcdad43..d2fa5e92c 100644 --- a/crates/sargon/src/system/sargon_os/transactions/mod.rs +++ b/crates/sargon/src/system/sargon_os/transactions/mod.rs @@ -3,7 +3,4 @@ mod sargon_os_transaction_status; mod sargon_os_transaction_submit; mod support; -pub use sargon_os_transaction_analysis::*; -pub use sargon_os_transaction_status::*; -pub use sargon_os_transaction_submit::*; pub use support::*; diff --git a/crates/sargon/src/system/sargon_os/transactions/sargon_os_transaction_analysis.rs b/crates/sargon/src/system/sargon_os/transactions/sargon_os_transaction_analysis.rs index 1aa110f97..1bb3923d6 100644 --- a/crates/sargon/src/system/sargon_os/transactions/sargon_os_transaction_analysis.rs +++ b/crates/sargon/src/system/sargon_os/transactions/sargon_os_transaction_analysis.rs @@ -303,12 +303,10 @@ struct PreviewResponseReceipts { #[cfg(test)] mod transaction_preview_analysis_tests { use super::*; - use radix_common::prelude::Decimal; use radix_engine_toolkit_common::receipt::{ - AsStr, FeeSummary as RETFeeSummary, LockedFees as RETLockedFees, + FeeSummary as RETFeeSummary, LockedFees as RETLockedFees, StateUpdatesSummary as RETStateUpdatesSummary, }; - use std::sync::Mutex; #[allow(clippy::upper_case_acronyms)] type SUT = SargonOS; diff --git a/crates/sargon/src/system/sargon_os/transactions/sargon_os_transaction_status.rs b/crates/sargon/src/system/sargon_os/transactions/sargon_os_transaction_status.rs index 6bd115bc0..16df8259a 100644 --- a/crates/sargon/src/system/sargon_os/transactions/sargon_os_transaction_status.rs +++ b/crates/sargon/src/system/sargon_os/transactions/sargon_os_transaction_status.rs @@ -96,8 +96,6 @@ impl SargonOS { #[cfg(test)] mod tests { use super::*; - use actix_rt::time::timeout; - use std::{future::Future, time::Duration}; #[allow(clippy::upper_case_acronyms)] type SUT = SargonOS; diff --git a/crates/sargon/src/system/sargon_os/transactions/sargon_os_transaction_submit.rs b/crates/sargon/src/system/sargon_os/transactions/sargon_os_transaction_submit.rs index a4bca82da..44355bd2a 100644 --- a/crates/sargon/src/system/sargon_os/transactions/sargon_os_transaction_submit.rs +++ b/crates/sargon/src/system/sargon_os/transactions/sargon_os_transaction_submit.rs @@ -23,8 +23,6 @@ impl SargonOS { #[cfg(test)] mod tests { use super::*; - use actix_rt::time::timeout; - use std::{future::Future, time::Duration}; #[allow(clippy::upper_case_acronyms)] type SUT = SargonOS; diff --git a/crates/sargon/src/system/sargon_os/transactions/support/signable_manifest_summary.rs b/crates/sargon/src/system/sargon_os/transactions/support/signable_manifest_summary.rs index 6945713d2..e8d641990 100644 --- a/crates/sargon/src/system/sargon_os/transactions/support/signable_manifest_summary.rs +++ b/crates/sargon/src/system/sargon_os/transactions/support/signable_manifest_summary.rs @@ -31,7 +31,6 @@ impl HasSampleValues for SignableManifestSummary { } } -#[cfg(not(tarpaulin_include))] impl IntoIterator for SignableManifestSummary { type Item = SignatureWithPublicKey; type IntoIter = as IntoIterator>::IntoIter; @@ -71,12 +70,10 @@ impl Signable for SignableManifestSummary { self.id } - #[cfg(not(tarpaulin_include))] fn get_payload(&self) -> Self::Payload { panic!("Manifest summary cannot be actually signed") } - #[cfg(not(tarpaulin_include))] fn signed( &self, _signatures_per_owner: IndexMap< diff --git a/crates/sargon/src/system/subsystems/log_system/log_system.rs b/crates/sargon/src/system/subsystems/log_system/log_system.rs index f6f17bd73..c8a9afb59 100644 --- a/crates/sargon/src/system/subsystems/log_system/log_system.rs +++ b/crates/sargon/src/system/subsystems/log_system/log_system.rs @@ -1,4 +1,4 @@ -use std::{ffi::OsStr, sync::Once}; +use std::sync::Once; use crate::prelude::*; @@ -63,6 +63,8 @@ pub fn rust_logger_set_level(level: LogFilter) { ); } +use enum_iterator::all; + /// Returns every supported LogFilter pub fn rust_logger_get_all_filters() -> Vec { all::().collect() diff --git a/crates/sargon/src/types/mod.rs b/crates/sargon/src/types/mod.rs index cdeacaeee..62f30511f 100644 --- a/crates/sargon/src/types/mod.rs +++ b/crates/sargon/src/types/mod.rs @@ -2,12 +2,8 @@ mod hd_signature; mod hd_signature_input; mod invalid_transaction_if_neglected; mod owned_types; -mod samples; pub use hd_signature::*; pub use hd_signature_input::*; pub use invalid_transaction_if_neglected::*; pub use owned_types::*; - -#[cfg(test)] -pub(crate) use samples::*; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/mod.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/mod.rs deleted file mode 100644 index 6a5033f08..000000000 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/mod.rs +++ /dev/null @@ -1,25 +0,0 @@ -mod assert_manifest; -mod bucket; -mod bucket_factory; -mod delete_account; -mod manifest_account_locker; -mod manifest_assets_transfers; -mod manifests; -mod manifests_access_controller; -mod manifests_create_tokens; -mod metadata; -mod modify_manifest; -mod third_party_deposit_update; - -pub use assert_manifest::*; -pub use bucket::*; -pub use bucket_factory::*; -pub use delete_account::*; -pub use manifest_account_locker::*; -pub use manifest_assets_transfers::*; -pub use manifests::*; -pub use manifests_access_controller::*; -pub use manifests_create_tokens::*; -pub use metadata::*; -pub use modify_manifest::*; -pub use third_party_deposit_update::*; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/execution_summary/mod.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/execution_summary/mod.rs deleted file mode 100644 index 92f0d8085..000000000 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/execution_summary/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -mod transaction_manifest_execution_summary; - -pub use transaction_manifest_execution_summary::*; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/execution_summary_v2/mod.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/execution_summary_v2/mod.rs deleted file mode 100644 index 56d582206..000000000 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/execution_summary_v2/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -mod transaction_manifest_execution_summary_v2; - -pub use transaction_manifest_execution_summary_v2::*; diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/mod.rs b/crates/sargon/src/wrapped_radix_engine_toolkit/mod.rs deleted file mode 100644 index cebce8201..000000000 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/mod.rs +++ /dev/null @@ -1,6 +0,0 @@ -mod high_level; -mod is_intent_signing; -mod low_level; -pub use high_level::*; -pub use is_intent_signing::*; -pub use low_level::*; diff --git a/crates/sargon/tests/integration/main.rs b/crates/sargon/tests/integration/main.rs index 9e6e47925..ad3de081c 100644 --- a/crates/sargon/tests/integration/main.rs +++ b/crates/sargon/tests/integration/main.rs @@ -91,7 +91,9 @@ mod integration_tests { let transfers = PerRecipientAssetTransfers::new( from, [PerRecipientAssetTransfer::new( - to, + OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { + value: to, + }, [PerRecipientFungibleTransfer::new( resource, amount, true, None, )], diff --git a/jvm/sargon-android/build.gradle.kts b/jvm/sargon-android/build.gradle.kts index 7cddc7866..e0685fdc9 100644 --- a/jvm/sargon-android/build.gradle.kts +++ b/jvm/sargon-android/build.gradle.kts @@ -283,7 +283,6 @@ afterEvaluate { commandLine( "cargo", "run", "-p", "sargon-uniffi", - "--features", "build-binary", "--bin", "sargon-bindgen", "generate", "--library", binaryFile.toString(), "--language", "kotlin", diff --git a/jvm/sargon-android/src/test/java/com/radixdlt/sargon/ProfileTest.kt b/jvm/sargon-android/src/test/java/com/radixdlt/sargon/ProfileTest.kt index 05d058315..5f08066e9 100644 --- a/jvm/sargon-android/src/test/java/com/radixdlt/sargon/ProfileTest.kt +++ b/jvm/sargon-android/src/test/java/com/radixdlt/sargon/ProfileTest.kt @@ -143,7 +143,7 @@ class ProfileTest : SampleTestable { @Test fun testCheckIfEncryptedProfileJsonContainsLegacyP2PLinksWhenP2PLinksArePresent() { - val json = File("../../" + "crates/sargon/fixtures/vector/profile_encrypted_by_password_of_babylon.json").readText() + val json = File("../../" + "crates/sargon-profile/fixtures/vector/profile_encrypted_by_password_of_babylon.json").readText() assertEquals( true, Profile.checkIfEncryptedProfileJsonContainsLegacyP2PLinks(json, "babylon") diff --git a/jvm/sargon-android/src/test/java/com/radixdlt/sargon/TransactionManifestTest.kt b/jvm/sargon-android/src/test/java/com/radixdlt/sargon/TransactionManifestTest.kt index 4a1f16db2..f4f4021c8 100644 --- a/jvm/sargon-android/src/test/java/com/radixdlt/sargon/TransactionManifestTest.kt +++ b/jvm/sargon-android/src/test/java/com/radixdlt/sargon/TransactionManifestTest.kt @@ -342,18 +342,17 @@ class TransactionManifestTest : SampleTestable { ) perAssetTransfer.transfers.forEach { when (val recipient = it.recipient) { - is AccountOrAddressOf.AddressOfExternalAccount -> + is OwnedOrThirdPartyAccountAddress.ThirdPartyAccount -> assertTrue( contains( recipient.value .string ) ) - is AccountOrAddressOf.ProfileAccount -> + is OwnedOrThirdPartyAccountAddress.OwnedAccount -> assertTrue( contains( recipient.value - .address .string ) ) @@ -377,8 +376,8 @@ class TransactionManifestTest : SampleTestable { listOf( PerRecipientAssetTransfer( recipient = - AccountOrAddressOf - .AddressOfExternalAccount( + OwnedOrThirdPartyAccountAddress + .ThirdPartyAccount( value = AccountAddress( "account_rdx12xkzynhzgtpnnd02tudw2els2g9xl73yk54ppw8xekt2sdrlaer264" @@ -588,7 +587,7 @@ class TransactionManifestTest : SampleTestable { @Test fun testAccountLockerClaim() { val expectedManifest = TransactionManifest.init( - instructionsString = openFile("account_locker_claim", "rtm").readText(), + instructionsString = openFileInManifests("account_locker_claim", "rtm").readText(), networkId = NetworkId.MAINNET ) var actualManifest = TransactionManifest.accountLockerClaim( @@ -643,12 +642,15 @@ class TransactionManifestTest : SampleTestable { private fun manifest(name: String) = TransactionManifest.init( - instructionsString = openFile(name, "rtm").readText(), + instructionsString = openFileInTxModels(name, "rtm").readText(), networkId = NetworkId.STOKENET ) - private fun engineToolkitReceipt(name: String): String = openFile(name, "dat").readText() + private fun engineToolkitReceipt(name: String): String = openFileInTxModels(name, "dat").readText() - private fun openFile(name: String, extension: String) = - File("../../" + "crates/sargon/fixtures/transaction/$name.$extension") + private fun openFileInCrate(crate: String, name: String, extension: String) = + File("../../" + "crates/" + crate + "/fixtures/transaction/$name.$extension") + + private fun openFileInTxModels(name: String, extension: String) = openFileInCrate("sargon-transaction-models", name, extension) + private fun openFileInManifests(name: String, extension: String) = openFileInCrate("sargon-manifests", name, extension) } diff --git a/scripts/ios/build-sargon.sh b/scripts/ios/build-sargon.sh index f92964d7f..2c4b16a30 100755 --- a/scripts/ios/build-sargon.sh +++ b/scripts/ios/build-sargon.sh @@ -44,7 +44,7 @@ generate_ffi() { else local TARGET_FOR_DYLIB_PATH="aarch64-apple-ios" fi - cargo run -p sargon-uniffi --features build-binary --bin sargon-bindgen generate --library target/$TARGET_FOR_DYLIB_PATH/release/lib$1_uniffi.dylib --language swift --out-dir target/uniffi-xcframework-staging + cargo run -p sargon-uniffi --bin sargon-bindgen generate --library target/$TARGET_FOR_DYLIB_PATH/release/lib$1_uniffi.dylib --language swift --out-dir target/uniffi-xcframework-staging mkdir -p apple/Sources/UniFFI/ mv target/uniffi-xcframework-staging/*.swift apple/Sources/UniFFI/ mv target/uniffi-xcframework-staging/$1FFI.modulemap target/uniffi-xcframework-staging/module.modulemap # Convention requires this have a specific name From e46165668e73e451f48a19b1744b1a5969cfb202 Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Thu, 2 Jan 2025 15:42:25 +0100 Subject: [PATCH 07/13] Use `default-members` in workspace and excluding `sargon-uniffi` crate for faster default developer experience. --- .pre-commit-config.yaml | 2 +- Cargo.toml | 34 +++++++++++++++++++ .../system/sargon_os/sargon_os_personas.rs | 4 ++- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 16a793f41..ea2ee4d2c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,5 +41,5 @@ repos: name: unit tests language: system types: [file, rust] - entry: cargo test --lib + entry: cargo test --workspace --lib pass_filenames: false diff --git a/Cargo.toml b/Cargo.toml index 930ad069b..6d22fe8c0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,6 +37,40 @@ members = [ "crates/sargon-uniffi", ] +default-members = [ + # sorted according to dependency, not alphabetically + "crates/sargon-core-utils", + "crates/sargon-core-error", + "crates/sargon-core-assert-json", + + "crates/identified-vec-of", + + "crates/sargon-core", + "crates/sargon-hierarchical-deterministic", + "crates/sargon-factors", + "crates/sargon-factors-supporting-types", + "crates/sargon-addresses", + "crates/sargon-keys-collector", + "crates/sargon-transaction-models", + "crates/sargon-manifests", + "crates/sargon-profile-supporting-types", + "crates/sargon-drivers", + "crates/http-client", + "crates/sargon-clients", + "crates/sargon-profile-gateway", + "crates/sargon-profile", + "crates/sargon-profile-app-preferences", + "crates/sargon-profile-security-structures", + "crates/sargon-profile-logic", + "crates/sargon-factor-instances-provider", + "crates/next-derivation-index-ephemeral", + + "crates/gateway-models", + "crates/gateway-client-and-api", + + "crates/sargon", # to be split +] + [profile.release] incremental = false panic = 'unwind' diff --git a/crates/sargon/src/system/sargon_os/sargon_os_personas.rs b/crates/sargon/src/system/sargon_os/sargon_os_personas.rs index 639782ce3..935282de8 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os_personas.rs +++ b/crates/sargon/src/system/sargon_os/sargon_os_personas.rs @@ -893,7 +893,9 @@ mod tests { // ARRANGE (and ACT) let event_bus_driver = RustEventBusDriver::new(); let drivers = Drivers::with_event_bus(event_bus_driver.clone()); - let clients = Clients::new(Bios::new(drivers)); + let mut clients = Clients::new(Bios::new(drivers)); + clients.factor_instances_cache = + FactorInstancesCacheClient::in_memory(); let interactors = Interactors::new_from_clients(&clients); let os = timeout( From d81f018c2186d25d65935fdf9142dcfdb3d06b43 Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Thu, 2 Jan 2025 18:20:30 +0100 Subject: [PATCH 08/13] ensure FactorInstancesCacheClient uses In-Memory cache for more tests --- crates/sargon/src/system/sargon_os/sargon_os.rs | 5 +++-- .../src/system/sargon_os/sargon_os_personas.rs | 12 +++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/crates/sargon/src/system/sargon_os/sargon_os.rs b/crates/sargon/src/system/sargon_os/sargon_os.rs index 1606aabb7..94b21fa92 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os.rs +++ b/crates/sargon/src/system/sargon_os/sargon_os.rs @@ -407,8 +407,9 @@ impl SargonOS { let test_drivers = Drivers::with_file_system(InMemoryFileSystemDriver::new()); let bios = Bios::new(test_drivers); - let clients = Clients::new(bios.clone()); - + let mut clients = Clients::new(bios.clone()); + clients.factor_instances_cache = + FactorInstancesCacheClient::in_memory(); let keys_derivation_interactor = derivation_interactor.into().unwrap_or_else(|| { Arc::new(TestDerivationInteractor::new( diff --git a/crates/sargon/src/system/sargon_os/sargon_os_personas.rs b/crates/sargon/src/system/sargon_os/sargon_os_personas.rs index 935282de8..8376b9070 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os_personas.rs +++ b/crates/sargon/src/system/sargon_os/sargon_os_personas.rs @@ -863,7 +863,9 @@ mod tests { // ARRANGE (and ACT) let event_bus_driver = RustEventBusDriver::new(); let drivers = Drivers::with_event_bus(event_bus_driver.clone()); - let clients = Clients::new(Bios::new(drivers)); + let mut clients = Clients::new(Bios::new(drivers)); + clients.factor_instances_cache = + FactorInstancesCacheClient::in_memory(); let interactors = Interactors::new_from_clients(&clients); let os = timeout( @@ -991,7 +993,9 @@ mod tests { // ARRANGE (and ACT) let event_bus_driver = RustEventBusDriver::new(); let drivers = Drivers::with_event_bus(event_bus_driver.clone()); - let clients = Clients::new(Bios::new(drivers)); + let mut clients = Clients::new(Bios::new(drivers)); + clients.factor_instances_cache = + FactorInstancesCacheClient::in_memory(); let interactors = Interactors::new_from_clients(&clients); let os = timeout( @@ -1025,7 +1029,9 @@ mod tests { // ARRANGE (and ACT) let event_bus_driver = RustEventBusDriver::new(); let drivers = Drivers::with_event_bus(event_bus_driver.clone()); - let clients = Clients::new(Bios::new(drivers)); + let mut clients = Clients::new(Bios::new(drivers)); + clients.factor_instances_cache = + FactorInstancesCacheClient::in_memory(); let interactors = Interactors::new_from_clients(&clients); let os = timeout( From 2d21cc21e5b7cb9f4577886c285dc4a3b433bece Mon Sep 17 00:00:00 2001 From: Alexander Cyon <116169792+CyonAlexRDX@users.noreply.github.com> Date: Fri, 3 Jan 2025 13:45:06 +0100 Subject: [PATCH 09/13] Ac/split udeps (#327) * Remove many unused dependencies * fix more FactorInstancesCache not using in-memory scenarios causing unit tests to fail. --------- Co-authored-by: Alexander Cyon --- Cargo.lock | 374 ------- SPLIT.md | 924 ------------------ crates/sargon-addresses/Cargo.toml | 1 - crates/sargon-addresses/src/lib.rs | 1 + crates/sargon-clients/Cargo.toml | 36 +- .../factor_instances_cache_client/client.rs | 6 +- crates/sargon-core-error/Cargo.toml | 3 +- crates/sargon-core/Cargo.toml | 5 - .../src/encryption/encryption_key.rs | 3 +- crates/sargon-core/src/lib.rs | 5 +- crates/sargon-drivers/Cargo.toml | 34 +- .../Cargo.toml | 31 +- crates/sargon-factors/Cargo.toml | 22 - .../factor_instance/factor_instance_badge.rs | 32 +- .../Cargo.toml | 18 - crates/sargon-manifests/Cargo.toml | 24 - .../per_recipient_asset_transfers.rs | 1 - crates/sargon-manifests/src/lib.rs | 41 +- .../sargon-profile-app-preferences/Cargo.toml | 42 +- crates/sargon-profile-gateway/Cargo.toml | 40 +- crates/sargon-profile-logic/Cargo.toml | 10 +- .../src/logic/persona/persona_data_ids.rs | 2 - .../logic/persona/shared_persona_data_ids.rs | 1 - .../Cargo.toml | 38 +- .../src/lib.rs | 19 +- .../security_shield_builder.rs | 4 +- .../Cargo.toml | 10 +- crates/sargon-profile/Cargo.toml | 39 +- crates/sargon-transaction-models/Cargo.toml | 20 +- crates/sargon-transaction-models/src/lib.rs | 28 +- crates/sargon/Cargo.toml | 28 - .../home_cards/deferred_deep_link/parser.rs | 3 +- crates/sargon/src/lib.rs | 89 -- .../src/signing/testing/simulated_user.rs | 2 - .../factor_instances_provider_unit_tests.rs | 6 +- .../sargon/src/system/sargon_os/sargon_os.rs | 36 +- .../system/sargon_os/sargon_os_accounts.rs | 16 +- ...gon_os_entities_linked_to_factor_source.rs | 4 +- .../src/system/sargon_os/sargon_os_factors.rs | 4 +- .../src/system/sargon_os/sargon_os_gateway.rs | 8 +- .../src/system/sargon_os/sargon_os_profile.rs | 8 +- .../sargon_os_security_structures.rs | 8 +- .../src/system/sargon_os/sargon_os_signing.rs | 8 +- 43 files changed, 155 insertions(+), 1879 deletions(-) delete mode 100644 SPLIT.md diff --git a/Cargo.lock b/Cargo.lock index 987908c6e..8227ef9e0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2828,42 +2828,24 @@ name = "sargon" version = "1.1.99" dependencies = [ "actix-rt", - "aes-gcm", - "assert-json-diff", "async-std", "async-trait", "base64 0.22.1 (git+https://github.com/marshallpierce/rust-base64.git?rev=e14400697453bcc85997119b874bc03d9601d0af)", - "camino 1.0.8", "cargo_toml 0.15.3 (git+https://gitlab.com/lib.rs/cargo_toml?rev=e498c94fc42a660c1ca1a28999ce1d757cfe77fe)", - "delegate", "derive_more", - "enum-as-inner", "enum-iterator", "futures", "gateway-client-and-api", "gateway-models", "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", - "hkdf", "identified-vec-of", - "iota-crypto", - "iso8601-timestamp", - "itertools 0.12.0", - "k256 0.13.3", "log", - "once_cell 1.19.0", "paste 1.0.14", "pretty_assertions", - "pretty_env_logger", "radix-common", - "radix-common-derive", - "radix-engine", "radix-engine-interface", - "radix-engine-toolkit", "radix-engine-toolkit-common", - "radix-rust", "radix-transactions", - "rand", - "reqwest", "sargon-addresses", "sargon-clients", "sargon-core", @@ -2877,18 +2859,11 @@ dependencies = [ "sargon-profile-logic", "sargon-profile-security-structures", "sargon-transaction-models", - "sbor", "security-framework", "security-framework-sys", "serde", "serde_json 1.0.108", - "serde_repr", "serde_with 3.4.0", - "strum 0.26.1", - "thiserror 1.0.50", - "url", - "uuid 1.6.1", - "zeroize 1.7.0", ] [[package]] @@ -2904,7 +2879,6 @@ dependencies = [ "radix-engine-interface", "radix-engine-toolkit", "radix-rust", - "radix-transactions", "sargon-core", "sargon-factors", "sargon-hierarchical-deterministic", @@ -2918,56 +2892,21 @@ name = "sargon-clients" version = "1.1.99" dependencies = [ "actix-rt", - "aes-gcm", - "assert-json-diff", - "async-std", "async-trait", - "base64 0.22.1 (git+https://github.com/marshallpierce/rust-base64.git?rev=e14400697453bcc85997119b874bc03d9601d0af)", - "camino 1.0.8", - "delegate", "derive_more", "enum-as-inner", - "enum-iterator", - "futures", "gateway-client-and-api", - "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", - "hkdf", "http-client", - "iota-crypto", - "iso8601-timestamp", - "itertools 0.12.0", - "k256 0.13.3", - "log", - "once_cell 1.19.0", - "paste 1.0.14", "pretty_assertions", - "pretty_env_logger", - "radix-common", - "radix-common-derive", - "radix-engine", - "radix-engine-interface", - "radix-engine-toolkit", - "radix-engine-toolkit-common", - "radix-rust", - "radix-transactions", - "rand", - "reqwest", "sargon-core", "sargon-drivers", "sargon-factors-supporting-types", "sargon-hierarchical-deterministic", "sargon-profile", "sargon-profile-supporting-types", - "sbor", "serde", "serde_json 1.0.108", - "serde_repr", "serde_with 3.4.0", - "strum 0.26.1", - "thiserror 1.0.50", - "url", - "uuid 1.6.1", - "zeroize 1.7.0", ] [[package]] @@ -2976,17 +2915,13 @@ version = "1.1.99" dependencies = [ "aes-gcm", "arraystring", - "assert-json-diff", "delegate", "derive_more", "enum-as-inner", "enum-iterator", "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", - "hkdf", "identified-vec-of", "iota-crypto", - "iso8601-timestamp", - "itertools 0.12.0", "k256 0.13.3", "log", "paste 1.0.14", @@ -3004,7 +2939,6 @@ dependencies = [ "serde_repr", "serde_with 3.4.0", "strum 0.26.1", - "thiserror 1.0.50", "url", "uuid 1.6.1", "zeroize 1.7.0", @@ -3051,53 +2985,20 @@ name = "sargon-drivers" version = "1.1.99" dependencies = [ "actix-rt", - "aes-gcm", - "assert-json-diff", - "async-std", "async-trait", - "base64 0.22.1 (git+https://github.com/marshallpierce/rust-base64.git?rev=e14400697453bcc85997119b874bc03d9601d0af)", - "camino 1.0.8", - "delegate", "derive_more", - "enum-as-inner", "enum-iterator", - "futures", - "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", - "hkdf", - "iota-crypto", - "iso8601-timestamp", - "itertools 0.12.0", - "k256 0.13.3", "log", - "once_cell 1.19.0", - "paste 1.0.14", - "pretty_assertions", "pretty_env_logger", - "radix-common", - "radix-common-derive", - "radix-engine", - "radix-engine-interface", - "radix-engine-toolkit", - "radix-engine-toolkit-common", - "radix-rust", - "radix-transactions", - "rand", "reqwest", "sargon-addresses", "sargon-core", "sargon-hierarchical-deterministic", "sargon-profile", "sargon-profile-supporting-types", - "sbor", "serde", "serde_json 1.0.108", - "serde_repr", - "serde_with 3.4.0", "strum 0.26.1", - "thiserror 1.0.50", - "url", - "uuid 1.6.1", - "zeroize 1.7.0", ] [[package]] @@ -3105,31 +3006,10 @@ name = "sargon-factor-instances-provider" version = "1.1.99" dependencies = [ "actix-rt", - "aes-gcm", - "arraystring", - "assert-json-diff", - "async-trait", - "delegate", "derive_more", - "enum-as-inner", - "enum-iterator", "futures", - "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", - "hkdf", "identified-vec-of", - "iota-crypto", - "iso8601-timestamp", - "itertools 0.12.0", - "k256 0.13.3", - "log", "next-derivation-index-ephemeral", - "paste 1.0.14", - "pretty_assertions", - "radix-common", - "radix-engine-interface", - "radix-rust", - "radix-transactions", - "rand", "sargon-addresses", "sargon-clients", "sargon-core", @@ -3142,55 +3022,26 @@ dependencies = [ "sargon-profile", "sargon-profile-logic", "sargon-profile-supporting-types", - "serde", - "serde_json 1.0.108", - "serde_repr", - "serde_with 3.4.0", - "strum 0.26.1", - "thiserror 1.0.50", - "url", - "uuid 1.6.1", - "zeroize 1.7.0", ] [[package]] name = "sargon-factors" version = "1.1.99" dependencies = [ - "arraystring", - "assert-json-diff", - "bip39", - "cargo_toml 0.15.3 (git+https://gitlab.com/lib.rs/cargo_toml?rev=e498c94fc42a660c1ca1a28999ce1d757cfe77fe)", - "delegate", "derive_more", - "enum-as-inner", "enum-iterator", - "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", "hkdf", "identified-vec-of", "iota-crypto", - "iso8601-timestamp", - "itertools 0.12.0", "k256 0.13.3", - "log", "once_cell 1.19.0", - "paste 1.0.14", - "pretty_assertions", "radix-common", "radix-engine-interface", - "radix-rust", - "radix-transactions", - "rand", "sargon-core", "sargon-hierarchical-deterministic", "serde", "serde_json 1.0.108", - "serde_repr", "serde_with 3.4.0", - "strum 0.26.1", - "thiserror 1.0.50", - "url", - "uuid 1.6.1", "zeroize 1.7.0", ] @@ -3209,36 +3060,18 @@ dependencies = [ name = "sargon-hierarchical-deterministic" version = "1.1.99" dependencies = [ - "assert-json-diff", "bip39", - "delegate", "derive_more", - "enum-as-inner", "enum-iterator", - "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", - "hkdf", "identified-vec-of", "iota-crypto", - "iso8601-timestamp", "itertools 0.12.0", - "k256 0.13.3", - "log", "paste 1.0.14", - "pretty_assertions", "radix-common", - "radix-engine-interface", - "radix-rust", - "radix-transactions", - "rand", "sargon-core", "serde", "serde_json 1.0.108", - "serde_repr", "serde_with 3.4.0", - "strum 0.26.1", - "thiserror 1.0.50", - "url", - "uuid 1.6.1", "zeroize 1.7.0", ] @@ -3261,33 +3094,17 @@ dependencies = [ name = "sargon-manifests" version = "1.1.99" dependencies = [ - "assert-json-diff", - "async-trait", "cargo_toml 0.15.3 (git+https://gitlab.com/lib.rs/cargo_toml?rev=e498c94fc42a660c1ca1a28999ce1d757cfe77fe)", - "delegate", "derive_more", - "enum-as-inner", - "enum-iterator", "gateway-models", - "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", "identified-vec-of", - "iota-crypto", - "iso8601-timestamp", - "itertools 0.12.0", - "k256 0.13.3", - "log", - "once_cell 1.19.0", - "paste 1.0.14", "pretty_assertions", "radix-common", - "radix-common-derive", "radix-engine", "radix-engine-interface", "radix-engine-toolkit", - "radix-engine-toolkit-common", "radix-rust", "radix-transactions", - "rand", "sargon-addresses", "sargon-core", "sargon-core-utils", @@ -3298,54 +3115,20 @@ dependencies = [ "sbor", "serde", "serde_json 1.0.108", - "serde_repr", - "serde_with 3.4.0", - "strum 0.26.1", - "thiserror 1.0.50", - "url", - "uuid 1.6.1", - "zeroize 1.7.0", ] [[package]] name = "sargon-profile" version = "1.1.99" dependencies = [ - "actix-rt", - "aes-gcm", - "assert-json-diff", - "async-std", - "async-trait", - "base64 0.22.1 (git+https://github.com/marshallpierce/rust-base64.git?rev=e14400697453bcc85997119b874bc03d9601d0af)", - "camino 1.0.8", "cargo_toml 0.15.3 (git+https://gitlab.com/lib.rs/cargo_toml?rev=e498c94fc42a660c1ca1a28999ce1d757cfe77fe)", - "delegate", "derive_more", - "enum-as-inner", "enum-iterator", - "futures", - "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", "hkdf", "identified-vec-of", - "iota-crypto", - "iso8601-timestamp", - "itertools 0.12.0", "k256 0.13.3", - "log", "once_cell 1.19.0", - "paste 1.0.14", "pretty_assertions", - "pretty_env_logger", - "radix-common", - "radix-common-derive", - "radix-engine", - "radix-engine-interface", - "radix-engine-toolkit", - "radix-engine-toolkit-common", - "radix-rust", - "radix-transactions", - "rand", - "reqwest", "sargon-addresses", "sargon-core", "sargon-factors", @@ -3354,55 +3137,18 @@ dependencies = [ "sargon-profile-app-preferences", "sargon-profile-security-structures", "sargon-transaction-models", - "sbor", "serde", "serde_json 1.0.108", "serde_repr", - "serde_with 3.4.0", "strum 0.26.1", - "thiserror 1.0.50", - "url", - "uuid 1.6.1", - "zeroize 1.7.0", ] [[package]] name = "sargon-profile-app-preferences" version = "1.1.99" dependencies = [ - "aes-gcm", - "assert-json-diff", - "async-std", - "async-trait", - "base64 0.22.1 (git+https://github.com/marshallpierce/rust-base64.git?rev=e14400697453bcc85997119b874bc03d9601d0af)", - "camino 1.0.8", - "delegate", "derive_more", - "enum-as-inner", - "enum-iterator", - "futures", - "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", - "hkdf", "identified-vec-of", - "iota-crypto", - "iso8601-timestamp", - "itertools 0.12.0", - "k256 0.13.3", - "log", - "once_cell 1.19.0", - "paste 1.0.14", - "pretty_assertions", - "pretty_env_logger", - "radix-common", - "radix-common-derive", - "radix-engine", - "radix-engine-interface", - "radix-engine-toolkit", - "radix-engine-toolkit-common", - "radix-rust", - "radix-transactions", - "rand", - "reqwest", "sargon-addresses", "sargon-core", "sargon-factors", @@ -3411,71 +3157,24 @@ dependencies = [ "sargon-profile-gateway", "sargon-profile-security-structures", "sargon-transaction-models", - "sbor", "serde", "serde_json 1.0.108", - "serde_repr", - "serde_with 3.4.0", - "strum 0.26.1", - "thiserror 1.0.50", - "url", - "uuid 1.6.1", - "zeroize 1.7.0", ] [[package]] name = "sargon-profile-gateway" version = "1.1.99" dependencies = [ - "aes-gcm", - "assert-json-diff", - "async-std", - "async-trait", - "base64 0.22.1 (git+https://github.com/marshallpierce/rust-base64.git?rev=e14400697453bcc85997119b874bc03d9601d0af)", - "camino 1.0.8", - "delegate", "derive_more", - "enum-as-inner", - "enum-iterator", - "futures", - "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", - "hkdf", "identified-vec-of", - "iota-crypto", - "iso8601-timestamp", - "itertools 0.12.0", - "k256 0.13.3", - "log", - "once_cell 1.19.0", - "paste 1.0.14", - "pretty_assertions", - "pretty_env_logger", - "radix-common", - "radix-common-derive", - "radix-engine", - "radix-engine-interface", - "radix-engine-toolkit", - "radix-engine-toolkit-common", - "radix-rust", - "radix-transactions", - "rand", - "reqwest", "sargon-addresses", "sargon-core", "sargon-factors", "sargon-hierarchical-deterministic", "sargon-keys-collector", "sargon-transaction-models", - "sbor", "serde", "serde_json 1.0.108", - "serde_repr", - "serde_with 3.4.0", - "strum 0.26.1", - "thiserror 1.0.50", - "url", - "uuid 1.6.1", - "zeroize 1.7.0", ] [[package]] @@ -3486,21 +3185,12 @@ dependencies = [ "identified-vec-of", "itertools 0.12.0", "pretty_assertions", - "radix-common", - "radix-common-derive", - "radix-engine", - "radix-engine-interface", - "radix-engine-toolkit", - "radix-engine-toolkit-common", - "radix-rust", - "radix-transactions", "sargon-addresses", "sargon-core", "sargon-factors", "sargon-hierarchical-deterministic", "sargon-profile", "sargon-profile-supporting-types", - "sbor", "serde", "serde_json 1.0.108", ] @@ -3509,54 +3199,18 @@ dependencies = [ name = "sargon-profile-security-structures" version = "1.1.99" dependencies = [ - "aes-gcm", - "assert-json-diff", - "async-std", - "async-trait", - "base64 0.22.1 (git+https://github.com/marshallpierce/rust-base64.git?rev=e14400697453bcc85997119b874bc03d9601d0af)", - "camino 1.0.8", - "delegate", "derive_more", "enum-as-inner", - "enum-iterator", - "futures", - "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", - "hkdf", "identified-vec-of", - "iota-crypto", - "iso8601-timestamp", - "itertools 0.12.0", - "k256 0.13.3", - "log", "next-derivation-index-ephemeral", - "once_cell 1.19.0", - "paste 1.0.14", "pretty_assertions", - "pretty_env_logger", - "radix-common", - "radix-common-derive", - "radix-engine", "radix-engine-interface", - "radix-engine-toolkit", - "radix-engine-toolkit-common", - "radix-rust", - "radix-transactions", - "rand", - "reqwest", "sargon-addresses", "sargon-core", "sargon-factors", "sargon-hierarchical-deterministic", - "sbor", "serde", - "serde_json 1.0.108", - "serde_repr", - "serde_with 3.4.0", - "strum 0.26.1", "thiserror 1.0.50", - "url", - "uuid 1.6.1", - "zeroize 1.7.0", ] [[package]] @@ -3567,20 +3221,11 @@ dependencies = [ "identified-vec-of", "itertools 0.12.0", "pretty_assertions", - "radix-common", - "radix-common-derive", - "radix-engine", - "radix-engine-interface", - "radix-engine-toolkit", - "radix-engine-toolkit-common", - "radix-rust", - "radix-transactions", "sargon-addresses", "sargon-core", "sargon-factors", "sargon-hierarchical-deterministic", "sargon-profile", - "sbor", "serde", "serde_json 1.0.108", ] @@ -3589,22 +3234,10 @@ dependencies = [ name = "sargon-transaction-models" version = "1.1.99" dependencies = [ - "assert-json-diff", - "async-trait", "cargo_toml 0.15.3 (git+https://gitlab.com/lib.rs/cargo_toml?rev=e498c94fc42a660c1ca1a28999ce1d757cfe77fe)", - "delegate", "derive_more", - "enum-as-inner", "enum-iterator", - "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", "identified-vec-of", - "iota-crypto", - "iso8601-timestamp", - "itertools 0.12.0", - "k256 0.13.3", - "log", - "once_cell 1.19.0", - "paste 1.0.14", "pretty_assertions", "radix-common", "radix-common-derive", @@ -3614,7 +3247,6 @@ dependencies = [ "radix-engine-toolkit-common", "radix-rust", "radix-transactions", - "rand", "sargon-addresses", "sargon-core", "sargon-factors", @@ -3622,13 +3254,7 @@ dependencies = [ "sbor", "serde", "serde_json 1.0.108", - "serde_repr", "serde_with 3.4.0", - "strum 0.26.1", - "thiserror 1.0.50", - "url", - "uuid 1.6.1", - "zeroize 1.7.0", ] [[package]] diff --git a/SPLIT.md b/SPLIT.md deleted file mode 100644 index 8d722d778..000000000 --- a/SPLIT.md +++ /dev/null @@ -1,924 +0,0 @@ -# Split into many crates - -Strategy is to use [cargo-modules](https://github.com/regexident/cargo-modules) to analyze modules and plan crates. - -Goal is a _broad_ and **not** a _deep_ tree. - -# [TOC](#toc) - - - -- [`core`](#core) -- [`testing`](#testing) -- [`collections`](#collections) -- [`bytes`](#bytes) -- [`hash`](#hash) -- [`elliptic-curve-cryptography-core`](#elliptic-curve-cryptography-core) -- [`secp256k1`](#secp256k1) -- [`curve25519`](#curve25519) -- [`elliptic-curve-cryptography`](#elliptic-curve-cryptography) -- [`bip39`](#bip39) -- [`bip32`](#bip32) -- [`bip44-like-path`](#bip44-like-path) -- [`cap26-core`](#cap26-core) -- [`account-path`](#account-path) -- [`identity-path`](#identity-path) -- [`derivation-path`](#derivation-path) -- [`hd-elliptic-curve-cryptography`](#hd-elliptic-curve-cryptography) -- [`factor-source-kind`](#factor-source-kind) -- [`derivation`](#derivation) -- [`decimal192`](#decimal192) -- [`addresses`](#addresses) -- [`factor-source-id`](#factor-source-id) -- [`factor-sources`](#factor-sources) -- [`factor-instance`](#factor-instance) -- [`security-shields`](#security-shields) -- [`entity-security-state`](#entity-security-state) -- [`entity-core`](#entity-core) -- [`account`](#account) -- [`persona-data`](#persona-data) -- [`persona`](#persona) -- [`keys-collector`](#keys-collector) -- [`transaction-manifest-core`](#transaction-manifest-core) -- [`transaction-core`](#transaction-core) -- [`transaction-manifest-building`](#transaction-manifest-building) -- [`signatures-collector`](#signatures-collector) -- [`TEMPLATE`](#template) - - - -# Crates - -> [!NOTE] -> We might prefix all crates with `sargon-`, but omitted here for clarity. - -## `core`[^](#toc) - -Lowest level possible modules - -> [!IMPORTANT] > **All** crates below depend on `core` -> but it should be the only sargon crate that ALL crates depend on. - -
- Click me - -- Contains many fundamental small enums types with no associated value (discriminator) -- No dependencies on any other sargon crates. -- Depends only on "small" external crates - -### Modules - -- `has_sample_values` -- `u11` -- `u30` -- `u31` -- `network_id` (move to a crate on top of `core`, `essentials`?) -- `factor_source_kind` (move to a crate on top of `core`, `essentials`?) -- `factor_source_list_kind` (move to a crate on top of `core`, `essentials`?) -- `role_kind` (move to a crate on top of `core`, `essentials`?) -- `key_kind` (move to a crate on top of `core`, `essentials`?) -- `entity_kind` (move to a crate on top of `core`, `essentials`?) -- `string_utils` -- `unsafe_id_stepper` -- `constants` - split out only non-radix specific ones, e.g. time -- `common_error` - must reduce complexity of associated values, we can then per crate declare tiny traits with helper ctors, e.g.: - -```diff -// in crate `core` -pub enum CommonError { - ... - #[error("Account Already Present {bad_value}")] -- AccountAlreadyPresent { bad_value: AccountAddress } = 10074, -+ AccountAlreadyPresent { bad_value: String } = 10074, - ... -} - -+ // in crate `addresses` -+ pub trait FromAccountAlreadyPresentErr { -+ fn account_already_present(bad_value: AccountAddress) -> CommonError { -+ CommonError::AccountAlreadyPresent { bad_value: bad_value.to_string() } -+ } -+ } -+ impl FromAccountAlreadyPresentErr for CommonError {} -``` - -### Dependencies - -#### Internal - -NONE - -#### External - -- `serde` - hmm can we make `serde` a feature flag for `core` crate? -- `thiserror` -- `uuid` ?? -
- -## `testing`[^](#toc) - -Testing utils. - -
- Click me - -### Modules - -- `assert_json` - -### Dependencies - -#### Internal - -- `core` - -#### External - -- `serde` -- `serde_json` -- `thiserror` -- `assert_json_diff` -- `pretty_assertions` -
- -## `collections`[^](#toc) - -Collection datatypes - -
- Click me - -### Modules - -- `identified_vec_of` -- `index_set_extensions` -- `index_map_extensions` -- `hash_map_extensions` - -### Dependencies - -#### Internal - -- `core` - -#### External - -- `indexmap` -
- -## `bytes`[^](#toc) - -Fixed size byte arrays. - -
- Click me - -### Modules - -- `exactly_60_bytes` (encrypted mnemonic for security questions factor) -- `exactly_12_bytes` (AES encryption) -- `exactly_65_bytes` (Secp256k1Signature) -- `exactly_33_bytes` (Secp256k1PublicKey) -- `exactly_64_bytes` (Ed25519Signature) -- `exactly_32_bytes` (Ed25519PublicKey) -- `exactly_29_bytes` (PublicKeyHash) - -### Dependencies - -#### Internal - -- `core` - -#### External - -- `hex` -
- -## `hash`[^](#toc) - -Blake hash - -
- Click me -### Modules -- `hash` -- `blake_hash` -- `public_key_hash` (???) - -### Dependencies - -#### Internal - -#### External - -- [`radix_common` (scrypto)](https://github.com/radixdlt/radixdlt-scrypto/tree/main/radix-common) - -
- -## `elliptic-curve-cryptography-core`[^](#toc) - -Common traits and models used by `secp256k1`, `curve25519` and `elliptic-curve-cryptography` crates. - -
- Click me -### Modules -- `is_private_key` -- `is_public_key` -- `curve` - -### Dependencies - -#### Internal - -- `bytes` - -#### External - -
- -## `secp256k1`[^](#toc) - -Secp256k1 ECC - -
- Click me -### Modules -- `secp256k1_private_key` -- `secp256k1_public_key` -- `secp256k1_signature` - -### Dependencies - -#### Internal - -- `elliptic-curve-cryptography-core` - -#### External - -- [`radix_common` (scrypto)](https://github.com/radixdlt/radixdlt-scrypto/tree/main/radix-common) - -
- -## `curve25519`[^](#toc) - -Curve25519 ECC - -
- Click me -### Modules -- `curve25519_private_key` -- `curve25519_public_key` -- `curve25519_signature` - -### Dependencies - -#### Internal - -- `elliptic-curve-cryptography-core` - -#### External - -- [`radix_common` (scrypto)](https://github.com/radixdlt/radixdlt-scrypto/tree/main/radix-common) - -
- -## `elliptic-curve-cryptography`[^](#toc) - -ECC models - -
- Click me -### Modules -- `private_key` -- `public_key` -- `signature` -- `signature_with_public_key` - -### Dependencies - -#### Internal - -- `curve25519` -- `secp256k1` - -#### External - -
- -## `bip39`[^](#toc) - -
- Click me - -### Modules - -- `bip39_seed` -- `bip39_word_count` -- `bip39_word` -- `bip39_entropy` -- `mnemonic` -- `bip39_passphrase` -- `mnemonic_with_passphrase` -
- -## `bip32`[^](#toc) - -
- Click me -
- -## `bip44-like-path`[^](#toc) - -
- Click me - -### Dependencies - -#### Internal - -- `bip32` -
- -## `cap26-core`[^](#toc) - -
- Click me - -### Dependencies - -#### Internal - -- `bip32` -
- -## `account-path`[^](#toc) - -
- Click me - -### Dependencies - -#### Internal - -- `cap26-core` -
- -## `identity-path`[^](#toc) - -
- Click me - -### Dependencies - -#### Internal - -- `cap26-core` -
- -## `derivation-path`[^](#toc) - -
- Click me - -### Dependencies - -#### Internal - -- `bip44-like-path` -- `account-path` -- `identity-path` -
- -## `hd-elliptic-curve-cryptography`[^](#toc) - -Hierarchical Deterministic Elliptic Curve Cryptography, HD ECC models such as `HDPublicKey`, `HDPrivateKey` and `HDSignature` - -
- Click me -### Modules -- `hd_private_key` -- `hd_public_key` -- `hd_signature` - -### Dependencies - -#### Internal - -- `elliptic-curve-cryptography` -- `derivation-path` - -#### External - -
- -## `factor-source-kind`[^](#toc) - -Enum with FactorSourceKind - -
- Click me - -### Modules - -### Dependencies - -#### Internal - -
- -## `derivation`[^](#toc) - -Hierarchical Deterministic derivation HDPrivateKey and HDPublicKey - -
- Click me - -### Modules - -### Dependencies - -#### Internal - -- `bip39` -- `hd-elliptic-curve-cryptography` -
- -## `decimal192`[^](#toc) - -
- Click me - -### Modules - -- `decimal192` - -### Dependencies - -#### Internal - -- `core` - -#### External - -- [`radix_common`][radix_common] -- `delegate` -- `enum_iterator` - -
- -## `addresses`[^](#toc) - -All address types. - -
- Click me - -### Modules - -### Dependencies - -#### Internal - -#### External - -
- -## `factor-source-id`[^](#toc) - -ID of FactorSources - -
- Click me - -### Modules - -- `factor_source_id` -- `factor_source_id_from_hash` -- `factor_source_id_from_address` - -### Dependencies - -#### Internal - -- `hash` -- `addresses` -- `factor-source-kind` - -#### External - -
- -## `factor-sources`[^](#toc) - -All different FactorSource types and the `FactorSource` enum. - -
- Click me -### Modules -- `factor_source` -- `device_factor_source` -- `ledger_factor_source` -- `arculus_factor_source` -- `password_factor_source` -- `off_device_mnemonic_factor_source` -- `security_questions_factor_source` -- `yubikey_factor_source` -- `trusted_contact_factor_source` - -### Dependencies - -#### Internal - -- `core` -- `factor-source-id` - -#### External - -
- -## `factor-instance`[^](#toc) - -`FactorInstance` and `HDFactorInstance - -
- Click me -### Modules -- `factor_instance -- `hd_factor_instance - -### Dependencies - -#### Internal - -- `factor-source-id` -- `hd-elliptic-curve-cryptography` - -#### External - -
- -## `security-shields`[^](#toc) - -MatrixOfFactors, SecurityStructureOf and builders - -
- Click me -### Modules - - `primary_role_with_factor_source_ids` - - `recovery_role_with_factor_source_ids` - - `confirmation_role_with_factor_source_ids` - - `primary_role_with_factor_sources` - - `recovery_role_with_factor_sources` - - `confirmation_role_with_factor_sources` - - `primary_role_with_factor_instances` - - `recovery_role_with_factor_instances` - - `confirmation_role_with_factor_instances` - - `matrix_of_factor_source_ids` - - `matrix_of_factor_sources` - - `matrix_of_factor_instances` - - `security_structure_of_factor_instances` - - `security_structure_of_factor_sources` - - `security_structure_of_factor_source_ids` - - `matrix_builder` - - `security_shield_builder` - -### Dependencies - -#### Internal - -- `factor-sources` -- `factor-instances` - -#### External - -
- -## `entity-security-state`[^](#toc) - -Entity SecurityState models - -
- Click me -### Modules - - `unsecured_entity_control` - - `securified_entity_control` - - `provisional_security_config` - - `access_controller` - -### Dependencies - -#### Internal - -- `security-shields` - -#### External - -
- -## `entity-core`[^](#toc) - -Account and Persona shared type `BaseEntity` which we can use `serde(flatten)` with to flat -out into `Account` and `Persona`, something like: - -```rust - -pub trait IsEntity { - fn address(&self) -> &String; - fn display_name(&self) -> &String; - - fn set_display_name(&mut self, new: String); -} - -#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] -pub struct BaseEntity { - address: String, - display_name: String, -} - -impl IsEntity for BaseEntity { - fn address(&self) -> &String { - &self.address - } - - fn display_name(&self) -> &String { - &self.display_name - } - - fn set_display_name(&mut self, new: String) { - self.display_name = new; - } -} - -#[macro_export] -macro_rules! forward_is_entity { - ($entity: ty) => { - impl IsEntity for $entity { - delegate::delegate! { - to self.base { - fn address(&self) -> &String; - fn display_name(&self) -> &String; - fn set_display_name(&mut self, new: String); - } - } - } - }; -} - -#[macro_export] -macro_rules! impl_deref_base_entity_for { - ($entity: ty) => { - impl Deref for $entity { - type Target = BaseEntity; - - fn deref(&self) -> &Self::Target { - &self.base - } - } - impl DerefMut for $entity { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.base - } - } - }; -} - -#[macro_export] -macro_rules! as_entity { - ($entity: ty) => { - $crate::forward_is_entity!($entity); - $crate::impl_deref_base_entity_for!($entity); - }; -} - -``` - -Later, In the `account` crate - -```rust -// NOT IN `entity-core` crate! -#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] -pub struct Account { - #[serde(flatten)] - base: BaseEntity, // <-- imbue BaseEntity fields - - // === Extra Fields === - pub appearance_id: u8, -} - -// impl `IsEntity` and `Deref`/`DerefMut` (as BaseEntity) for `Account` -as_entity!(Account); -``` - -Later, In the `persona` crate - -```rust -// NOT IN `entity-core` crate! -#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] -pub struct Persona { - #[serde(flatten)] - base: BaseEntity, // <-- imbue BaseEntity fields - - // === Extra Fields === - pub persona_data: PersonaData, -} - -// impl `IsEntity` and `Deref`/`DerefMut` (as BaseEntity) for `Persona` -as_entity!(Persona); -``` - -
- Click me -### Modules - -### Dependencies - -#### Internal - -- `addresses` - -#### External - -- `delegate` - -
- -## `account`[^](#toc) - -Account entity - -
- Click me -### Modules -- `account` -- `appearance_id` - -### Dependencies - -#### Internal - -- `entity-core` - -#### External - -
- -## `persona-data`[^](#toc) - -Persona Data models - -
- Click me -### Modules -- `persona_data` - -### Dependencies - -#### Internal - -#### External - -
- -## `persona`[^](#toc) - -Persona entity - -
- Click me -### Modules -- `persona` - -### Dependencies - -#### Internal - -- `entity-core` -- `persona-data` - -#### External - -
- -## `keys-collector`[^](#toc) - -Multi-factor-multi-path derivation - -
- Click me -### Modules -- `keys_collector` -- `key_derivation_interactor` -- `key_derivation_request` -- `key_derivation_response` -- `derivation_purpose` - -### Dependencies - -#### Internal - -- `derivation-path` -- `factor-source` - -#### External - -
- -- [radix_common]: https://github.com/radixdlt/radixdlt-scrypto/tree/main/radix-common - -## `transaction-manifest-core`[^](#toc) - -TransactionManifests models, this does NOT include the logic of building/declaring Transaction manifests. - -
- Click me -### Modules - -### Dependencies - -#### Internal - -- `core` - -#### External - -
- -## `transaction-core`[^](#toc) - -Radix Engine transaction models **except** TransactionManifest which is a lower level crate this crate depends on (split in two for smaller size). And note that **building** TransactionManifests is a third crate/ - -
- Click me -### Modules -- `transaction_intent` -- `transaction_header` - -### Dependencies - -#### Internal - -- `transaction-manifest-core` - -#### External - -
- -## `transaction-manifest-building`[^](#toc) - -Building of TransactionManifests. - -
- Click me -### Modules - -### Dependencies - -#### Internal - -- `transaction-manifest-core` - -#### External - -- [`radix-transactions` (scrypto)](https://github.com/radixdlt/radixdlt-scrypto/tree/main/radix-transactions) - -
- -## `signatures-collector`[^](#toc) - -Multi-tx-multi-entity-multi-factor signing coordinator. - -
- Click me -### Modules -- `signatures_collector` -- `sign_request` -- `sign_response` -- `sign_interactor` - -### Dependencies - -#### Internal - -- `transaction` - -#### External - -
- -## `TEMPLATE`[^](#toc) - -DESCRIPTION - -
- Click me -### Modules - -### Dependencies - -#### Internal - -- `core` - -#### External - -
diff --git a/crates/sargon-addresses/Cargo.toml b/crates/sargon-addresses/Cargo.toml index 533ee53c5..8a3a819e4 100644 --- a/crates/sargon-addresses/Cargo.toml +++ b/crates/sargon-addresses/Cargo.toml @@ -15,7 +15,6 @@ radix-engine = { workspace = true } radix-engine-interface = { workspace = true } radix-engine-toolkit = { workspace = true } radix-rust = { workspace = true } -radix-transactions = { workspace = true } # ==== EXTERNAL DEPENDENCIES ==== derive_more = { workspace = true } diff --git a/crates/sargon-addresses/src/lib.rs b/crates/sargon-addresses/src/lib.rs index 4a544b6c2..aaa188bc4 100644 --- a/crates/sargon-addresses/src/lib.rs +++ b/crates/sargon-addresses/src/lib.rs @@ -62,6 +62,7 @@ pub mod prelude { ResourceAddress as ScryptoResourceAddress, }, }; + pub(crate) use radix_engine::system::system_modules::execution_trace::ResourceSpecifier as ScryptoResourceSpecifier; pub use radix_engine_toolkit::models::{ diff --git a/crates/sargon-clients/Cargo.toml b/crates/sargon-clients/Cargo.toml index 9af540249..940138843 100644 --- a/crates/sargon-clients/Cargo.toml +++ b/crates/sargon-clients/Cargo.toml @@ -15,50 +15,16 @@ gateway-client-and-api = { path = "../gateway-client-and-api" } sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } # === RADIX DEPENDENCIES === -radix-engine = { workspace = true } -radix-common = { workspace = true } -radix-common-derive = { workspace = true } -radix-engine-interface = { workspace = true } -radix-engine-toolkit = { workspace = true } -radix-engine-toolkit-common = { workspace = true } -radix-transactions = { workspace = true } -radix-rust = { workspace = true } -sbor = { workspace = true } +# None # === EXTERNAL DEPENDENCIES === -aes-gcm = { workspace = true } -assert-json-diff = { workspace = true } -async-std = { workspace = true } async-trait = { workspace = true } -base64 = { workspace = true } -camino = { workspace = true } -delegate = { workspace = true } derive_more = { workspace = true } enum-as-inner = { workspace = true } -enum-iterator = { workspace = true } -futures = { workspace = true } -hex = { workspace = true } -hkdf = { workspace = true } -iota-crypto = { workspace = true } -iso8601-timestamp = { workspace = true } -itertools = { workspace = true } -k256 = { workspace = true } -log = { workspace = true } -once_cell = { workspace = true } -paste = { workspace = true } pretty_assertions = { workspace = true } -pretty_env_logger = { workspace = true } -rand = { workspace = true } -reqwest = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } -serde_repr = { workspace = true } serde_with = { workspace = true } -strum = { workspace = true } -thiserror = { workspace = true } -url = { workspace = true } -uuid = { workspace = true } -zeroize = { workspace = true } [dev-dependencies] actix-rt = { workspace = true } diff --git a/crates/sargon-clients/src/clients/client/factor_instances_cache_client/client.rs b/crates/sargon-clients/src/clients/client/factor_instances_cache_client/client.rs index 3dd543fcc..734211f1e 100644 --- a/crates/sargon-clients/src/clients/client/factor_instances_cache_client/client.rs +++ b/crates/sargon-clients/src/clients/client/factor_instances_cache_client/client.rs @@ -1,6 +1,6 @@ -use std::borrow::Borrow; +use std::{borrow::Borrow, path::Path}; -use async_std::path::PathBuf; +// use async_std::path::PathBuf; use crate::prelude::*; @@ -69,7 +69,7 @@ impl FactorInstancesCacheClient { async fn path(&self) -> Result { let dir = self.file_system_client.writable_app_dir_path().await?; - let path = PathBuf::from(dir).join(Self::CACHE_FILE); + let path = Path::new(&dir).join(Self::CACHE_FILE); let path_str = path.to_string_lossy().to_string(); let path_str = self.file_system_client.create_if_needed(path_str).await?; diff --git a/crates/sargon-core-error/Cargo.toml b/crates/sargon-core-error/Cargo.toml index eb1946eb3..f97a27d46 100644 --- a/crates/sargon-core-error/Cargo.toml +++ b/crates/sargon-core-error/Cargo.toml @@ -5,9 +5,10 @@ edition = "2021" [dependencies] # === SARGON CRATES === - +# None # === RADIX DEPENDENCIES === +# None # === EXTERNAL DEPENDENCIES === log = { workspace = true } diff --git a/crates/sargon-core/Cargo.toml b/crates/sargon-core/Cargo.toml index 08e570d86..844eda6bc 100644 --- a/crates/sargon-core/Cargo.toml +++ b/crates/sargon-core/Cargo.toml @@ -18,16 +18,12 @@ radix-transactions = { workspace = true } # ==== EXTERNAL DEPENDENCIES ==== aes-gcm = { workspace = true } arraystring = { workspace = true } -assert-json-diff = { workspace = true } delegate = { workspace = true } derive_more = { workspace = true } enum-as-inner = { workspace = true } enum-iterator = { workspace = true } hex = { workspace = true } -hkdf = { workspace = true } iota-crypto = { workspace = true } -iso8601-timestamp = { workspace = true } -itertools = { workspace = true } k256 = { workspace = true } log = { workspace = true } paste = { workspace = true } @@ -38,7 +34,6 @@ serde_json = { workspace = true } serde_repr = { workspace = true } serde_with = { workspace = true } strum = { workspace = true } -thiserror = { workspace = true } url = { workspace = true } uuid = { workspace = true } zeroize = { workspace = true } diff --git a/crates/sargon-core/src/encryption/encryption_key.rs b/crates/sargon-core/src/encryption/encryption_key.rs index 5e34c57c6..912e0198e 100644 --- a/crates/sargon-core/src/encryption/encryption_key.rs +++ b/crates/sargon-core/src/encryption/encryption_key.rs @@ -1,4 +1,5 @@ use crate::prelude::*; +use crypto::keys::x25519::PublicKey as X25519PublicKey; #[derive( Zeroize, @@ -16,8 +17,6 @@ use crate::prelude::*; #[serde(transparent)] pub struct EncryptionKey(pub Exactly32Bytes); -use crypto::keys::x25519::PublicKey as X25519PublicKey; - impl From for EncryptionKey { fn from(value: X25519PublicKey) -> EncryptionKey { EncryptionKey(Exactly32Bytes::from(&value.to_bytes())) diff --git a/crates/sargon-core/src/lib.rs b/crates/sargon-core/src/lib.rs index e0c8b2e95..4ebfc03d8 100644 --- a/crates/sargon-core/src/lib.rs +++ b/crates/sargon-core/src/lib.rs @@ -46,7 +46,6 @@ pub mod prelude { pub use ::hex::decode as hex_decode; pub use ::hex::encode as hex_encode; - pub use itertools::Itertools; pub use log::{debug, error, info, trace, warn}; pub use serde::{ de, ser::SerializeStruct, Deserialize, Deserializer, Serialize, @@ -99,12 +98,10 @@ pub mod prelude { }; pub(crate) use radix_engine_interface::prelude::{ - MetadataValue as ScryptoMetadataValue, + Epoch as ScryptoEpoch, MetadataValue as ScryptoMetadataValue, ToMetadataEntry as ScryptoToMetadataEntry, }; - pub use radix_engine_interface::prelude::Epoch as ScryptoEpoch; - pub use radix_transactions::model::{ SignatureV1 as ScryptoSignature, SignatureWithPublicKeyV1 as ScryptoSignatureWithPublicKey, diff --git a/crates/sargon-drivers/Cargo.toml b/crates/sargon-drivers/Cargo.toml index 9dc11c203..3d0e04d7c 100644 --- a/crates/sargon-drivers/Cargo.toml +++ b/crates/sargon-drivers/Cargo.toml @@ -12,50 +12,18 @@ sargon-profile = { path = "../sargon-profile" } sargon-profile-supporting-types = { path = "../sargon-profile-supporting-types" } # === RADIX DEPENDENCIES === -radix-engine = { workspace = true } -radix-common = { workspace = true } -radix-common-derive = { workspace = true } -radix-engine-interface = { workspace = true } -radix-engine-toolkit = { workspace = true } -radix-engine-toolkit-common = { workspace = true } -radix-transactions = { workspace = true } -radix-rust = { workspace = true } -sbor = { workspace = true } +# None # === EXTERNAL DEPENDENCIES === -aes-gcm = { workspace = true } -assert-json-diff = { workspace = true } -async-std = { workspace = true } async-trait = { workspace = true } -base64 = { workspace = true } -camino = { workspace = true } -delegate = { workspace = true } derive_more = { workspace = true } -enum-as-inner = { workspace = true } enum-iterator = { workspace = true } -futures = { workspace = true } -hex = { workspace = true } -hkdf = { workspace = true } -iota-crypto = { workspace = true } -iso8601-timestamp = { workspace = true } -itertools = { workspace = true } -k256 = { workspace = true } log = { workspace = true } -once_cell = { workspace = true } -paste = { workspace = true } -pretty_assertions = { workspace = true } pretty_env_logger = { workspace = true } -rand = { workspace = true } reqwest = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } -serde_repr = { workspace = true } -serde_with = { workspace = true } strum = { workspace = true } -thiserror = { workspace = true } -url = { workspace = true } -uuid = { workspace = true } -zeroize = { workspace = true } [dev-dependencies] actix-rt = { workspace = true } diff --git a/crates/sargon-factor-instances-provider/Cargo.toml b/crates/sargon-factor-instances-provider/Cargo.toml index e0b1b269a..73c2d5bfa 100644 --- a/crates/sargon-factor-instances-provider/Cargo.toml +++ b/crates/sargon-factor-instances-provider/Cargo.toml @@ -21,40 +21,11 @@ sargon-profile-supporting-types = { path = "../sargon-profile-supporting-types" next-derivation-index-ephemeral = { path = "../next-derivation-index-ephemeral" } # ==== RADIX DEPENDENCIES ==== -radix-common = { workspace = true } -radix-engine-interface = { workspace = true } -radix-rust = { workspace = true } -radix-transactions = { workspace = true } +# None # ==== EXTERNAL DEPENDENCIES ==== -aes-gcm = { workspace = true } -arraystring = { workspace = true } -assert-json-diff = { workspace = true } -async-trait = { workspace = true } -delegate = { workspace = true } derive_more = { workspace = true } -enum-as-inner = { workspace = true } -enum-iterator = { workspace = true } futures = { workspace = true } -hex = { workspace = true } -hkdf = { workspace = true } -iota-crypto = { workspace = true } -iso8601-timestamp = { workspace = true } -itertools = { workspace = true } -k256 = { workspace = true } -log = { workspace = true } -paste = { workspace = true } -pretty_assertions = { workspace = true } -rand = { workspace = true } -serde = { workspace = true } -serde_json = { workspace = true } -serde_repr = { workspace = true } -serde_with = { workspace = true } -strum = { workspace = true } -thiserror = { workspace = true } -url = { workspace = true } -uuid = { workspace = true } -zeroize = { workspace = true } [dev-dependencies] actix-rt = { workspace = true } diff --git a/crates/sargon-factors/Cargo.toml b/crates/sargon-factors/Cargo.toml index 5eee724f3..95d9ec6da 100644 --- a/crates/sargon-factors/Cargo.toml +++ b/crates/sargon-factors/Cargo.toml @@ -13,37 +13,15 @@ sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-determinist # ==== RADIX DEPENDENCIES ==== radix-common = { workspace = true } radix-engine-interface = { workspace = true } -radix-rust = { workspace = true } -radix-transactions = { workspace = true } # ==== EXTERNAL DEPENDENCIES ==== -arraystring = { workspace = true } -assert-json-diff = { workspace = true } -bip39 = { workspace = true } -delegate = { workspace = true } derive_more = { workspace = true } -enum-as-inner = { workspace = true } enum-iterator = { workspace = true } -hex = { workspace = true } hkdf = { workspace = true } iota-crypto = { workspace = true } -iso8601-timestamp = { workspace = true } -itertools = { workspace = true } k256 = { workspace = true } -log = { workspace = true } once_cell = { workspace = true } -paste = { workspace = true } -pretty_assertions = { workspace = true } -rand = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } -serde_repr = { workspace = true } serde_with = { workspace = true } -strum = { workspace = true } -thiserror = { workspace = true } -url = { workspace = true } -uuid = { workspace = true } zeroize = { workspace = true } - -[build-dependencies] -cargo_toml = { workspace = true } diff --git a/crates/sargon-factors/src/factor_instance/factor_instance_badge.rs b/crates/sargon-factors/src/factor_instance/factor_instance_badge.rs index 5ebfeb767..966bba2c1 100644 --- a/crates/sargon-factors/src/factor_instance/factor_instance_badge.rs +++ b/crates/sargon-factors/src/factor_instance/factor_instance_badge.rs @@ -213,20 +213,20 @@ mod tests { // ); // } - // #[test] - // fn a_correct_resource_or_non_fungible_is_derived_from_a_virtual_factor_instance_badge( - // ) { - // let sut = FactorInstanceBadge::sample_virtual(); - // let resource_or_non_fungible = ScryptoResourceOrNonFungible::from(sut); - // assert_eq!( - // resource_or_non_fungible, - // ScryptoResourceOrNonFungible::NonFungible( - // ScryptoNonFungibleGlobalId::from_public_key( - // &ScryptoPublicKey::from( - // HierarchicalDeterministicPublicKey::sample().public_key - // ) - // ) - // ) - // ); - // } + #[test] + fn a_correct_resource_or_non_fungible_is_derived_from_a_virtual_factor_instance_badge( + ) { + let sut = FactorInstanceBadge::sample_virtual(); + let resource_or_non_fungible = ScryptoResourceOrNonFungible::from(sut); + assert_eq!( + resource_or_non_fungible, + ScryptoResourceOrNonFungible::NonFungible( + ScryptoNonFungibleGlobalId::from_public_key( + &ScryptoPublicKey::from( + HierarchicalDeterministicPublicKey::sample().public_key + ) + ) + ) + ); + } } diff --git a/crates/sargon-hierarchical-deterministic/Cargo.toml b/crates/sargon-hierarchical-deterministic/Cargo.toml index 9b3967e13..6892323c0 100644 --- a/crates/sargon-hierarchical-deterministic/Cargo.toml +++ b/crates/sargon-hierarchical-deterministic/Cargo.toml @@ -10,33 +10,15 @@ sargon-core = { path = "../sargon-core" } # ==== RADIX DEPENDENCIES ==== radix-common = { workspace = true } -radix-engine-interface = { workspace = true } -radix-rust = { workspace = true } -radix-transactions = { workspace = true } # ==== EXTERNAL DEPENDENCIES ==== -assert-json-diff = { workspace = true } bip39 = { workspace = true } -delegate = { workspace = true } derive_more = { workspace = true } -enum-as-inner = { workspace = true } enum-iterator = { workspace = true } -hex = { workspace = true } -hkdf = { workspace = true } iota-crypto = { workspace = true } -iso8601-timestamp = { workspace = true } itertools = { workspace = true } -k256 = { workspace = true } -log = { workspace = true } paste = { workspace = true } -pretty_assertions = { workspace = true } -rand = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } -serde_repr = { workspace = true } serde_with = { workspace = true } -strum = { workspace = true } -thiserror = { workspace = true } -url = { workspace = true } -uuid = { workspace = true } zeroize = { workspace = true } diff --git a/crates/sargon-manifests/Cargo.toml b/crates/sargon-manifests/Cargo.toml index b0402edcb..a71118c8c 100644 --- a/crates/sargon-manifests/Cargo.toml +++ b/crates/sargon-manifests/Cargo.toml @@ -18,42 +18,18 @@ sargon-profile = { path = "../sargon-profile" } # === RADIX DEPENDENCIES === radix-common = { workspace = true } -radix-common-derive = { workspace = true } radix-engine = { workspace = true } radix-engine-interface = { workspace = true } radix-engine-toolkit = { workspace = true } -radix-engine-toolkit-common = { workspace = true } radix-rust = { workspace = true } radix-transactions = { workspace = true } sbor = { workspace = true } # === EXTERNAL DEPENDENCIES === -assert-json-diff = { workspace = true } -async-trait = { workspace = true } -cargo_toml = { workspace = true } -delegate = { workspace = true } derive_more = { workspace = true } -enum-as-inner = { workspace = true } -enum-iterator = { workspace = true } -hex = { workspace = true } -iota-crypto = { workspace = true } -iso8601-timestamp = { workspace = true } -itertools = { workspace = true } -k256 = { workspace = true } -log = { workspace = true } -once_cell = { workspace = true } -paste = { workspace = true } pretty_assertions = { workspace = true } -rand = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } -serde_repr = { workspace = true } -serde_with = { workspace = true } -strum = { workspace = true } -thiserror = { workspace = true } -url = { workspace = true } -uuid = { workspace = true } -zeroize = { workspace = true } [build-dependencies] cargo_toml = { workspace = true } diff --git a/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfers.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfers.rs index 0c6378cb5..c8a3dcb14 100644 --- a/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfers.rs +++ b/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfers.rs @@ -1,5 +1,4 @@ use crate::prelude::*; -use radix_rust::prelude::IndexMap; #[derive(Clone, Debug, PartialEq, Eq, Hash)] pub struct PerRecipientAssetTransfers { diff --git a/crates/sargon-manifests/src/lib.rs b/crates/sargon-manifests/src/lib.rs index 4deefd671..9957c6700 100644 --- a/crates/sargon-manifests/src/lib.rs +++ b/crates/sargon-manifests/src/lib.rs @@ -39,17 +39,27 @@ pub mod prelude { ManifestSbor as ScryptoManifestSbor, ScryptoSbor, }; - pub(crate) use radix_engine_interface::prelude::{ - AccessRule as ScryptoAccessRule, - FungibleResourceRoles as ScryptoFungibleResourceRoles, - MetadataInit as ScryptoMetadataInit, - MetadataValue as ScryptoMetadataValue, - ModuleConfig as ScryptoModuleConfig, - NonFungibleResourceRoles as ScryptoNonFungibleResourceRoles, - OwnerRole as ScryptoOwnerRole, - RoleAssignmentInit as ScryptoRoleAssignmentInit, - ToMetadataEntry as ScryptoToMetadataEntry, - UncheckedUrl as ScryptoUncheckedUrl, + pub(crate) use radix_engine_interface::{ + blueprints::{ + access_controller::RuleSet as ScryptoRuleSet, + account::{ + DefaultDepositRule as ScryptoDefaultDepositRule, + ACCOUNT_SECURIFY_IDENT as SCRYPTO_ACCOUNT_SECURIFY_IDENT, + }, + identity::IDENTITY_SECURIFY_IDENT as SCRYPTO_IDENTITY_SECURIFY_IDENT, + }, + prelude::{ + AccessRule as ScryptoAccessRule, + FungibleResourceRoles as ScryptoFungibleResourceRoles, + MetadataInit as ScryptoMetadataInit, + MetadataValue as ScryptoMetadataValue, + ModuleConfig as ScryptoModuleConfig, + NonFungibleResourceRoles as ScryptoNonFungibleResourceRoles, + OwnerRole as ScryptoOwnerRole, + RoleAssignmentInit as ScryptoRoleAssignmentInit, + ToMetadataEntry as ScryptoToMetadataEntry, + UncheckedUrl as ScryptoUncheckedUrl, + }, }; pub use radix_engine_toolkit::{ @@ -140,15 +150,6 @@ pub mod prelude { Update as RetUpdate, }, }; - - pub(crate) use radix_engine_interface::blueprints::{ - access_controller::RuleSet as ScryptoRuleSet, - account::{ - DefaultDepositRule as ScryptoDefaultDepositRule, - ACCOUNT_SECURIFY_IDENT as SCRYPTO_ACCOUNT_SECURIFY_IDENT, - }, - identity::IDENTITY_SECURIFY_IDENT as SCRYPTO_IDENTITY_SECURIFY_IDENT, - }; } pub use prelude::*; diff --git a/crates/sargon-profile-app-preferences/Cargo.toml b/crates/sargon-profile-app-preferences/Cargo.toml index 32da16d33..c4d49fcb3 100644 --- a/crates/sargon-profile-app-preferences/Cargo.toml +++ b/crates/sargon-profile-app-preferences/Cargo.toml @@ -16,47 +16,9 @@ sargon-profile-gateway = { path = "../sargon-profile-gateway" } sargon-profile-security-structures = { path = "../sargon-profile-security-structures" } # === RADIX DEPENDENCIES === -radix-common = { workspace = true } -radix-common-derive = { workspace = true } -radix-engine = { workspace = true } -radix-engine-interface = { workspace = true } -radix-engine-toolkit = { workspace = true } -radix-engine-toolkit-common = { workspace = true } -radix-rust = { workspace = true } -radix-transactions = { workspace = true } -sbor = { workspace = true } +# None # === EXTERNAL DEPENDENCIES === -aes-gcm = { workspace = true } -assert-json-diff = { workspace = true } -async-std = { workspace = true } -async-trait = { workspace = true } -base64 = { workspace = true } -camino = { workspace = true } -delegate = { workspace = true } derive_more = { workspace = true } -enum-as-inner = { workspace = true } -enum-iterator = { workspace = true } -futures = { workspace = true } -hex = { workspace = true } -hkdf = { workspace = true } -iota-crypto = { workspace = true } -iso8601-timestamp = { workspace = true } -itertools = { workspace = true } -k256 = { workspace = true } -log = { workspace = true } -once_cell = { workspace = true } -paste = { workspace = true } -pretty_assertions = { workspace = true } -pretty_env_logger = { workspace = true } -rand = { workspace = true } -reqwest = { workspace = true } serde = { workspace = true } -serde_json = { workspace = true } -serde_repr = { workspace = true } -serde_with = { workspace = true } -strum = { workspace = true } -thiserror = { workspace = true } -url = { workspace = true } -uuid = { workspace = true } -zeroize = { workspace = true } +serde_json = { workspace = true } \ No newline at end of file diff --git a/crates/sargon-profile-gateway/Cargo.toml b/crates/sargon-profile-gateway/Cargo.toml index 8c7616236..617ff06cf 100644 --- a/crates/sargon-profile-gateway/Cargo.toml +++ b/crates/sargon-profile-gateway/Cargo.toml @@ -14,47 +14,9 @@ sargon-addresses = { path = "../sargon-addresses" } sargon-transaction-models = { path = "../sargon-transaction-models" } # === RADIX DEPENDENCIES === -radix-common = { workspace = true } -radix-common-derive = { workspace = true } -radix-engine = { workspace = true } -radix-engine-interface = { workspace = true } -radix-engine-toolkit = { workspace = true } -radix-engine-toolkit-common = { workspace = true } -radix-rust = { workspace = true } -radix-transactions = { workspace = true } -sbor = { workspace = true } +# None # === EXTERNAL DEPENDENCIES === -aes-gcm = { workspace = true } -assert-json-diff = { workspace = true } -async-std = { workspace = true } -async-trait = { workspace = true } -base64 = { workspace = true } -camino = { workspace = true } -delegate = { workspace = true } derive_more = { workspace = true } -enum-as-inner = { workspace = true } -enum-iterator = { workspace = true } -futures = { workspace = true } -hex = { workspace = true } -hkdf = { workspace = true } -iota-crypto = { workspace = true } -iso8601-timestamp = { workspace = true } -itertools = { workspace = true } -k256 = { workspace = true } -log = { workspace = true } -once_cell = { workspace = true } -paste = { workspace = true } -pretty_assertions = { workspace = true } -pretty_env_logger = { workspace = true } -rand = { workspace = true } -reqwest = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } -serde_repr = { workspace = true } -serde_with = { workspace = true } -strum = { workspace = true } -thiserror = { workspace = true } -url = { workspace = true } -uuid = { workspace = true } -zeroize = { workspace = true } diff --git a/crates/sargon-profile-logic/Cargo.toml b/crates/sargon-profile-logic/Cargo.toml index f1a52e238..06e35773b 100644 --- a/crates/sargon-profile-logic/Cargo.toml +++ b/crates/sargon-profile-logic/Cargo.toml @@ -14,15 +14,7 @@ sargon-profile = { path = "../sargon-profile" } sargon-profile-supporting-types = { path = "../sargon-profile-supporting-types" } # === RADIX DEPENDENCIES === -radix-common = { workspace = true } -radix-common-derive = { workspace = true } -radix-engine = { workspace = true } -radix-engine-interface = { workspace = true } -radix-engine-toolkit = { workspace = true } -radix-engine-toolkit-common = { workspace = true } -radix-rust = { workspace = true } -radix-transactions = { workspace = true } -sbor = { workspace = true } +# None # === EXTERNAL DEPENDENCIES === derive_more = { workspace = true } diff --git a/crates/sargon-profile-logic/src/logic/persona/persona_data_ids.rs b/crates/sargon-profile-logic/src/logic/persona/persona_data_ids.rs index 88f8899b4..a7f783a2e 100644 --- a/crates/sargon-profile-logic/src/logic/persona/persona_data_ids.rs +++ b/crates/sargon-profile-logic/src/logic/persona/persona_data_ids.rs @@ -1,5 +1,3 @@ -use radix_rust::prelude::IndexSet; - use crate::prelude::*; pub trait PersonaDataIdsOfEntries { diff --git a/crates/sargon-profile-logic/src/logic/persona/shared_persona_data_ids.rs b/crates/sargon-profile-logic/src/logic/persona/shared_persona_data_ids.rs index a2c45d83f..19c5fe23b 100644 --- a/crates/sargon-profile-logic/src/logic/persona/shared_persona_data_ids.rs +++ b/crates/sargon-profile-logic/src/logic/persona/shared_persona_data_ids.rs @@ -1,5 +1,4 @@ use crate::prelude::*; -use radix_rust::prelude::IndexSet; pub trait SharedPersonaDataIdsOfEntries { fn ids_of_entries(&self) -> IndexSet; diff --git a/crates/sargon-profile-security-structures/Cargo.toml b/crates/sargon-profile-security-structures/Cargo.toml index fa0bb3ef0..bd4c86664 100644 --- a/crates/sargon-profile-security-structures/Cargo.toml +++ b/crates/sargon-profile-security-structures/Cargo.toml @@ -13,47 +13,11 @@ sargon-addresses = { path = "../sargon-addresses" } next-derivation-index-ephemeral = { path = "../next-derivation-index-ephemeral" } # === RADIX DEPENDENCIES === -radix-common = { workspace = true } -radix-common-derive = { workspace = true } -radix-engine = { workspace = true } radix-engine-interface = { workspace = true } -radix-engine-toolkit = { workspace = true } -radix-engine-toolkit-common = { workspace = true } -radix-rust = { workspace = true } -radix-transactions = { workspace = true } -sbor = { workspace = true } # === EXTERNAL DEPENDENCIES === -aes-gcm = { workspace = true } -assert-json-diff = { workspace = true } -async-std = { workspace = true } -async-trait = { workspace = true } -base64 = { workspace = true } -camino = { workspace = true } -delegate = { workspace = true } derive_more = { workspace = true } enum-as-inner = { workspace = true } -enum-iterator = { workspace = true } -futures = { workspace = true } -hex = { workspace = true } -hkdf = { workspace = true } -iota-crypto = { workspace = true } -iso8601-timestamp = { workspace = true } -itertools = { workspace = true } -k256 = { workspace = true } -log = { workspace = true } -once_cell = { workspace = true } -paste = { workspace = true } pretty_assertions = { workspace = true } -pretty_env_logger = { workspace = true } -rand = { workspace = true } -reqwest = { workspace = true } serde = { workspace = true } -serde_json = { workspace = true } -serde_repr = { workspace = true } -serde_with = { workspace = true } -strum = { workspace = true } -thiserror = { workspace = true } -url = { workspace = true } -uuid = { workspace = true } -zeroize = { workspace = true } +thiserror = { workspace = true } \ No newline at end of file diff --git a/crates/sargon-profile-security-structures/src/lib.rs b/crates/sargon-profile-security-structures/src/lib.rs index 9f12ddcc8..c43d2f1ca 100644 --- a/crates/sargon-profile-security-structures/src/lib.rs +++ b/crates/sargon-profile-security-structures/src/lib.rs @@ -17,14 +17,15 @@ pub mod prelude { pub use sargon_factors::prelude::*; pub use sargon_hierarchical_deterministic::prelude::*; - pub(crate) use radix_engine_interface::prelude::{ - AccessRule as ScryptoAccessRule, - BasicRequirement as ScryptoBasicRequirement, - CompositeRequirement as ScryptoCompositeRequirement, - }; - - pub(crate) use radix_engine_interface::blueprints::{ - access_controller::RuleSet as ScryptoRuleSet, - resource::ResourceOrNonFungible as ScryptoResourceOrNonFungible, + pub(crate) use radix_engine_interface::{ + blueprints::{ + access_controller::RuleSet as ScryptoRuleSet, + resource::ResourceOrNonFungible as ScryptoResourceOrNonFungible, + }, + prelude::{ + AccessRule as ScryptoAccessRule, + BasicRequirement as ScryptoBasicRequirement, + CompositeRequirement as ScryptoCompositeRequirement, + }, }; } diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/security_shield_builder.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/security_shield_builder.rs index b23884bac..0c8118f28 100644 --- a/crates/sargon-profile-security-structures/src/roles_matrices_structures/security_shield_builder.rs +++ b/crates/sargon-profile-security-structures/src/roles_matrices_structures/security_shield_builder.rs @@ -803,12 +803,12 @@ mod tests { #[allow(clippy::mutable_key_type)] fn hash() { assert_eq!( - radix_rust::hashset![ + HashSet::from_iter([ SUT::sample(), SUT::sample(), SUT::sample_other(), SUT::sample_other(), - ] + ]) .len(), 2 ) diff --git a/crates/sargon-profile-supporting-types/Cargo.toml b/crates/sargon-profile-supporting-types/Cargo.toml index 321461a56..d5b31c4f5 100644 --- a/crates/sargon-profile-supporting-types/Cargo.toml +++ b/crates/sargon-profile-supporting-types/Cargo.toml @@ -13,15 +13,7 @@ sargon-addresses = { path = "../sargon-addresses" } sargon-profile = { path = "../sargon-profile" } # === RADIX DEPENDENCIES === -radix-common = { workspace = true } -radix-common-derive = { workspace = true } -radix-engine = { workspace = true } -radix-engine-interface = { workspace = true } -radix-engine-toolkit = { workspace = true } -radix-engine-toolkit-common = { workspace = true } -radix-rust = { workspace = true } -radix-transactions = { workspace = true } -sbor = { workspace = true } +# None # === EXTERNAL DEPENDENCIES === derive_more = { workspace = true } diff --git a/crates/sargon-profile/Cargo.toml b/crates/sargon-profile/Cargo.toml index 570630fd1..3a3efb1b9 100644 --- a/crates/sargon-profile/Cargo.toml +++ b/crates/sargon-profile/Cargo.toml @@ -17,56 +17,19 @@ sargon-profile-app-preferences = { path = "../sargon-profile-app-preferences" } sargon-profile-security-structures = { path = "../sargon-profile-security-structures" } # === RADIX DEPENDENCIES === -radix-common = { workspace = true } -radix-common-derive = { workspace = true } -radix-engine = { workspace = true } -radix-engine-interface = { workspace = true } -radix-engine-toolkit = { workspace = true } -radix-engine-toolkit-common = { workspace = true } -radix-rust = { workspace = true } -radix-transactions = { workspace = true } -sbor = { workspace = true } +# None # === EXTERNAL DEPENDENCIES === -aes-gcm = { workspace = true } -assert-json-diff = { workspace = true } -async-std = { workspace = true } -async-trait = { workspace = true } -base64 = { workspace = true } -camino = { workspace = true } -delegate = { workspace = true } derive_more = { workspace = true } -enum-as-inner = { workspace = true } enum-iterator = { workspace = true } -futures = { workspace = true } -hex = { workspace = true } hkdf = { workspace = true } -iota-crypto = { workspace = true } -iso8601-timestamp = { workspace = true } -itertools = { workspace = true } k256 = { workspace = true } -log = { workspace = true } once_cell = { workspace = true } -paste = { workspace = true } pretty_assertions = { workspace = true } -pretty_env_logger = { workspace = true } -rand = { workspace = true } -reqwest = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } serde_repr = { workspace = true } -serde_with = { workspace = true } strum = { workspace = true } -thiserror = { workspace = true } -url = { workspace = true } -uuid = { workspace = true } -zeroize = { workspace = true } - -[dev-dependencies] -actix-rt = { workspace = true } [build-dependencies] cargo_toml = { workspace = true } - -[lints.rust] -unexpected_cfgs = { level = "forbid", check-cfg = ['cfg(tarpaulin_include)'] } diff --git a/crates/sargon-transaction-models/Cargo.toml b/crates/sargon-transaction-models/Cargo.toml index 237276d3f..0aa7d7c93 100644 --- a/crates/sargon-transaction-models/Cargo.toml +++ b/crates/sargon-transaction-models/Cargo.toml @@ -24,31 +24,13 @@ radix-transactions = { workspace = true } sbor = { workspace = true } # === EXTERNAL DEPENDENCIES === -assert-json-diff = { workspace = true } -async-trait = { workspace = true } -delegate = { workspace = true } derive_more = { workspace = true } -enum-as-inner = { workspace = true } enum-iterator = { workspace = true } -hex = { workspace = true } -iota-crypto = { workspace = true } -iso8601-timestamp = { workspace = true } -itertools = { workspace = true } -k256 = { workspace = true } -log = { workspace = true } -once_cell = { workspace = true } -paste = { workspace = true } pretty_assertions = { workspace = true } -rand = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } -serde_repr = { workspace = true } serde_with = { workspace = true } -strum = { workspace = true } -thiserror = { workspace = true } -url = { workspace = true } -uuid = { workspace = true } -zeroize = { workspace = true } + [build-dependencies] cargo_toml = { workspace = true } diff --git a/crates/sargon-transaction-models/src/lib.rs b/crates/sargon-transaction-models/src/lib.rs index 55a34d075..97c08441a 100644 --- a/crates/sargon-transaction-models/src/lib.rs +++ b/crates/sargon-transaction-models/src/lib.rs @@ -19,23 +19,25 @@ pub mod prelude { pub use crate::profile_models::*; pub use crate::unvalidated_transaction_manifest::*; - pub(crate) use radix_engine::{ - blueprints::consensus_manager::UnstakeData as ScryptoUnstakeData, - system::system_modules::execution_trace::ResourceSpecifier as ScryptoResourceSpecifier, - transaction::FeeLocks as ScryptoFeeLocks, - }; - pub(crate) use radix_common::{ crypto::Secp256k1PrivateKey as ScryptoSecp256k1PrivateKey, math::Decimal as ScryptoDecimal192, prelude::UpperBound as ScryptoUpperBound, }; - pub(crate) use radix_engine_toolkit_common::receipt::RuntimeToolkitTransactionReceipt as ScryptoRuntimeToolkitTransactionReceipt; - - pub(crate) use radix_engine_toolkit_common::receipt::SerializableToolkitTransactionReceipt as ScryptoSerializableToolkitTransactionReceipt; + pub(crate) use radix_engine::{ + blueprints::consensus_manager::UnstakeData as ScryptoUnstakeData, + system::system_modules::execution_trace::ResourceSpecifier as ScryptoResourceSpecifier, + transaction::FeeLocks as ScryptoFeeLocks, + }; - pub(crate) use radix_engine_interface::prelude::MetadataValue as ScryptoMetadataValue; + pub(crate) use radix_engine_interface::{ + blueprints::account::{ + DefaultDepositRule as ScryptoDefaultDepositRule, + ResourcePreference as ScryptoResourcePreference, + }, + prelude::MetadataValue as ScryptoMetadataValue, + }; pub use radix_engine_toolkit::{ functions::{ @@ -126,9 +128,9 @@ pub mod prelude { }, }; - pub(crate) use radix_engine_interface::blueprints::account::{ - DefaultDepositRule as ScryptoDefaultDepositRule, - ResourcePreference as ScryptoResourcePreference, + pub(crate) use radix_engine_toolkit_common::receipt::{ + RuntimeToolkitTransactionReceipt as ScryptoRuntimeToolkitTransactionReceipt, + SerializableToolkitTransactionReceipt as ScryptoSerializableToolkitTransactionReceipt, }; pub(crate) use radix_transactions::{ diff --git a/crates/sargon/Cargo.toml b/crates/sargon/Cargo.toml index 8098eb06e..5619052f7 100644 --- a/crates/sargon/Cargo.toml +++ b/crates/sargon/Cargo.toml @@ -30,50 +30,25 @@ sargon-drivers = { path = "../sargon-drivers" } gateway-client-and-api = { path = "../gateway-client-and-api" } # === RADIX DEPENDENCIES === -radix-engine = { workspace = true } radix-common = { workspace = true } -radix-common-derive = { workspace = true } radix-engine-interface = { workspace = true } -radix-engine-toolkit = { workspace = true } radix-engine-toolkit-common = { workspace = true } radix-transactions = { workspace = true } -radix-rust = { workspace = true } -sbor = { workspace = true } # === EXTERNAL DEPENDENCIES === -aes-gcm = { workspace = true } -assert-json-diff = { workspace = true } async-std = { workspace = true } async-trait = { workspace = true } base64 = { workspace = true } -camino = { workspace = true } -delegate = { workspace = true } derive_more = { workspace = true } -enum-as-inner = { workspace = true } enum-iterator = { workspace = true } futures = { workspace = true } hex = { workspace = true } -hkdf = { workspace = true } -iota-crypto = { workspace = true } -iso8601-timestamp = { workspace = true } -itertools = { workspace = true } -k256 = { workspace = true } log = { workspace = true } -once_cell = { workspace = true } paste = { workspace = true } pretty_assertions = { workspace = true } -pretty_env_logger = { workspace = true } -rand = { workspace = true } -reqwest = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } -serde_repr = { workspace = true } serde_with = { workspace = true } -strum = { workspace = true } -thiserror = { workspace = true } -url = { workspace = true } -uuid = { workspace = true } -zeroize = { workspace = true } # Fixes nasty iOS bug "_kSecMatchSubjectWholeString", see https://github.com/kornelski/rust-security-framework/issues/203 # This is a workaround to fix a bug with version 2.11.0 that added some symbols that are not available on iOS @@ -87,6 +62,3 @@ actix-rt = { workspace = true } [build-dependencies] cargo_toml = { workspace = true } - -[lints.rust] -unexpected_cfgs = { level = "forbid", check-cfg = ['cfg(tarpaulin_include)'] } diff --git a/crates/sargon/src/home_cards/deferred_deep_link/parser.rs b/crates/sargon/src/home_cards/deferred_deep_link/parser.rs index 5d3008954..fd4221c33 100644 --- a/crates/sargon/src/home_cards/deferred_deep_link/parser.rs +++ b/crates/sargon/src/home_cards/deferred_deep_link/parser.rs @@ -1,6 +1,5 @@ use crate::prelude::*; -use base64::engine::general_purpose::URL_SAFE_NO_PAD; -use base64::Engine; +use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine}; #[async_trait::async_trait] pub trait DeferredDeepLinkParser: Send + Sync { diff --git a/crates/sargon/src/lib.rs b/crates/sargon/src/lib.rs index 0d5627cc6..31dca3b1e 100644 --- a/crates/sargon/src/lib.rs +++ b/crates/sargon/src/lib.rs @@ -38,95 +38,6 @@ pub mod prelude { #[cfg(test)] pub(crate) use radix_common::math::Decimal as ScryptoDecimal192; - - pub use radix_engine_toolkit::{ - functions::{ - transaction_v1::{ - instructions::extract_addresses as RET_ins_extract_addresses, - intent::{ - from_payload_bytes as RET_intent_from_payload_bytes, - hash as ret_hash_intent, - to_payload_bytes as RET_intent_to_payload_bytes, - }, - manifest::{ - from_payload_bytes as RET_from_payload_bytes_manifest_v1, - statically_analyze_and_validate as RET_statically_analyze_and_validate, - to_payload_bytes as RET_to_payload_bytes_manifest_v1, - }, - notarized_transaction::{ - from_payload_bytes as RET_decompile_notarize_tx, - to_payload_bytes as RET_compile_notarized_tx, - }, - signed_intent::hash as RET_signed_intent_hash, - }, - transaction_v2::{ - instructions::extract_addresses as RET_ins_extract_addresses_v2, - notarized_transaction::{ - from_payload_bytes as RET_decompile_notarize_tx_v2, - to_payload_bytes as RET_compile_notarized_tx_v2, - }, - signed_partial_transaction::{ - from_payload_bytes as RET_decompile_signed_partial_tx, - to_payload_bytes as RET_compile_signed_partial_tx, - }, - signed_transaction_intent::hash as RET_signed_intent_hash_v2, - subintent::{ - from_payload_bytes as RET_subintent_from_payload_bytes, - hash as ret_hash_subintent, - to_payload_bytes as RET_subintent_to_payload_bytes, - }, - subintent_manifest::{ - as_enclosed as RET_subintent_manifest_as_enclosed, - from_payload_bytes as RET_from_payload_bytes_subintent_manifest, - statically_analyze_and_validate as RET_statically_analyze_and_validate_subintent_manifest, - to_payload_bytes as RET_to_payload_bytes_subintent_manifest, - }, - transaction_intent::{ - hash as ret_hash_transaction_intent_v2, - to_payload_bytes as RET_transaction_intent_to_payload_bytes_v2, - }, - transaction_manifest::{ - dynamically_analyze as RET_dynamically_analyze_v2, - from_payload_bytes as RET_from_payload_bytes_manifest_v2, - statically_analyze_and_validate as RET_statically_analyze_and_validate_v2, - to_payload_bytes as RET_to_payload_bytes_manifest_v2, - }, - }, - }, - models::{ - canonical_address_types::{ - CanonicalAccessControllerAddress as RetAccessControllerAddress, - CanonicalAccountAddress as RetAccountAddress, - CanonicalAddress as RetIsAddressTrait, - CanonicalComponentAddress as RetComponentAddress, - CanonicalIdentityAddress as RetIdentityAddress, - CanonicalLockerAddress as RetLockerAddress, - CanonicalPackageAddress as RetPackageAddress, - CanonicalPoolAddress as RetPoolAddress, - CanonicalResourceAddress as RetResourceAddress, - CanonicalValidatorAddress as RetValidatorAddress, - CanonicalVaultAddress as RetVaultAddress, - }, - node_id::TypedNodeId as RetTypedNodeId, - }, - transaction_types::{ - DetailedManifestClass as RetDetailedManifestClass, - DynamicAnalysis as RetDynamicAnalysis, FeeSummary as RetFeeSummary, - FungibleResourceIndicator as RetFungibleResourceIndicator, - ManifestClass as RetManifestClass, NewEntities as RetNewEntities, - NonFungibleResourceIndicator as RetNonFungibleResourceIndicator, - Operation as RetOperation, Predicted as RetPredicted, - ReservedInstruction as RetReservedInstruction, - ResourceIndicator as RetResourceIndicator, - StaticAnalysisWithResourceMovements as RetStaticAnalysisWithResourceMovements, - TrackedPoolContribution as RetTrackedPoolContribution, - TrackedPoolRedemption as RetTrackedPoolRedemption, - TrackedValidatorClaim as RetTrackedValidatorClaim, - TrackedValidatorStake as RetTrackedValidatorStake, - TransactionTypesError as RetTransactionTypesError, - Update as RetUpdate, - }, - }; } pub use prelude::*; diff --git a/crates/sargon/src/signing/testing/simulated_user.rs b/crates/sargon/src/signing/testing/simulated_user.rs index 8f0724560..8dfc97b19 100644 --- a/crates/sargon/src/signing/testing/simulated_user.rs +++ b/crates/sargon/src/signing/testing/simulated_user.rs @@ -188,8 +188,6 @@ impl SimulatedUser { where F: Fn() -> bool, { - use rand::prelude::*; - match &self.mode { SimulatedUserMode::Prudent => true, SimulatedUserMode::Lazy(laziness) => match laziness { diff --git a/crates/sargon/src/system/sargon_os/factor_instances_provider_unit_tests.rs b/crates/sargon/src/system/sargon_os/factor_instances_provider_unit_tests.rs index 0b85744cb..29959378b 100644 --- a/crates/sargon/src/system/sargon_os/factor_instances_provider_unit_tests.rs +++ b/crates/sargon/src/system/sargon_os/factor_instances_provider_unit_tests.rs @@ -1,5 +1,7 @@ #![allow(non_snake_case)] +use crate::prelude::*; + impl SargonOS { pub(crate) async fn with_bdfs() -> (Arc, FactorSource) { let os = Self::fast_boot().await; @@ -224,10 +226,6 @@ impl SargonOS { } } -use sbor::prelude::indexmap::IndexSet; - -use crate::prelude::*; - #[actix_rt::test] async fn create_accounts_when_last_is_used_cache_is_fill_only_with_account_vecis_and_if_profile_is_used_a_new_account_is_created( ) { diff --git a/crates/sargon/src/system/sargon_os/sargon_os.rs b/crates/sargon/src/system/sargon_os/sargon_os.rs index 94b21fa92..0a1a72b70 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os.rs +++ b/crates/sargon/src/system/sargon_os/sargon_os.rs @@ -481,7 +481,9 @@ impl SargonOS { ) -> Result> { let drivers = Drivers::with_networking(networking); let bios = Bios::new(drivers); - let clients = Clients::new(bios); + let mut clients = Clients::new(bios); + clients.factor_instances_cache = + FactorInstancesCacheClient::in_memory(); let interactors = Interactors::new_from_clients(&clients); let os = @@ -540,7 +542,9 @@ mod tests { SecureStorageClient::new(secure_storage_driver.clone()); secure_storage_client.save_profile(&profile).await.unwrap(); let drivers = Drivers::with_secure_storage(secure_storage_driver); - let clients = Clients::new(Bios::new(drivers)); + let mut clients = Clients::new(Bios::new(drivers)); + clients.factor_instances_cache = + FactorInstancesCacheClient::in_memory(); let interactors = Interactors::new_from_clients(&clients); // ACT let os = timeout( @@ -559,7 +563,9 @@ mod tests { async fn test_boot_when_existing_profile_with_no_networks_profile_state_considered_none( ) { // ARRANGE - let clients = Clients::new(Bios::new(Drivers::test())); + let mut clients = Clients::new(Bios::new(Drivers::test())); + clients.factor_instances_cache = + FactorInstancesCacheClient::in_memory(); let interactors = Interactors::new_from_clients(&clients); let os = SUT::boot_with_clients_and_interactor(clients, interactors).await; @@ -581,7 +587,9 @@ mod tests { .unwrap(); // ACT - let clients = Clients::new(Bios::new(Drivers::test())); + let mut clients = Clients::new(Bios::new(Drivers::test())); + clients.factor_instances_cache = + FactorInstancesCacheClient::in_memory(); let interactors = Interactors::new_from_clients(&clients); let new_os = @@ -621,7 +629,9 @@ mod tests { #[actix_rt::test] async fn test_new_wallet() { let test_drivers = Drivers::test(); - let clients = Clients::new(Bios::new(test_drivers)); + let mut clients = Clients::new(Bios::new(test_drivers)); + clients.factor_instances_cache = + FactorInstancesCacheClient::in_memory(); let interactors = Interactors::new_from_clients(&clients); let os = SUT::boot_with_clients_and_interactor(clients, interactors).await; @@ -664,7 +674,9 @@ mod tests { #[actix_rt::test] async fn test_new_wallet_through_derived_bdfs() { let test_drivers = Drivers::test(); - let clients = Clients::new(Bios::new(test_drivers)); + let mut clients = Clients::new(Bios::new(test_drivers)); + clients.factor_instances_cache = + FactorInstancesCacheClient::in_memory(); let interactors = Interactors::new_from_clients(&clients); let os = SUT::boot_with_clients_and_interactor(clients, interactors).await; @@ -684,7 +696,9 @@ mod tests { #[actix_rt::test] async fn test_new_wallet_through_derived_bdfs_with_empty_accounts() { let test_drivers = Drivers::test(); - let clients = Clients::new(Bios::new(test_drivers)); + let mut clients = Clients::new(Bios::new(test_drivers)); + clients.factor_instances_cache = + FactorInstancesCacheClient::in_memory(); let interactors = Interactors::new_from_clients(&clients); let os = @@ -706,7 +720,9 @@ mod tests { async fn test_new_wallet_through_derived_bdfs_with_accounts_derived_from_other_hd_factor_source( ) { let test_drivers = Drivers::test(); - let clients = Clients::new(Bios::new(test_drivers)); + let mut clients = Clients::new(Bios::new(test_drivers)); + clients.factor_instances_cache = + FactorInstancesCacheClient::in_memory(); let interactors = Interactors::new_from_clients(&clients); let os = @@ -739,7 +755,9 @@ mod tests { #[actix_rt::test] async fn test_delete_wallet() { let test_drivers = Drivers::test(); - let clients = Clients::new(Bios::new(test_drivers)); + let mut clients = Clients::new(Bios::new(test_drivers)); + clients.factor_instances_cache = + FactorInstancesCacheClient::in_memory(); let interactors = Interactors::new_from_clients(&clients); let os = diff --git a/crates/sargon/src/system/sargon_os/sargon_os_accounts.rs b/crates/sargon/src/system/sargon_os/sargon_os_accounts.rs index 52442ade4..04d3a8aab 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os_accounts.rs +++ b/crates/sargon/src/system/sargon_os/sargon_os_accounts.rs @@ -1354,7 +1354,9 @@ mod tests { // ARRANGE (and ACT) let event_bus_driver = RustEventBusDriver::new(); let drivers = Drivers::with_event_bus(event_bus_driver.clone()); - let clients = Clients::new(Bios::new(drivers)); + let mut clients = Clients::new(Bios::new(drivers)); + clients.factor_instances_cache = + FactorInstancesCacheClient::in_memory(); let interactors = Interactors::new_from_clients(&clients); let os = timeout( @@ -1384,7 +1386,9 @@ mod tests { // ARRANGE (and ACT) let event_bus_driver = RustEventBusDriver::new(); let drivers = Drivers::with_event_bus(event_bus_driver.clone()); - let clients = Clients::new(Bios::new(drivers)); + let mut clients = Clients::new(Bios::new(drivers)); + clients.factor_instances_cache = + FactorInstancesCacheClient::in_memory(); let interactors = Interactors::new_from_clients(&clients); let os = timeout( SARGON_OS_TEST_MAX_ASYNC_DURATION, @@ -1430,7 +1434,9 @@ mod tests { // ARRANGE let event_bus_driver = RustEventBusDriver::new(); let drivers = Drivers::with_event_bus(event_bus_driver.clone()); - let clients = Clients::new(Bios::new(drivers)); + let mut clients = Clients::new(Bios::new(drivers)); + clients.factor_instances_cache = + FactorInstancesCacheClient::in_memory(); let interactors = Interactors::new_from_clients(&clients); let os = timeout( SARGON_OS_TEST_MAX_ASYNC_DURATION, @@ -1517,7 +1523,9 @@ mod tests { // ARRANGE (and ACT) let event_bus_driver = RustEventBusDriver::new(); let drivers = Drivers::with_event_bus(event_bus_driver.clone()); - let clients = Clients::new(Bios::new(drivers)); + let mut clients = Clients::new(Bios::new(drivers)); + clients.factor_instances_cache = + FactorInstancesCacheClient::in_memory(); let interactors = Interactors::new_from_clients(&clients); let os = timeout( SARGON_OS_TEST_MAX_ASYNC_DURATION, diff --git a/crates/sargon/src/system/sargon_os/sargon_os_entities_linked_to_factor_source.rs b/crates/sargon/src/system/sargon_os/sargon_os_entities_linked_to_factor_source.rs index 57ea539da..b528ea42f 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os_entities_linked_to_factor_source.rs +++ b/crates/sargon/src/system/sargon_os/sargon_os_entities_linked_to_factor_source.rs @@ -286,7 +286,9 @@ mod tests { build_unsafe_storage(device_mnemonic_backed_up).await; let drivers = Drivers::with_storages(secure_storage, unsafe_storage); let bios = Bios::new(drivers); - let clients = Clients::new(bios); + let mut clients = Clients::new(bios); + clients.factor_instances_cache = + FactorInstancesCacheClient::in_memory(); let interactors = Interactors::new_from_clients(&clients); let os = diff --git a/crates/sargon/src/system/sargon_os/sargon_os_factors.rs b/crates/sargon/src/system/sargon_os/sargon_os_factors.rs index 6848388d8..2848c523e 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os_factors.rs +++ b/crates/sargon/src/system/sargon_os/sargon_os_factors.rs @@ -762,7 +762,9 @@ mod tests { // ARRANGE (and ACT) let event_bus_driver = RustEventBusDriver::new(); let drivers = Drivers::with_event_bus(event_bus_driver.clone()); - let clients = Clients::new(Bios::new(drivers)); + let mut clients = Clients::new(Bios::new(drivers)); + clients.factor_instances_cache = + FactorInstancesCacheClient::in_memory(); let interactors = Interactors::new_from_clients(&clients); let os = timeout( SARGON_OS_TEST_MAX_ASYNC_DURATION, diff --git a/crates/sargon/src/system/sargon_os/sargon_os_gateway.rs b/crates/sargon/src/system/sargon_os/sargon_os_gateway.rs index fd87edeb9..8e3274cf0 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os_gateway.rs +++ b/crates/sargon/src/system/sargon_os/sargon_os_gateway.rs @@ -158,7 +158,9 @@ mod tests { // ARRANGE (and ACT) let event_bus_driver = RustEventBusDriver::new(); let drivers = Drivers::with_event_bus(event_bus_driver.clone()); - let clients = Clients::new(Bios::new(drivers)); + let mut clients = Clients::new(Bios::new(drivers)); + clients.factor_instances_cache = + FactorInstancesCacheClient::in_memory(); let interactors = Interactors::new_from_clients(&clients); let os = timeout( SARGON_OS_TEST_MAX_ASYNC_DURATION, @@ -185,7 +187,9 @@ mod tests { // ARRANGE (and ACT) let event_bus_driver = RustEventBusDriver::new(); let drivers = Drivers::with_event_bus(event_bus_driver.clone()); - let clients = Clients::new(Bios::new(drivers)); + let mut clients = Clients::new(Bios::new(drivers)); + clients.factor_instances_cache = + FactorInstancesCacheClient::in_memory(); let interactors = Interactors::new_from_clients(&clients); let os = timeout( SARGON_OS_TEST_MAX_ASYNC_DURATION, diff --git a/crates/sargon/src/system/sargon_os/sargon_os_profile.rs b/crates/sargon/src/system/sargon_os/sargon_os_profile.rs index 251142465..67c611ee3 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os_profile.rs +++ b/crates/sargon/src/system/sargon_os/sargon_os_profile.rs @@ -286,7 +286,9 @@ mod tests { // ARRANGE (and ACT) let event_bus_driver = RustEventBusDriver::new(); let drivers = Drivers::with_event_bus(event_bus_driver.clone()); - let clients = Clients::new(Bios::new(drivers)); + let mut clients = Clients::new(Bios::new(drivers)); + clients.factor_instances_cache = + FactorInstancesCacheClient::in_memory(); let interactors = Interactors::new_from_clients(&clients); let os = timeout( @@ -496,7 +498,9 @@ mod tests { async fn test_set_profile_when_no_profile_exists() { // ARRANGE let test_drivers = Drivers::test(); - let clients = Clients::new(Bios::new(test_drivers)); + let mut clients = Clients::new(Bios::new(test_drivers)); + clients.factor_instances_cache = + FactorInstancesCacheClient::in_memory(); let interactors = Interactors::new_from_clients(&clients); let os = SargonOS::boot_with_clients_and_interactor(clients, interactors) diff --git a/crates/sargon/src/system/sargon_os/sargon_os_security_structures.rs b/crates/sargon/src/system/sargon_os/sargon_os_security_structures.rs index 09bbec7fb..cd30cf643 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os_security_structures.rs +++ b/crates/sargon/src/system/sargon_os/sargon_os_security_structures.rs @@ -204,7 +204,9 @@ mod tests { // ARRANGE (and ACT) let event_bus_driver = RustEventBusDriver::new(); let drivers = Drivers::with_event_bus(event_bus_driver.clone()); - let clients = Clients::new(Bios::new(drivers)); + let mut clients = Clients::new(Bios::new(drivers)); + clients.factor_instances_cache = + FactorInstancesCacheClient::in_memory(); let interactors = Interactors::new_from_clients(&clients); let os = timeout( @@ -235,7 +237,9 @@ mod tests { // ARRANGE let event_bus_driver = RustEventBusDriver::new(); let drivers = Drivers::with_event_bus(event_bus_driver.clone()); - let clients = Clients::new(Bios::new(drivers)); + let mut clients = Clients::new(Bios::new(drivers)); + clients.factor_instances_cache = + FactorInstancesCacheClient::in_memory(); let interactors = Interactors::new_from_clients(&clients); let os = timeout( diff --git a/crates/sargon/src/system/sargon_os/sargon_os_signing.rs b/crates/sargon/src/system/sargon_os/sargon_os_signing.rs index e1e9cbf6f..06be8965f 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os_signing.rs +++ b/crates/sargon/src/system/sargon_os/sargon_os_signing.rs @@ -272,7 +272,9 @@ mod test { #[actix_rt::test] async fn test_sign_fail_due_to_profile() { let test_drivers = Drivers::test(); - let clients = Clients::new(Bios::new(test_drivers)); + let mut clients = Clients::new(Bios::new(test_drivers)); + clients.factor_instances_cache = + FactorInstancesCacheClient::in_memory(); let interactors = Interactors::new_from_clients(&clients); let sut = SUT::boot_with_clients_and_interactor(clients, interactors).await; @@ -321,7 +323,9 @@ mod test { secure_storage_client.save_profile(profile).await.unwrap(); let test_drivers = Drivers::with_secure_storage(secure_storage_driver); - let clients = Clients::new(Bios::new(test_drivers)); + let mut clients = Clients::new(Bios::new(test_drivers)); + clients.factor_instances_cache = + FactorInstancesCacheClient::in_memory(); let use_factor_sources_interactors = Arc::new(TestUseFactorSourcesInteractors::new( From 4d6c7d8ef9b61e5d7e8b66cc00e459bf0a22a85a Mon Sep 17 00:00:00 2001 From: Alexander Cyon <116169792+CyonAlexRDX@users.noreply.github.com> Date: Sat, 4 Jan 2025 15:18:10 +0100 Subject: [PATCH 10/13] Split `core`, group crates, rename crates (#329) --- .swiftformat | 4 +- Cargo.lock | 2062 +++++++++++------ Cargo.toml | 194 +- .../AccountOrAddressOf+Wrap+Functions.swift | 2 +- .../AccountOrAddressOf+SampleValues.swift | 2 +- .../Profile/Account/Account+Swiftified.swift | 4 + .../Profile/Factor/FactorSource+Extras.swift | 43 + .../FactorSourceIntegrity+Swiftified.swift | 29 + .../AccountOrAddressOf+Swiftified.swift | 12 +- .../ManifestBuildingTests.swift | 4 +- ...WalletToDappInteractionResponseTests.swift | 2 +- .../Transaction/AccountOrAddressOfTests.swift | 2 +- apple/Tests/Utils/Test.swift | 27 +- crates/common/bytes/Cargo.toml | 24 + .../bytes/src}/bag_of_bytes.rs | 15 +- .../bytes/src}/exactly_n_bytes.rs | 4 +- crates/common/bytes/src/lib.rs | 29 + .../bytes/src}/non_empty_max_n_bytes.rs | 8 +- .../bytes/src}/secret_bytes.rs | 2 +- .../bytes}/src/secure_random_bytes.rs | 0 crates/common/entity-foundation/Cargo.toml | 19 + .../entity-foundation/src}/appearance_id.rs | 2 +- .../entity-foundation/src}/entity_kind.rs | 0 crates/common/entity-foundation/src/lib.rs | 20 + crates/common/host-info/Cargo.toml | 18 + .../host-info/src}/host_info/device_id.rs | 2 +- .../src}/host_info/device_info_description.rs | 2 + .../host-info/src}/host_info/host_id.rs | 7 +- .../host-info/src}/host_info/host_info.rs | 0 .../host-info/src}/host_info/host_os.rs | 2 +- .../host-info/src}/host_info/mod.rs | 0 crates/common/host-info/src/lib.rs | 19 + .../{ => common}/identified-vec-of/Cargo.toml | 7 +- .../decl_identified_vec_of_with_samples.rs | 4 +- .../identified-vec-of/src/identifiable.rs | 0 .../src/identified_vec_of.rs | 2 - .../src/identified_vec_of_display_debug.rs | 0 .../src/identified_vec_of_iterator.rs | 2 - .../src/identified_vec_of_modify.rs | 0 .../src/identified_vec_of_query.rs | 1 - .../src/identified_vec_of_serde.rs | 0 ...ntified_vec_of_validation_import_export.rs | 0 .../{ => common}/identified-vec-of/src/lib.rs | 6 +- .../identified-vec-of/src/user.rs | 0 crates/common/metadata/Cargo.toml | 17 + crates/common/metadata/src/lib.rs | 15 + .../metadata}/src/metadata.rs | 0 crates/common/network/Cargo.toml | 20 + .../network}/src/is_network_aware.rs | 0 crates/common/network/src/lib.rs | 19 + .../network}/src/network_id.rs | 3 + crates/common/numeric/Cargo.toml | 23 + .../numeric/src/decimal}/decimal192.rs | 0 .../numeric/src/decimal}/locale_config.rs | 0 crates/common/numeric/src/decimal/mod.rs | 7 + .../numeric/src/decimal}/rounding_mode.rs | 0 crates/common/numeric/src/lib.rs | 30 + .../src/unsigned_ints/add_via_deref.rs | 0 .../unsigned_ints/global_index_constants.rs | 0 .../numeric}/src/unsigned_ints/mod.rs | 0 .../numeric}/src/unsigned_ints/u30.rs | 0 .../numeric}/src/unsigned_ints/u31.rs | 0 crates/common/short-string/Cargo.toml | 21 + .../short-string/src}/display_name.rs | 4 +- .../short-string/src}/email_address.rs | 2 + crates/common/short-string/src/lib.rs | 21 + .../short-string/src}/short_string.rs | 0 .../assert-json}/Cargo.toml | 4 +- .../assert-json}/src/assert_json.rs | 0 .../assert-json}/src/lib.rs | 0 crates/core/collections/Cargo.toml | 16 + .../collections}/src/appendable_collection.rs | 2 +- .../collections/src}/collections/just.rs | 5 +- .../collections/src}/collections/mod.rs | 0 crates/core/collections/src/lib.rs | 7 + .../error}/Cargo.toml | 2 +- .../error}/src/common_error.rs | 0 .../error}/src/lib.rs | 0 crates/core/has-sample-values/Cargo.toml | 16 + .../src/has_sample_values.rs | 92 +- crates/core/has-sample-values/src/lib.rs | 16 + crates/core/misc/Cargo.toml | 24 + .../src/types => core/misc/src}/bool_type.rs | 3 +- .../misc/src}/hidden_constructor.rs | 0 .../misc}/src/image_url_utils.rs | 5 +- .../src/types => core/misc/src}/instant.rs | 3 + crates/core/misc/src/lib.rs | 34 + crates/core/misc/src/parse_url.rs | 7 + .../misc/src}/requested_number_quantifier.rs | 0 .../misc/src}/requested_quantity.rs | 2 +- .../misc}/src/unsafe_id_stepper.rs | 2 + .../misc/src}/vector_image_type.rs | 0 crates/core/time-utils/Cargo.toml | 15 + crates/core/time-utils/src/lib.rs | 12 + .../utils}/Cargo.toml | 2 +- .../utils}/src/common_error_map.rs | 2 +- .../utils}/src/constants.rs | 10 + crates/core/utils/src/factory.rs | 30 + .../utils}/src/lib.rs | 0 .../utils}/src/logged_panic.rs | 0 .../utils}/src/serialization.rs | 2 +- .../utils}/src/string_utils.rs | 0 .../addresses}/Cargo.toml | 17 +- .../src/address/access_controller_address.rs | 0 .../addresses}/src/address/account_address.rs | 0 .../addresses}/src/address/address.rs | 0 .../addresses}/src/address/address_format.rs | 0 .../address/address_of_account_or_persona.rs | 0 .../addresses}/src/address/address_union.rs | 4 +- .../src/address/component_address.rs | 0 .../addresses}/src/address/entity_address.rs | 0 .../src/address/identity_address.rs | 0 .../address/legacy_olympia_account_address.rs | 1 + .../addresses}/src/address/locker_address.rs | 0 .../addresses}/src/address/mod.rs | 0 .../src/address/non_fungible_global_id.rs | 1 + .../src/address/non_fungible_local_id.rs | 6 +- .../address/non_fungible_local_id_string.rs | 0 .../address/non_fungible_resource_address.rs | 4 +- .../addresses}/src/address/package_address.rs | 0 .../addresses}/src/address/pool_address.rs | 0 .../addresses}/src/address/public_key_hash.rs | 0 .../src/address/resource_address.rs | 0 .../src/address/validator_address.rs | 0 .../addresses}/src/address/vault_address.rs | 0 .../src/address/wrap_ret_address.rs | 9 +- .../addresses_manifest_builder_support.rs | 6 +- .../addresses}/src/address_conversion/mod.rs | 0 .../resource_address_from.rs | 0 .../addresses}/src/lib.rs | 22 +- .../addresses}/src/resource/mod.rs | 0 .../src/resource/resource_or_non_fungible.rs | 0 crates/crypto/ecc/Cargo.toml | 30 + .../ecc/src}/keys/ed25519/mod.rs | 0 .../ecc/src}/keys/ed25519/private_key.rs | 0 .../ecc/src}/keys/ed25519/public_key.rs | 0 .../ecc/src}/keys/is_private_key.rs | 0 .../ecc/src}/keys/is_public_key.rs | 0 .../ecc/src}/keys/key_agreement/mod.rs | 0 .../src}/keys/key_agreement/private_key.rs | 0 .../ecc/src}/keys/key_agreement/public_key.rs | 0 .../src/types => crypto/ecc/src}/keys/mod.rs | 0 .../ecc/src}/keys/private_key.rs | 0 .../ecc/src}/keys/public_key.rs | 2 + .../ecc/src}/keys/secp256k1/mod.rs | 0 .../ecc/src}/keys/secp256k1/private_key.rs | 0 .../ecc/src}/keys/secp256k1/public_key.rs | 0 .../ecc/src}/keys/slip10_curve.rs | 0 crates/crypto/ecc/src/lib.rs | 44 + .../ecc/src}/signatures/ed25519_signature.rs | 0 .../ecc/src}/signatures/mod.rs | 0 .../src}/signatures/secp256k1_signature.rs | 0 .../ecc/src}/signatures/signature.rs | 0 .../signatures/signature_with_public_key.rs | 0 crates/crypto/encryption/Cargo.toml | 26 + .../encryption}/src/encryption/aes_gcm_256.rs | 0 .../src/encryption/aes_gcm_sealed_box.rs | 0 .../src/encryption/encryption_key.rs | 0 .../src/encryption/encryption_scheme.rs | 2 + .../encryption/encryption_scheme_version.rs | 2 +- .../encryption}/src/encryption/mod.rs | 0 .../src/encryption/version_of_algorithm.rs | 0 .../src/encryption/versioned_encryption.rs | 0 .../encryption/src}/key_derivation/mod.rs | 0 .../password_based_key_derivation_scheme.rs | 2 + ...ord_based_key_derivation_scheme_version.rs | 2 +- ...versioned_password_based_key_derivation.rs | 0 crates/crypto/encryption/src/lib.rs | 19 + .../encryption/src}/pb_hkdf_sha256.rs | 8 +- .../encryption/src}/versioned_algorithm.rs | 0 crates/crypto/hash/Cargo.toml | 15 + .../{sargon-core => crypto/hash}/src/hash.rs | 13 + crates/crypto/hash/src/lib.rs | 15 + .../hd}/Cargo.toml | 14 +- .../hd}/src/bip32/hd_path.rs | 0 .../hd}/src/bip32/hd_path_component.rs | 2 + .../bip32/key_space/components/hardened.rs | 0 .../hd}/src/bip32/key_space/components/mod.rs | 0 .../bip32/key_space/components/securified.rs | 2 +- .../bip32/key_space/components/unhardened.rs | 2 +- .../key_space/components/unsecurified.rs | 2 + .../components/unsecurified_hardened.rs | 4 +- .../hd}/src/bip32/key_space/key_space.rs | 0 .../hd}/src/bip32/key_space/mod.rs | 0 .../bip32/key_space/traits/add_via_global.rs | 0 .../key_space/traits/from_global_key_space.rs | 0 .../key_space/traits/from_local_key_space.rs | 0 .../has_offset_from_global_key_space.rs | 0 .../key_space/traits/is_in_local_key_space.rs | 0 .../traits/is_mappable_to_global_key_space.rs | 0 .../hd}/src/bip32/key_space/traits/mod.rs | 0 .../hd}/src/bip32/mod.rs | 0 .../hd}/src/bip32/traits/from_bip32_str.rs | 0 .../is_path_component_string_convertible.rs | 0 .../bip32/traits/is_security_state_aware.rs | 0 .../hd}/src/bip32/traits/mod.rs | 0 .../hd}/src/bip32/traits/to_bip32_str.rs | 0 .../hd}/src/bip39/bip39_entropy.rs | 4 +- .../hd}/src/bip39/bip39_passphrase.rs | 18 - .../hd}/src/bip39/bip39_seed.rs | 2 +- .../src/bip39/bip39_word/bip39_language.rs | 0 .../hd}/src/bip39/bip39_word/bip39_word.rs | 2 + .../hd}/src/bip39/bip39_word/mod.rs | 0 .../hd}/src/bip39/bip39_word/u11.rs | 0 .../hd}/src/bip39/bip39_word_count.rs | 0 .../hd}/src/bip39/mnemonic.rs | 17 +- .../hd}/src/bip39/mod.rs | 0 .../hd}/src/bip44/bip44_like_path.rs | 1 - .../hd}/src/bip44/mod.rs | 0 .../hd}/src/cap26/cap26_entity_kind.rs | 0 .../hd}/src/cap26/cap26_key_kind.rs | 0 .../hd}/src/cap26/mod.rs | 0 .../hd}/src/cap26/paths/account_path.rs | 0 .../hd}/src/cap26/paths/get_id_path.rs | 0 .../hd}/src/cap26/paths/identity_path.rs | 0 .../hd}/src/cap26/paths/mod.rs | 0 .../hd}/src/cap26/paths/traits.rs | 0 .../src/cap26/paths/unvalidated_cap26_path.rs | 0 .../hd}/src/derivation/derivation_path.rs | 0 .../src/derivation/derivation_path_scheme.rs | 0 .../derivation/has_derivation_path_scheme.rs | 0 .../hierarchical_deterministic_private_key.rs | 0 .../hierarchical_deterministic_public_key.rs | 0 .../derivation/mnemonic_with_passphrase.rs | 22 - .../hd}/src/derivation/mod.rs | 0 .../hd}/src/has_key_kind.rs | 0 crates/crypto/hd/src/lib.rs | 41 + crates/factors/factors/Cargo.toml | 41 + .../factors}/build.rs | 0 ...curity_questions_factor_source_sample.json | 0 ..._questions_factor_source_sample_other.json | 0 .../factor_instance/badge_virtual_source.rs | 2 + .../src/factor_instance/factor_instance.rs | 0 .../factor_instance/factor_instance_badge.rs | 2 + .../src/factor_instance/factor_instances.rs | 3 + .../factors}/src/factor_instance/mod.rs | 0 ...rarchical_deterministic_factor_instance.rs | 0 .../factors}/src/factor_source.rs | 2 + .../factors}/src/factor_source_category.rs | 0 .../factors}/src/factor_source_common.rs | 2 + .../src/factor_source_crypto_parameters.rs | 0 .../factors}/src/factor_source_flag.rs | 0 .../factors}/src/factor_source_id.rs | 0 .../src/factor_source_id_from_address.rs | 2 + .../src/factor_source_id_from_hash.rs | 2 + .../factors}/src/factor_source_kind.rs | 2 + .../device_factor_source.rs | 2 + .../device_factor_source_hint.rs | 2 + .../device_factor_source/mod.rs | 0 .../src/factor_sources/factor_sources.rs | 0 .../ledger_hardware_wallet_factor_source.rs | 0 .../ledger_hardware_wallet_hint.rs | 0 .../ledger_hardware_wallet_model.rs | 4 + .../mod.rs | 0 .../factors}/src/factor_sources/mod.rs | 0 ...ierarchical_deterministic_factor_source.rs | 17 +- .../factors}/src/factor_sources_of_kind.rs | 2 + .../hd_factor_instance_account_creation.rs | 0 .../hd_factor_instance_identity_creation.rs | 0 .../hd_transaction_signing_factor_instance.rs | 2 + ...rarchical_deterministic_factor_instance.rs | 0 .../factors}/src/is_entity_path.rs | 0 .../factors}/src/is_factor_source.rs | 0 .../factors}/src/lib.rs | 18 +- .../arculus_card_factor_source.rs | 0 .../arculus_card_hint.rs | 0 .../arculus_card_model.rs | 2 + .../arculus_card_factor_source/mod.rs | 0 .../factors}/src/mfa_factor_sources/mod.rs | 0 .../off_device_mnemonic_factor_source/mod.rs | 0 .../off_device_factor_source_hint.rs | 2 + .../off_device_mnemonic_factor_source.rs | 0 .../password_factor_source/mod.rs | 0 .../password_factor_source.rs | 0 .../password_factor_source_hint.rs | 0 .../answer/mod.rs | 0 .../answer/security_question_and_answer.rs | 0 .../answer/security_questions_and_answers.rs | 0 .../kdf/is_security_questions_kdf_scheme.rs | 2 + .../kdf/mod.rs | 0 ...s_keys_from_questions_and_answer_scheme.rs | 2 + .../keys_by_diffie_hellman_fold.rs | 1 + .../mod.rs | 0 ...m_questions_and_answers_lower_trim_utf8.rs | 0 .../mod.rs | 0 .../security_question_and_answer_as_bytes.rs | 0 .../security_question_answer_as_bytes.rs | 0 .../kdf/sub_kdf/mod.rs | 0 .../security_questions_factor_source/mod.rs | 0 .../question/mod.rs | 0 .../question/security_question.rs | 0 .../question/security_question_kind.rs | 0 .../question/security_questions.rs | 0 .../security_questions_factor_source.rs | 2 + .../security_questions_sealed_mnemonic.rs | 2 + .../trusted_contact_factor_source/mod.rs | 0 .../trusted_contact_factor_source.rs | 2 + .../trusted_contact_factor_source_contact.rs | 2 + .../src/samples/factor_source_id_samples.rs | 0 .../samples/factor_source_ids_with_samples.rs | 0 .../src/samples/factor_source_samples.rs | 3 + ...l_deterministic_factor_instance_samples.rs | 0 .../factors}/src/samples/mod.rs | 0 crates/factors/instances-provider/Cargo.toml | 32 + crates/factors/instances-provider/src/lib.rs | 17 + .../src/next_index_assigner/mod.rs | 0 .../next_derivation_entity_index_assigner.rs | 0 ...n_entity_index_cache_analyzing_assigner.rs | 0 ...entity_index_profile_analyzing_assigner.rs | 0 .../src/provider/factor_instances_provider.rs | 0 .../provider/instances_in_cache_consumer.rs | 0 .../instances-provider}/src/provider/mod.rs | 0 .../factor_instances_provider_outcome.rs | 0 ...r_instances_provider_outcome_for_factor.rs | 0 ...ernal_factor_instances_provider_outcome.rs | 0 ...r_instances_provider_outcome_for_factor.rs | 0 .../src/provider/outcome/mod.rs | 0 .../provider_adopters/cache_filler.rs | 0 .../src/provider/provider_adopters/mod.rs | 0 ...curify_entity_factor_instances_provider.rs | 0 ...rtual_entity_creating_instance_provider.rs | 2 + .../instances-provider}/src/types/mod.rs | 0 ...n_interactor_from_secure_storage_client.rs | 0 crates/factors/keys-collector/Cargo.toml | 28 + .../src/collector/derivation_purpose.rs | 1 + .../src/collector/key_derivation_outcome.rs | 1 + .../keys-collector}/src/collector/key_ring.rs | 0 .../src/collector/keys_collector.rs | 0 .../collector/keys_collector_dependencies.rs | 0 .../collector/keys_collector_preprocessor.rs | 0 .../src/collector/keys_collector_state.rs | 0 .../keys-collector}/src/collector/mod.rs | 0 .../src/derivation_testing/mod.rs | 0 .../stateless_dummy_indices.rs | 2 + .../test_keys_collector/mod.rs | 0 .../test_derivation_interactor.rs | 0 .../test_keys_collector.rs | 2 + .../key_derivation_interactor.rs | 0 .../key_derivation_request.rs | 0 .../key_derivation_response.rs | 0 .../src/host_interaction/mod.rs | 0 crates/factors/keys-collector/src/lib.rs | 36 + .../src/tests/derivation_tests.rs | 8 +- .../keys-collector}/src/tests/mod.rs | 0 .../Cargo.toml | 26 + .../src/agnostic_paths/derivation_preset.rs | 0 .../src/agnostic_paths/index_agnostic_path.rs | 0 .../src/agnostic_paths/mod.rs | 0 .../quantified_derivation_preset.rs | 0 .../src/agnostic_paths/quantities.rs | 0 .../src/lib.rs | 28 + ...ion_entity_index_with_ephemeral_offsets.rs | 0 ...ith_ephemeral_offsets_for_factor_source.rs | 0 crates/factors/supporting-types/Cargo.toml | 17 + crates/factors/supporting-types/src/lib.rs | 11 + .../supporting-types}/src/mnemonic_loading.rs | 0 crates/gateway-client-and-api/Cargo.toml | 25 - crates/gateway/client-and-api/Cargo.toml | 26 + .../src/assert_network_request.rs | 0 .../src/client/gateway_client.rs | 2 +- .../client/gateway_client_dispatch_request.rs | 0 .../client-and-api}/src/client/mod.rs | 0 .../client-and-api}/src/endpoints/mod.rs | 0 .../src/endpoints/state_endpoints.rs | 0 .../src/endpoints/status_endpoints.rs | 0 .../src/endpoints/transaction_endpoints.rs | 0 .../client-and-api}/src/lib.rs | 11 +- .../client-and-api}/src/methods/mod.rs | 0 .../src/methods/page_methods.rs | 2 +- .../src/methods/state_methods.rs | 4 +- .../src/methods/transaction_methods.rs | 0 .../models}/Cargo.toml | 10 +- .../models}/build.rs | 0 ...ity_details__single_account_no_assets.json | 0 ...quest_entity_details__single_resource.json | 0 .../request_entity_details__two_accounts.json | 0 ...ingle_account_many_nfts_and_fungibles.json | 0 ...ity_details__single_account_no_assets.json | 0 ...ponse_entity_details__single_resource.json | 0 ..._details__single_resource_no_metadata.json | 0 ...response_entity_details__two_accounts.json | 0 ...ty_details_details__fungible_resource.json | 0 ...etails_details__non_fungible_resource.json | 0 .../models/transaction/request_preview.json | 0 .../models/transaction/request_status.json | 0 .../models/transaction/request_submit.json | 0 .../transaction/response_construction.json | 0 .../models/transaction/response_preview.json | 0 .../response_status__committed_success.json | 0 .../transaction/response_status__pending.json | 0 .../models/transaction/response_submit.json | 0 .../models}/src/lib.rs | 11 +- .../models}/src/types/mod.rs | 0 .../src/types/request/gw_public_key.rs | 0 .../src/types/request/gw_public_key_serde.rs | 0 .../types/request/ledger_state_selector.rs | 0 .../models}/src/types/request/mod.rs | 0 .../src/types/request/state/account/mod.rs | 0 .../account/page/authorized_depositors.rs | 0 .../types/request/state/account/page/mod.rs | 0 .../account/page/resource_preferences.rs | 0 .../types/request/state/entity/details/mod.rs | 0 .../request/state/entity/details/opt_ins.rs | 2 + .../request/state/entity/details/request.rs | 2 + .../src/types/request/state/entity/mod.rs | 0 .../request/state/entity/page/fungibles.rs | 0 .../types/request/state/entity/page/mod.rs | 0 .../entity/page/non_fungible_vault_ids.rs | 0 .../state/entity/page/non_fungible_vaults.rs | 0 .../state/entity/page/non_fungibles.rs | 0 .../models}/src/types/request/state/mod.rs | 0 .../request/state/non_fungible/location.rs | 0 .../types/request/state/non_fungible/mod.rs | 0 .../src/types/request/transaction/mod.rs | 0 .../types/request/transaction/preview/mod.rs | 0 .../request/transaction/preview/opt_ins.rs | 0 .../request/transaction/preview/opt_ins_v2.rs | 0 .../transaction/preview/request_flags.rs | 2 +- .../preview/transaction_preview.rs | 0 .../preview/transaction_preview_v2.rs | 0 .../types/request/transaction/status/mod.rs | 0 .../transaction/status/subintent_status.rs | 0 .../transaction/status/transaction_status.rs | 0 .../types/request/transaction/submit/mod.rs | 0 .../transaction/submit/transaction_submit.rs | 0 .../src/types/response/ledger_state.rs | 0 .../models}/src/types/response/mod.rs | 0 .../src/types/response/page_response.rs | 0 .../src/types/response/state/account/mod.rs | 0 .../account/page/authorized_depositor.rs | 0 .../types/response/state/account/page/mod.rs | 0 .../state/account/page/resource_preference.rs | 0 .../state/entity/details/details/item.rs | 0 .../entity/details/details/item_component.rs | 0 .../details/details/item_fungible_resource.rs | 0 .../details/item_non_fungible_resource.rs | 0 .../entity/details/details/item_package.rs | 0 .../state/entity/details/details/mod.rs | 0 .../details/role_assignments/assignment.rs | 0 .../details/role_assignments/collection.rs | 0 .../details/details/role_assignments/entry.rs | 0 .../details/role_assignments/explicit_rule.rs | 0 .../details/details/role_assignments/mod.rs | 0 .../details/role_assignments/module.rs | 0 .../details/details/role_assignments/owner.rs | 0 .../details/role_assignments/resolution.rs | 0 .../details/role_assignments/role_key.rs | 0 .../entity/details/fungible/collection.rs | 0 .../details/fungible/collection_item.rs | 0 .../fungible/collection_item_global.rs | 0 .../state/entity/details/fungible/mod.rs | 0 .../entity/details/metadata/collection.rs | 2 + .../state/entity/details/metadata/item.rs | 0 .../entity/details/metadata/item_value.rs | 0 .../state/entity/details/metadata/mod.rs | 0 .../entity/details/metadata/typed_value.rs | 0 .../response/state/entity/details/mod.rs | 0 .../entity/details/non_fungible/collection.rs | 0 .../details/non_fungible/collection_item.rs | 0 .../non_fungible/collection_item_global.rs | 0 .../state/entity/details/non_fungible/mod.rs | 0 .../response/state/entity/details/response.rs | 0 .../state/entity/details/response_item.rs | 0 .../src/types/response/state/entity/mod.rs | 0 .../types/response/state/entity/page/mod.rs | 0 .../entity/page/non_fungible_vault_item.rs | 0 .../models}/src/types/response/state/mod.rs | 0 .../response/state/non_fungible/location.rs | 0 .../types/response/state/non_fungible/mod.rs | 0 .../types/response/status/gateway_status.rs | 0 .../models}/src/types/response/status/mod.rs | 0 .../response/transaction/construction/mod.rs | 0 .../transaction_construction_response.rs | 0 .../src/types/response/transaction/mod.rs | 0 .../transaction/preview/logs_inner.rs | 0 .../types/response/transaction/preview/mod.rs | 0 .../preview/transaction_preview_response.rs | 0 .../transaction_preview_response_v2.rs | 0 .../preview/transaction_receipt.rs | 0 .../preview/transaction_receipt_status.rs | 0 .../types/response/transaction/status/mod.rs | 0 .../transaction/status/payload_item.rs | 0 .../transaction/status/payload_status.rs | 0 .../transaction/status/transaction_status.rs | 0 .../transaction/subintent_status/mod.rs | 0 .../transaction/subintent_status/response.rs | 0 .../transaction/subintent_status/status.rs | 0 .../types/response/transaction/submit/mod.rs | 0 .../response/transaction/submit/submit.rs | 0 .../types/support/fetch_resources_output.rs | 0 .../fetch_transferable_resources_output.rs | 0 .../models}/src/types/support/mod.rs | 0 crates/http-client/src/lib.rs | 10 - .../Cargo.toml | 22 - .../src/lib.rs | 14 - .../profile/logic/logic_SPLIT_ME/Cargo.toml | 25 + .../profile/logic/logic_SPLIT_ME/src/lib.rs | 15 + .../src/logic/account/account_visibility.rs | 0 .../src/logic/account/accounts_visibility.rs | 0 .../logic_SPLIT_ME}/src/logic/account/mod.rs | 0 .../src/logic/account/query_accounts.rs | 0 .../account/query_security_structures.rs | 0 .../src/logic/authorized_dapps_logic.rs | 0 .../src/logic/gateway/current_gateway.rs | 0 .../logic_SPLIT_ME}/src/logic/gateway/mod.rs | 0 .../instances_deriving_with_factor_sources.rs | 0 .../logic/logic_SPLIT_ME}/src/logic/mod.rs | 0 .../logic_SPLIT_ME}/src/logic/persona/mod.rs | 0 .../src/logic/persona/persona_data_ids.rs | 0 .../src/logic/persona/query_personas.rs | 0 .../logic/persona/shared_persona_data_ids.rs | 0 .../src/logic/profile_header.rs | 2 + .../src/logic/profile_network/mod.rs | 0 .../profile_network_details.rs | 2 + ...etwork_entities_linked_to_factor_source.rs | 0 .../profile_network_get_entities.rs | 0 .../src/logic/profile_networks.rs | 0 .../src/logic/profile_update.rs | 2 + .../src/logic/query_factor_sources.rs | 0 ...trix_of_factor_instances_index_agnostic.rs | 0 .../logic/logic_SPLIT_ME}/src/tests/mod.rs | 0 .../models/account-for-display/Cargo.toml | 20 + .../src}/account_for_display.rs | 19 - .../models/account-for-display/src/lib.rs | 16 + .../profile/models/app-preferences/Cargo.toml | 28 + .../app_display_settings.rs | 0 .../src/app_display_settings/fiat_currency.rs | 0 .../src/app_display_settings/mod.rs | 0 .../app-preferences}/src/app_preferences.rs | 0 .../models/app-preferences}/src/lib.rs | 7 +- .../models/app-preferences}/src/security.rs | 2 +- .../src/transaction_preferences.rs | 0 crates/profile/models/gateway/Cargo.toml | 29 + .../models/gateway}/src/gateway.rs | 2 +- crates/profile/models/gateway/src/lib.rs | 24 + .../models/gateway}/src/network_definition.rs | 1 - .../models/gateway}/src/saved_gateways.rs | 2 +- .../models/profile_SPLIT_ME/Cargo.toml | 46 + .../models/profile_SPLIT_ME}/build.rs | 0 .../vector/huge_profile_1000_accounts.json | 0 ...rsion_100_patch_after_app_version_120.json | 0 ...laintext_profile_snapshot_version_100.json | 0 .../profile_encrypted_by_password_empty.json | 0 ...file_encrypted_by_password_of_babylon.json | 0 .../encrypted_profile_snapshot.rs | 5 + .../src}/encrypted_profile/mod.rs | 0 .../models/profile_SPLIT_ME/src/lib.rs | 44 + .../src/profilesnapshot_version.rs | 0 .../access_controller_address_samples.rs | 0 .../src/samples/account_address_samples.rs | 0 .../src/samples/account_samples.rs | 0 .../src/samples/identity_address_samples.rs | 0 .../profile_SPLIT_ME}/src/samples/mod.rs | 0 .../src/samples/persona_samples.rs | 0 .../src/samples/profile_samples.rs | 0 .../supporting_types/account_or_persona.rs | 0 .../supporting_types/accounts_for_display.rs | 0 .../supporting_types/accounts_or_personas.rs | 0 .../authorized_dapp_detailed.rs | 0 .../authorized_persona_detailed.rs | 0 .../detailed_authorized_personas.rs | 0 .../src/supporting_types/mod.rs | 2 - .../on_same_network_validating.rs | 0 .../entities_linked_to_factor_source.rs | 0 .../integrity/device.rs | 0 .../integrity/integrity.rs | 0 .../integrity/mod.rs | 0 .../entities_linked_to_factor_source/mod.rs | 0 .../profile_to_check.rs | 0 .../src/v100/entity/abstract_entity_type.rs | 0 .../src/v100/entity/account/account.rs | 19 + .../src/v100/entity/account/mod.rs | 0 .../entity/account/on_ledger_settings/mod.rs | 0 .../on_ledger_settings/on_ledger_settings.rs | 0 .../src/v100/entity/entity_flag.rs | 0 .../src/v100/entity/entity_flags.rs | 0 .../src/v100/entity/has_security_state.rs | 0 .../src/v100/entity/is_entity.rs | 0 .../profile_SPLIT_ME}/src/v100/entity/mod.rs | 0 .../src/v100/entity/persona/mod.rs | 0 .../src/v100/entity/persona/persona.rs | 0 .../collection_of_email_addresses.rs | 0 .../collection_of_phone_numbers.rs | 0 .../persona/persona_data/entry_kinds/mod.rs | 0 .../persona_data_entry_email_address.rs | 0 .../entry_kinds/persona_data_entry_name.rs | 0 .../persona_data_entry_phone_number.rs | 0 .../v100/entity/persona/persona_data/mod.rs | 0 .../persona/persona_data/persona_data.rs | 0 .../persona_data/persona_data_entry_id.rs | 2 +- ...ersona_data_identified_collection_types.rs | 2 +- .../persona_data_identified_entry_types.rs | 2 +- .../entity_security_state.rs | 0 .../src/v100/entity_security_state/mod.rs | 0 .../provisional_securified_config.rs | 0 ...ovisional_securified_transaction_queued.rs | 0 .../unsecured_entity_control.rs | 0 .../src/v100/header/content_hint.rs | 0 .../src/v100/header/device_info.rs | 3 + .../src/v100/header/header.rs | 2 + .../profile_SPLIT_ME}/src/v100/header/mod.rs | 0 .../src/v100/header/profile_id.rs | 2 +- .../models/profile_SPLIT_ME}/src/v100/mod.rs | 0 .../src/v100/networks/mod.rs | 0 .../src/v100/networks/network/accounts.rs | 0 .../authorized_dapp/authorized_dapp.rs | 0 .../authorized_persona_simple.rs | 0 .../networks/network/authorized_dapp/mod.rs | 0 .../authorized_dapp_preference_deposits.rs | 0 .../authorized_dapp_preferences.rs | 0 .../authorized_dapp/preferences/mod.rs | 0 .../references_to_authorized_personas.rs | 0 .../authorized_dapp/shared_persona_data.rs | 0 ..._to_dapp_with_persona_account_addresses.rs | 0 ...ith_persona_ids_of_persona_data_entries.rs | 0 .../authorized_dapp/shared_with_dapp.rs | 2 +- .../v100/networks/network/authorized_dapps.rs | 0 .../src/v100/networks/network/mod.rs | 0 .../src/v100/networks/network/personas.rs | 0 .../v100/networks/network/profile_network.rs | 0 .../resource_preferences/hidden_resources.rs | 0 .../network/resource_preferences/mod.rs | 0 .../resource_app_preference.rs | 0 .../resource_identifier.rs | 0 .../resource_preferences.rs | 0 .../resource_visibility.rs | 0 .../src/v100/networks/profile_networks.rs | 0 .../profile_SPLIT_ME}/src/v100/profile.rs | 0 .../src/v100/profile_file_contents.rs | 0 ...oto_profile_maybe_with_legacy_p2p_links.rs | 0 .../src/v100/secured_entity_control/mod.rs | 0 .../secured_entity_control.rs | 0 .../models/security-structures/Cargo.toml | 30 + .../src/factor_list_kind.rs | 0 .../models/security-structures}/src/lib.rs | 24 +- .../security-structures}/src/role_kind.rs | 0 .../auto_build_outcome_for_testing.rs | 0 .../automatic_shield_builder.rs | 1 - .../factor_selector.rs | 0 .../automatic_shield_builder/mod.rs | 0 .../automatic_shield_builder/proto_shield.rs | 0 .../automatic_shield_builder/quantity.rs | 0 ...al_role_with_hd_factor_instance_samples.rs | 0 .../has_role_kind.rs | 0 .../abstract_matrix_builder_or_built.rs | 0 .../matrices/builder/error.rs | 0 .../matrices/builder/matrix_builder.rs | 0 .../builder/matrix_builder_unit_tests.rs | 0 .../matrices/builder/matrix_template.rs | 0 .../matrices/builder/mod.rs | 0 .../matrices/matrix_of_factor_instances.rs | 0 .../matrices/matrix_of_factor_source_ids.rs | 0 .../matrices/matrix_of_factor_sources.rs | 0 .../roles_matrices_structures/matrices/mod.rs | 0 .../src/roles_matrices_structures/mod.rs | 0 .../roles/abstract_role_builder_or_built.rs | 0 .../confirmation_roles_builder_unit_tests.rs | 2 +- .../roles/builder/mod.rs | 0 .../primary_roles_builder_unit_tests.rs | 0 .../recovery_roles_builder_unit_tests.rs | 0 .../roles/builder/roles_builder.rs | 0 .../roles/builder/roles_builder_unit_tests.rs | 0 ...confirmation_role_with_factor_instances.rs | 0 ...archical_deterministic_factor_instances.rs | 0 .../factor_instance_level/mod.rs | 0 .../primary_role_with_factor_instances.rs | 0 .../recovery_role_with_factor_instances.rs | 0 .../role_into_scrypto_access_rule.rs | 10 - .../role_with_factor_instances.rs | 0 ...onfirmation_role_with_factor_source_ids.rs | 0 .../factor_source_id_level/mod.rs | 0 .../primary_role_with_factor_source_ids.rs | 0 .../recovery_role_with_factor_source_ids.rs | 0 .../roles_with_factor_ids.rs | 0 .../factor_source_kind_level/mod.rs | 0 .../factor_source_kind_level/role_template.rs | 0 .../confirmation_role_with_factor_sources.rs | 0 .../factor_levels/factor_source_level/mod.rs | 0 .../primary_role_with_factor_sources.rs | 0 .../recovery_role_with_factor_sources.rs | 0 .../roles_with_factor_sources.rs | 0 .../roles/factor_levels/mod.rs | 0 .../roles_matrices_structures/roles/mod.rs | 0 .../security_shield_builder.rs | 6 +- .../security_shield_builder_invalid_reason.rs | 0 .../security_shield_prerequisites_status.rs | 0 .../security_structure_id.rs | 0 .../security_structure_metadata.rs | 2 + .../abstract_security_structure_of_factors.rs | 0 .../security_structure_of_factors/mod.rs | 0 .../security_structure_of_factor_instances.rs | 2 - ...security_structure_of_factor_source_ids.rs | 0 .../security_structure_of_factor_sources.rs | 0 .../selected_factor_sources_status.rs | 0 .../models/supporting-types/Cargo.toml | 23 + .../src/abstract_securified_entity.rs | 0 .../src/any_securified_entity.rs | 0 .../src/assert_derivation_path.rs | 0 .../src/is_securified_entity.rs | 0 .../models/supporting-types}/src/lib.rs | 8 +- .../supporting-types}/src/profile_state.rs | 0 .../src/securified_account.rs | 0 .../src/securified_persona.rs | 0 .../src/unsecurified_entity.rs | 0 .../models/supporting-types}/src/veci.rs | 0 crates/sargon-clients/Cargo.toml | 30 - crates/sargon-clients/src/lib.rs | 14 - crates/sargon-core-utils/src/factory.rs | 45 - crates/sargon-core/Cargo.toml | 39 - crates/sargon-core/src/lib.rs | 126 - crates/sargon-core/src/types/logged_result.rs | 54 - crates/sargon-core/src/types/mod.rs | 57 - crates/sargon-core/src/types/safe_to_log.rs | 9 - crates/sargon-drivers/src/lib.rs | 17 - .../Cargo.toml | 31 - .../src/lib.rs | 17 - .../Cargo.toml | 18 - .../src/lib.rs | 11 - crates/sargon-factors/Cargo.toml | 27 - .../src/lib.rs | 24 - crates/sargon-keys-collector/Cargo.toml | 21 - crates/sargon-keys-collector/src/lib.rs | 27 - crates/sargon-manifests/Cargo.toml | 35 - .../sargon-profile-app-preferences/Cargo.toml | 24 - crates/sargon-profile-gateway/Cargo.toml | 22 - crates/sargon-profile-gateway/src/lib.rs | 13 - crates/sargon-profile-logic/Cargo.toml | 24 - crates/sargon-profile-logic/src/lib.rs | 13 - .../Cargo.toml | 23 - .../Cargo.toml | 23 - crates/sargon-profile/Cargo.toml | 35 - crates/sargon-profile/src/encrypted/mod.rs | 9 - crates/sargon-profile/src/lib.rs | 28 - crates/sargon-transaction-models/Cargo.toml | 36 - .../src/hierarchical_deterministic/.DS_Store | Bin 6148 -> 0 bytes .../owned_or_third_party_account_address.rs | 27 - crates/sargon/.DS_Store | Bin 6148 -> 0 bytes .../needs_a_new_home_dumping_ground/mod.rs | 1 - crates/sargon/target/.DS_Store | Bin 6148 -> 0 bytes crates/{sargon => sargon_SPLIT_ME}/Cargo.toml | 36 +- crates/{sargon => sargon_SPLIT_ME}/build.rs | 0 .../fixtures}/Package.swift | 0 .../fixtures/models/well_known.json | 0 .../vector/big_profile_100_accounts.json | 0 .../fixtures/vector/bip44_secp256k1.json | 0 .../fixtures/vector/cap26_curve25519.json | 0 .../fixtures/vector/cap26_secp256k1.json | 0 .../vector/deep_link_request_params.json | 0 ...rsion_100_patch_after_app_version_120.json | 0 ...laintext_profile_snapshot_version_100.json | 0 .../rola_challenge_payload_hash_vectors.json | 0 .../fixtures/vector/slip10_tests_#10.json | 0 .../fixtures/vector/slip10_tests_#1000.json | 0 .../wallet_interactions_dapp_to_wallet.json | 0 .../wallet_interactions_wallet_to_dapp.json | 0 .../src}/Package.swift | 0 .../deferred_deep_link_method.rs | 0 .../deferred_deep_link_special_dapp.rs | 0 .../src/home_cards/deferred_deep_link/mod.rs | 0 .../onboarding_deep_link_value.rs | 0 .../home_cards/deferred_deep_link/parser.rs | 0 .../src/home_cards/home_card.rs | 0 .../src/home_cards/home_cards.rs | 0 .../src/home_cards/manager.rs | 0 .../src/home_cards/mod.rs | 0 .../src/home_cards/observer.rs | 0 .../src/home_cards/storage.rs | 0 crates/{sargon => sargon_SPLIT_ME}/src/lib.rs | 26 +- .../src/radix_connect/interaction_id.rs | 0 .../src/radix_connect/interaction_version.rs | 0 .../src/radix_connect/mobile/client.rs | 2 + .../mobile/deep_link_parsing/mod.rs | 0 .../mobile/deep_link_parsing/parser.rs | 3 +- .../mobile/deep_link_parsing/request.rs | 0 .../src/radix_connect/mobile/mod.rs | 0 .../radix_connect/mobile/relay_service/mod.rs | 0 .../mobile/relay_service/service.rs | 3 + .../mobile/relay_service/success_response.rs | 0 .../src/radix_connect/mobile/session/mod.rs | 0 .../radix_connect/mobile/session/session.rs | 2 + .../mobile/session/session_id.rs | 0 .../mobile/session/session_origin.rs | 0 .../mobile/session_dapp_request.rs | 0 .../radix_connect/mobile/session_storage.rs | 0 .../mobile/session_wallet_response.rs | 0 .../src/radix_connect/mod.rs | 0 .../p2p_links/link_connection_qr_data.rs | 0 .../src/radix_connect/p2p_links/mod.rs | 0 .../src/radix_connect/p2p_links/p2p_link.rs | 15 - .../src/radix_connect/p2p_links/p2p_links.rs | 0 .../p2p_links/radix_connect_password.rs | 0 .../p2p_links/radix_connect_purpose.rs | 0 .../src/radix_connect/wallet_account.rs | 0 .../dapp_to_wallet/auth_challenge_nonce.rs | 0 .../dapp_metadata/interaction_metadata.rs | 0 .../interaction_metadata_unvalidated.rs | 0 .../dapp_to_wallet/dapp_metadata/mod.rs | 0 .../dapp_to_wallet/dapp_metadata/origin.rs | 0 .../dapp_to_wallet/interaction.rs | 0 .../dapp_to_wallet/interaction_items/items.rs | 0 .../dapp_to_wallet/interaction_items/mod.rs | 0 .../expiration/after_delay.rs | 0 .../pre_authorization/expiration/at_time.rs | 0 .../expiration/expiration.rs | 0 .../pre_authorization/expiration/mod.rs | 0 .../pre_authorization/expiration/status.rs | 0 .../pre_authorization/mod.rs | 0 .../pre_authorization/pre_authorization.rs | 0 .../pre_authorization/subintent.rs | 2 +- .../unvalidated_subintent_manifest.rs | 0 .../interaction_items/request/auth/auth.rs | 0 .../request/auth/login_with_challenge.rs | 0 .../interaction_items/request/auth/mod.rs | 0 .../request/auth/use_persona.rs | 0 .../request/authorized_request.rs | 0 .../request/entity/accounts.rs | 0 .../interaction_items/request/entity/mod.rs | 0 .../request/entity/persona_data.rs | 0 .../request/entity/proof_of_ownership.rs | 0 .../interaction_items/request/entity/reset.rs | 0 .../interaction_items/request/mod.rs | 0 .../request/unauthorized_request.rs | 0 .../interaction_items}/transaction/mod.rs | 0 .../transaction/transaction.rs | 2 +- .../dapp_to_wallet/interaction_unvalidated.rs | 0 .../dapp_to_wallet/mod.rs | 0 .../dapp_wallet_interaction/mod.rs | 0 .../failure_response/error_type.rs | 0 .../failure_response/failure.rs | 0 .../wallet_to_dapp/failure_response/mod.rs | 0 .../wallet_to_dapp/mod.rs | 0 .../wallet_to_dapp/response.rs | 0 .../success_response/account/account_proof.rs | 0 .../success_response/account/accounts.rs | 0 .../success_response/account/mod.rs | 0 .../success_response/auth/auth.rs | 0 .../auth/auth_login_with_challenge.rs | 0 .../auth/auth_login_without_challenge.rs | 0 .../success_response/auth/auth_proof.rs | 0 .../success_response/auth/auth_use_persona.rs | 0 .../success_response/auth/mod.rs | 0 .../success_response/authorized_request.rs | 0 .../wallet_to_dapp/success_response/items.rs | 0 .../wallet_to_dapp/success_response/mod.rs | 0 .../success_response/persona/mod.rs | 0 .../success_response/persona/persona_proof.rs | 0 .../success_response/persona_data/mod.rs | 0 .../persona_data/persona_data.rs | 0 .../success_response/pre_authorization/mod.rs | 0 .../pre_authorization/pre_authorization.rs | 0 .../pre_authorization/subintent_response.rs | 0 .../proof_of_ownership/mod.rs | 0 .../proof_of_ownership/proof.rs | 0 .../proof_of_ownership/proof_of_ownership.rs | 0 .../success_response/success.rs | 0 .../success_response}/transaction/mod.rs | 0 .../transaction/transaction.rs | 0 .../success_response/unauthorized_request.rs | 0 .../radix_connect/wallet_interaction/mod.rs | 0 .../src/radix_connect/wallet_persona.rs | 0 .../radix_connect/well_known_client/client.rs | 0 .../radix_connect/well_known_client/mod.rs | 0 .../models/dapp_definition.rs | 0 .../models/dapp_well_known_data.rs | 0 .../well_known_client/models/mod.rs | 0 .../src/security_center/client.rs | 0 .../src/security_center/mod.rs | 0 .../src/security_center/security_problem.rs | 0 .../security_center/security_problem_kind.rs | 0 .../support/addresses_entities_bad_state.rs | 0 .../security_center/support/backup_result.rs | 2 +- .../src/security_center/support/input.rs | 0 .../src/security_center/support/mod.rs | 0 .../src/signing/authentication/auth_intent.rs | 0 .../authentication/auth_intent_hash.rs | 0 .../src/signing/authentication/mod.rs | 0 .../authentication/signed_auth_intent.rs | 25 +- ...instances_required_to_sign_transactions.rs | 0 .../src/signing/collector/mod.rs | 0 .../signatures_collecting_continuation.rs | 0 .../signing/collector/signatures_collector.rs | 2 +- .../signatures_collector_dependencies.rs | 0 .../signatures_collector_preprocessor.rs | 0 .../collector/signatures_collector_state.rs | 0 .../signing_finish_early_strategy.rs | 0 .../extractor_of_entities_requiring_auth.rs | 1 - .../src/signing/host_interaction/mod.rs | 0 .../host_interaction/sign_interactor.rs | 0 .../signing/host_interaction/sign_request.rs | 0 .../signing/host_interaction/sign_response.rs | 0 .../transaction_sign_request_input.rs | 0 .../src/signing/mod.rs | 0 .../src/signing/petition_types/mod.rs | 0 .../petition_types/petition_for_entity.rs | 0 .../factor_source_referencing.rs | 0 .../petition_for_factors_types/mod.rs | 0 .../neglected_factor_instance.rs | 2 + .../petition_for_factors/mod.rs | 0 .../petition_for_factors.rs | 2 + .../petition_for_factors_input.rs | 0 .../petition_for_factors_state.rs | 0 .../petition_for_factors_state_snapshot.rs | 0 .../petition_for_factors_status.rs | 0 .../petition_for_factors_sub_state.rs | 0 .../petition_for_transaction.rs | 2 + .../signing/petition_types/petition_status.rs | 0 .../src/signing/petition_types/petitions.rs | 2 + .../signing/petition_types/signing_purpose.rs | 0 .../src/signing/signable_with_entities.rs | 0 .../src/signing/signables/mod.rs | 0 .../src/signing/signables/signable.rs | 0 .../signing/signables/signable_auth_intent.rs | 10 +- .../signing/signables/signable_subintent.rs | 0 .../signables/signable_transaction_intent.rs | 0 .../maybe_signed_transactions.rs | 0 .../signing/signatures_outecome_types/mod.rs | 0 .../petition_transaction_outcome.rs | 0 .../sign_with_factors_outcome.rs | 0 .../signatures_outcome.rs | 0 .../src/signing/testing/interactors/mod.rs | 0 .../testing/interactors/test_interactor.rs | 0 .../interactors/test_sign_interactor.rs | 0 .../src/signing/testing/mod.rs | 0 .../src/signing/testing/simulated_user.rs | 0 .../testing/test_signatures_collector.rs | 0 .../src/system/bios/bios.rs | 0 .../src/system/bios/mod.rs | 0 .../src/system/interactors/interactors.rs | 0 .../src/system/interactors/mod.rs | 0 .../src/system/interactors/testing/mod.rs | 0 .../test_use_factor_sources_interactors.rs | 0 .../use_factor_sources_interactor.rs | 0 .../src/system/mod.rs | 1 + .../system/sargon_os/delete_account/mod.rs | 0 .../sargon_os_delete_account.rs | 0 .../sargon_os/delete_account/support}/mod.rs | 0 .../delete_account/support/outcome.rs | 0 ...th_factor_source_and_derivation_outcome.rs | 0 .../factor_instances_provider_unit_tests.rs | 0 .../src/system/sargon_os/mod.rs | 0 .../system/sargon_os/pre_authorization/mod.rs | 0 .../sargon_os_create_subintent.rs | 0 .../sargon_os_pre_authorization_status.rs | 0 .../pre_authorization/support/mod.rs | 0 .../support/pre_authorization_status.rs | 0 .../system/sargon_os/profile_state_holder.rs | 0 .../src/system/sargon_os/sargon_os.rs | 2 +- .../system/sargon_os/sargon_os_accounts.rs | 2 +- ...gon_os_entities_linked_to_factor_source.rs | 0 .../src/system/sargon_os/sargon_os_factors.rs | 6 +- .../src/system/sargon_os/sargon_os_gateway.rs | 0 .../system/sargon_os/sargon_os_personas.rs | 0 .../src/system/sargon_os/sargon_os_profile.rs | 0 .../sargon_os/sargon_os_security_center.rs | 0 .../sargon_os_security_structures.rs | 0 .../src/system/sargon_os/sargon_os_signing.rs | 0 .../sargon_os/sargon_os_sync_accounts.rs | 8 +- .../src/system/sargon_os/transactions/mod.rs | 0 .../sargon_os_transaction_analysis.rs | 0 .../sargon_os_transaction_status.rs | 0 .../sargon_os_transaction_submit.rs | 0 .../sargon_os/transactions/support/mod.rs | 0 .../support/pre_auth_to_review.rs | 0 .../support/signable_manifest_summary.rs | 0 .../support/transaction_to_review.rs | 0 .../src/system/subsystems/README.md | 0 .../subsystems/log_system/log_system.rs | 0 .../src/system/subsystems/log_system/mod.rs | 0 .../src/system/subsystems/mod.rs | 0 .../test_diagnose_instance_duplicates.rs} | 0 .../src/types/hd_signature.rs | 0 .../src/types/hd_signature_input.rs | 0 .../types/invalid_transaction_if_neglected.rs | 0 .../src/types/mod.rs | 0 .../src/types/owned_types/mod.rs | 0 .../src/types/owned_types/owned.rs | 0 .../owned_types/owned_factor_instance.rs | 0 .../tests}/Package.swift | 0 .../tests/integration/main.rs | 4 +- .../tests/vectors/main.rs | 0 crates/system/clients/clients/Cargo.toml | 31 + crates/system/clients/clients/build.rs | 11 + .../clients/clients}/src/clients/README.md | 0 .../client/entropy_client/entropy_client.rs | 0 .../src/clients/client/entropy_client/mod.rs | 0 .../event_bus_client/event_bus_client.rs | 0 .../clients/client/event_bus_client/mod.rs | 0 .../cache/factor_instances_cache.rs | 0 .../cache/keyed_instances.rs | 0 .../cache/mod.rs | 0 .../factor_instances_cache_snapshot.rs | 0 .../factor_source_id_from_hash_dense_key.rs | 0 .../cache/serializable_cache/mod.rs | 0 .../factor_instances_cache_client/client.rs | 0 .../factor_instances_cache_client/mod.rs | 0 .../models}/mod.rs | 0 .../models/outcome.rs | 0 .../file_system_client/file_system_client.rs | 15 +- .../clients/client/file_system_client/mod.rs | 0 .../host_info_client/host_info_client.rs | 0 .../clients/client/host_info_client/mod.rs | 0 .../clients}/src/clients/client/mod.rs | 0 .../client/profile_change_client/mod.rs | 0 .../profile_change_client.rs | 0 .../client/secure_storage_client/mod.rs | 0 .../secure_storage_client.rs | 0 .../client/unsafe_storage_client/mod.rs | 0 .../unsafe_storage_client.rs | 0 .../clients/clients}/src/clients/clients.rs | 0 .../clients/clients}/src/clients/mod.rs | 0 crates/system/clients/clients/src/lib.rs | 20 + .../clients/http}/Cargo.toml | 6 +- .../clients/http}/src/http_client.rs | 0 crates/system/clients/http/src/lib.rs | 15 + .../drivers}/Cargo.toml | 15 +- crates/system/drivers/build.rs | 11 + .../drivers}/src/drivers/README.md | 0 .../drivers}/src/drivers/drivers.rs | 0 .../entropy_provider_driver.rs | 0 .../drivers/entropy_provider_driver/mod.rs | 0 .../entropy_provider_driver/support/mod.rs | 0 .../support/test/mod.rs | 0 .../support/test/rust_entropy_driver.rs | 0 .../event_bus_driver/event_bus_driver.rs | 0 .../src/drivers/event_bus_driver/mod.rs | 0 .../drivers/event_bus_driver/support/event.rs | 0 .../event_bus_driver/support/event_kind.rs | 0 .../support/event_notification.rs | 4 +- .../support/event_profile_modified.rs | 0 .../support/has_event_kind.rs | 0 .../drivers/event_bus_driver/support/mod.rs | 0 .../event_bus_driver/support/test/mod.rs | 0 .../support/test/rust_event_bus_driver.rs | 0 .../file_system_driver/file_system_driver.rs | 0 .../src/drivers/file_system_driver/mod.rs | 0 .../drivers/file_system_driver/support/mod.rs | 0 .../test/in_memory_file_system_driver.rs | 0 .../file_system_driver/support/test/mod.rs | 0 .../support/test/rust_file_system_driver.rs | 20 +- .../host_info_driver/host_info_driver.rs | 0 .../src/drivers/host_info_driver/mod.rs | 0 .../drivers/host_info_driver/support/mod.rs | 0 .../host_info_driver/support/test/mod.rs | 0 .../support/test/rust_host_info_driver.rs | 0 .../drivers/logging_driver/logging_driver.rs | 0 .../src/drivers/logging_driver/mod.rs | 0 .../logging_driver/support/log_level.rs | 0 .../src/drivers/logging_driver/support/mod.rs | 0 .../logging_driver/support/test/mod.rs | 0 .../support/test/rust_logging_driver.rs | 0 .../drivers}/src/drivers/mod.rs | 0 .../src/drivers/networking_driver/mod.rs | 0 .../networking_driver/networking_driver.rs | 0 .../drivers/networking_driver/support/mod.rs | 0 .../support/network_method.rs | 0 .../support/network_request.rs | 2 + .../support/network_response.rs | 0 .../support/test/mock_networking_driver.rs | 2 + .../networking_driver/support/test/mod.rs | 0 .../support/test/rust_networking_driver.rs | 0 .../src/drivers/profile_change_driver/mod.rs | 0 .../profile_change_driver.rs | 0 .../profile_change_driver/support/mod.rs | 0 .../profile_change_driver/support/test/mod.rs | 0 .../test/rust_profile_change_driver.rs | 0 .../src/drivers/secure_storage_driver/mod.rs | 0 .../secure_storage_driver.rs | 0 .../secure_storage_driver/support/mod.rs | 0 .../secure_storage_access_error_kind.rs | 0 .../support/secure_storage_key.rs | 0 .../support/test/ephemeral_secure_storage.rs | 0 .../support/test/fail_secure_storage.rs | 0 .../secure_storage_driver/support/test/mod.rs | 0 .../src/drivers/unsafe_storage_driver/mod.rs | 0 .../support/ephemeral_unsafe_storage.rs | 0 .../unsafe_storage_driver/support/mod.rs | 0 .../support/unsafe_storage_key.rs | 0 .../unsafe_storage_driver.rs | 0 crates/system/drivers/src/lib.rs | 23 + crates/transaction/foundation/Cargo.toml | 19 + .../foundation/src}/epoch.rs | 0 .../foundation/src}/intent_discriminator.rs | 0 crates/transaction/foundation/src/lib.rs | 18 + .../foundation/src}/nonce.rs | 0 .../foundation/src}/version_type.rs | 6 +- crates/transaction/manifests/Cargo.toml | 39 + .../manifests}/build.rs | 0 .../transaction/account_locker_claim.rtm | 0 .../account_locker_claim_max_nft_items.rtm | 0 .../transaction/create_3_nft_collections.rtm | 0 .../create_access_controller_for_account.rtm | 0 .../create_access_controller_for_persona.rtm | 0 .../manifests}/src/bucket.rs | 0 .../manifests}/src/bucket_factory.rs | 0 .../delete_account/delete_account_transfer.rs | 0 .../delete_account_transfers.rs | 0 .../delete_account/manifest_delete_account.rs | 0 .../manifests}/src/delete_account/mod.rs | 0 .../manifests}/src/high_level/mod.rs | 0 .../account_locker_claimable_resource.rs | 0 .../account_locker/mod.rs | 0 .../account_or_address_of.rs} | 41 +- .../assets_transfers/mod.rs | 4 +- .../assets_transfers/per_asset/mod.rs | 0 .../per_asset/per_asset_fungible_resource.rs | 0 .../per_asset/per_asset_fungible_transfer.rs | 24 +- .../per_asset_non_fungible_transfer.rs | 26 +- .../per_asset/per_asset_transfers.rs | 0 ...er_asset_transfers_of_fungible_resource.rs | 0 ...sset_transfers_of_non_fungible_resource.rs | 0 .../assets_transfers/per_recipient/mod.rs | 0 .../per_recipient_asset_transfer.rs | 12 +- .../per_recipient_asset_transfers.rs | 64 +- .../per_recipient_fungible_transfer.rs | 0 .../per_recipient_non_fungibles_transfer.rs | 0 .../assets_transfers/transfer_types.rs | 8 +- .../dependency_information.rs | 0 .../build_information/mod.rs | 0 .../sargon_build_information.rs | 0 .../build_information/sargon_dependencies.rs | 0 .../high_level/sargon_specific_types/mod.rs | 0 .../sargon_specific_types/stake_claim.rs | 0 .../sargon_specific_types/transaction/mod.rs | 0 .../transaction/transaction_status.rs | 0 .../transaction/transaction_status_reason.rs | 0 .../transaction_guarantee.rs | 0 .../high_level/token_definition_metadata.rs | 0 .../manifests}/src/lib.rs | 15 +- .../manifests}/src/manifest_account_locker.rs | 2 +- .../src/manifest_assets_transfers.rs | 2 +- .../manifests}/src/manifests.rs | 0 .../src/manifests_access_controller.rs | 0 .../manifests}/src/manifests_create_tokens.rs | 0 .../manifests}/src/modify_manifest.rs | 0 .../sample_resource_definition_metadata.json | 0 .../manifest_third_party_deposit_update.rs | 0 .../src/third_party_deposit_update/mod.rs | 0 .../third_party_deposits_delta.rs | 0 crates/transaction/models/Cargo.toml | 49 + .../models}/build.rs | 0 .../fixtures/transaction/account_delete.dat | 0 .../fixtures/transaction/account_delete.rtm | 0 ...cker_claim_fungibles_and_non_fungibles.dat | 0 ...cker_claim_fungibles_and_non_fungibles.rtm | 0 .../claim_two_stakes_from_one_validator.dat | 0 .../claim_two_stakes_from_one_validator.rtm | 0 .../transaction/contribute_to_bi_pool.dat | 0 .../transaction/contribute_to_bi_pool.rtm | 0 .../transaction/create_3_nft_collections.rtm | 0 .../create_access_controller_for_account.rtm | 0 .../create_access_controller_for_persona.rtm | 0 .../transaction/create_nft_collection.dat | 0 .../transaction/create_nft_collection.rtm | 0 .../fixtures/transaction/create_pool.dat | 0 .../fixtures/transaction/create_pool.rtm | 0 .../transaction/create_single_fungible.dat | 0 .../transaction/create_single_fungible.rtm | 0 .../transaction/mint_nft_gumball_card.dat | 0 .../transaction/mint_nft_gumball_card.rtm | 0 .../multi_account_resource_transfer.rtm | 0 ...ti_account_resource_transfer_subintent.rtm | 0 .../transaction/open_subintent_fungibles.rtm | 0 .../open_subintent_mix_multiple_deposits.rtm | 0 ...subintent_non_fungibles_no_certain_ids.rtm | 0 ...bintent_non_fungibles_with_certain_ids.rtm | 0 ...open_subintent_pool_stakes_stake_claim.rtm | 0 .../transaction/present_proof_swap_candy.dat | 0 .../transaction/present_proof_swap_candy.rtm | 0 .../transaction/redeem_from_bi_pool.dat | 0 .../transaction/redeem_from_bi_pool.rtm | 0 .../transaction/resource_transfer.rtm | 0 .../resource_transfer_subintent.rtm | 0 .../transaction/stake_to_three_validators.dat | 0 .../transaction/stake_to_three_validators.rtm | 0 .../third_party_deposits_update.dat | 0 .../third_party_deposits_update.rtm | 0 ...transfer_1to2_multiple_nf_and_f_tokens.dat | 0 ...transfer_1to2_multiple_nf_and_f_tokens.rtm | 0 .../unstake_partially_from_one_validator.dat | 0 .../unstake_partially_from_one_validator.rtm | 0 .../models}/src/assert_manifest.rs | 0 .../models}/src/error_from.rs | 0 .../models}/src/is_intent_signing.rs | 0 .../models}/src/lib.rs | 26 +- .../low_level/compiled_notarized_intent.rs | 0 .../low_level/compiled_transaction_intent.rs | 0 .../dynamically_analyzable_manifest.rs | 0 .../execution_summary/execution_summary.rs | 0 .../low_level/execution_summary/fee_locks.rs | 0 .../execution_summary/fee_summary.rs | 0 .../src/low_level/execution_summary/mod.rs | 0 .../execution_summary/new_entities.rs | 0 .../newly_created_resource.rs | 3 +- .../execution_summary/reserved_instruction.rs | 0 .../fungible_resource_indicator.rs | 0 .../resource_indicator/mod.rs | 0 .../non_fungible_resource_indicator.rs | 0 .../resource_indicator/predicted.rs | 2 +- .../resource_indicator/resource_indicator.rs | 0 .../resource_specifier/mod.rs | 0 .../resource_specifier/resource_specifier.rs | 0 .../models}/src/low_level/intent_signature.rs | 0 .../manifest_encountered_component_address.rs | 2 +- .../account_deposit/account_deposits.rs | 0 .../account_deposit/change_source.rs | 0 .../manifest_summary/account_deposit/mod.rs | 0 .../simple_counted_resource_bounds.rs | 0 .../simple_non_fungible_resource_bounds.rs | 0 .../account_deposit/simple_resource_bounds.rs | 0 .../account_deposit/unspecified_resources.rs | 0 .../account_withdraw/account_withdraw.rs | 0 .../manifest_summary/account_withdraw/mod.rs | 0 .../manifest_summary/manifest_summary.rs | 0 .../src/low_level/manifest_summary/mod.rs | 0 .../models}/src/low_level/mod.rs | 8 +- .../src/low_level/notarized_transaction.rs | 0 .../models}/src/low_level/notary_signature.rs | 0 .../src/low_level/sbor_depth_validation.rs | 2 +- .../models}/src/low_level/signed_intent.rs | 0 .../statically_analyzable_manifest.rs | 0 .../detailed_manifest_class.rs | 0 .../detailed_manifest_class_kind.rs | 0 .../src/low_level/transaction_classes/mod.rs | 0 .../transaction_classes/types/mod.rs | 0 .../types/resource_preference_update.rs | 0 .../types/tracked_pool_contribution.rs | 0 .../types/tracked_pool_redemption.rs | 0 .../types/tracked_validator_claim.rs | 0 .../types/tracked_validator_stake.rs | 0 .../transaction_classes/types/unstake_data.rs | 0 .../transaction_hashes/intent_hash.rs | 0 .../src/low_level/transaction_hashes/mod.rs | 0 .../transaction_hashes/signed_intent_hash.rs | 0 .../transaction_hashes/subintent_hash.rs | 0 .../transaction_hashes/transaction_hashes.rs | 5 +- .../validate_and_decode_hash.rs | 0 .../src/low_level/v1/intent_signatures.rs | 0 .../src/low_level/v1/message/message.rs | 0 .../models}/src/low_level/v1/message/mod.rs | 0 .../v1/message/plaintext_message/mod.rs | 0 .../plaintext_message/plaintext_message.rs | 0 .../plaintext_message_contents.rs | 0 .../models}/src/low_level/v1/mod.rs | 0 .../src/low_level/v1/transaction_header.rs | 0 .../src/low_level/v1/transaction_intent.rs | 0 .../v1/transaction_manifest/blobs/blob.rs | 0 .../v1/transaction_manifest/blobs/blobs.rs | 0 .../v1/transaction_manifest/blobs/mod.rs | 0 .../execution_summary/mod.rs | 0 .../transaction_manifest_execution_summary.rs | 0 .../instructions/instructions.rs | 2 + .../transaction_manifest/instructions/mod.rs | 0 .../low_level/v1/transaction_manifest/mod.rs | 0 .../transaction_manifest.rs | 0 .../src/low_level/v2/compiled_subintent.rs | 0 .../src/low_level/v2/intent_header_v2.rs | 0 .../src/low_level/v2/message_v2/message_v2.rs | 0 .../src/low_level/v2/message_v2/mod.rs | 0 .../models}/src/low_level/v2/mod.rs | 0 .../v2/signed_partial_transaction.rs | 0 .../src/low_level/v2/signed_subintent.rs | 0 .../models}/src/low_level/v2/subintent.rs | 0 .../child_subintent_specifier.rs | 0 .../child_subintent_specifiers.rs | 0 .../execution_summary_v2/mod.rs | 0 ...ansaction_manifest_execution_summary_v2.rs | 0 .../instructions_v2/instructions_v2.rs | 2 + .../instructions_v2/mod.rs | 0 .../v2/transaction_manifest_v2/mod.rs | 0 .../subintent_manifest.rs | 0 .../transaction_manifest_v2.rs | 0 .../src/profile_models/deposit_rule.rs | 2 + .../models}/src/profile_models/mod.rs | 0 .../third_party_deposits/asset_exception.rs | 0 .../assets_exception_list.rs | 0 .../deposit_address_exception_rule.rs | 0 .../depositors_allow_list.rs | 0 .../third_party_deposits/mod.rs | 0 .../third_party_deposits.rs | 0 .../src/unvalidated_transaction_manifest.rs | 0 .../conversion-macros}/Cargo.toml | 0 .../conversion-macros}/src/common.rs | 0 .../conversion-macros}/src/enum_conversion.rs | 0 .../conversion-macros}/src/lib.rs | 0 .../src/struct_conversion.rs | 0 .../uniffi_SPLIT_ME}/Cargo.toml | 40 +- .../uniffi_SPLIT_ME}/build.rs | 0 .../uniffi_SPLIT_ME}/src/Package.swift | 0 .../uniffi_SPLIT_ME}/src/bindgen/args.rs | 0 .../uniffi_SPLIT_ME}/src/bindgen/bin.rs | 0 .../src/bindgen/bindgen_error.rs | 0 .../src/bindgen/post_process.rs | 0 .../src/bindgen/post_process_kotlin.rs | 0 .../src/bindgen/post_process_swift.rs | 0 .../src/core/error/common_error.rs | 0 .../uniffi_SPLIT_ME}/src/core/error/mod.rs | 0 .../uniffi_SPLIT_ME}/src/core/hash.rs | 0 .../uniffi_SPLIT_ME}/src/core/mod.rs | 0 .../uniffi_SPLIT_ME}/src/core/result/mod.rs | 0 .../src/core/result/result.rs | 0 .../src/core/types/appearance_id.rs | 0 .../src/core/types/bag_of_bytes.rs | 0 .../types/collections/internal_mapping.rs | 2 +- .../src/core/types/collections/mod.rs | 0 .../src/core/types/decimal192.rs | 0 .../src/core/types/entity_kind.rs | 0 .../uniffi_SPLIT_ME}/src/core/types/epoch.rs | 0 .../src/core/types/exactly_n_bytes.rs | 0 .../src/core/types/instant.rs | 0 .../src/core/types/intent_discriminator.rs | 0 .../src/core/types/keys/ed25519/mod.rs | 0 .../src/core/types/keys/ed25519/public_key.rs | 0 .../src/core/types/keys/key_agreement/mod.rs | 0 .../types/keys/key_agreement/public_key.rs | 0 .../src/core/types/keys/mod.rs | 0 .../src/core/types/keys/public_key.rs | 0 .../src/core/types/keys/secp256k1/mod.rs | 0 .../core/types/keys/secp256k1/public_key.rs | 0 .../src/core/types/keys/slip10_curve.rs | 0 .../src/core/types/locale_config.rs | 0 .../uniffi_SPLIT_ME}/src/core/types/mod.rs | 0 .../src/core/types/non_empty_max_n_bytes.rs | 0 .../uniffi_SPLIT_ME}/src/core/types/nonce.rs | 0 .../core/types/requested_number_quantifier.rs | 0 .../src/core/types/requested_quantity.rs | 0 .../src/core/types/rounding_mode.rs | 0 .../src/core/types/secret_bytes.rs | 0 .../types/signatures/ed25519_signature.rs | 0 .../src/core/types/signatures/mod.rs | 0 .../types/signatures/secp256k1_signature.rs | 0 .../src/core/types/signatures/signature.rs | 0 .../signatures/signature_with_public_key.rs | 0 .../src/core/types/version_type.rs | 0 .../src/core/utils/builder_arc_map.rs | 0 .../src/core/utils/constants.rs | 0 .../src/core/utils/conversion_tests_macro.rs | 0 .../core/utils/delegate_debug_display_impl.rs | 0 .../core/utils/image_url_utils_uniffi_fn.rs | 6 +- .../uniffi_SPLIT_ME}/src/core/utils/mod.rs | 0 .../bip32/hardened.rs | 0 .../bip32/hd_path.rs | 0 .../bip32/hd_path_component.rs | 0 .../bip32/key_space.rs | 0 .../hierarchical_deterministic/bip32/mod.rs | 0 .../bip32/securified.rs | 0 .../hierarchical_deterministic/bip32/u30.rs | 0 .../hierarchical_deterministic/bip32/u31.rs | 0 .../bip32/unhardened.rs | 0 .../bip32/unsecurified.rs | 0 .../bip32/unsecurified_hardened.rs | 0 .../bip39/bip39_entropy.rs | 0 .../bip39/bip39_passphrase.rs | 0 .../bip39/bip39_seed.rs | 0 .../bip39/bip39_word/bip39_language.rs | 0 .../bip39/bip39_word/bip39_word.rs | 0 .../bip39/bip39_word/mod.rs | 0 .../bip39/bip39_word/u11.rs | 0 .../bip39/bip39_word_count.rs | 0 .../bip39/mnemonic.rs | 0 .../hierarchical_deterministic/bip39/mod.rs | 0 .../bip44/bip44_like_path.rs | 0 .../hierarchical_deterministic/bip44/mod.rs | 0 .../cap26/cap26_entity_kind.rs | 0 .../cap26/cap26_key_kind.rs | 0 .../cap26/cap26_path/mod.rs | 0 .../cap26/cap26_path/paths/account_path.rs | 0 .../cap26/cap26_path/paths/identity_path.rs | 0 .../cap26/cap26_path/paths/mod.rs | 0 .../hierarchical_deterministic/cap26/mod.rs | 0 .../derivation/derivation_path.rs | 0 .../derivation/derivation_path_scheme.rs | 0 .../hierarchical_deterministic_public_key.rs | 0 .../derivation/mnemonic_with_passphrase.rs | 0 .../derivation/mod.rs | 0 .../src/hierarchical_deterministic/mod.rs | 0 .../src/home_cards/home_card.rs | 0 .../src/home_cards/manager.rs | 0 .../uniffi_SPLIT_ME}/src/home_cards/mod.rs | 0 .../src/home_cards/observer.rs | 0 .../src/home_cards/storage.rs | 0 .../src/keys_collector/derivation_purpose.rs | 0 .../keys_collector/key_derivation_request.rs | 1 - .../keys_collector/key_derivation_response.rs | 1 - .../src/keys_collector/mod.rs | 0 .../uniffi_SPLIT_ME}/src/lib.rs | 5 +- .../encrypted/encryption/aes_gcm_256.rs | 2 +- .../encrypted/encryption/encryption_scheme.rs | 2 +- .../src/profile/encrypted/encryption/mod.rs | 0 .../src/profile/encrypted/mod.rs | 0 .../arculus_card_factor_source.rs | 0 .../arculus_card_hint.rs | 0 .../arculus_card_model.rs | 0 .../arculus_card_factor_source/mod.rs | 0 .../src/profile/mfa/mfa_factor_sources/mod.rs | 0 .../off_device_mnemonic_factor_source/mod.rs | 0 .../off_device_factor_source_hint.rs | 0 .../off_device_mnemonic_factor_source.rs | 0 .../password_factor_source/mod.rs | 0 .../password_factor_source.rs | 0 .../password_factor_source_hint.rs | 0 .../answer/mod.rs | 0 .../answer/security_question_and_answer.rs | 0 .../kdf/mod.rs | 0 ...s_keys_from_questions_and_answer_scheme.rs | 0 .../keys_by_diffie_hellman_fold.rs | 0 .../mod.rs | 0 ...m_questions_and_answers_lower_trim_utf8.rs | 0 .../mod.rs | 0 .../security_question_and_answer_as_bytes.rs | 0 .../security_question_answer_as_bytes.rs | 0 .../kdf/sub_kdf/mod.rs | 0 .../security_questions_factor_source/mod.rs | 0 .../question/mod.rs | 0 .../question/security_question.rs | 0 .../question/security_question_kind.rs | 0 .../question/security_questions.rs | 0 .../security_questions_factor_source.rs | 0 .../security_questions_sealed_mnemonic.rs | 0 .../trusted_contact_factor_source/mod.rs | 0 .../trusted_contact_factor_source.rs | 0 .../trusted_contact_factor_source_contact.rs | 0 .../uniffi_SPLIT_ME}/src/profile/mfa/mod.rs | 0 .../profile/mfa/secured_entity_control/mod.rs | 0 .../secured_entity_control.rs | 0 .../matrices/decl_matrix_macro.rs | 0 .../matrices/matrix_of_factor_instances.rs | 0 .../matrices/matrix_of_factor_source_ids.rs | 0 .../matrices/matrix_of_factor_sources.rs | 0 .../mfa/security_structures/matrices/mod.rs | 0 .../profile/mfa/security_structures/mod.rs | 0 ...ource_in_role_builder_validation_status.rs | 0 .../mfa/security_structures/models/mod.rs | 0 .../security_structures/models/role_kind.rs | 0 .../roles/decl_role_macro.rs | 0 .../mfa/security_structures/roles/mod.rs | 0 .../roles/roles_factor_instances.rs | 0 .../roles/roles_factor_source_ids.rs | 0 .../roles/roles_factor_sources.rs | 0 .../security_shield_builder.rs | 0 .../security_shield_builder_invalid_reason.rs | 0 .../security_shield_prerequisites_status.rs | 0 .../security_structure_id.rs | 0 .../security_structure_metadata.rs | 0 .../security_structures/mod.rs | 0 .../security_structure_of_factor_instances.rs | 0 ...security_structure_of_factor_source_ids.rs | 0 .../security_structure_of_factor_sources.rs | 0 .../selected_factor_sources_status.rs | 0 .../uniffi_SPLIT_ME}/src/profile/mod.rs | 0 .../src/profile/profilesnapshot_version.rs | 0 .../supporting_types/account_for_display.rs | 0 .../supporting_types/account_or_persona.rs | 0 .../authorized_dapp_detailed.rs | 0 .../authorized_persona_detailed.rs | 0 .../supporting_types/decl_vec_samples_for.rs | 0 .../profile/supporting_types/email_address.rs | 0 .../src/profile/supporting_types/host_id.rs | 0 .../src/profile/supporting_types/host_info.rs | 0 .../src/profile/supporting_types/host_os.rs | 0 .../src/profile/supporting_types/mod.rs | 0 .../v100/address/access_controller_address.rs | 0 .../profile/v100/address/account_address.rs | 0 .../src/profile/v100/address/address.rs | 0 .../profile/v100/address/address_format.rs | 0 .../profile/v100/address/component_address.rs | 0 .../profile/v100/address/identity_address.rs | 0 .../address/legacy_olympia_account_address.rs | 0 .../profile/v100/address/locker_address.rs | 0 .../src/profile/v100/address/mod.rs | 0 .../v100/address/non_fungible_global_id.rs | 0 .../v100/address/non_fungible_local_id.rs | 0 .../address/non_fungible_local_id_string.rs | 0 .../address/non_fungible_resource_address.rs | 0 .../profile/v100/address/package_address.rs | 0 .../src/profile/v100/address/pool_address.rs | 0 .../profile/v100/address/resource_address.rs | 0 .../profile/v100/address/validator_address.rs | 0 .../src/profile/v100/address/vault_address.rs | 0 .../profile/v100/address/wrap_ret_address.rs | 0 .../app_display_settings.rs | 0 .../app_display_settings/fiat_currency.rs | 0 .../app_display_settings/mod.rs | 0 .../v100/app_preferences/app_preferences.rs | 0 .../v100/app_preferences/gateways/gateway.rs | 0 .../v100/app_preferences/gateways/mod.rs | 0 .../gateways/network_definition.rs | 0 .../gateways/saved_gateways.rs | 2 +- .../src/profile/v100/app_preferences/mod.rs | 0 .../profile/v100/app_preferences/security.rs | 0 .../transaction_preferences.rs | 0 .../entities_linked_to_factor_source.rs | 0 .../integrity/device.rs | 0 .../integrity/integrity.rs | 0 .../integrity/mod.rs | 0 .../entities_linked_to_factor_source/mod.rs | 0 .../profile_to_check.rs | 0 .../profile/v100/entity/account/account.rs | 0 .../src/profile/v100/entity/account/mod.rs | 0 .../entity/account/on_ledger_settings/mod.rs | 0 .../on_ledger_settings/on_ledger_settings.rs | 0 .../third_party_deposits/asset_exception.rs | 0 .../deposit_address_exception_rule.rs | 0 .../third_party_deposits/deposit_rule.rs | 0 .../third_party_deposits/mod.rs | 0 .../resource_or_non_fungible.rs | 0 .../third_party_deposits.rs | 0 .../src/profile/v100/entity/display_name.rs | 0 .../src/profile/v100/entity/entity_flag.rs | 0 .../src/profile/v100/entity/mod.rs | 0 .../src/profile/v100/entity/persona/mod.rs | 0 .../profile/v100/entity/persona/persona.rs | 0 .../collection_of_email_addresses.rs | 0 .../collection_of_phone_numbers.rs | 0 .../persona/persona_data/entry_kinds/mod.rs | 0 .../persona_data_entry_email_address.rs | 0 .../entry_kinds/persona_data_entry_name.rs | 0 .../persona_data_entry_phone_number.rs | 0 .../v100/entity/persona/persona_data/mod.rs | 0 .../persona/persona_data/persona_data.rs | 0 .../persona_data/persona_data_entry_id.rs | 0 ...ersona_data_identified_collection_types.rs | 0 .../persona_data_identified_entry_types.rs | 0 .../entity_security_state.rs | 0 .../profile/v100/entity_security_state/mod.rs | 0 .../provisional_securified_config.rs | 0 .../unsecured_entity_control.rs | 0 .../factor_instance/badge_virtual_source.rs | 0 .../factor_instance/factor_instance.rs | 0 .../factor_instance/factor_instance_badge.rs | 0 .../v100/factors/factor_instance/mod.rs | 0 .../src/profile/v100/factors/factor_source.rs | 0 .../v100/factors/factor_source_common.rs | 0 .../factor_source_crypto_parameters.rs | 0 .../v100/factors/factor_source_flag.rs | 0 .../profile/v100/factors/factor_source_id.rs | 0 .../factors/factor_source_id_from_address.rs | 0 .../factors/factor_source_id_from_hash.rs | 0 .../v100/factors/factor_source_kind.rs | 0 .../device_factor_source.rs | 0 .../device_factor_source_hint.rs | 0 .../device_factor_source/mod.rs | 0 .../factors/factor_sources/factor_sources.rs | 0 .../ledger_hardware_wallet_factor_source.rs | 0 .../ledger_hardware_wallet_hint.rs | 0 .../ledger_hardware_wallet_model.rs | 0 .../mod.rs | 0 .../v100/factors/factor_sources/mod.rs | 0 ...ierarchical_deterministic_factor_source.rs | 0 ...rarchical_deterministic_factor_instance.rs | 0 .../src/profile/v100/factors/mod.rs | 0 .../src/profile/v100/header/content_hint.rs | 0 .../src/profile/v100/header/device_id.rs | 0 .../src/profile/v100/header/device_info.rs | 0 .../v100/header/device_info_description.rs | 0 .../src/profile/v100/header/header.rs | 0 .../src/profile/v100/header/mod.rs | 0 .../src/profile/v100/header/profile_id.rs | 0 .../src/profile/v100/json_data_convertible.rs | 0 .../uniffi_SPLIT_ME}/src/profile/v100/mod.rs | 0 .../src/profile/v100/networks/mod.rs | 0 .../authorized_dapp/authorized_dapp.rs | 0 .../authorized_persona_simple.rs | 0 .../networks/network/authorized_dapp/mod.rs | 0 .../authorized_dapp_preference_deposits.rs | 0 .../authorized_dapp_preferences.rs | 0 .../authorized_dapp/preferences/mod.rs | 0 .../authorized_dapp/shared_persona_data.rs | 0 ..._to_dapp_with_persona_account_addresses.rs | 0 ...ith_persona_ids_of_persona_data_entries.rs | 0 .../authorized_dapp/shared_with_dapp.rs | 0 .../src/profile/v100/networks/network/mod.rs | 0 .../v100/networks/network/network_id.rs | 0 .../v100/networks/network/profile_network.rs | 2 +- .../network/resource_preferences/mod.rs | 0 .../resource_app_preference.rs | 0 .../resource_identifier.rs | 0 .../resource_preferences.rs | 0 .../resource_visibility.rs | 0 .../src/profile/v100/profile.rs | 0 .../src/profile/v100/profile_file_contents.rs | 0 .../src/radix_connect/interaction_id.rs | 0 .../src/radix_connect/interaction_version.rs | 0 .../src/radix_connect/mobile/client.rs | 0 .../src/radix_connect/mobile/mod.rs | 0 .../src/radix_connect/mobile/session/mod.rs | 0 .../mobile/session/session_id.rs | 0 .../mobile/session_dapp_request.rs | 0 .../radix_connect/mobile/session_storage.rs | 0 .../mobile/session_wallet_response.rs | 0 .../uniffi_SPLIT_ME}/src/radix_connect/mod.rs | 0 .../p2p_links/link_connection_qr_data.rs | 0 .../src/radix_connect/p2p_links/mod.rs | 0 .../src/radix_connect/p2p_links/p2p_link.rs | 0 .../src/radix_connect/p2p_links/p2p_links.rs | 0 .../p2p_links/radix_connect_password.rs | 0 .../p2p_links/radix_connect_purpose.rs | 0 .../src/radix_connect/wallet_account.rs | 0 .../dapp_to_wallet/auth_challenge_nonce.rs | 0 .../dapp_metadata/interaction_metadata.rs | 0 .../interaction_metadata_unvalidated.rs | 0 .../dapp_to_wallet/dapp_metadata/mod.rs | 0 .../dapp_to_wallet/dapp_metadata/origin.rs | 0 .../dapp_to_wallet/interaction.rs | 0 .../dapp_to_wallet/interaction_items/items.rs | 0 .../dapp_to_wallet/interaction_items/mod.rs | 0 .../expiration/after_delay.rs | 0 .../pre_authorization/expiration/at_time.rs | 0 .../expiration/expiration.rs | 0 .../pre_authorization/expiration/mod.rs | 0 .../pre_authorization/expiration/status.rs | 0 .../pre_authorization/mod.rs | 0 .../pre_authorization/pre_authorization.rs | 0 .../pre_authorization/subintent.rs | 0 .../unvalidated_subintent_manifest.rs | 0 .../interaction_items/request/auth/auth.rs | 0 .../request/auth/login_with_challenge.rs | 0 .../interaction_items/request/auth/mod.rs | 0 .../request/auth/use_persona.rs | 0 .../request/authorized_request.rs | 0 .../request/entity/accounts.rs | 0 .../interaction_items/request/entity/mod.rs | 0 .../request/entity/persona_data.rs | 0 .../request/entity/proof_of_ownership.rs | 0 .../interaction_items/request/entity/reset.rs | 0 .../interaction_items/request/mod.rs | 0 .../request/unauthorized_request.rs | 0 .../interaction_items/transaction/mod.rs | 0 .../transaction/transaction.rs | 0 .../transaction/transaction_version.rs | 0 .../unvalidated_transaction_manifest.rs | 0 .../dapp_to_wallet/interaction_unvalidated.rs | 0 .../dapp_to_wallet/mod.rs | 0 .../dapp_wallet_interaction/mod.rs | 0 .../failure_response/error_type.rs | 0 .../failure_response/failure.rs | 0 .../wallet_to_dapp/failure_response/mod.rs | 0 .../wallet_to_dapp/mod.rs | 0 .../wallet_to_dapp/response.rs | 0 .../success_response/account/account_proof.rs | 0 .../success_response/account/accounts.rs | 0 .../success_response/account/mod.rs | 0 .../success_response/auth/auth.rs | 0 .../auth/auth_login_with_challenge.rs | 0 .../auth/auth_login_without_challenge.rs | 0 .../success_response/auth/auth_proof.rs | 0 .../success_response/auth/auth_use_persona.rs | 0 .../success_response/auth/mod.rs | 0 .../success_response/authorized_request.rs | 0 .../wallet_to_dapp/success_response/items.rs | 0 .../wallet_to_dapp/success_response/mod.rs | 0 .../success_response/persona/mod.rs | 0 .../success_response/persona/persona_proof.rs | 0 .../success_response/persona_data/mod.rs | 0 .../persona_data/persona_data.rs | 0 .../success_response/pre_authorization/mod.rs | 0 .../pre_authorization/pre_authorization.rs | 0 .../proof_of_ownership/mod.rs | 0 .../proof_of_ownership/proof.rs | 0 .../proof_of_ownership/proof_of_ownership.rs | 0 .../success_response/success.rs | 0 .../success_response/transaction/mod.rs | 0 .../transaction/transaction.rs | 0 .../success_response/unauthorized_request.rs | 0 .../radix_connect/wallet_interaction/mod.rs | 0 .../src/radix_connect/wallet_persona.rs | 0 .../uniffi_SPLIT_ME}/src/sargon.udl | 0 .../src/security_center/mod.rs | 0 .../src/security_center/security_problem.rs | 0 .../security_center/security_problem_kind.rs | 0 .../support/addresses_entities_bad_state.rs | 0 .../security_center/support/backup_result.rs | 0 .../src/security_center/support/input.rs | 0 .../src/security_center/support/mod.rs | 0 .../src/signing/authentication/auth_intent.rs | 0 .../authentication/auth_intent_hash.rs | 0 .../src/signing/authentication/mod.rs | 0 .../authentication/signed_auth_intent.rs | 2 +- .../src/signing/hd_signature.rs | 0 .../src/signing/hd_signature_input.rs | 0 .../src/signing/intent_signature_of_owner.rs | 0 .../invalid_transaction_if_neglected.rs | 0 .../uniffi_SPLIT_ME}/src/signing/mod.rs | 0 .../src/signing/neglected_factors.rs | 5 +- .../src/signing/sign_request.rs | 0 .../src/signing/sign_response.rs | 2 +- .../src/signing/sign_with_factors_outcome.rs | 0 .../signing/signatures_per_fractor_source.rs | 0 .../signing/transaction_sign_request_input.rs | 0 .../transactions_to_sign_per_factor_source.rs | 0 .../uniffi_SPLIT_ME}/src/system/bios/bios.rs | 0 .../uniffi_SPLIT_ME}/src/system/bios/mod.rs | 0 .../src/system/drivers/README.md | 0 .../src/system/drivers/drivers.rs | 0 .../entropy_provider_driver.rs | 0 .../drivers/entropy_provider_driver/mod.rs | 0 .../event_bus_driver/event_bus_driver.rs | 0 .../system/drivers/event_bus_driver/mod.rs | 0 .../drivers/event_bus_driver/support/event.rs | 0 .../event_bus_driver/support/event_kind.rs | 0 .../support/event_notification.rs | 0 .../support/event_profile_modified.rs | 0 .../support/has_event_kind.rs | 0 .../drivers/event_bus_driver/support/mod.rs | 0 .../file_system_driver/file_system_driver.rs | 0 .../system/drivers/file_system_driver/mod.rs | 0 .../host_info_driver/host_info_driver.rs | 0 .../system/drivers/host_info_driver/mod.rs | 0 .../drivers/logging_driver/logging_driver.rs | 0 .../src/system/drivers/logging_driver/mod.rs | 0 .../logging_driver/support/log_level.rs | 0 .../drivers/logging_driver/support/mod.rs | 0 .../src/system/drivers/mod.rs | 0 .../system/drivers/networking_driver/mod.rs | 0 .../networking_driver/networking_driver.rs | 0 .../drivers/networking_driver/support/mod.rs | 0 .../support/network_method.rs | 0 .../support/network_request.rs | 0 .../support/network_response.rs | 0 .../drivers/profile_change_driver/mod.rs | 0 .../profile_change_driver.rs | 0 .../drivers/secure_storage_driver/mod.rs | 0 .../secure_storage_driver.rs | 0 .../secure_storage_driver/support/mod.rs | 0 .../secure_storage_access_error_kind.rs | 0 .../support/secure_storage_key.rs | 0 .../drivers/unsafe_storage_driver/mod.rs | 0 .../unsafe_storage_driver/support/mod.rs | 0 .../support/test/ephemeral_unsafe_storage.rs | 0 .../unsafe_storage_driver/support/test/mod.rs | 0 .../support/unsafe_storage_key.rs | 0 .../unsafe_storage_driver.rs | 0 .../src/system/interactors/host_interactor.rs | 0 .../src/system/interactors/mod.rs | 0 .../uniffi_SPLIT_ME}/src/system/mod.rs | 0 .../system/sargon_os/delete_account/mod.rs | 0 .../sargon_os_delete_account.rs | 0 .../sargon_os/delete_account/support/mod.rs | 0 .../delete_account/support/outcome.rs | 0 .../src/system/sargon_os/mod.rs | 0 .../system/sargon_os/pre_authorization/mod.rs | 0 .../sargon_os_create_subintent.rs | 0 .../sargon_os_pre_authorization_status.rs | 0 .../pre_authorization/support/mod.rs | 0 .../support/pre_authorization_status.rs | 0 .../system/sargon_os/profile_state_holder.rs | 0 .../src/system/sargon_os/sargon_os.rs | 0 .../system/sargon_os/sargon_os_accounts.rs | 0 ...gon_os_entities_linked_to_factor_source.rs | 0 .../src/system/sargon_os/sargon_os_factors.rs | 0 .../src/system/sargon_os/sargon_os_gateway.rs | 0 .../src/system/sargon_os/sargon_os_profile.rs | 0 .../sargon_os/sargon_os_security_center.rs | 0 .../sargon_os_security_structures.rs | 0 .../src/system/sargon_os/sargon_os_signing.rs | 0 .../sargon_os/sargon_os_sync_accounts.rs | 0 .../src/system/sargon_os/transactions/mod.rs | 0 .../sargon_os_transaction_analysis.rs | 0 .../sargon_os_transaction_status.rs | 0 .../sargon_os_transaction_submit.rs | 0 .../sargon_os/transactions/support/mod.rs | 0 .../support/pre_auth_to_review.rs | 0 .../support/transaction_to_review.rs | 0 .../src/system/subsystems/README.md | 0 .../subsystems/log_system/log_system.rs | 0 .../src/system/subsystems/log_system/mod.rs | 0 .../src/system/subsystems/mod.rs | 0 .../uniffi_SPLIT_ME}/src/types/ffi_url.rs | 2 +- .../uniffi_SPLIT_ME}/src/types/mod.rs | 0 .../src/types/owned_factor_instance.rs | 0 .../src/types/vector_image_type.rs | 0 .../high_level/mod.rs | 0 .../high_level/ret_api.rs | 2 +- .../account_locker_claimable_resource.rs | 0 .../account_locker/mod.rs | 0 .../address_of_account_or_persona.rs | 0 .../sargon_specific_types/address_union.rs | 0 .../assets_transfers/account_or_address_of.rs | 26 + .../assets_transfers/mod.rs | 4 +- .../assets_transfers/per_asset/mod.rs | 0 .../per_asset/per_asset_fungible_resource.rs | 0 .../per_asset/per_asset_transfers.rs | 0 ...er_asset_transfers_of_fungible_resource.rs | 0 ...sset_transfers_of_non_fungible_resource.rs | 0 .../assets_transfers/per_recipient/mod.rs | 0 .../per_recipient_asset_transfer.rs | 2 +- .../per_recipient_asset_transfers.rs | 0 .../assets_transfers/transfer_types.rs | 4 +- .../dependency_information.rs | 0 .../build_information/mod.rs | 0 .../sargon_build_information.rs | 0 .../build_information/sargon_dependencies.rs | 0 .../manifest_encountered_component_address.rs | 0 .../high_level/sargon_specific_types/mod.rs | 0 .../sargon_specific_types/stake_claim.rs | 0 .../sargon_specific_types/transaction/mod.rs | 0 .../transaction/transaction_status.rs | 0 .../transaction/transaction_status_reason.rs | 0 .../transaction_guarantee.rs | 0 .../high_level/token_definition_metadata.rs | 0 .../low_level/compiled_notarized_intent.rs | 0 .../low_level/compiled_transaction_intent.rs | 0 .../execution_summary/execution_summary.rs | 0 .../low_level/execution_summary/fee_locks.rs | 0 .../execution_summary/fee_summary.rs | 0 .../low_level/execution_summary/mod.rs | 0 .../execution_summary/new_entities.rs | 0 .../newly_created_resource.rs | 0 .../execution_summary/reserved_instruction.rs | 0 .../fungible_resource_indicator.rs | 0 .../resource_indicator/mod.rs | 0 .../non_fungible_resource_indicator.rs | 0 .../resource_indicator/predicted.rs | 0 .../resource_indicator/resource_indicator.rs | 0 .../resource_specifier/mod.rs | 0 .../resource_specifier/resource_specifier.rs | 0 .../low_level/intent_signature.rs | 0 .../account_deposit/account_deposit.rs | 0 .../account_deposit/change_source.rs | 0 .../manifest_summary/account_deposit/mod.rs | 0 .../simple_fungible_resource_bounds.rs | 0 .../simple_non_fungible_resource_bounds.rs | 0 .../account_deposit/simple_resource_bounds.rs | 0 .../account_deposit/unspecified_resources.rs | 0 .../account_withdraw/account_withdraw.rs | 0 .../manifest_summary/account_withdraw/mod.rs | 0 .../manifest_summary/manifest_summary.rs | 0 .../low_level/manifest_summary/mod.rs | 0 .../low_level/mod.rs | 0 .../low_level/notarized_transaction.rs | 0 .../low_level/notary_signature.rs | 0 .../low_level/public_key_hash.rs | 0 .../low_level/signed_intent.rs | 0 .../detailed_manifest_class.rs | 0 .../detailed_manifest_class_kind.rs | 0 .../low_level/transaction_classes/mod.rs | 0 .../transaction_classes/types/mod.rs | 0 .../types/resource_preference_update.rs | 0 .../types/tracked_pool_contribution.rs | 0 .../types/tracked_pool_redemption.rs | 0 .../types/tracked_validator_claim.rs | 0 .../types/tracked_validator_stake.rs | 0 .../transaction_classes/types/unstake_data.rs | 0 .../transaction_hashes/intent_hash.rs | 0 .../low_level/transaction_hashes/mod.rs | 0 .../transaction_hashes/signed_intent_hash.rs | 0 .../transaction_hashes/subintent_hash.rs | 0 .../transaction_hashes/transaction_hashes.rs | 0 .../low_level/v1/intent_signatures.rs | 0 .../low_level/v1/message/message.rs | 0 .../low_level/v1/message/mod.rs | 0 .../v1/message/plaintext_message/mod.rs | 0 .../plaintext_message/plaintext_message.rs | 0 .../plaintext_message_contents.rs | 0 .../low_level/v1/mod.rs | 0 .../low_level/v1/transaction_header.rs | 0 .../low_level/v1/transaction_intent.rs | 0 .../v1/transaction_manifest/blobs/blob.rs | 0 .../v1/transaction_manifest/blobs/blobs.rs | 0 .../v1/transaction_manifest/blobs/mod.rs | 0 .../instructions/instructions.rs | 0 .../transaction_manifest/instructions/mod.rs | 0 .../low_level/v1/transaction_manifest/mod.rs | 0 .../transaction_manifest.rs | 0 .../low_level/v2/compiled_subintent.rs | 0 .../low_level/v2/intent_header_v2.rs | 0 .../low_level/v2/message_v2/message_v2.rs | 0 .../low_level/v2/message_v2/mod.rs | 0 .../low_level/v2/mod.rs | 0 .../low_level/v2/signed_subintent.rs | 0 .../low_level/v2/subintent.rs | 0 .../v2/transaction_manifest_v2/mod.rs | 0 .../subintent_manifest.rs | 0 .../transaction_manifest_v2.rs | 0 .../src/wrapped_radix_engine_toolkit/mod.rs | 0 .../uniffi_SPLIT_ME}/tests/Package.swift | 0 .../tests/integration/main.rs | 0 .../uniffi_SPLIT_ME}/tests/vectors/main.rs | 0 .../uniffi_SPLIT_ME}/uniffi.toml | 0 .../com/radixdlt/cargo/toml/SargonVersion.kt | 2 +- .../java/com/radixdlt/sargon/ProfileTest.kt | 4 +- .../sargon/TransactionManifestTest.kt | 14 +- 1881 files changed, 3783 insertions(+), 2325 deletions(-) create mode 100644 apple/Sources/Sargon/Extensions/Swiftified/Profile/Factor/FactorSource+Extras.swift create mode 100644 apple/Sources/Sargon/Extensions/Swiftified/Profile/Factor/FactorSourceIntegrity+Swiftified.swift create mode 100644 crates/common/bytes/Cargo.toml rename crates/{sargon-core/src/types => common/bytes/src}/bag_of_bytes.rs (96%) rename crates/{sargon-core/src/types => common/bytes/src}/exactly_n_bytes.rs (99%) create mode 100644 crates/common/bytes/src/lib.rs rename crates/{sargon-core/src/types => common/bytes/src}/non_empty_max_n_bytes.rs (97%) rename crates/{sargon-core/src/types => common/bytes/src}/secret_bytes.rs (99%) rename crates/{sargon-core => common/bytes}/src/secure_random_bytes.rs (100%) create mode 100644 crates/common/entity-foundation/Cargo.toml rename crates/{sargon-core/src/types => common/entity-foundation/src}/appearance_id.rs (98%) rename crates/{sargon-core/src/types => common/entity-foundation/src}/entity_kind.rs (100%) create mode 100644 crates/common/entity-foundation/src/lib.rs create mode 100644 crates/common/host-info/Cargo.toml rename crates/{sargon-core/src/types => common/host-info/src}/host_info/device_id.rs (98%) rename crates/{sargon-core/src/types => common/host-info/src}/host_info/device_info_description.rs (99%) rename crates/{sargon-core/src/types => common/host-info/src}/host_info/host_id.rs (92%) rename crates/{sargon-core/src/types => common/host-info/src}/host_info/host_info.rs (100%) rename crates/{sargon-core/src/types => common/host-info/src}/host_info/host_os.rs (99%) rename crates/{sargon-core/src/types => common/host-info/src}/host_info/mod.rs (100%) create mode 100644 crates/common/host-info/src/lib.rs rename crates/{ => common}/identified-vec-of/Cargo.toml (68%) rename crates/{ => common}/identified-vec-of/src/decl_identified_vec_of_with_samples.rs (98%) rename crates/{ => common}/identified-vec-of/src/identifiable.rs (100%) rename crates/{ => common}/identified-vec-of/src/identified_vec_of.rs (98%) rename crates/{ => common}/identified-vec-of/src/identified_vec_of_display_debug.rs (100%) rename crates/{ => common}/identified-vec-of/src/identified_vec_of_iterator.rs (98%) rename crates/{ => common}/identified-vec-of/src/identified_vec_of_modify.rs (100%) rename crates/{ => common}/identified-vec-of/src/identified_vec_of_query.rs (99%) rename crates/{ => common}/identified-vec-of/src/identified_vec_of_serde.rs (100%) rename crates/{ => common}/identified-vec-of/src/identified_vec_of_validation_import_export.rs (100%) rename crates/{ => common}/identified-vec-of/src/lib.rs (86%) rename crates/{ => common}/identified-vec-of/src/user.rs (100%) create mode 100644 crates/common/metadata/Cargo.toml create mode 100644 crates/common/metadata/src/lib.rs rename crates/{sargon-core => common/metadata}/src/metadata.rs (100%) create mode 100644 crates/common/network/Cargo.toml rename crates/{sargon-core => common/network}/src/is_network_aware.rs (100%) create mode 100644 crates/common/network/src/lib.rs rename crates/{sargon-core => common/network}/src/network_id.rs (99%) create mode 100644 crates/common/numeric/Cargo.toml rename crates/{sargon-core/src/types => common/numeric/src/decimal}/decimal192.rs (100%) rename crates/{sargon-core/src/types => common/numeric/src/decimal}/locale_config.rs (100%) create mode 100644 crates/common/numeric/src/decimal/mod.rs rename crates/{sargon-core/src/types => common/numeric/src/decimal}/rounding_mode.rs (100%) create mode 100644 crates/common/numeric/src/lib.rs rename crates/{sargon-core => common/numeric}/src/unsigned_ints/add_via_deref.rs (100%) rename crates/{sargon-core => common/numeric}/src/unsigned_ints/global_index_constants.rs (100%) rename crates/{sargon-core => common/numeric}/src/unsigned_ints/mod.rs (100%) rename crates/{sargon-core => common/numeric}/src/unsigned_ints/u30.rs (100%) rename crates/{sargon-core => common/numeric}/src/unsigned_ints/u31.rs (100%) create mode 100644 crates/common/short-string/Cargo.toml rename crates/{sargon-core/src/types => common/short-string/src}/display_name.rs (96%) rename crates/{sargon-core/src/types => common/short-string/src}/email_address.rs (98%) create mode 100644 crates/common/short-string/src/lib.rs rename crates/{sargon-core/src/types => common/short-string/src}/short_string.rs (100%) rename crates/{sargon-core-assert-json => core/assert-json}/Cargo.toml (80%) rename crates/{sargon-core-assert-json => core/assert-json}/src/assert_json.rs (100%) rename crates/{sargon-core-assert-json => core/assert-json}/src/lib.rs (100%) create mode 100644 crates/core/collections/Cargo.toml rename crates/{sargon-core => core/collections}/src/appendable_collection.rs (98%) rename crates/{sargon-core/src/types => core/collections/src}/collections/just.rs (96%) rename crates/{sargon-core/src/types => core/collections/src}/collections/mod.rs (100%) create mode 100644 crates/core/collections/src/lib.rs rename crates/{sargon-core-error => core/error}/Cargo.toml (90%) rename crates/{sargon-core-error => core/error}/src/common_error.rs (100%) rename crates/{sargon-core-error => core/error}/src/lib.rs (100%) create mode 100644 crates/core/has-sample-values/Cargo.toml rename crates/{sargon-core => core/has-sample-values}/src/has_sample_values.rs (100%) create mode 100644 crates/core/has-sample-values/src/lib.rs create mode 100644 crates/core/misc/Cargo.toml rename crates/{sargon-core/src/types => core/misc/src}/bool_type.rs (98%) rename crates/{sargon-core/src/types => core/misc/src}/hidden_constructor.rs (100%) rename crates/{sargon-core => core/misc}/src/image_url_utils.rs (98%) rename crates/{sargon-core/src/types => core/misc/src}/instant.rs (98%) create mode 100644 crates/core/misc/src/lib.rs create mode 100644 crates/core/misc/src/parse_url.rs rename crates/{sargon-core/src/types => core/misc/src}/requested_number_quantifier.rs (100%) rename crates/{sargon-core/src/types => core/misc/src}/requested_quantity.rs (99%) rename crates/{sargon-core => core/misc}/src/unsafe_id_stepper.rs (97%) rename crates/{sargon-core/src/types => core/misc/src}/vector_image_type.rs (100%) create mode 100644 crates/core/time-utils/Cargo.toml create mode 100644 crates/core/time-utils/src/lib.rs rename crates/{sargon-core-utils => core/utils}/Cargo.toml (87%) rename crates/{sargon-core-utils => core/utils}/src/common_error_map.rs (97%) rename crates/{sargon-core-utils => core/utils}/src/constants.rs (91%) create mode 100644 crates/core/utils/src/factory.rs rename crates/{sargon-core-utils => core/utils}/src/lib.rs (100%) rename crates/{sargon-core-utils => core/utils}/src/logged_panic.rs (100%) rename crates/{sargon-core-utils => core/utils}/src/serialization.rs (99%) rename crates/{sargon-core-utils => core/utils}/src/string_utils.rs (100%) rename crates/{sargon-addresses => crypto/addresses}/Cargo.toml (50%) rename crates/{sargon-addresses => crypto/addresses}/src/address/access_controller_address.rs (100%) rename crates/{sargon-addresses => crypto/addresses}/src/address/account_address.rs (100%) rename crates/{sargon-addresses => crypto/addresses}/src/address/address.rs (100%) rename crates/{sargon-addresses => crypto/addresses}/src/address/address_format.rs (100%) rename crates/{sargon-addresses => crypto/addresses}/src/address/address_of_account_or_persona.rs (100%) rename crates/{sargon-addresses => crypto/addresses}/src/address/address_union.rs (99%) rename crates/{sargon-addresses => crypto/addresses}/src/address/component_address.rs (100%) rename crates/{sargon-addresses => crypto/addresses}/src/address/entity_address.rs (100%) rename crates/{sargon-addresses => crypto/addresses}/src/address/identity_address.rs (100%) rename crates/{sargon-addresses => crypto/addresses}/src/address/legacy_olympia_account_address.rs (99%) rename crates/{sargon-addresses => crypto/addresses}/src/address/locker_address.rs (100%) rename crates/{sargon-addresses => crypto/addresses}/src/address/mod.rs (100%) rename crates/{sargon-addresses => crypto/addresses}/src/address/non_fungible_global_id.rs (99%) rename crates/{sargon-addresses => crypto/addresses}/src/address/non_fungible_local_id.rs (98%) rename crates/{sargon-addresses => crypto/addresses}/src/address/non_fungible_local_id_string.rs (100%) rename crates/{sargon-addresses => crypto/addresses}/src/address/non_fungible_resource_address.rs (99%) rename crates/{sargon-addresses => crypto/addresses}/src/address/package_address.rs (100%) rename crates/{sargon-addresses => crypto/addresses}/src/address/pool_address.rs (100%) rename crates/{sargon-addresses => crypto/addresses}/src/address/public_key_hash.rs (100%) rename crates/{sargon-addresses => crypto/addresses}/src/address/resource_address.rs (100%) rename crates/{sargon-addresses => crypto/addresses}/src/address/validator_address.rs (100%) rename crates/{sargon-addresses => crypto/addresses}/src/address/vault_address.rs (100%) rename crates/{sargon-addresses => crypto/addresses}/src/address/wrap_ret_address.rs (98%) rename crates/{sargon-addresses => crypto/addresses}/src/address_conversion/addresses_manifest_builder_support.rs (98%) rename crates/{sargon-addresses => crypto/addresses}/src/address_conversion/mod.rs (100%) rename crates/{sargon-addresses => crypto/addresses}/src/address_conversion/resource_address_from.rs (100%) rename crates/{sargon-addresses => crypto/addresses}/src/lib.rs (85%) rename crates/{sargon-addresses => crypto/addresses}/src/resource/mod.rs (100%) rename crates/{sargon-addresses => crypto/addresses}/src/resource/resource_or_non_fungible.rs (100%) create mode 100644 crates/crypto/ecc/Cargo.toml rename crates/{sargon-core/src/types => crypto/ecc/src}/keys/ed25519/mod.rs (100%) rename crates/{sargon-core/src/types => crypto/ecc/src}/keys/ed25519/private_key.rs (100%) rename crates/{sargon-core/src/types => crypto/ecc/src}/keys/ed25519/public_key.rs (100%) rename crates/{sargon-core/src/types => crypto/ecc/src}/keys/is_private_key.rs (100%) rename crates/{sargon-core/src/types => crypto/ecc/src}/keys/is_public_key.rs (100%) rename crates/{sargon-core/src/types => crypto/ecc/src}/keys/key_agreement/mod.rs (100%) rename crates/{sargon-core/src/types => crypto/ecc/src}/keys/key_agreement/private_key.rs (100%) rename crates/{sargon-core/src/types => crypto/ecc/src}/keys/key_agreement/public_key.rs (100%) rename crates/{sargon-core/src/types => crypto/ecc/src}/keys/mod.rs (100%) rename crates/{sargon-core/src/types => crypto/ecc/src}/keys/private_key.rs (100%) rename crates/{sargon-core/src/types => crypto/ecc/src}/keys/public_key.rs (99%) rename crates/{sargon-core/src/types => crypto/ecc/src}/keys/secp256k1/mod.rs (100%) rename crates/{sargon-core/src/types => crypto/ecc/src}/keys/secp256k1/private_key.rs (100%) rename crates/{sargon-core/src/types => crypto/ecc/src}/keys/secp256k1/public_key.rs (100%) rename crates/{sargon-core/src/types => crypto/ecc/src}/keys/slip10_curve.rs (100%) create mode 100644 crates/crypto/ecc/src/lib.rs rename crates/{sargon-core/src/types => crypto/ecc/src}/signatures/ed25519_signature.rs (100%) rename crates/{sargon-core/src/types => crypto/ecc/src}/signatures/mod.rs (100%) rename crates/{sargon-core/src/types => crypto/ecc/src}/signatures/secp256k1_signature.rs (100%) rename crates/{sargon-core/src/types => crypto/ecc/src}/signatures/signature.rs (100%) rename crates/{sargon-core/src/types => crypto/ecc/src}/signatures/signature_with_public_key.rs (100%) create mode 100644 crates/crypto/encryption/Cargo.toml rename crates/{sargon-core => crypto/encryption}/src/encryption/aes_gcm_256.rs (100%) rename crates/{sargon-core => crypto/encryption}/src/encryption/aes_gcm_sealed_box.rs (100%) rename crates/{sargon-core => crypto/encryption}/src/encryption/encryption_key.rs (100%) rename crates/{sargon-core => crypto/encryption}/src/encryption/encryption_scheme.rs (98%) rename crates/{sargon-core => crypto/encryption}/src/encryption/encryption_scheme_version.rs (84%) rename crates/{sargon-core => crypto/encryption}/src/encryption/mod.rs (100%) rename crates/{sargon-core => crypto/encryption}/src/encryption/version_of_algorithm.rs (100%) rename crates/{sargon-core => crypto/encryption}/src/encryption/versioned_encryption.rs (100%) rename crates/{sargon-profile/src/encrypted => crypto/encryption/src}/key_derivation/mod.rs (100%) rename crates/{sargon-profile/src/encrypted => crypto/encryption/src}/key_derivation/password_based_key_derivation_scheme.rs (98%) rename crates/{sargon-profile/src/encrypted => crypto/encryption/src}/key_derivation/password_based_key_derivation_scheme_version.rs (90%) rename crates/{sargon-profile/src/encrypted => crypto/encryption/src}/key_derivation/versioned_password_based_key_derivation.rs (100%) create mode 100644 crates/crypto/encryption/src/lib.rs rename crates/{sargon-profile/src/encrypted => crypto/encryption/src}/pb_hkdf_sha256.rs (90%) rename crates/{sargon-profile/src/encrypted => crypto/encryption/src}/versioned_algorithm.rs (100%) create mode 100644 crates/crypto/hash/Cargo.toml rename crates/{sargon-core => crypto/hash}/src/hash.rs (91%) create mode 100644 crates/crypto/hash/src/lib.rs rename crates/{sargon-hierarchical-deterministic => crypto/hd}/Cargo.toml (52%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip32/hd_path.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip32/hd_path_component.rs (99%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip32/key_space/components/hardened.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip32/key_space/components/mod.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip32/key_space/components/securified.rs (99%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip32/key_space/components/unhardened.rs (99%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip32/key_space/components/unsecurified.rs (99%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip32/key_space/components/unsecurified_hardened.rs (99%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip32/key_space/key_space.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip32/key_space/mod.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip32/key_space/traits/add_via_global.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip32/key_space/traits/from_global_key_space.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip32/key_space/traits/from_local_key_space.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip32/key_space/traits/has_offset_from_global_key_space.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip32/key_space/traits/is_in_local_key_space.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip32/key_space/traits/is_mappable_to_global_key_space.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip32/key_space/traits/mod.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip32/mod.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip32/traits/from_bip32_str.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip32/traits/is_path_component_string_convertible.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip32/traits/is_security_state_aware.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip32/traits/mod.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip32/traits/to_bip32_str.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip39/bip39_entropy.rs (99%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip39/bip39_passphrase.rs (83%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip39/bip39_seed.rs (99%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip39/bip39_word/bip39_language.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip39/bip39_word/bip39_word.rs (99%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip39/bip39_word/mod.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip39/bip39_word/u11.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip39/bip39_word_count.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip39/mnemonic.rs (98%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip39/mod.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip44/bip44_like_path.rs (99%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/bip44/mod.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/cap26/cap26_entity_kind.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/cap26/cap26_key_kind.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/cap26/mod.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/cap26/paths/account_path.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/cap26/paths/get_id_path.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/cap26/paths/identity_path.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/cap26/paths/mod.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/cap26/paths/traits.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/cap26/paths/unvalidated_cap26_path.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/derivation/derivation_path.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/derivation/derivation_path_scheme.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/derivation/has_derivation_path_scheme.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/derivation/hierarchical_deterministic_private_key.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/derivation/hierarchical_deterministic_public_key.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/derivation/mnemonic_with_passphrase.rs (95%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/derivation/mod.rs (100%) rename crates/{sargon-hierarchical-deterministic => crypto/hd}/src/has_key_kind.rs (100%) create mode 100644 crates/crypto/hd/src/lib.rs create mode 100644 crates/factors/factors/Cargo.toml rename crates/{sargon-factors => factors/factors}/build.rs (100%) rename crates/{sargon-factors => factors/factors}/fixtures/vector/security_questions_factor_source_sample.json (100%) rename crates/{sargon-factors => factors/factors}/fixtures/vector/security_questions_factor_source_sample_other.json (100%) rename crates/{sargon-factors => factors/factors}/src/factor_instance/badge_virtual_source.rs (99%) rename crates/{sargon-factors => factors/factors}/src/factor_instance/factor_instance.rs (100%) rename crates/{sargon-factors => factors/factors}/src/factor_instance/factor_instance_badge.rs (99%) rename crates/{sargon-factors => factors/factors}/src/factor_instance/factor_instances.rs (98%) rename crates/{sargon-factors => factors/factors}/src/factor_instance/mod.rs (100%) rename crates/{sargon-factors => factors/factors}/src/factor_instance/private_hierarchical_deterministic_factor_instance.rs (100%) rename crates/{sargon-factors => factors/factors}/src/factor_source.rs (99%) rename crates/{sargon-factors => factors/factors}/src/factor_source_category.rs (100%) rename crates/{sargon-factors => factors/factors}/src/factor_source_common.rs (99%) rename crates/{sargon-factors => factors/factors}/src/factor_source_crypto_parameters.rs (100%) rename crates/{sargon-factors => factors/factors}/src/factor_source_flag.rs (100%) rename crates/{sargon-factors => factors/factors}/src/factor_source_id.rs (100%) rename crates/{sargon-factors => factors/factors}/src/factor_source_id_from_address.rs (98%) rename crates/{sargon-factors => factors/factors}/src/factor_source_id_from_hash.rs (99%) rename crates/{sargon-factors => factors/factors}/src/factor_source_kind.rs (99%) rename crates/{sargon-factors => factors/factors}/src/factor_sources/device_factor_source/device_factor_source.rs (99%) rename crates/{sargon-factors => factors/factors}/src/factor_sources/device_factor_source/device_factor_source_hint.rs (99%) rename crates/{sargon-factors => factors/factors}/src/factor_sources/device_factor_source/mod.rs (100%) rename crates/{sargon-factors => factors/factors}/src/factor_sources/factor_sources.rs (100%) rename crates/{sargon-factors => factors/factors}/src/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_factor_source.rs (100%) rename crates/{sargon-factors => factors/factors}/src/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_hint.rs (100%) rename crates/{sargon-factors => factors/factors}/src/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_model.rs (95%) rename crates/{sargon-factors => factors/factors}/src/factor_sources/ledger_hardware_wallet_factor_source/mod.rs (100%) rename crates/{sargon-factors => factors/factors}/src/factor_sources/mod.rs (100%) rename crates/{sargon-factors => factors/factors}/src/factor_sources/private_hierarchical_deterministic_factor_source.rs (94%) rename crates/{sargon-factors => factors/factors}/src/factor_sources_of_kind.rs (99%) rename crates/{sargon-factors => factors/factors}/src/hd_factor_instance_account_creation.rs (100%) rename crates/{sargon-factors => factors/factors}/src/hd_factor_instance_identity_creation.rs (100%) rename crates/{sargon-factors => factors/factors}/src/hd_transaction_signing_factor_instance.rs (99%) rename crates/{sargon-factors => factors/factors}/src/hierarchical_deterministic_factor_instance.rs (100%) rename crates/{sargon-factors => factors/factors}/src/is_entity_path.rs (100%) rename crates/{sargon-factors => factors/factors}/src/is_factor_source.rs (100%) rename crates/{sargon-factors => factors/factors}/src/lib.rs (78%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/arculus_card_factor_source/arculus_card_factor_source.rs (100%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/arculus_card_factor_source/arculus_card_hint.rs (100%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/arculus_card_factor_source/arculus_card_model.rs (96%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/arculus_card_factor_source/mod.rs (100%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/mod.rs (100%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/off_device_mnemonic_factor_source/mod.rs (100%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_factor_source_hint.rs (96%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_mnemonic_factor_source.rs (100%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/password_factor_source/mod.rs (100%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/password_factor_source/password_factor_source.rs (100%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/password_factor_source/password_factor_source_hint.rs (100%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/security_questions_factor_source/answer/mod.rs (100%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/security_questions_factor_source/answer/security_question_and_answer.rs (100%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/security_questions_factor_source/answer/security_questions_and_answers.rs (100%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/security_questions_factor_source/kdf/is_security_questions_kdf_scheme.rs (89%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/security_questions_factor_source/kdf/mod.rs (100%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/security_questions_factor_source/kdf/security_questions_keys_from_questions_and_answer_scheme.rs (99%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/keys_by_diffie_hellman_fold.rs (98%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/mod.rs (100%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/keys_from_questions_and_answers_lower_trim_utf8.rs (100%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/mod.rs (100%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/security_question_and_answer_as_bytes.rs (100%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/security_question_answer_as_bytes.rs (100%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/mod.rs (100%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/security_questions_factor_source/mod.rs (100%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/security_questions_factor_source/question/mod.rs (100%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/security_questions_factor_source/question/security_question.rs (100%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/security_questions_factor_source/question/security_question_kind.rs (100%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/security_questions_factor_source/question/security_questions.rs (100%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/security_questions_factor_source/security_questions_factor_source.rs (99%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/security_questions_factor_source/security_questions_sealed_mnemonic.rs (99%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/trusted_contact_factor_source/mod.rs (100%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source.rs (99%) rename crates/{sargon-factors => factors/factors}/src/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source_contact.rs (96%) rename crates/{sargon-factors => factors/factors}/src/samples/factor_source_id_samples.rs (100%) rename crates/{sargon-factors => factors/factors}/src/samples/factor_source_ids_with_samples.rs (100%) rename crates/{sargon-factors => factors/factors}/src/samples/factor_source_samples.rs (97%) rename crates/{sargon-factors => factors/factors}/src/samples/hierarchical_deterministic_factor_instance_samples.rs (100%) rename crates/{sargon-factors => factors/factors}/src/samples/mod.rs (100%) create mode 100644 crates/factors/instances-provider/Cargo.toml create mode 100644 crates/factors/instances-provider/src/lib.rs rename crates/{sargon-factor-instances-provider => factors/instances-provider}/src/next_index_assigner/mod.rs (100%) rename crates/{sargon-factor-instances-provider => factors/instances-provider}/src/next_index_assigner/next_derivation_entity_index_assigner.rs (100%) rename crates/{sargon-factor-instances-provider => factors/instances-provider}/src/next_index_assigner/next_derivation_entity_index_cache_analyzing_assigner.rs (100%) rename crates/{sargon-factor-instances-provider => factors/instances-provider}/src/next_index_assigner/next_derivation_entity_index_profile_analyzing_assigner.rs (100%) rename crates/{sargon-factor-instances-provider => factors/instances-provider}/src/provider/factor_instances_provider.rs (100%) rename crates/{sargon-factor-instances-provider => factors/instances-provider}/src/provider/instances_in_cache_consumer.rs (100%) rename crates/{sargon-factor-instances-provider => factors/instances-provider}/src/provider/mod.rs (100%) rename crates/{sargon-factor-instances-provider => factors/instances-provider}/src/provider/outcome/factor_instances_provider_outcome.rs (100%) rename crates/{sargon-factor-instances-provider => factors/instances-provider}/src/provider/outcome/factor_instances_provider_outcome_for_factor.rs (100%) rename crates/{sargon-factor-instances-provider => factors/instances-provider}/src/provider/outcome/internal_factor_instances_provider_outcome.rs (100%) rename crates/{sargon-factor-instances-provider => factors/instances-provider}/src/provider/outcome/internal_factor_instances_provider_outcome_for_factor.rs (100%) rename crates/{sargon-factor-instances-provider => factors/instances-provider}/src/provider/outcome/mod.rs (100%) rename crates/{sargon-factor-instances-provider => factors/instances-provider}/src/provider/provider_adopters/cache_filler.rs (100%) rename crates/{sargon-factor-instances-provider => factors/instances-provider}/src/provider/provider_adopters/mod.rs (100%) rename crates/{sargon-factor-instances-provider => factors/instances-provider}/src/provider/provider_adopters/securify_entity_factor_instances_provider.rs (100%) rename crates/{sargon-factor-instances-provider => factors/instances-provider}/src/provider/provider_adopters/virtual_entity_creating_instance_provider.rs (99%) rename crates/{sargon-factor-instances-provider => factors/instances-provider}/src/types/mod.rs (100%) rename crates/{sargon-factor-instances-provider => factors/instances-provider}/src/types/test_derivation_interactor_from_secure_storage_client.rs (100%) create mode 100644 crates/factors/keys-collector/Cargo.toml rename crates/{sargon-keys-collector => factors/keys-collector}/src/collector/derivation_purpose.rs (98%) rename crates/{sargon-keys-collector => factors/keys-collector}/src/collector/key_derivation_outcome.rs (96%) rename crates/{sargon-keys-collector => factors/keys-collector}/src/collector/key_ring.rs (100%) rename crates/{sargon-keys-collector => factors/keys-collector}/src/collector/keys_collector.rs (100%) rename crates/{sargon-keys-collector => factors/keys-collector}/src/collector/keys_collector_dependencies.rs (100%) rename crates/{sargon-keys-collector => factors/keys-collector}/src/collector/keys_collector_preprocessor.rs (100%) rename crates/{sargon-keys-collector => factors/keys-collector}/src/collector/keys_collector_state.rs (100%) rename crates/{sargon-keys-collector => factors/keys-collector}/src/collector/mod.rs (100%) rename crates/{sargon-keys-collector => factors/keys-collector}/src/derivation_testing/mod.rs (100%) rename crates/{sargon-keys-collector => factors/keys-collector}/src/derivation_testing/stateless_dummy_indices.rs (95%) rename crates/{sargon-keys-collector => factors/keys-collector}/src/derivation_testing/test_keys_collector/mod.rs (100%) rename crates/{sargon-keys-collector => factors/keys-collector}/src/derivation_testing/test_keys_collector/test_derivation_interactor.rs (100%) rename crates/{sargon-keys-collector => factors/keys-collector}/src/derivation_testing/test_keys_collector/test_keys_collector.rs (98%) rename crates/{sargon-keys-collector => factors/keys-collector}/src/host_interaction/key_derivation_interactor.rs (100%) rename crates/{sargon-keys-collector => factors/keys-collector}/src/host_interaction/key_derivation_request.rs (100%) rename crates/{sargon-keys-collector => factors/keys-collector}/src/host_interaction/key_derivation_response.rs (100%) rename crates/{sargon-keys-collector => factors/keys-collector}/src/host_interaction/mod.rs (100%) create mode 100644 crates/factors/keys-collector/src/lib.rs rename crates/{sargon-keys-collector => factors/keys-collector}/src/tests/derivation_tests.rs (99%) rename crates/{sargon-keys-collector => factors/keys-collector}/src/tests/mod.rs (100%) create mode 100644 crates/factors/next-derivation-index-ephemeral/Cargo.toml rename crates/{ => factors}/next-derivation-index-ephemeral/src/agnostic_paths/derivation_preset.rs (100%) rename crates/{ => factors}/next-derivation-index-ephemeral/src/agnostic_paths/index_agnostic_path.rs (100%) rename crates/{ => factors}/next-derivation-index-ephemeral/src/agnostic_paths/mod.rs (100%) rename crates/{ => factors}/next-derivation-index-ephemeral/src/agnostic_paths/quantified_derivation_preset.rs (100%) rename crates/{ => factors}/next-derivation-index-ephemeral/src/agnostic_paths/quantities.rs (100%) create mode 100644 crates/factors/next-derivation-index-ephemeral/src/lib.rs rename crates/{ => factors}/next-derivation-index-ephemeral/src/next_derivation_entity_index_with_ephemeral_offsets.rs (100%) rename crates/{ => factors}/next-derivation-index-ephemeral/src/next_derivation_entity_index_with_ephemeral_offsets_for_factor_source.rs (100%) create mode 100644 crates/factors/supporting-types/Cargo.toml create mode 100644 crates/factors/supporting-types/src/lib.rs rename crates/{sargon-factors-supporting-types => factors/supporting-types}/src/mnemonic_loading.rs (100%) delete mode 100644 crates/gateway-client-and-api/Cargo.toml create mode 100644 crates/gateway/client-and-api/Cargo.toml rename crates/{gateway-client-and-api => gateway/client-and-api}/src/assert_network_request.rs (100%) rename crates/{gateway-client-and-api => gateway/client-and-api}/src/client/gateway_client.rs (99%) rename crates/{gateway-client-and-api => gateway/client-and-api}/src/client/gateway_client_dispatch_request.rs (100%) rename crates/{gateway-client-and-api => gateway/client-and-api}/src/client/mod.rs (100%) rename crates/{gateway-client-and-api => gateway/client-and-api}/src/endpoints/mod.rs (100%) rename crates/{gateway-client-and-api => gateway/client-and-api}/src/endpoints/state_endpoints.rs (100%) rename crates/{gateway-client-and-api => gateway/client-and-api}/src/endpoints/status_endpoints.rs (100%) rename crates/{gateway-client-and-api => gateway/client-and-api}/src/endpoints/transaction_endpoints.rs (100%) rename crates/{gateway-client-and-api => gateway/client-and-api}/src/lib.rs (54%) rename crates/{gateway-client-and-api => gateway/client-and-api}/src/methods/mod.rs (100%) rename crates/{gateway-client-and-api => gateway/client-and-api}/src/methods/page_methods.rs (99%) rename crates/{gateway-client-and-api => gateway/client-and-api}/src/methods/state_methods.rs (99%) rename crates/{gateway-client-and-api => gateway/client-and-api}/src/methods/transaction_methods.rs (100%) rename crates/{gateway-models => gateway/models}/Cargo.toml (55%) rename crates/{gateway-models => gateway/models}/build.rs (100%) rename crates/{gateway-models => gateway/models}/fixtures/models/state/request_entity_details__single_account_no_assets.json (100%) rename crates/{gateway-models => gateway/models}/fixtures/models/state/request_entity_details__single_resource.json (100%) rename crates/{gateway-models => gateway/models}/fixtures/models/state/request_entity_details__two_accounts.json (100%) rename crates/{gateway-models => gateway/models}/fixtures/models/state/response_entity_details__single_account_many_nfts_and_fungibles.json (100%) rename crates/{gateway-models => gateway/models}/fixtures/models/state/response_entity_details__single_account_no_assets.json (100%) rename crates/{gateway-models => gateway/models}/fixtures/models/state/response_entity_details__single_resource.json (100%) rename crates/{gateway-models => gateway/models}/fixtures/models/state/response_entity_details__single_resource_no_metadata.json (100%) rename crates/{gateway-models => gateway/models}/fixtures/models/state/response_entity_details__two_accounts.json (100%) rename crates/{gateway-models => gateway/models}/fixtures/models/state/response_entity_details_details__fungible_resource.json (100%) rename crates/{gateway-models => gateway/models}/fixtures/models/state/response_entity_details_details__non_fungible_resource.json (100%) rename crates/{gateway-models => gateway/models}/fixtures/models/transaction/request_preview.json (100%) rename crates/{gateway-models => gateway/models}/fixtures/models/transaction/request_status.json (100%) rename crates/{gateway-models => gateway/models}/fixtures/models/transaction/request_submit.json (100%) rename crates/{gateway-models => gateway/models}/fixtures/models/transaction/response_construction.json (100%) rename crates/{gateway-models => gateway/models}/fixtures/models/transaction/response_preview.json (100%) rename crates/{gateway-models => gateway/models}/fixtures/models/transaction/response_status__committed_success.json (100%) rename crates/{gateway-models => gateway/models}/fixtures/models/transaction/response_status__pending.json (100%) rename crates/{gateway-models => gateway/models}/fixtures/models/transaction/response_submit.json (100%) rename crates/{gateway-models => gateway/models}/src/lib.rs (92%) rename crates/{gateway-models => gateway/models}/src/types/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/request/gw_public_key.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/request/gw_public_key_serde.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/request/ledger_state_selector.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/request/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/request/state/account/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/request/state/account/page/authorized_depositors.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/request/state/account/page/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/request/state/account/page/resource_preferences.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/request/state/entity/details/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/request/state/entity/details/opt_ins.rs (93%) rename crates/{gateway-models => gateway/models}/src/types/request/state/entity/details/request.rs (98%) rename crates/{gateway-models => gateway/models}/src/types/request/state/entity/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/request/state/entity/page/fungibles.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/request/state/entity/page/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/request/state/entity/page/non_fungible_vault_ids.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/request/state/entity/page/non_fungible_vaults.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/request/state/entity/page/non_fungibles.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/request/state/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/request/state/non_fungible/location.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/request/state/non_fungible/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/request/transaction/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/request/transaction/preview/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/request/transaction/preview/opt_ins.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/request/transaction/preview/opt_ins_v2.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/request/transaction/preview/request_flags.rs (98%) rename crates/{gateway-models => gateway/models}/src/types/request/transaction/preview/transaction_preview.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/request/transaction/preview/transaction_preview_v2.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/request/transaction/status/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/request/transaction/status/subintent_status.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/request/transaction/status/transaction_status.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/request/transaction/submit/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/request/transaction/submit/transaction_submit.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/ledger_state.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/page_response.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/account/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/account/page/authorized_depositor.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/account/page/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/account/page/resource_preference.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/details/item.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/details/item_component.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/details/item_fungible_resource.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/details/item_non_fungible_resource.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/details/item_package.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/details/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/details/role_assignments/assignment.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/details/role_assignments/collection.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/details/role_assignments/entry.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/details/role_assignments/explicit_rule.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/details/role_assignments/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/details/role_assignments/module.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/details/role_assignments/owner.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/details/role_assignments/resolution.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/details/role_assignments/role_key.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/fungible/collection.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/fungible/collection_item.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/fungible/collection_item_global.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/fungible/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/metadata/collection.rs (96%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/metadata/item.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/metadata/item_value.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/metadata/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/metadata/typed_value.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/non_fungible/collection.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/non_fungible/collection_item.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/non_fungible/collection_item_global.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/non_fungible/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/response.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/details/response_item.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/page/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/entity/page/non_fungible_vault_item.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/non_fungible/location.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/state/non_fungible/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/status/gateway_status.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/status/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/transaction/construction/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/transaction/construction/transaction_construction_response.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/transaction/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/transaction/preview/logs_inner.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/transaction/preview/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/transaction/preview/transaction_preview_response.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/transaction/preview/transaction_preview_response_v2.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/transaction/preview/transaction_receipt.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/transaction/preview/transaction_receipt_status.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/transaction/status/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/transaction/status/payload_item.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/transaction/status/payload_status.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/transaction/status/transaction_status.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/transaction/subintent_status/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/transaction/subintent_status/response.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/transaction/subintent_status/status.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/transaction/submit/mod.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/response/transaction/submit/submit.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/support/fetch_resources_output.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/support/fetch_transferable_resources_output.rs (100%) rename crates/{gateway-models => gateway/models}/src/types/support/mod.rs (100%) delete mode 100644 crates/http-client/src/lib.rs delete mode 100644 crates/next-derivation-index-ephemeral/Cargo.toml delete mode 100644 crates/next-derivation-index-ephemeral/src/lib.rs create mode 100644 crates/profile/logic/logic_SPLIT_ME/Cargo.toml create mode 100644 crates/profile/logic/logic_SPLIT_ME/src/lib.rs rename crates/{sargon-profile-logic => profile/logic/logic_SPLIT_ME}/src/logic/account/account_visibility.rs (100%) rename crates/{sargon-profile-logic => profile/logic/logic_SPLIT_ME}/src/logic/account/accounts_visibility.rs (100%) rename crates/{sargon-profile-logic => profile/logic/logic_SPLIT_ME}/src/logic/account/mod.rs (100%) rename crates/{sargon-profile-logic => profile/logic/logic_SPLIT_ME}/src/logic/account/query_accounts.rs (100%) rename crates/{sargon-profile-logic => profile/logic/logic_SPLIT_ME}/src/logic/account/query_security_structures.rs (100%) rename crates/{sargon-profile-logic => profile/logic/logic_SPLIT_ME}/src/logic/authorized_dapps_logic.rs (100%) rename crates/{sargon-profile-logic => profile/logic/logic_SPLIT_ME}/src/logic/gateway/current_gateway.rs (100%) rename crates/{sargon-profile-logic => profile/logic/logic_SPLIT_ME}/src/logic/gateway/mod.rs (100%) rename crates/{sargon-profile-logic => profile/logic/logic_SPLIT_ME}/src/logic/instances_deriving_with_factor_sources.rs (100%) rename crates/{sargon-profile-logic => profile/logic/logic_SPLIT_ME}/src/logic/mod.rs (100%) rename crates/{sargon-profile-logic => profile/logic/logic_SPLIT_ME}/src/logic/persona/mod.rs (100%) rename crates/{sargon-profile-logic => profile/logic/logic_SPLIT_ME}/src/logic/persona/persona_data_ids.rs (100%) rename crates/{sargon-profile-logic => profile/logic/logic_SPLIT_ME}/src/logic/persona/query_personas.rs (100%) rename crates/{sargon-profile-logic => profile/logic/logic_SPLIT_ME}/src/logic/persona/shared_persona_data_ids.rs (100%) rename crates/{sargon-profile-logic => profile/logic/logic_SPLIT_ME}/src/logic/profile_header.rs (98%) rename crates/{sargon-profile-logic => profile/logic/logic_SPLIT_ME}/src/logic/profile_network/mod.rs (100%) rename crates/{sargon-profile-logic => profile/logic/logic_SPLIT_ME}/src/logic/profile_network/profile_network_details.rs (99%) rename crates/{sargon-profile-logic => profile/logic/logic_SPLIT_ME}/src/logic/profile_network/profile_network_entities_linked_to_factor_source.rs (100%) rename crates/{sargon-profile-logic => profile/logic/logic_SPLIT_ME}/src/logic/profile_network/profile_network_get_entities.rs (100%) rename crates/{sargon-profile-logic => profile/logic/logic_SPLIT_ME}/src/logic/profile_networks.rs (100%) rename crates/{sargon-profile-logic => profile/logic/logic_SPLIT_ME}/src/logic/profile_update.rs (99%) rename crates/{sargon-profile-logic => profile/logic/logic_SPLIT_ME}/src/logic/query_factor_sources.rs (100%) rename crates/{sargon-profile-logic => profile/logic/logic_SPLIT_ME}/src/tests/matrix_of_factor_instances_index_agnostic.rs (100%) rename crates/{sargon-profile-logic => profile/logic/logic_SPLIT_ME}/src/tests/mod.rs (100%) create mode 100644 crates/profile/models/account-for-display/Cargo.toml rename crates/{sargon-profile/src/supporting_types => profile/models/account-for-display/src}/account_for_display.rs (78%) create mode 100644 crates/profile/models/account-for-display/src/lib.rs create mode 100644 crates/profile/models/app-preferences/Cargo.toml rename crates/{sargon-profile-app-preferences => profile/models/app-preferences}/src/app_display_settings/app_display_settings.rs (100%) rename crates/{sargon-profile-app-preferences => profile/models/app-preferences}/src/app_display_settings/fiat_currency.rs (100%) rename crates/{sargon-profile-app-preferences => profile/models/app-preferences}/src/app_display_settings/mod.rs (100%) rename crates/{sargon-profile-app-preferences => profile/models/app-preferences}/src/app_preferences.rs (100%) rename crates/{sargon-profile-app-preferences => profile/models/app-preferences}/src/lib.rs (60%) rename crates/{sargon-profile-app-preferences => profile/models/app-preferences}/src/security.rs (99%) rename crates/{sargon-profile-app-preferences => profile/models/app-preferences}/src/transaction_preferences.rs (100%) create mode 100644 crates/profile/models/gateway/Cargo.toml rename crates/{sargon-profile-gateway => profile/models/gateway}/src/gateway.rs (99%) create mode 100644 crates/profile/models/gateway/src/lib.rs rename crates/{sargon-profile-gateway => profile/models/gateway}/src/network_definition.rs (99%) rename crates/{sargon-profile-gateway => profile/models/gateway}/src/saved_gateways.rs (99%) create mode 100644 crates/profile/models/profile_SPLIT_ME/Cargo.toml rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/build.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/fixtures/vector/huge_profile_1000_accounts.json (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/fixtures/vector/multi_profile_snapshots_test_version_100_patch_after_app_version_120.json (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/fixtures/vector/only_plaintext_profile_snapshot_version_100.json (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/fixtures/vector/profile_encrypted_by_password_empty.json (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/fixtures/vector/profile_encrypted_by_password_of_babylon.json (100%) rename crates/{sargon-profile/src/encrypted => profile/models/profile_SPLIT_ME/src}/encrypted_profile/encrypted_profile_snapshot.rs (97%) rename crates/{sargon-profile/src/encrypted => profile/models/profile_SPLIT_ME/src}/encrypted_profile/mod.rs (100%) create mode 100644 crates/profile/models/profile_SPLIT_ME/src/lib.rs rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/profilesnapshot_version.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/samples/access_controller_address_samples.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/samples/account_address_samples.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/samples/account_samples.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/samples/identity_address_samples.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/samples/mod.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/samples/persona_samples.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/samples/profile_samples.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/supporting_types/account_or_persona.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/supporting_types/accounts_for_display.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/supporting_types/accounts_or_personas.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/supporting_types/authorized_dapp_detailed.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/supporting_types/authorized_persona_detailed.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/supporting_types/detailed_authorized_personas.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/supporting_types/mod.rs (88%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/supporting_types/on_same_network_validating.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entities_linked_to_factor_source/entities_linked_to_factor_source.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entities_linked_to_factor_source/integrity/device.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entities_linked_to_factor_source/integrity/integrity.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entities_linked_to_factor_source/integrity/mod.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entities_linked_to_factor_source/mod.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entities_linked_to_factor_source/profile_to_check.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entity/abstract_entity_type.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entity/account/account.rs (97%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entity/account/mod.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entity/account/on_ledger_settings/mod.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entity/account/on_ledger_settings/on_ledger_settings.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entity/entity_flag.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entity/entity_flags.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entity/has_security_state.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entity/is_entity.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entity/mod.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entity/persona/mod.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entity/persona/persona.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entity/persona/persona_data/collection_of_email_addresses.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entity/persona/persona_data/collection_of_phone_numbers.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entity/persona/persona_data/entry_kinds/mod.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_email_address.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_name.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_phone_number.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entity/persona/persona_data/mod.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entity/persona/persona_data/persona_data.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entity/persona/persona_data/persona_data_entry_id.rs (99%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entity/persona/persona_data/persona_data_identified_collection_types.rs (99%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entity/persona/persona_data/persona_data_identified_entry_types.rs (99%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entity_security_state/entity_security_state.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entity_security_state/mod.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entity_security_state/provisional_securified_config.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entity_security_state/provisional_securified_transaction_queued.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/entity_security_state/unsecured_entity_control.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/header/content_hint.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/header/device_info.rs (99%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/header/header.rs (99%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/header/mod.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/header/profile_id.rs (98%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/mod.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/networks/mod.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/networks/network/accounts.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/networks/network/authorized_dapp/authorized_dapp.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/networks/network/authorized_dapp/authorized_persona_simple.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/networks/network/authorized_dapp/mod.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/networks/network/authorized_dapp/preferences/authorized_dapp_preference_deposits.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/networks/network/authorized_dapp/preferences/authorized_dapp_preferences.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/networks/network/authorized_dapp/preferences/mod.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/networks/network/authorized_dapp/references_to_authorized_personas.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/networks/network/authorized_dapp/shared_persona_data.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_account_addresses.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_ids_of_persona_data_entries.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/networks/network/authorized_dapp/shared_with_dapp.rs (99%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/networks/network/authorized_dapps.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/networks/network/mod.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/networks/network/personas.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/networks/network/profile_network.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/networks/network/resource_preferences/hidden_resources.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/networks/network/resource_preferences/mod.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/networks/network/resource_preferences/resource_app_preference.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/networks/network/resource_preferences/resource_identifier.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/networks/network/resource_preferences/resource_preferences.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/networks/network/resource_preferences/resource_visibility.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/networks/profile_networks.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/profile.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/profile_file_contents.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/proto_profile_maybe_with_legacy_p2p_links.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/secured_entity_control/mod.rs (100%) rename crates/{sargon-profile => profile/models/profile_SPLIT_ME}/src/v100/secured_entity_control/secured_entity_control.rs (100%) create mode 100644 crates/profile/models/security-structures/Cargo.toml rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/factor_list_kind.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/lib.rs (54%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/role_kind.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/automatic_shield_builder/auto_build_outcome_for_testing.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/automatic_shield_builder/automatic_shield_builder.rs (99%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/automatic_shield_builder/factor_selector.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/automatic_shield_builder/mod.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/automatic_shield_builder/proto_shield.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/automatic_shield_builder/quantity.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/general_role_with_hd_factor_instance_samples.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/has_role_kind.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/matrices/abstract_matrix_builder_or_built.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/matrices/builder/error.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/matrices/builder/matrix_builder.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/matrices/builder/matrix_builder_unit_tests.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/matrices/builder/matrix_template.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/matrices/builder/mod.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/matrices/matrix_of_factor_instances.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/matrices/matrix_of_factor_source_ids.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/matrices/matrix_of_factor_sources.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/matrices/mod.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/mod.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/roles/abstract_role_builder_or_built.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/roles/builder/confirmation_roles_builder_unit_tests.rs (99%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/roles/builder/mod.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/roles/builder/primary_roles_builder_unit_tests.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/roles/builder/recovery_roles_builder_unit_tests.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/roles/builder/roles_builder.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/roles/builder/roles_builder_unit_tests.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/confirmation_role_with_factor_instances.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/general_role_with_hierarchical_deterministic_factor_instances.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/mod.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/primary_role_with_factor_instances.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/recovery_role_with_factor_instances.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/role_into_scrypto_access_rule.rs (91%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/role_with_factor_instances.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/confirmation_role_with_factor_source_ids.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/mod.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/primary_role_with_factor_source_ids.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/recovery_role_with_factor_source_ids.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/roles_with_factor_ids.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/roles/factor_levels/factor_source_kind_level/mod.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/roles/factor_levels/factor_source_kind_level/role_template.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/roles/factor_levels/factor_source_level/confirmation_role_with_factor_sources.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/roles/factor_levels/factor_source_level/mod.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/roles/factor_levels/factor_source_level/primary_role_with_factor_sources.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/roles/factor_levels/factor_source_level/recovery_role_with_factor_sources.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/roles/factor_levels/factor_source_level/roles_with_factor_sources.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/roles/factor_levels/mod.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/roles/mod.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/security_shield_builder.rs (99%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/security_shield_builder_invalid_reason.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/security_shield_prerequisites_status.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/security_structure_id.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/security_structure_metadata.rs (98%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/security_structure_of_factors/abstract_security_structure_of_factors.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/security_structure_of_factors/mod.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/security_structure_of_factors/security_structure_of_factor_instances.rs (99%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/security_structure_of_factors/security_structure_of_factor_source_ids.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/security_structure_of_factors/security_structure_of_factor_sources.rs (100%) rename crates/{sargon-profile-security-structures => profile/models/security-structures}/src/roles_matrices_structures/selected_factor_sources_status.rs (100%) create mode 100644 crates/profile/models/supporting-types/Cargo.toml rename crates/{sargon-profile-supporting-types => profile/models/supporting-types}/src/abstract_securified_entity.rs (100%) rename crates/{sargon-profile-supporting-types => profile/models/supporting-types}/src/any_securified_entity.rs (100%) rename crates/{sargon-profile-supporting-types => profile/models/supporting-types}/src/assert_derivation_path.rs (100%) rename crates/{sargon-profile-supporting-types => profile/models/supporting-types}/src/is_securified_entity.rs (100%) rename crates/{sargon-profile-supporting-types => profile/models/supporting-types}/src/lib.rs (77%) rename crates/{sargon-profile-supporting-types => profile/models/supporting-types}/src/profile_state.rs (100%) rename crates/{sargon-profile-supporting-types => profile/models/supporting-types}/src/securified_account.rs (100%) rename crates/{sargon-profile-supporting-types => profile/models/supporting-types}/src/securified_persona.rs (100%) rename crates/{sargon-profile-supporting-types => profile/models/supporting-types}/src/unsecurified_entity.rs (100%) rename crates/{sargon-profile-supporting-types => profile/models/supporting-types}/src/veci.rs (100%) delete mode 100644 crates/sargon-clients/Cargo.toml delete mode 100644 crates/sargon-clients/src/lib.rs delete mode 100644 crates/sargon-core-utils/src/factory.rs delete mode 100644 crates/sargon-core/Cargo.toml delete mode 100644 crates/sargon-core/src/lib.rs delete mode 100644 crates/sargon-core/src/types/logged_result.rs delete mode 100644 crates/sargon-core/src/types/mod.rs delete mode 100644 crates/sargon-core/src/types/safe_to_log.rs delete mode 100644 crates/sargon-drivers/src/lib.rs delete mode 100644 crates/sargon-factor-instances-provider/Cargo.toml delete mode 100644 crates/sargon-factor-instances-provider/src/lib.rs delete mode 100644 crates/sargon-factors-supporting-types/Cargo.toml delete mode 100644 crates/sargon-factors-supporting-types/src/lib.rs delete mode 100644 crates/sargon-factors/Cargo.toml delete mode 100644 crates/sargon-hierarchical-deterministic/src/lib.rs delete mode 100644 crates/sargon-keys-collector/Cargo.toml delete mode 100644 crates/sargon-keys-collector/src/lib.rs delete mode 100644 crates/sargon-manifests/Cargo.toml delete mode 100644 crates/sargon-profile-app-preferences/Cargo.toml delete mode 100644 crates/sargon-profile-gateway/Cargo.toml delete mode 100644 crates/sargon-profile-gateway/src/lib.rs delete mode 100644 crates/sargon-profile-logic/Cargo.toml delete mode 100644 crates/sargon-profile-logic/src/lib.rs delete mode 100644 crates/sargon-profile-security-structures/Cargo.toml delete mode 100644 crates/sargon-profile-supporting-types/Cargo.toml delete mode 100644 crates/sargon-profile/Cargo.toml delete mode 100644 crates/sargon-profile/src/encrypted/mod.rs delete mode 100644 crates/sargon-profile/src/lib.rs delete mode 100644 crates/sargon-transaction-models/Cargo.toml delete mode 100644 crates/sargon-uniffi/src/hierarchical_deterministic/.DS_Store delete mode 100644 crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/owned_or_third_party_account_address.rs delete mode 100644 crates/sargon/.DS_Store delete mode 100644 crates/sargon/src/needs_a_new_home_dumping_ground/mod.rs delete mode 100644 crates/sargon/target/.DS_Store rename crates/{sargon => sargon_SPLIT_ME}/Cargo.toml (57%) rename crates/{sargon => sargon_SPLIT_ME}/build.rs (100%) rename crates/{sargon-uniffi/src => sargon_SPLIT_ME/fixtures}/Package.swift (100%) rename crates/{sargon => sargon_SPLIT_ME}/fixtures/models/well_known.json (100%) rename crates/{sargon => sargon_SPLIT_ME}/fixtures/vector/big_profile_100_accounts.json (100%) rename crates/{sargon => sargon_SPLIT_ME}/fixtures/vector/bip44_secp256k1.json (100%) rename crates/{sargon => sargon_SPLIT_ME}/fixtures/vector/cap26_curve25519.json (100%) rename crates/{sargon => sargon_SPLIT_ME}/fixtures/vector/cap26_secp256k1.json (100%) rename crates/{sargon => sargon_SPLIT_ME}/fixtures/vector/deep_link_request_params.json (100%) rename crates/{sargon => sargon_SPLIT_ME}/fixtures/vector/multi_profile_snapshots_test_version_100_patch_after_app_version_120.json (100%) rename crates/{sargon => sargon_SPLIT_ME}/fixtures/vector/only_plaintext_profile_snapshot_version_100.json (100%) rename crates/{sargon => sargon_SPLIT_ME}/fixtures/vector/rola_challenge_payload_hash_vectors.json (100%) rename crates/{sargon => sargon_SPLIT_ME}/fixtures/vector/slip10_tests_#10.json (100%) rename crates/{sargon => sargon_SPLIT_ME}/fixtures/vector/slip10_tests_#1000.json (100%) rename crates/{sargon => sargon_SPLIT_ME}/fixtures/vector/wallet_interactions_dapp_to_wallet.json (100%) rename crates/{sargon => sargon_SPLIT_ME}/fixtures/vector/wallet_interactions_wallet_to_dapp.json (100%) rename crates/{sargon-uniffi/tests => sargon_SPLIT_ME/src}/Package.swift (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/home_cards/deferred_deep_link/deferred_deep_link_method.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/home_cards/deferred_deep_link/deferred_deep_link_special_dapp.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/home_cards/deferred_deep_link/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/home_cards/deferred_deep_link/onboarding_deep_link_value.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/home_cards/deferred_deep_link/parser.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/home_cards/home_card.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/home_cards/home_cards.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/home_cards/manager.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/home_cards/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/home_cards/observer.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/home_cards/storage.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/lib.rs (78%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/interaction_id.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/interaction_version.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/mobile/client.rs (99%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/mobile/deep_link_parsing/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/mobile/deep_link_parsing/parser.rs (99%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/mobile/deep_link_parsing/request.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/mobile/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/mobile/relay_service/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/mobile/relay_service/service.rs (98%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/mobile/relay_service/success_response.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/mobile/session/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/mobile/session/session.rs (99%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/mobile/session/session_id.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/mobile/session/session_origin.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/mobile/session_dapp_request.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/mobile/session_storage.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/mobile/session_wallet_response.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/p2p_links/link_connection_qr_data.rs (100%) rename crates/{sargon-uniffi => sargon_SPLIT_ME}/src/radix_connect/p2p_links/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/p2p_links/p2p_link.rs (95%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/p2p_links/p2p_links.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/p2p_links/radix_connect_password.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/p2p_links/radix_connect_purpose.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_account.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/auth_challenge_nonce.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/interaction_metadata.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/interaction_metadata_unvalidated.rs (100%) rename crates/{sargon-uniffi => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/origin.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/items.rs (100%) rename crates/{sargon-uniffi => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/after_delay.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/at_time.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/expiration.rs (100%) rename crates/{sargon-uniffi => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/status.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/pre_authorization.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/subintent.rs (98%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/unvalidated_subintent_manifest.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/auth.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/login_with_challenge.rs (100%) rename crates/{sargon-uniffi => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/use_persona.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/authorized_request.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/accounts.rs (100%) rename crates/{sargon-uniffi => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/persona_data.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/proof_of_ownership.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/reset.rs (100%) rename crates/{sargon-uniffi => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/unauthorized_request.rs (100%) rename crates/{sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response => sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items}/transaction/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/transaction.rs (99%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_unvalidated.rs (100%) rename crates/{sargon-uniffi => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/mod.rs (100%) rename crates/{sargon-uniffi => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/error_type.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/failure.rs (100%) rename crates/{sargon-uniffi => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/mod.rs (100%) rename crates/{sargon-uniffi => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/response.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/account_proof.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/accounts.rs (100%) rename crates/{sargon-uniffi => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_login_with_challenge.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_login_without_challenge.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_proof.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_use_persona.rs (100%) rename crates/{sargon-uniffi => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/authorized_request.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/items.rs (100%) rename crates/{sargon-uniffi => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/mod.rs (100%) rename crates/{sargon-uniffi => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona/persona_proof.rs (100%) rename crates/{sargon-uniffi => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona_data/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona_data/persona_data.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/pre_authorization.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/subintent_response.rs (100%) rename crates/{sargon-uniffi => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/proof.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/proof_of_ownership.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/success.rs (100%) rename crates/{sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items => sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response}/transaction/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/transaction.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/unauthorized_request.rs (100%) rename crates/{sargon-uniffi => sargon_SPLIT_ME}/src/radix_connect/wallet_interaction/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/wallet_persona.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/well_known_client/client.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/well_known_client/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/well_known_client/models/dapp_definition.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/well_known_client/models/dapp_well_known_data.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/radix_connect/well_known_client/models/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/security_center/client.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/security_center/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/security_center/security_problem.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/security_center/security_problem_kind.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/security_center/support/addresses_entities_bad_state.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/security_center/support/backup_result.rs (97%) rename crates/{sargon => sargon_SPLIT_ME}/src/security_center/support/input.rs (100%) rename crates/{sargon-uniffi => sargon_SPLIT_ME}/src/security_center/support/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/authentication/auth_intent.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/authentication/auth_intent_hash.rs (100%) rename crates/{sargon-uniffi => sargon_SPLIT_ME}/src/signing/authentication/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/authentication/signed_auth_intent.rs (82%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/collector/extractor_of_instances_required_to_sign_transactions.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/collector/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/collector/signatures_collecting_continuation.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/collector/signatures_collector.rs (99%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/collector/signatures_collector_dependencies.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/collector/signatures_collector_preprocessor.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/collector/signatures_collector_state.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/collector/signing_finish_early_strategy.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/extractor_of_entities_requiring_auth.rs (99%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/host_interaction/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/host_interaction/sign_interactor.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/host_interaction/sign_request.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/host_interaction/sign_response.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/host_interaction/transaction_sign_request_input.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/petition_types/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/petition_types/petition_for_entity.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/petition_types/petition_for_factors_types/factor_source_referencing.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/petition_types/petition_for_factors_types/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/petition_types/petition_for_factors_types/neglected_factor_instance.rs (99%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/petition_types/petition_for_factors_types/petition_for_factors/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors.rs (99%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_input.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state_snapshot.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_status.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_sub_state.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/petition_types/petition_for_transaction.rs (99%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/petition_types/petition_status.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/petition_types/petitions.rs (99%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/petition_types/signing_purpose.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/signable_with_entities.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/signables/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/signables/signable.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/signables/signable_auth_intent.rs (94%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/signables/signable_subintent.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/signables/signable_transaction_intent.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/signatures_outecome_types/maybe_signed_transactions.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/signatures_outecome_types/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/signatures_outecome_types/petition_transaction_outcome.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/signatures_outecome_types/sign_with_factors_outcome.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/signatures_outecome_types/signatures_outcome.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/testing/interactors/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/testing/interactors/test_interactor.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/testing/interactors/test_sign_interactor.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/testing/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/testing/simulated_user.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/signing/testing/test_signatures_collector.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/bios/bios.rs (100%) rename crates/{sargon-uniffi => sargon_SPLIT_ME}/src/system/bios/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/interactors/interactors.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/interactors/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/interactors/testing/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/interactors/testing/test_use_factor_sources_interactors.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/interactors/use_factor_sources_interactor.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/mod.rs (78%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/sargon_os/delete_account/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/sargon_os/delete_account/sargon_os_delete_account.rs (100%) rename crates/{sargon-clients/src/clients/client/factor_instances_cache_client/models => sargon_SPLIT_ME/src/system/sargon_os/delete_account/support}/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/sargon_os/delete_account/support/outcome.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/sargon_os/entity_creating_with_factor_source_and_derivation_outcome.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/sargon_os/factor_instances_provider_unit_tests.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/sargon_os/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/sargon_os/pre_authorization/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/sargon_os/pre_authorization/sargon_os_create_subintent.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/sargon_os/pre_authorization/sargon_os_pre_authorization_status.rs (100%) rename crates/{sargon-uniffi => sargon_SPLIT_ME}/src/system/sargon_os/pre_authorization/support/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/sargon_os/pre_authorization/support/pre_authorization_status.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/sargon_os/profile_state_holder.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/sargon_os/sargon_os.rs (99%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/sargon_os/sargon_os_accounts.rs (99%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/sargon_os/sargon_os_entities_linked_to_factor_source.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/sargon_os/sargon_os_factors.rs (99%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/sargon_os/sargon_os_gateway.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/sargon_os/sargon_os_personas.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/sargon_os/sargon_os_profile.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/sargon_os/sargon_os_security_center.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/sargon_os/sargon_os_security_structures.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/sargon_os/sargon_os_signing.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/sargon_os/sargon_os_sync_accounts.rs (97%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/sargon_os/transactions/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/sargon_os/transactions/sargon_os_transaction_analysis.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/sargon_os/transactions/sargon_os_transaction_status.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/sargon_os/transactions/sargon_os_transaction_submit.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/sargon_os/transactions/support/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/sargon_os/transactions/support/pre_auth_to_review.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/sargon_os/transactions/support/signable_manifest_summary.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/sargon_os/transactions/support/transaction_to_review.rs (100%) rename crates/{sargon-uniffi => sargon_SPLIT_ME}/src/system/subsystems/README.md (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/system/subsystems/log_system/log_system.rs (100%) rename crates/{sargon-uniffi => sargon_SPLIT_ME}/src/system/subsystems/log_system/mod.rs (100%) rename crates/{sargon-uniffi => sargon_SPLIT_ME}/src/system/subsystems/mod.rs (100%) rename crates/{sargon/src/needs_a_new_home_dumping_ground/diagnose_instance_duplicates.rs => sargon_SPLIT_ME/src/system/test_diagnose_instance_duplicates.rs} (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/types/hd_signature.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/types/hd_signature_input.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/types/invalid_transaction_if_neglected.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/types/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/types/owned_types/mod.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/types/owned_types/owned.rs (100%) rename crates/{sargon => sargon_SPLIT_ME}/src/types/owned_types/owned_factor_instance.rs (100%) rename crates/{sargon/fixtures => sargon_SPLIT_ME/tests}/Package.swift (100%) rename crates/{sargon => sargon_SPLIT_ME}/tests/integration/main.rs (99%) rename crates/{sargon => sargon_SPLIT_ME}/tests/vectors/main.rs (100%) create mode 100644 crates/system/clients/clients/Cargo.toml create mode 100644 crates/system/clients/clients/build.rs rename crates/{sargon-clients => system/clients/clients}/src/clients/README.md (100%) rename crates/{sargon-clients => system/clients/clients}/src/clients/client/entropy_client/entropy_client.rs (100%) rename crates/{sargon-clients => system/clients/clients}/src/clients/client/entropy_client/mod.rs (100%) rename crates/{sargon-clients => system/clients/clients}/src/clients/client/event_bus_client/event_bus_client.rs (100%) rename crates/{sargon-clients => system/clients/clients}/src/clients/client/event_bus_client/mod.rs (100%) rename crates/{sargon-clients => system/clients/clients}/src/clients/client/factor_instances_cache_client/cache/factor_instances_cache.rs (100%) rename crates/{sargon-clients => system/clients/clients}/src/clients/client/factor_instances_cache_client/cache/keyed_instances.rs (100%) rename crates/{sargon-clients => system/clients/clients}/src/clients/client/factor_instances_cache_client/cache/mod.rs (100%) rename crates/{sargon-clients => system/clients/clients}/src/clients/client/factor_instances_cache_client/cache/serializable_cache/factor_instances_cache_snapshot.rs (100%) rename crates/{sargon-clients => system/clients/clients}/src/clients/client/factor_instances_cache_client/cache/serializable_cache/factor_source_id_from_hash_dense_key.rs (100%) rename crates/{sargon-clients => system/clients/clients}/src/clients/client/factor_instances_cache_client/cache/serializable_cache/mod.rs (100%) rename crates/{sargon-clients => system/clients/clients}/src/clients/client/factor_instances_cache_client/client.rs (100%) rename crates/{sargon-clients => system/clients/clients}/src/clients/client/factor_instances_cache_client/mod.rs (100%) rename crates/{sargon-uniffi/src/system/sargon_os/delete_account/support => system/clients/clients/src/clients/client/factor_instances_cache_client/models}/mod.rs (100%) rename crates/{sargon-clients => system/clients/clients}/src/clients/client/factor_instances_cache_client/models/outcome.rs (100%) rename crates/{sargon-clients => system/clients/clients}/src/clients/client/file_system_client/file_system_client.rs (95%) rename crates/{sargon-clients => system/clients/clients}/src/clients/client/file_system_client/mod.rs (100%) rename crates/{sargon-clients => system/clients/clients}/src/clients/client/host_info_client/host_info_client.rs (100%) rename crates/{sargon-clients => system/clients/clients}/src/clients/client/host_info_client/mod.rs (100%) rename crates/{sargon-clients => system/clients/clients}/src/clients/client/mod.rs (100%) rename crates/{sargon-clients => system/clients/clients}/src/clients/client/profile_change_client/mod.rs (100%) rename crates/{sargon-clients => system/clients/clients}/src/clients/client/profile_change_client/profile_change_client.rs (100%) rename crates/{sargon-clients => system/clients/clients}/src/clients/client/secure_storage_client/mod.rs (100%) rename crates/{sargon-clients => system/clients/clients}/src/clients/client/secure_storage_client/secure_storage_client.rs (100%) rename crates/{sargon-clients => system/clients/clients}/src/clients/client/unsafe_storage_client/mod.rs (100%) rename crates/{sargon-clients => system/clients/clients}/src/clients/client/unsafe_storage_client/unsafe_storage_client.rs (100%) rename crates/{sargon-clients => system/clients/clients}/src/clients/clients.rs (100%) rename crates/{sargon-clients => system/clients/clients}/src/clients/mod.rs (100%) create mode 100644 crates/system/clients/clients/src/lib.rs rename crates/{http-client => system/clients/http}/Cargo.toml (63%) rename crates/{http-client => system/clients/http}/src/http_client.rs (100%) create mode 100644 crates/system/clients/http/src/lib.rs rename crates/{sargon-drivers => system/drivers}/Cargo.toml (56%) create mode 100644 crates/system/drivers/build.rs rename crates/{sargon-drivers => system/drivers}/src/drivers/README.md (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/drivers.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/entropy_provider_driver/entropy_provider_driver.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/entropy_provider_driver/mod.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/entropy_provider_driver/support/mod.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/entropy_provider_driver/support/test/mod.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/entropy_provider_driver/support/test/rust_entropy_driver.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/event_bus_driver/event_bus_driver.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/event_bus_driver/mod.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/event_bus_driver/support/event.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/event_bus_driver/support/event_kind.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/event_bus_driver/support/event_notification.rs (96%) rename crates/{sargon-drivers => system/drivers}/src/drivers/event_bus_driver/support/event_profile_modified.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/event_bus_driver/support/has_event_kind.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/event_bus_driver/support/mod.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/event_bus_driver/support/test/mod.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/event_bus_driver/support/test/rust_event_bus_driver.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/file_system_driver/file_system_driver.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/file_system_driver/mod.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/file_system_driver/support/mod.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/file_system_driver/support/test/in_memory_file_system_driver.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/file_system_driver/support/test/mod.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/file_system_driver/support/test/rust_file_system_driver.rs (92%) rename crates/{sargon-drivers => system/drivers}/src/drivers/host_info_driver/host_info_driver.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/host_info_driver/mod.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/host_info_driver/support/mod.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/host_info_driver/support/test/mod.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/host_info_driver/support/test/rust_host_info_driver.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/logging_driver/logging_driver.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/logging_driver/mod.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/logging_driver/support/log_level.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/logging_driver/support/mod.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/logging_driver/support/test/mod.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/logging_driver/support/test/rust_logging_driver.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/mod.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/networking_driver/mod.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/networking_driver/networking_driver.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/networking_driver/support/mod.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/networking_driver/support/network_method.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/networking_driver/support/network_request.rs (99%) rename crates/{sargon-drivers => system/drivers}/src/drivers/networking_driver/support/network_response.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/networking_driver/support/test/mock_networking_driver.rs (99%) rename crates/{sargon-drivers => system/drivers}/src/drivers/networking_driver/support/test/mod.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/networking_driver/support/test/rust_networking_driver.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/profile_change_driver/mod.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/profile_change_driver/profile_change_driver.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/profile_change_driver/support/mod.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/profile_change_driver/support/test/mod.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/profile_change_driver/support/test/rust_profile_change_driver.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/secure_storage_driver/mod.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/secure_storage_driver/secure_storage_driver.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/secure_storage_driver/support/mod.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/secure_storage_driver/support/secure_storage_access_error_kind.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/secure_storage_driver/support/secure_storage_key.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/secure_storage_driver/support/test/ephemeral_secure_storage.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/secure_storage_driver/support/test/fail_secure_storage.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/secure_storage_driver/support/test/mod.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/unsafe_storage_driver/mod.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/unsafe_storage_driver/support/ephemeral_unsafe_storage.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/unsafe_storage_driver/support/mod.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/unsafe_storage_driver/support/unsafe_storage_key.rs (100%) rename crates/{sargon-drivers => system/drivers}/src/drivers/unsafe_storage_driver/unsafe_storage_driver.rs (100%) create mode 100644 crates/system/drivers/src/lib.rs create mode 100644 crates/transaction/foundation/Cargo.toml rename crates/{sargon-core/src/types => transaction/foundation/src}/epoch.rs (100%) rename crates/{sargon-core/src/types => transaction/foundation/src}/intent_discriminator.rs (100%) create mode 100644 crates/transaction/foundation/src/lib.rs rename crates/{sargon-core/src/types => transaction/foundation/src}/nonce.rs (100%) rename crates/{sargon-core/src/types => transaction/foundation/src}/version_type.rs (95%) create mode 100644 crates/transaction/manifests/Cargo.toml rename crates/{sargon-manifests => transaction/manifests}/build.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/fixtures/transaction/account_locker_claim.rtm (100%) rename crates/{sargon-manifests => transaction/manifests}/fixtures/transaction/account_locker_claim_max_nft_items.rtm (100%) rename crates/{sargon-manifests => transaction/manifests}/fixtures/transaction/create_3_nft_collections.rtm (100%) rename crates/{sargon-manifests => transaction/manifests}/fixtures/transaction/create_access_controller_for_account.rtm (100%) rename crates/{sargon-manifests => transaction/manifests}/fixtures/transaction/create_access_controller_for_persona.rtm (100%) rename crates/{sargon-manifests => transaction/manifests}/src/bucket.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/bucket_factory.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/delete_account/delete_account_transfer.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/delete_account/delete_account_transfers.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/delete_account/manifest_delete_account.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/delete_account/mod.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/high_level/mod.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/high_level/sargon_specific_types/account_locker/account_locker_claimable_resource.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/high_level/sargon_specific_types/account_locker/mod.rs (100%) rename crates/{sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/owned_or_third_party_account_address.rs => transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/account_or_address_of.rs} (64%) rename crates/{sargon-manifests => transaction/manifests}/src/high_level/sargon_specific_types/assets_transfers/mod.rs (58%) rename crates/{sargon-manifests => transaction/manifests}/src/high_level/sargon_specific_types/assets_transfers/per_asset/mod.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_fungible_resource.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_fungible_transfer.rs (76%) rename crates/{sargon-manifests => transaction/manifests}/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_non_fungible_transfer.rs (78%) rename crates/{sargon-manifests => transaction/manifests}/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers_of_fungible_resource.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers_of_non_fungible_resource.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/high_level/sargon_specific_types/assets_transfers/per_recipient/mod.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfer.rs (89%) rename crates/{sargon-manifests => transaction/manifests}/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfers.rs (84%) rename crates/{sargon-manifests => transaction/manifests}/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_fungible_transfer.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_non_fungibles_transfer.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/high_level/sargon_specific_types/assets_transfers/transfer_types.rs (94%) rename crates/{sargon-manifests => transaction/manifests}/src/high_level/sargon_specific_types/build_information/dependency_information.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/high_level/sargon_specific_types/build_information/mod.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/high_level/sargon_specific_types/build_information/sargon_build_information.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/high_level/sargon_specific_types/build_information/sargon_dependencies.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/high_level/sargon_specific_types/mod.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/high_level/sargon_specific_types/stake_claim.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/high_level/sargon_specific_types/transaction/mod.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/high_level/sargon_specific_types/transaction/transaction_status.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/high_level/sargon_specific_types/transaction/transaction_status_reason.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/high_level/sargon_specific_types/transaction_guarantee.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/high_level/token_definition_metadata.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/lib.rs (94%) rename crates/{sargon-manifests => transaction/manifests}/src/manifest_account_locker.rs (99%) rename crates/{sargon-manifests => transaction/manifests}/src/manifest_assets_transfers.rs (99%) rename crates/{sargon-manifests => transaction/manifests}/src/manifests.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/manifests_access_controller.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/manifests_create_tokens.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/modify_manifest.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/sample_resource_definition_metadata.json (100%) rename crates/{sargon-manifests => transaction/manifests}/src/third_party_deposit_update/manifest_third_party_deposit_update.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/third_party_deposit_update/mod.rs (100%) rename crates/{sargon-manifests => transaction/manifests}/src/third_party_deposit_update/third_party_deposits_delta.rs (100%) create mode 100644 crates/transaction/models/Cargo.toml rename crates/{sargon-transaction-models => transaction/models}/build.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/account_delete.dat (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/account_delete.rtm (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/account_locker_claim_fungibles_and_non_fungibles.dat (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/account_locker_claim_fungibles_and_non_fungibles.rtm (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/claim_two_stakes_from_one_validator.dat (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/claim_two_stakes_from_one_validator.rtm (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/contribute_to_bi_pool.dat (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/contribute_to_bi_pool.rtm (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/create_3_nft_collections.rtm (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/create_access_controller_for_account.rtm (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/create_access_controller_for_persona.rtm (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/create_nft_collection.dat (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/create_nft_collection.rtm (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/create_pool.dat (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/create_pool.rtm (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/create_single_fungible.dat (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/create_single_fungible.rtm (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/mint_nft_gumball_card.dat (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/mint_nft_gumball_card.rtm (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/multi_account_resource_transfer.rtm (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/multi_account_resource_transfer_subintent.rtm (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/open_subintent_fungibles.rtm (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/open_subintent_mix_multiple_deposits.rtm (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/open_subintent_non_fungibles_no_certain_ids.rtm (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/open_subintent_non_fungibles_with_certain_ids.rtm (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/open_subintent_pool_stakes_stake_claim.rtm (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/present_proof_swap_candy.dat (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/present_proof_swap_candy.rtm (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/redeem_from_bi_pool.dat (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/redeem_from_bi_pool.rtm (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/resource_transfer.rtm (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/resource_transfer_subintent.rtm (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/stake_to_three_validators.dat (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/stake_to_three_validators.rtm (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/third_party_deposits_update.dat (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/third_party_deposits_update.rtm (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/transfer_1to2_multiple_nf_and_f_tokens.dat (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/transfer_1to2_multiple_nf_and_f_tokens.rtm (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/unstake_partially_from_one_validator.dat (100%) rename crates/{sargon-transaction-models => transaction/models}/fixtures/transaction/unstake_partially_from_one_validator.rtm (100%) rename crates/{sargon-transaction-models => transaction/models}/src/assert_manifest.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/error_from.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/is_intent_signing.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/lib.rs (93%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/compiled_notarized_intent.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/compiled_transaction_intent.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/dynamically_analyzable_manifest.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/execution_summary/execution_summary.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/execution_summary/fee_locks.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/execution_summary/fee_summary.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/execution_summary/mod.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/execution_summary/new_entities.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/execution_summary/newly_created_resource.rs (98%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/execution_summary/reserved_instruction.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/execution_summary/resource_indicator/fungible_resource_indicator.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/execution_summary/resource_indicator/mod.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/execution_summary/resource_indicator/non_fungible_resource_indicator.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/execution_summary/resource_indicator/predicted.rs (99%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/execution_summary/resource_indicator/resource_indicator.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/execution_summary/resource_specifier/mod.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/execution_summary/resource_specifier/resource_specifier.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/intent_signature.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/manifest_encountered_component_address.rs (98%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/manifest_summary/account_deposit/account_deposits.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/manifest_summary/account_deposit/change_source.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/manifest_summary/account_deposit/mod.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/manifest_summary/account_deposit/simple_counted_resource_bounds.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/manifest_summary/account_deposit/simple_non_fungible_resource_bounds.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/manifest_summary/account_deposit/simple_resource_bounds.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/manifest_summary/account_deposit/unspecified_resources.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/manifest_summary/account_withdraw/account_withdraw.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/manifest_summary/account_withdraw/mod.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/manifest_summary/manifest_summary.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/manifest_summary/mod.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/mod.rs (90%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/notarized_transaction.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/notary_signature.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/sbor_depth_validation.rs (97%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/signed_intent.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/statically_analyzable_manifest.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/transaction_classes/detailed_manifest_class.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/transaction_classes/detailed_manifest_class_kind.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/transaction_classes/mod.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/transaction_classes/types/mod.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/transaction_classes/types/resource_preference_update.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/transaction_classes/types/tracked_pool_contribution.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/transaction_classes/types/tracked_pool_redemption.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/transaction_classes/types/tracked_validator_claim.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/transaction_classes/types/tracked_validator_stake.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/transaction_classes/types/unstake_data.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/transaction_hashes/intent_hash.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/transaction_hashes/mod.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/transaction_hashes/signed_intent_hash.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/transaction_hashes/subintent_hash.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/transaction_hashes/transaction_hashes.rs (98%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/transaction_hashes/validate_and_decode_hash.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v1/intent_signatures.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v1/message/message.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v1/message/mod.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v1/message/plaintext_message/mod.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v1/message/plaintext_message/plaintext_message.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v1/message/plaintext_message/plaintext_message_contents.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v1/mod.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v1/transaction_header.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v1/transaction_intent.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v1/transaction_manifest/blobs/blob.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v1/transaction_manifest/blobs/blobs.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v1/transaction_manifest/blobs/mod.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v1/transaction_manifest/execution_summary/mod.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v1/transaction_manifest/execution_summary/transaction_manifest_execution_summary.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v1/transaction_manifest/instructions/instructions.rs (99%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v1/transaction_manifest/instructions/mod.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v1/transaction_manifest/mod.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v1/transaction_manifest/transaction_manifest.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v2/compiled_subintent.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v2/intent_header_v2.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v2/message_v2/message_v2.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v2/message_v2/mod.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v2/mod.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v2/signed_partial_transaction.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v2/signed_subintent.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v2/subintent.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v2/transaction_manifest_v2/child_subintent_specifier.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v2/transaction_manifest_v2/child_subintent_specifiers.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v2/transaction_manifest_v2/execution_summary_v2/mod.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v2/transaction_manifest_v2/execution_summary_v2/transaction_manifest_execution_summary_v2.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v2/transaction_manifest_v2/instructions_v2/instructions_v2.rs (99%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v2/transaction_manifest_v2/instructions_v2/mod.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v2/transaction_manifest_v2/mod.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v2/transaction_manifest_v2/subintent_manifest.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/low_level/v2/transaction_manifest_v2/transaction_manifest_v2.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/profile_models/deposit_rule.rs (98%) rename crates/{sargon-transaction-models => transaction/models}/src/profile_models/mod.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/profile_models/third_party_deposits/asset_exception.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/profile_models/third_party_deposits/assets_exception_list.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/profile_models/third_party_deposits/deposit_address_exception_rule.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/profile_models/third_party_deposits/depositors_allow_list.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/profile_models/third_party_deposits/mod.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/profile_models/third_party_deposits/third_party_deposits.rs (100%) rename crates/{sargon-transaction-models => transaction/models}/src/unvalidated_transaction_manifest.rs (100%) rename crates/{sargon-uniffi-conversion-macros => uniffi/conversion-macros}/Cargo.toml (100%) rename crates/{sargon-uniffi-conversion-macros => uniffi/conversion-macros}/src/common.rs (100%) rename crates/{sargon-uniffi-conversion-macros => uniffi/conversion-macros}/src/enum_conversion.rs (100%) rename crates/{sargon-uniffi-conversion-macros => uniffi/conversion-macros}/src/lib.rs (100%) rename crates/{sargon-uniffi-conversion-macros => uniffi/conversion-macros}/src/struct_conversion.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/Cargo.toml (55%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/build.rs (100%) rename crates/{sargon => uniffi/uniffi_SPLIT_ME}/src/Package.swift (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/bindgen/args.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/bindgen/bin.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/bindgen/bindgen_error.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/bindgen/post_process.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/bindgen/post_process_kotlin.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/bindgen/post_process_swift.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/error/common_error.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/error/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/hash.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/result/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/result/result.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/appearance_id.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/bag_of_bytes.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/collections/internal_mapping.rs (99%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/collections/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/decimal192.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/entity_kind.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/epoch.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/exactly_n_bytes.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/instant.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/intent_discriminator.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/keys/ed25519/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/keys/ed25519/public_key.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/keys/key_agreement/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/keys/key_agreement/public_key.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/keys/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/keys/public_key.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/keys/secp256k1/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/keys/secp256k1/public_key.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/keys/slip10_curve.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/locale_config.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/non_empty_max_n_bytes.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/nonce.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/requested_number_quantifier.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/requested_quantity.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/rounding_mode.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/secret_bytes.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/signatures/ed25519_signature.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/signatures/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/signatures/secp256k1_signature.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/signatures/signature.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/signatures/signature_with_public_key.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/types/version_type.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/utils/builder_arc_map.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/utils/constants.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/utils/conversion_tests_macro.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/utils/delegate_debug_display_impl.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/utils/image_url_utils_uniffi_fn.rs (64%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/core/utils/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/bip32/hardened.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/bip32/hd_path.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/bip32/hd_path_component.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/bip32/key_space.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/bip32/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/bip32/securified.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/bip32/u30.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/bip32/u31.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/bip32/unhardened.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/bip32/unsecurified.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/bip32/unsecurified_hardened.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/bip39/bip39_entropy.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/bip39/bip39_passphrase.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/bip39/bip39_seed.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/bip39/bip39_word/bip39_language.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/bip39/bip39_word/bip39_word.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/bip39/bip39_word/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/bip39/bip39_word/u11.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/bip39/bip39_word_count.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/bip39/mnemonic.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/bip39/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/bip44/bip44_like_path.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/bip44/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/cap26/cap26_entity_kind.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/cap26/cap26_key_kind.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/cap26/cap26_path/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/cap26/cap26_path/paths/account_path.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/cap26/cap26_path/paths/identity_path.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/cap26/cap26_path/paths/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/cap26/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/derivation/derivation_path.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/derivation/derivation_path_scheme.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/derivation/hierarchical_deterministic_public_key.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/derivation/mnemonic_with_passphrase.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/derivation/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/hierarchical_deterministic/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/home_cards/home_card.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/home_cards/manager.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/home_cards/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/home_cards/observer.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/home_cards/storage.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/keys_collector/derivation_purpose.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/keys_collector/key_derivation_request.rs (99%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/keys_collector/key_derivation_response.rs (98%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/keys_collector/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/lib.rs (98%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/encrypted/encryption/aes_gcm_256.rs (75%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/encrypted/encryption/encryption_scheme.rs (74%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/encrypted/encryption/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/encrypted/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/arculus_card_factor_source/arculus_card_factor_source.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/arculus_card_factor_source/arculus_card_hint.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/arculus_card_factor_source/arculus_card_model.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/arculus_card_factor_source/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/off_device_mnemonic_factor_source/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_factor_source_hint.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_mnemonic_factor_source.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/password_factor_source/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/password_factor_source/password_factor_source.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/password_factor_source/password_factor_source_hint.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/answer/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/answer/security_question_and_answer.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/security_questions_keys_from_questions_and_answer_scheme.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/keys_by_diffie_hellman_fold.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/keys_from_questions_and_answers_lower_trim_utf8.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/security_question_and_answer_as_bytes.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/security_question_answer_as_bytes.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/security_question.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/security_question_kind.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/security_questions.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/security_questions_factor_source.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/security_questions_sealed_mnemonic.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/trusted_contact_factor_source/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source_contact.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/secured_entity_control/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/secured_entity_control/secured_entity_control.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/security_structures/matrices/decl_matrix_macro.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/security_structures/matrices/matrix_of_factor_instances.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/security_structures/matrices/matrix_of_factor_source_ids.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/security_structures/matrices/matrix_of_factor_sources.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/security_structures/matrices/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/security_structures/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/security_structures/models/factor_source_in_role_builder_validation_status.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/security_structures/models/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/security_structures/models/role_kind.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/security_structures/roles/decl_role_macro.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/security_structures/roles/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/security_structures/roles/roles_factor_instances.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/security_structures/roles/roles_factor_source_ids.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/security_structures/roles/roles_factor_sources.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/security_structures/security_shield_builder.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/security_structures/security_shield_builder_invalid_reason.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/security_structures/security_shield_prerequisites_status.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/security_structures/security_structure_id.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/security_structures/security_structure_metadata.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/security_structures/security_structures/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/security_structures/security_structures/security_structure_of_factor_instances.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/security_structures/security_structures/security_structure_of_factor_source_ids.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/security_structures/security_structures/security_structure_of_factor_sources.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mfa/security_structures/selected_factor_sources_status.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/profilesnapshot_version.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/supporting_types/account_for_display.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/supporting_types/account_or_persona.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/supporting_types/authorized_dapp_detailed.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/supporting_types/authorized_persona_detailed.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/supporting_types/decl_vec_samples_for.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/supporting_types/email_address.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/supporting_types/host_id.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/supporting_types/host_info.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/supporting_types/host_os.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/supporting_types/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/address/access_controller_address.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/address/account_address.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/address/address.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/address/address_format.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/address/component_address.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/address/identity_address.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/address/legacy_olympia_account_address.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/address/locker_address.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/address/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/address/non_fungible_global_id.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/address/non_fungible_local_id.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/address/non_fungible_local_id_string.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/address/non_fungible_resource_address.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/address/package_address.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/address/pool_address.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/address/resource_address.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/address/validator_address.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/address/vault_address.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/address/wrap_ret_address.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/app_preferences/app_display_settings/app_display_settings.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/app_preferences/app_display_settings/fiat_currency.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/app_preferences/app_display_settings/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/app_preferences/app_preferences.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/app_preferences/gateways/gateway.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/app_preferences/gateways/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/app_preferences/gateways/network_definition.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/app_preferences/gateways/saved_gateways.rs (96%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/app_preferences/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/app_preferences/security.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/app_preferences/transaction_preferences.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entities_linked_to_factor_source/entities_linked_to_factor_source.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entities_linked_to_factor_source/integrity/device.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entities_linked_to_factor_source/integrity/integrity.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entities_linked_to_factor_source/integrity/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entities_linked_to_factor_source/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entities_linked_to_factor_source/profile_to_check.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entity/account/account.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entity/account/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entity/account/on_ledger_settings/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entity/account/on_ledger_settings/on_ledger_settings.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/asset_exception.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/deposit_address_exception_rule.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/deposit_rule.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/resource_or_non_fungible.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/third_party_deposits.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entity/display_name.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entity/entity_flag.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entity/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entity/persona/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entity/persona/persona.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entity/persona/persona_data/collection_of_email_addresses.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entity/persona/persona_data/collection_of_phone_numbers.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entity/persona/persona_data/entry_kinds/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_email_address.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_name.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_phone_number.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entity/persona/persona_data/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entity/persona/persona_data/persona_data.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entity/persona/persona_data/persona_data_entry_id.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entity/persona/persona_data/persona_data_identified_collection_types.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entity/persona/persona_data/persona_data_identified_entry_types.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entity_security_state/entity_security_state.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entity_security_state/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entity_security_state/provisional_securified_config.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/entity_security_state/unsecured_entity_control.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/factors/factor_instance/badge_virtual_source.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/factors/factor_instance/factor_instance.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/factors/factor_instance/factor_instance_badge.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/factors/factor_instance/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/factors/factor_source.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/factors/factor_source_common.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/factors/factor_source_crypto_parameters.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/factors/factor_source_flag.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/factors/factor_source_id.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/factors/factor_source_id_from_address.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/factors/factor_source_id_from_hash.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/factors/factor_source_kind.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/factors/factor_sources/device_factor_source/device_factor_source.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/factors/factor_sources/device_factor_source/device_factor_source_hint.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/factors/factor_sources/device_factor_source/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/factors/factor_sources/factor_sources.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/factors/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_factor_source.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/factors/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_hint.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/factors/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_model.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/factors/factor_sources/ledger_hardware_wallet_factor_source/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/factors/factor_sources/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/factors/factor_sources/private_hierarchical_deterministic_factor_source.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/factors/hierarchical_deterministic_factor_instance.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/factors/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/header/content_hint.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/header/device_id.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/header/device_info.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/header/device_info_description.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/header/header.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/header/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/header/profile_id.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/json_data_convertible.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/networks/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/networks/network/authorized_dapp/authorized_dapp.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/networks/network/authorized_dapp/authorized_persona_simple.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/networks/network/authorized_dapp/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/networks/network/authorized_dapp/preferences/authorized_dapp_preference_deposits.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/networks/network/authorized_dapp/preferences/authorized_dapp_preferences.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/networks/network/authorized_dapp/preferences/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/networks/network/authorized_dapp/shared_persona_data.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_account_addresses.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_ids_of_persona_data_entries.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/networks/network/authorized_dapp/shared_with_dapp.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/networks/network/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/networks/network/network_id.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/networks/network/profile_network.rs (95%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/networks/network/resource_preferences/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/networks/network/resource_preferences/resource_app_preference.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/networks/network/resource_preferences/resource_identifier.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/networks/network/resource_preferences/resource_preferences.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/networks/network/resource_preferences/resource_visibility.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/profile.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/profile/v100/profile_file_contents.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/interaction_id.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/interaction_version.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/mobile/client.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/mobile/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/mobile/session/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/mobile/session/session_id.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/mobile/session_dapp_request.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/mobile/session_storage.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/mobile/session_wallet_response.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/p2p_links/link_connection_qr_data.rs (100%) rename crates/{sargon => uniffi/uniffi_SPLIT_ME}/src/radix_connect/p2p_links/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/p2p_links/p2p_link.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/p2p_links/p2p_links.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/p2p_links/radix_connect_password.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/p2p_links/radix_connect_purpose.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_account.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/auth_challenge_nonce.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/interaction_metadata.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/interaction_metadata_unvalidated.rs (100%) rename crates/{sargon => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/origin.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/items.rs (100%) rename crates/{sargon => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/after_delay.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/at_time.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/expiration.rs (100%) rename crates/{sargon => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/status.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/pre_authorization.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/subintent.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/unvalidated_subintent_manifest.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/auth.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/login_with_challenge.rs (100%) rename crates/{sargon => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/use_persona.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/authorized_request.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/accounts.rs (100%) rename crates/{sargon => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/persona_data.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/proof_of_ownership.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/reset.rs (100%) rename crates/{sargon => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/unauthorized_request.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/transaction.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/transaction_version.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/unvalidated_transaction_manifest.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_unvalidated.rs (100%) rename crates/{sargon => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/mod.rs (100%) rename crates/{sargon => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/error_type.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/failure.rs (100%) rename crates/{sargon => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/mod.rs (100%) rename crates/{sargon => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/response.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/account_proof.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/accounts.rs (100%) rename crates/{sargon => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_login_with_challenge.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_login_without_challenge.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_proof.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_use_persona.rs (100%) rename crates/{sargon => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/authorized_request.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/items.rs (100%) rename crates/{sargon => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/mod.rs (100%) rename crates/{sargon => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona/persona_proof.rs (100%) rename crates/{sargon => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona_data/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona_data/persona_data.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/pre_authorization.rs (100%) rename crates/{sargon => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/proof.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/proof_of_ownership.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/success.rs (100%) rename crates/{sargon => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/transaction.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/unauthorized_request.rs (100%) rename crates/{sargon => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_interaction/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/radix_connect/wallet_persona.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/sargon.udl (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/security_center/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/security_center/security_problem.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/security_center/security_problem_kind.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/security_center/support/addresses_entities_bad_state.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/security_center/support/backup_result.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/security_center/support/input.rs (100%) rename crates/{sargon => uniffi/uniffi_SPLIT_ME}/src/security_center/support/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/signing/authentication/auth_intent.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/signing/authentication/auth_intent_hash.rs (100%) rename crates/{sargon => uniffi/uniffi_SPLIT_ME}/src/signing/authentication/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/signing/authentication/signed_auth_intent.rs (97%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/signing/hd_signature.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/signing/hd_signature_input.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/signing/intent_signature_of_owner.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/signing/invalid_transaction_if_neglected.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/signing/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/signing/neglected_factors.rs (93%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/signing/sign_request.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/signing/sign_response.rs (96%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/signing/sign_with_factors_outcome.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/signing/signatures_per_fractor_source.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/signing/transaction_sign_request_input.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/signing/transactions_to_sign_per_factor_source.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/bios/bios.rs (100%) rename crates/{sargon => uniffi/uniffi_SPLIT_ME}/src/system/bios/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/README.md (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/drivers.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/entropy_provider_driver/entropy_provider_driver.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/entropy_provider_driver/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/event_bus_driver/event_bus_driver.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/event_bus_driver/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/event_bus_driver/support/event.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/event_bus_driver/support/event_kind.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/event_bus_driver/support/event_notification.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/event_bus_driver/support/event_profile_modified.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/event_bus_driver/support/has_event_kind.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/event_bus_driver/support/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/file_system_driver/file_system_driver.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/file_system_driver/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/host_info_driver/host_info_driver.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/host_info_driver/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/logging_driver/logging_driver.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/logging_driver/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/logging_driver/support/log_level.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/logging_driver/support/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/networking_driver/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/networking_driver/networking_driver.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/networking_driver/support/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/networking_driver/support/network_method.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/networking_driver/support/network_request.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/networking_driver/support/network_response.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/profile_change_driver/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/profile_change_driver/profile_change_driver.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/secure_storage_driver/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/secure_storage_driver/secure_storage_driver.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/secure_storage_driver/support/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/secure_storage_driver/support/secure_storage_access_error_kind.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/secure_storage_driver/support/secure_storage_key.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/unsafe_storage_driver/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/unsafe_storage_driver/support/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/unsafe_storage_driver/support/test/ephemeral_unsafe_storage.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/unsafe_storage_driver/support/test/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/unsafe_storage_driver/support/unsafe_storage_key.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/drivers/unsafe_storage_driver/unsafe_storage_driver.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/interactors/host_interactor.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/interactors/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/sargon_os/delete_account/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/sargon_os/delete_account/sargon_os_delete_account.rs (100%) rename crates/{sargon => uniffi/uniffi_SPLIT_ME}/src/system/sargon_os/delete_account/support/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/sargon_os/delete_account/support/outcome.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/sargon_os/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/sargon_os/pre_authorization/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/sargon_os/pre_authorization/sargon_os_create_subintent.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/sargon_os/pre_authorization/sargon_os_pre_authorization_status.rs (100%) rename crates/{sargon => uniffi/uniffi_SPLIT_ME}/src/system/sargon_os/pre_authorization/support/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/sargon_os/pre_authorization/support/pre_authorization_status.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/sargon_os/profile_state_holder.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/sargon_os/sargon_os.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/sargon_os/sargon_os_accounts.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/sargon_os/sargon_os_entities_linked_to_factor_source.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/sargon_os/sargon_os_factors.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/sargon_os/sargon_os_gateway.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/sargon_os/sargon_os_profile.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/sargon_os/sargon_os_security_center.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/sargon_os/sargon_os_security_structures.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/sargon_os/sargon_os_signing.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/sargon_os/sargon_os_sync_accounts.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/sargon_os/transactions/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/sargon_os/transactions/sargon_os_transaction_analysis.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/sargon_os/transactions/sargon_os_transaction_status.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/sargon_os/transactions/sargon_os_transaction_submit.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/sargon_os/transactions/support/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/sargon_os/transactions/support/pre_auth_to_review.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/sargon_os/transactions/support/transaction_to_review.rs (100%) rename crates/{sargon => uniffi/uniffi_SPLIT_ME}/src/system/subsystems/README.md (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/system/subsystems/log_system/log_system.rs (100%) rename crates/{sargon => uniffi/uniffi_SPLIT_ME}/src/system/subsystems/log_system/mod.rs (100%) rename crates/{sargon => uniffi/uniffi_SPLIT_ME}/src/system/subsystems/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/types/ffi_url.rs (97%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/types/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/types/owned_factor_instance.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/types/vector_image_type.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/high_level/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/high_level/ret_api.rs (99%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/account_locker/account_locker_claimable_resource.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/account_locker/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/address_of_account_or_persona.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/address_union.rs (100%) create mode 100644 crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/account_or_address_of.rs rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/mod.rs (58%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_fungible_resource.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers_of_fungible_resource.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers_of_non_fungible_resource.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfer.rs (86%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfers.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/transfer_types.rs (94%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/build_information/dependency_information.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/build_information/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/build_information/sargon_build_information.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/build_information/sargon_dependencies.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/manifest_encountered_component_address.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/stake_claim.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction/transaction_status.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction/transaction_status_reason.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction_guarantee.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/high_level/token_definition_metadata.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/compiled_notarized_intent.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/compiled_transaction_intent.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/execution_summary/execution_summary.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/execution_summary/fee_locks.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/execution_summary/fee_summary.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/execution_summary/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/execution_summary/new_entities.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/execution_summary/newly_created_resource.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/execution_summary/reserved_instruction.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/fungible_resource_indicator.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/non_fungible_resource_indicator.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/predicted.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/resource_indicator.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_specifier/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_specifier/resource_specifier.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/intent_signature.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/account_deposit.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/change_source.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/simple_fungible_resource_bounds.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/simple_non_fungible_resource_bounds.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/simple_resource_bounds.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/unspecified_resources.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_withdraw/account_withdraw.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_withdraw/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/manifest_summary.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/notarized_transaction.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/notary_signature.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/public_key_hash.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/signed_intent.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/detailed_manifest_class.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/detailed_manifest_class_kind.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/resource_preference_update.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/tracked_pool_contribution.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/tracked_pool_redemption.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/tracked_validator_claim.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/tracked_validator_stake.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/unstake_data.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/intent_hash.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/signed_intent_hash.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/subintent_hash.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/transaction_hashes.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/v1/intent_signatures.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/v1/message/message.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/v1/message/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/v1/message/plaintext_message/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/v1/message/plaintext_message/plaintext_message.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/v1/message/plaintext_message/plaintext_message_contents.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/v1/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_header.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_intent.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/blobs/blob.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/blobs/blobs.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/blobs/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/instructions/instructions.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/instructions/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/transaction_manifest.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/v2/compiled_subintent.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/v2/intent_header_v2.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/v2/message_v2/message_v2.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/v2/message_v2/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/v2/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/v2/signed_subintent.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/v2/subintent.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/mod.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/subintent_manifest.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/transaction_manifest_v2.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/src/wrapped_radix_engine_toolkit/mod.rs (100%) rename crates/{sargon => uniffi/uniffi_SPLIT_ME}/tests/Package.swift (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/tests/integration/main.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/tests/vectors/main.rs (100%) rename crates/{sargon-uniffi => uniffi/uniffi_SPLIT_ME}/uniffi.toml (100%) diff --git a/.swiftformat b/.swiftformat index 950e5ea17..58ad68b12 100644 --- a/.swiftformat +++ b/.swiftformat @@ -1,5 +1,7 @@ --swiftversion 5.9 +--exclude apple/Sources/UniFFI/** + # format options --allman false # Prefer `K&R` https://en.wikipedia.org/wiki/Indentation_style#K&R_style --indent tab @@ -10,4 +12,4 @@ --disable redundantNilInit,redundantSelf,extensionAccessControl --lineaftermarks false --ifdef no-indent ---header strip \ No newline at end of file +--header strip diff --git a/Cargo.lock b/Cargo.lock index 8227ef9e0..aae1bdd9c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,20 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "account-for-display" +version = "1.1.99" +dependencies = [ + "addresses", + "derive_more", + "entity-foundation", + "has-sample-values", + "identified-vec-of", + "network", + "serde", + "short-string", +] + [[package]] name = "actix-macros" version = "0.2.4" @@ -9,7 +23,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" dependencies = [ "quote", - "syn 2.0.85", + "syn 2.0.94", ] [[package]] @@ -31,6 +45,36 @@ dependencies = [ "gimli", ] +[[package]] +name = "addresses" +version = "1.1.99" +dependencies = [ + "assert-json", + "bytes 1.1.99", + "derive_more", + "ecc", + "enum-as-inner", + "enum-iterator", + "factors", + "has-sample-values", + "hash", + "hierarchical-deterministic", + "identified-vec-of", + "log", + "network", + "paste 1.0.14", + "pretty_assertions", + "radix-common", + "radix-engine", + "radix-engine-interface", + "radix-engine-toolkit", + "radix-rust", + "sargon-core-utils", + "serde", + "serde_json 1.0.108", + "serde_with 3.4.0", +] + [[package]] name = "adler2" version = "2.0.0" @@ -95,9 +139,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.18" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "android-tzdata" @@ -141,9 +185,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" @@ -175,9 +219,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.91" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" +checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" [[package]] name = "arraystring" @@ -193,13 +237,26 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +[[package]] +name = "assert-json" +version = "1.1.99" +dependencies = [ + "assert-json-diff", + "error", + "log", + "pretty_assertions", + "serde", + "serde_json 1.0.108", + "thiserror 1.0.50", +] + [[package]] name = "assert-json-diff" version = "2.0.2" source = "git+https://github.com/davidpdrsn/assert-json-diff/?rev=bca0d2c590808274298d939e0533da79cd09076d#bca0d2c590808274298d939e0533da79cd09076d" dependencies = [ "serde", - "serde_json 1.0.132", + "serde_json 1.0.134", ] [[package]] @@ -322,7 +379,7 @@ source = "git+https://github.com/dtolnay/async-trait?rev=1eb21ed8bd87029bf4dcbea dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.94", ] [[package]] @@ -507,9 +564,27 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.8.0" +version = "1.1.99" +dependencies = [ + "assert-json", + "delegate", + "derive_more", + "error", + "has-sample-values", + "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", + "paste 1.0.14", + "rand", + "serde", + "serde_json 1.0.108", + "serde_with 3.4.0", + "zeroize 1.7.0", +] + +[[package]] +name = "bytes" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] name = "camino" @@ -527,9 +602,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" dependencies = [ "serde", ] @@ -544,7 +619,7 @@ dependencies = [ "cargo-platform", "semver", "serde", - "serde_json 1.0.132", + "serde_json 1.0.134", ] [[package]] @@ -557,8 +632,8 @@ dependencies = [ "cargo-platform", "semver", "serde", - "serde_json 1.0.132", - "thiserror 1.0.65", + "serde_json 1.0.134", + "thiserror 1.0.69", ] [[package]] @@ -582,9 +657,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.31" +version = "1.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" +checksum = "a012a0df96dd6d06ba9a1b29d6402d1a5d77c6befd2566afdc26e10603dc93d7" dependencies = [ "shlex", ] @@ -597,9 +672,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.38" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" dependencies = [ "android-tzdata", "iana-time-zone", @@ -666,7 +741,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.94", ] [[package]] @@ -678,7 +753,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.94", ] [[package]] @@ -692,6 +767,28 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" +[[package]] +name = "clients" +version = "1.1.99" +dependencies = [ + "actix-rt", + "async-trait", + "core-collections", + "derive_more", + "drivers", + "enum-as-inner", + "factors-supporting-types", + "gateway-client-and-api", + "hierarchical-deterministic", + "http-client", + "pretty_assertions", + "profile", + "profile-supporting-types", + "serde", + "serde_json 1.0.108", + "serde_with 3.4.0", +] + [[package]] name = "colorchoice" version = "1.0.3" @@ -700,12 +797,12 @@ checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "colored" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" +checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" dependencies = [ "lazy_static", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -729,6 +826,16 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d8a42181e0652c2997ae4d217f25b63c5337a52fd2279736e97b832fa0a3cff" +[[package]] +name = "core-collections" +version = "1.1.99" +dependencies = [ + "has-sample-values", + "indexmap 2.7.0", + "serde", + "serde_json 1.0.108", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -745,20 +852,39 @@ version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +[[package]] +name = "core-misc" +version = "1.1.99" +dependencies = [ + "assert-json", + "derive_more", + "error", + "has-sample-values", + "iso8601-timestamp", + "itertools 0.12.0", + "log", + "pretty_assertions", + "radix-common", + "sargon-core-utils", + "serde", + "serde_json 1.0.108", + "strum 0.26.1", +] + [[package]] name = "cpufeatures" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" dependencies = [ "libc", ] [[package]] name = "crossbeam-channel" -version = "0.5.13" +version = "0.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" +checksum = "06ba6d68e24814cb8de6bb986db8222d3a027d15872cabc0d18817bc3c0e4471" dependencies = [ "crossbeam-utils", ] @@ -774,9 +900,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crypto-bigint" @@ -834,7 +960,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.94", ] [[package]] @@ -858,7 +984,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.85", + "syn 2.0.94", ] [[package]] @@ -869,7 +995,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.85", + "syn 2.0.94", ] [[package]] @@ -879,7 +1005,7 @@ source = "git+https://github.com/Kobzol/rust-delegate/?rev=ac852be64f3e4b5f9b58b dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.94", ] [[package]] @@ -917,7 +1043,7 @@ source = "git+https://github.com/JelteF/derive_more?rev=d7f5b9e94d024790682f6fc4 dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.94", "unicode-xid", ] @@ -939,12 +1065,71 @@ dependencies = [ "subtle", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.94", +] + [[package]] name = "downcast-rs" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" +[[package]] +name = "drivers" +version = "1.1.99" +dependencies = [ + "actix-rt", + "addresses", + "async-trait", + "derive_more", + "enum-iterator", + "hierarchical-deterministic", + "indexmap 2.7.0", + "itertools 0.12.0", + "log", + "pretty_env_logger", + "profile", + "profile-supporting-types", + "reqwest", + "serde", + "serde_json 1.0.108", + "strum 0.26.1", + "time-utils", +] + +[[package]] +name = "ecc" +version = "1.1.99" +dependencies = [ + "assert-json", + "bytes 1.1.99", + "derive_more", + "enum-as-inner", + "error", + "has-sample-values", + "hash", + "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", + "identified-vec-of", + "iota-crypto", + "k256 0.13.3", + "log", + "pretty_assertions", + "radix-common", + "radix-transactions", + "serde", + "serde_json 1.0.108", + "serde_with 3.4.0", + "zeroize 1.7.0", +] + [[package]] name = "ecdsa" version = "0.16.9" @@ -1023,6 +1208,39 @@ dependencies = [ "zeroize 1.8.1", ] +[[package]] +name = "encryption" +version = "1.1.99" +dependencies = [ + "aes-gcm", + "assert-json", + "bytes 1.1.99", + "derive_more", + "error", + "has-sample-values", + "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", + "hkdf", + "iota-crypto", + "k256 0.13.3", + "log", + "serde", + "serde_repr", + "zeroize 1.7.0", +] + +[[package]] +name = "entity-foundation" +version = "1.1.99" +dependencies = [ + "assert-json", + "derive_more", + "error", + "has-sample-values", + "itertools 0.12.0", + "serde", + "serde_json 1.0.108", +] + [[package]] name = "enum-as-inner" version = "0.6.0" @@ -1031,7 +1249,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.94", ] [[package]] @@ -1049,7 +1267,7 @@ source = "git+https://github.com/stephaneyfx/enum-iterator/?rev=9d472a1237cfd03b dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.94", ] [[package]] @@ -1073,12 +1291,21 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", +] + +[[package]] +name = "error" +version = "1.1.99" +dependencies = [ + "log", + "serde_json 1.0.108", + "thiserror 1.0.50", ] [[package]] @@ -1125,14 +1352,84 @@ checksum = "311a6d2f1f9d60bff73d2c78a0af97ed27f79672f15c238192a5bbb64db56d00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.94", +] + +[[package]] +name = "factor-instances-provider" +version = "1.1.99" +dependencies = [ + "actix-rt", + "addresses", + "assert-json", + "clients", + "derive_more", + "error", + "factors", + "futures", + "hierarchical-deterministic", + "identified-vec-of", + "indexmap 2.7.0", + "keys-collector", + "next-derivation-index-ephemeral", + "profile", + "profile-logic", + "profile-supporting-types", + "sargon-core-utils", + "serde", +] + +[[package]] +name = "factors" +version = "1.1.99" +dependencies = [ + "bytes 1.1.99", + "core-collections", + "core-misc", + "derive_more", + "ecc", + "encryption", + "enum-as-inner", + "enum-iterator", + "hash", + "hierarchical-deterministic", + "hkdf", + "host-info", + "identified-vec-of", + "indexmap 2.7.0", + "iota-crypto", + "k256 0.13.3", + "network", + "numeric", + "once_cell 1.19.0", + "paste 1.0.14", + "radix-common", + "radix-engine-interface", + "sargon-core-utils", + "serde", + "serde_json 1.0.108", + "serde_with 3.4.0", + "short-string", + "time-utils", + "zeroize 1.7.0", +] + +[[package]] +name = "factors-supporting-types" +version = "1.1.99" +dependencies = [ + "async-trait", + "error", + "factors", + "hierarchical-deterministic", + "identified-vec-of", ] [[package]] name = "fastrand" -version = "2.1.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "ff" @@ -1264,7 +1561,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.94", ] [[package]] @@ -1302,32 +1599,35 @@ name = "gateway-client-and-api" version = "1.1.99" dependencies = [ "actix-rt", + "addresses", + "assert-json", + "drivers", "gateway-models", "http-client", + "metadata", + "profile-gateway", "radix-common", - "sargon-addresses", - "sargon-core", - "sargon-core-assert-json", - "sargon-drivers", - "sargon-profile-gateway", - "sargon-transaction-models", + "sargon-core-utils", "serde", "serde_json 1.0.108", + "transaction-models", ] [[package]] name = "gateway-models" version = "1.1.99" dependencies = [ + "addresses", + "assert-json", + "core-misc", "derive_more", + "enum-as-inner", + "metadata", "radix-engine-interface", "radix-engine-toolkit-common", "radix-transactions", - "sargon-addresses", - "sargon-core", - "sargon-core-assert-json", - "sargon-transaction-models", "serde", + "transaction-models", ] [[package]] @@ -1343,9 +1643,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96512db27971c2c3eece70a1e106fbe6c87760234e31e8f7e5634912fe52794a" +checksum = "2cb8bc4c28d15ade99c7e90b219f30da4be5c88e586277e8cbe886beeb868ab2" dependencies = [ "typenum", ] @@ -1379,9 +1679,9 @@ checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "glob" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "gloo-timers" @@ -1417,6 +1717,27 @@ dependencies = [ "subtle", ] +[[package]] +name = "has-sample-values" +version = "1.1.99" +dependencies = [ + "error", + "indexmap 2.7.0", + "iso8601-timestamp", + "url", + "uuid 1.6.1", +] + +[[package]] +name = "hash" +version = "1.1.99" +dependencies = [ + "bytes 1.1.99", + "derive_more", + "radix-common", + "serde", +] + [[package]] name = "hashbrown" version = "0.12.3" @@ -1435,9 +1756,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "heck" @@ -1478,29 +1799,68 @@ version = "0.4.3" source = "git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792#b2b4370b5bf021b98ee7adc92233e8de3f2de792" [[package]] -name = "hkdf" -version = "0.12.4" -source = "git+https://github.com/RustCrypto/KDFs/?rev=1ac16e8b9d4ee7a67613c9396c6cc1327652eaba#1ac16e8b9d4ee7a67613c9396c6cc1327652eaba" -dependencies = [ - "hmac", -] - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +name = "hierarchical-deterministic" +version = "1.1.99" dependencies = [ - "digest", -] - -[[package]] + "assert-json", + "bip39", + "bytes 1.1.99", + "derive_more", + "ecc", + "enum-as-inner", + "enum-iterator", + "has-sample-values", + "hash", + "identified-vec-of", + "iota-crypto", + "itertools 0.12.0", + "network", + "numeric", + "paste 1.0.14", + "radix-common", + "serde", + "serde_json 1.0.108", + "serde_with 3.4.0", + "strum 0.26.1", + "zeroize 1.7.0", +] + +[[package]] +name = "hkdf" +version = "0.12.4" +source = "git+https://github.com/RustCrypto/KDFs/?rev=1ac16e8b9d4ee7a67613c9396c6cc1327652eaba#1ac16e8b9d4ee7a67613c9396c6cc1327652eaba" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "host-info" +version = "1.1.99" +dependencies = [ + "assert-json", + "derive_more", + "has-sample-values", + "serde", + "serde_json 1.0.108", + "time-utils", +] + +[[package]] name = "http" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" dependencies = [ - "bytes", + "bytes 1.9.0", "fnv", "itoa", ] @@ -1511,7 +1871,7 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ - "bytes", + "bytes 1.9.0", "http", ] @@ -1521,7 +1881,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ - "bytes", + "bytes 1.9.0", "futures-util", "http", "http-body", @@ -1533,9 +1893,11 @@ name = "http-client" version = "1.1.99" dependencies = [ "actix-rt", + "bytes 1.1.99", + "drivers", + "error", "reqwest", - "sargon-core", - "sargon-drivers", + "sargon-core-utils", "serde", "serde_json 1.0.108", ] @@ -1554,11 +1916,11 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "1.5.0" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" +checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" dependencies = [ - "bytes", + "bytes 1.9.0", "futures-channel", "futures-util", "http", @@ -1577,7 +1939,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ - "bytes", + "bytes 1.9.0", "http-body-util", "hyper", "hyper-util", @@ -1589,11 +1951,11 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" dependencies = [ - "bytes", + "bytes 1.9.0", "futures-channel", "futures-util", "http", @@ -1629,6 +1991,124 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.94", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -1639,24 +2119,35 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" name = "identified-vec-of" version = "1.1.99" dependencies = [ + "assert-json", "derive_more", + "error", + "indexmap 2.7.0", "itertools 0.12.0", "paste 1.0.14", - "radix-rust", - "sargon-core-assert-json", - "sargon-core-error", "serde", "serde_json 1.0.108", ] [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", ] [[package]] @@ -1672,12 +2163,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", - "hashbrown 0.15.0", + "hashbrown 0.15.2", "serde", ] @@ -1740,7 +2231,7 @@ name = "iso8601-timestamp" version = "0.2.17" source = "git+https://github.com/Lantern-chat/iso8601-timestamp/?rev=e5a3f2a5911759bc6b0d8100b032a6b4dd6e12c1#e5a3f2a5911759bc6b0d8100b032a6b4dd6e12c1" dependencies = [ - "generic-array 1.1.0", + "generic-array 1.1.1", "serde", "time", ] @@ -1764,16 +2255,17 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "js-sys" -version = "0.3.72" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" +checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" dependencies = [ + "once_cell 1.20.2", "wasm-bindgen", ] @@ -1811,6 +2303,28 @@ dependencies = [ "cpufeatures", ] +[[package]] +name = "keys-collector" +version = "1.1.99" +dependencies = [ + "actix-rt", + "addresses", + "async-trait", + "core-collections", + "core-misc", + "derive_more", + "error", + "factors", + "factors-supporting-types", + "has-sample-values", + "hierarchical-deterministic", + "indexmap 2.7.0", + "itertools 0.12.0", + "log", + "network", + "numeric", +] + [[package]] name = "kv-log-macro" version = "1.0.7" @@ -1834,15 +2348,15 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.161" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libm" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" [[package]] name = "linux-raw-sys" @@ -1850,6 +2364,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + [[package]] name = "lock_api" version = "0.4.12" @@ -1869,12 +2389,55 @@ dependencies = [ "value-bag", ] +[[package]] +name = "manifests" +version = "1.1.99" +dependencies = [ + "account-for-display", + "addresses", + "cargo_toml 0.15.3 (git+https://gitlab.com/lib.rs/cargo_toml?rev=e498c94fc42a660c1ca1a28999ce1d757cfe77fe)", + "derive_more", + "enum-as-inner", + "factors", + "gateway-models", + "hierarchical-deterministic", + "identified-vec-of", + "itertools 0.12.0", + "metadata", + "paste 1.0.14", + "pretty_assertions", + "profile", + "radix-common", + "radix-engine", + "radix-engine-interface", + "radix-engine-toolkit", + "radix-rust", + "radix-transactions", + "sargon-core-utils", + "sbor", + "serde", + "serde_json 1.0.108", + "transaction-models", +] + [[package]] name = "memchr" version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "metadata" +version = "1.1.99" +dependencies = [ + "derive_more", + "has-sample-values", + "radix-engine-interface", + "serde", + "serde_json 1.0.108", + "strum 0.26.1", +] + [[package]] name = "mime" version = "0.3.17" @@ -1899,20 +2462,19 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" dependencies = [ "adler2", ] [[package]] name = "mio" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ - "hermit-abi 0.3.9", "libc", "wasi", "windows-sys 0.52.0", @@ -1935,7 +2497,7 @@ dependencies = [ "skeptic", "smallvec", "tagptr", - "thiserror 1.0.65", + "thiserror 1.0.69", "triomphe", "uuid 1.11.0", ] @@ -1963,19 +2525,38 @@ dependencies = [ "tempfile", ] +[[package]] +name = "network" +version = "1.1.99" +dependencies = [ + "assert-json", + "enum-iterator", + "has-sample-values", + "numeric", + "radix-common", + "serde", + "serde_json 1.0.108", + "serde_repr", + "strum 0.26.1", +] + [[package]] name = "next-derivation-index-ephemeral" version = "1.1.99" dependencies = [ + "addresses", + "assert-json", "derive_more", "enum-iterator", - "sargon-addresses", - "sargon-core", - "sargon-core-assert-json", - "sargon-core-error", - "sargon-factors", - "sargon-hierarchical-deterministic", + "error", + "factors", + "has-sample-values", + "hierarchical-deterministic", + "identified-vec-of", + "indexmap 2.7.0", + "network", "serde", + "serde_json 1.0.108", "serde_with 3.4.0", ] @@ -2033,11 +2614,29 @@ dependencies = [ "libc", ] +[[package]] +name = "numeric" +version = "1.1.99" +dependencies = [ + "bytes 1.1.99", + "delegate", + "derive_more", + "enum-iterator", + "error", + "has-sample-values", + "radix-common", + "serde", + "serde_json 1.0.108", + "serde_repr", + "serde_with 3.4.0", + "strum 0.26.1", +] + [[package]] name = "object" -version = "0.36.5" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] @@ -2082,7 +2681,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.94", ] [[package]] @@ -2093,9 +2692,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "300.4.0+3.4.0" +version = "300.4.1+3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a709e02f2b4aca747929cca5ed248880847c650233cf8b8cdc48f40aaf4898a6" +checksum = "faa4eac4138c62414b5622d1b31c5c304f34b406b013c079c2bbc652fdd6678c" dependencies = [ "cc", ] @@ -2161,9 +2760,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -2252,7 +2851,7 @@ version = "0.2.0" source = "git+https://github.com/dhedey/preinterpret?rev=6754b92bdead0ddd6f69fbee7d782180d6351605#6754b92bdead0ddd6f69fbee7d782180d6351605" dependencies = [ "proc-macro2", - "syn 2.0.85", + "syn 2.0.94", ] [[package]] @@ -2275,58 +2874,201 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.89" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] [[package]] -name = "pulldown-cmark" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57206b407293d2bcd3af849ce869d52068623f19e1b5ff8e8778e3309439682b" +name = "profile" +version = "1.1.99" dependencies = [ - "bitflags 2.6.0", - "memchr", - "unicase", + "account-for-display", + "addresses", + "cargo_toml 0.15.3 (git+https://gitlab.com/lib.rs/cargo_toml?rev=e498c94fc42a660c1ca1a28999ce1d757cfe77fe)", + "core-misc", + "derive_more", + "encryption", + "entity-foundation", + "enum-as-inner", + "enum-iterator", + "factors", + "has-sample-values", + "hierarchical-deterministic", + "hkdf", + "host-info", + "identified-vec-of", + "itertools 0.12.0", + "k256 0.13.3", + "keys-collector", + "log", + "once_cell 1.19.0", + "paste 1.0.14", + "pretty_assertions", + "profile-app-preferences", + "profile-security-structures", + "serde", + "serde_json 1.0.108", + "serde_repr", + "serde_with 3.4.0", + "strum 0.26.1", + "time-utils", + "transaction-models", ] [[package]] -name = "quote" -version = "1.0.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +name = "profile-app-preferences" +version = "1.1.99" dependencies = [ - "proc-macro2", + "addresses", + "core-misc", + "derive_more", + "factors", + "hierarchical-deterministic", + "identified-vec-of", + "indexmap 2.7.0", + "keys-collector", + "log", + "numeric", + "paste 1.0.14", + "profile-gateway", + "profile-security-structures", + "serde", + "serde_json 1.0.108", + "transaction-models", ] [[package]] -name = "radix-blueprint-schema-init" -version = "1.3.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=v1.3.0#57309755e1fe81ba802e0bf92bbcaf4f116b9b62" +name = "profile-gateway" +version = "1.1.99" dependencies = [ - "bitflags 1.3.2", - "radix-common", - "sbor", + "addresses", + "assert-json", + "core-misc", + "derive_more", + "error", + "factors", + "has-sample-values", + "hierarchical-deterministic", + "identified-vec-of", + "keys-collector", + "log", + "network", + "paste 1.0.14", "serde", + "serde_json 1.0.108", + "transaction-models", + "url", ] [[package]] -name = "radix-common" -version = "1.3.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=v1.3.0#57309755e1fe81ba802e0bf92bbcaf4f116b9b62" +name = "profile-logic" +version = "1.1.99" dependencies = [ - "bech32", - "blake2", - "blst", - "bnum", - "ed25519-dalek", - "hex 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static", - "num-bigint", - "num-integer", + "addresses", + "derive_more", + "factors", + "hierarchical-deterministic", + "identified-vec-of", + "itertools 0.12.0", + "paste 1.0.14", + "pretty_assertions", + "profile", + "profile-supporting-types", + "serde", + "serde_json 1.0.108", + "time-utils", +] + +[[package]] +name = "profile-security-structures" +version = "1.1.99" +dependencies = [ + "addresses", + "core-collections", + "derive_more", + "enum-as-inner", + "factors", + "has-sample-values", + "hierarchical-deterministic", + "identified-vec-of", + "log", + "network", + "next-derivation-index-ephemeral", + "pretty_assertions", + "radix-engine-interface", + "sargon-core-utils", + "serde", + "serde_json 1.0.108", + "short-string", + "thiserror 1.0.50", + "time-utils", +] + +[[package]] +name = "profile-supporting-types" +version = "1.1.99" +dependencies = [ + "addresses", + "derive_more", + "enum-as-inner", + "factors", + "hierarchical-deterministic", + "identified-vec-of", + "itertools 0.12.0", + "pretty_assertions", + "profile", + "serde", + "serde_json 1.0.108", +] + +[[package]] +name = "pulldown-cmark" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57206b407293d2bcd3af849ce869d52068623f19e1b5ff8e8778e3309439682b" +dependencies = [ + "bitflags 2.6.0", + "memchr", + "unicase", +] + +[[package]] +name = "quote" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix-blueprint-schema-init" +version = "1.3.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=v1.3.0#57309755e1fe81ba802e0bf92bbcaf4f116b9b62" +dependencies = [ + "bitflags 1.3.2", + "radix-common", + "sbor", + "serde", +] + +[[package]] +name = "radix-common" +version = "1.3.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=v1.3.0#57309755e1fe81ba802e0bf92bbcaf4f116b9b62" +dependencies = [ + "bech32", + "blake2", + "blst", + "bnum", + "ed25519-dalek", + "hex 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static", + "num-bigint", + "num-integer", "num-traits", "paste 1.0.15", "radix-rust", @@ -2399,7 +3141,7 @@ dependencies = [ "regex 1.9.3 (registry+https://github.com/rust-lang/crates.io-index)", "sbor", "serde", - "serde_json 1.0.132", + "serde_json 1.0.134", "strum 0.24.1", ] @@ -2444,8 +3186,8 @@ dependencies = [ "sbor", "sbor-json", "scrypto", - "serde_json 1.0.132", - "serde_with 3.11.0", + "serde_json 1.0.134", + "serde_with 3.12.0", ] [[package]] @@ -2459,7 +3201,7 @@ dependencies = [ "radix-rust", "sbor", "serde", - "serde_with 3.11.0", + "serde_with 3.12.0", ] [[package]] @@ -2478,7 +3220,7 @@ name = "radix-rust" version = "1.3.0" source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=v1.3.0#57309755e1fe81ba802e0bf92bbcaf4f116b9b62" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.7.0", "serde", ] @@ -2604,9 +3346,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ "bitflags 2.6.0", ] @@ -2672,7 +3414,7 @@ version = "0.12.3" source = "git+https://github.com/seanmonstar/reqwest?rev=0720159f6369f54e045a1fd315e0f24b7a0b4a39#0720159f6369f54e045a1fd315e0f24b7a0b4a39" dependencies = [ "base64 0.22.1 (registry+https://github.com/rust-lang/crates.io-index)", - "bytes", + "bytes 1.9.0", "futures-core", "futures-util", "http", @@ -2691,7 +3433,7 @@ dependencies = [ "pin-project-lite", "rustls-pemfile", "serde", - "serde_json 1.0.132", + "serde_json 1.0.134", "serde_urlencoded", "sync_wrapper", "tokio", @@ -2739,7 +3481,7 @@ dependencies = [ "rinja_parser", "rustc-hash", "serde", - "syn 2.0.85", + "syn 2.0.94", ] [[package]] @@ -2754,507 +3496,134 @@ dependencies = [ ] [[package]] -name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - -[[package]] -name = "rustc-hash" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" - -[[package]] -name = "rustc_version" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" -dependencies = [ - "semver", -] - -[[package]] -name = "rustix" -version = "0.38.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" -dependencies = [ - "bitflags 2.6.0", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] - -[[package]] -name = "rustls-pemfile" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" -dependencies = [ - "rustls-pki-types", -] - -[[package]] -name = "rustls-pki-types" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" - -[[package]] -name = "rustversion" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "sargon" -version = "1.1.99" -dependencies = [ - "actix-rt", - "async-std", - "async-trait", - "base64 0.22.1 (git+https://github.com/marshallpierce/rust-base64.git?rev=e14400697453bcc85997119b874bc03d9601d0af)", - "cargo_toml 0.15.3 (git+https://gitlab.com/lib.rs/cargo_toml?rev=e498c94fc42a660c1ca1a28999ce1d757cfe77fe)", - "derive_more", - "enum-iterator", - "futures", - "gateway-client-and-api", - "gateway-models", - "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", - "identified-vec-of", - "log", - "paste 1.0.14", - "pretty_assertions", - "radix-common", - "radix-engine-interface", - "radix-engine-toolkit-common", - "radix-transactions", - "sargon-addresses", - "sargon-clients", - "sargon-core", - "sargon-drivers", - "sargon-factor-instances-provider", - "sargon-factors", - "sargon-hierarchical-deterministic", - "sargon-keys-collector", - "sargon-manifests", - "sargon-profile", - "sargon-profile-logic", - "sargon-profile-security-structures", - "sargon-transaction-models", - "security-framework", - "security-framework-sys", - "serde", - "serde_json 1.0.108", - "serde_with 3.4.0", -] - -[[package]] -name = "sargon-addresses" -version = "1.1.99" -dependencies = [ - "derive_more", - "enum-iterator", - "log", - "pretty_assertions", - "radix-common", - "radix-engine", - "radix-engine-interface", - "radix-engine-toolkit", - "radix-rust", - "sargon-core", - "sargon-factors", - "sargon-hierarchical-deterministic", - "serde", - "serde_json 1.0.108", - "serde_with 3.4.0", -] - -[[package]] -name = "sargon-clients" -version = "1.1.99" -dependencies = [ - "actix-rt", - "async-trait", - "derive_more", - "enum-as-inner", - "gateway-client-and-api", - "http-client", - "pretty_assertions", - "sargon-core", - "sargon-drivers", - "sargon-factors-supporting-types", - "sargon-hierarchical-deterministic", - "sargon-profile", - "sargon-profile-supporting-types", - "serde", - "serde_json 1.0.108", - "serde_with 3.4.0", -] - -[[package]] -name = "sargon-core" -version = "1.1.99" -dependencies = [ - "aes-gcm", - "arraystring", - "delegate", - "derive_more", - "enum-as-inner", - "enum-iterator", - "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", - "identified-vec-of", - "iota-crypto", - "k256 0.13.3", - "log", - "paste 1.0.14", - "pretty_assertions", - "radix-common", - "radix-engine-interface", - "radix-rust", - "radix-transactions", - "rand", - "sargon-core-assert-json", - "sargon-core-error", - "sargon-core-utils", - "serde", - "serde_json 1.0.108", - "serde_repr", - "serde_with 3.4.0", - "strum 0.26.1", - "url", - "uuid 1.6.1", - "zeroize 1.7.0", -] - -[[package]] -name = "sargon-core-assert-json" -version = "1.1.99" -dependencies = [ - "assert-json-diff", - "log", - "pretty_assertions", - "sargon-core-error", - "serde", - "serde_json 1.0.108", - "thiserror 1.0.50", -] - -[[package]] -name = "sargon-core-error" -version = "1.1.99" -dependencies = [ - "log", - "serde_json 1.0.108", - "thiserror 1.0.50", -] - -[[package]] -name = "sargon-core-utils" -version = "1.1.99" -dependencies = [ - "iso8601-timestamp", - "log", - "pretty_assertions", - "sargon-core-error", - "serde", - "serde_json 1.0.108", - "url", - "uuid 1.6.1", -] - -[[package]] -name = "sargon-drivers" -version = "1.1.99" -dependencies = [ - "actix-rt", - "async-trait", - "derive_more", - "enum-iterator", - "log", - "pretty_env_logger", - "reqwest", - "sargon-addresses", - "sargon-core", - "sargon-hierarchical-deterministic", - "sargon-profile", - "sargon-profile-supporting-types", - "serde", - "serde_json 1.0.108", - "strum 0.26.1", -] - -[[package]] -name = "sargon-factor-instances-provider" -version = "1.1.99" -dependencies = [ - "actix-rt", - "derive_more", - "futures", - "identified-vec-of", - "next-derivation-index-ephemeral", - "sargon-addresses", - "sargon-clients", - "sargon-core", - "sargon-core-assert-json", - "sargon-core-error", - "sargon-core-utils", - "sargon-factors", - "sargon-hierarchical-deterministic", - "sargon-keys-collector", - "sargon-profile", - "sargon-profile-logic", - "sargon-profile-supporting-types", -] - -[[package]] -name = "sargon-factors" -version = "1.1.99" -dependencies = [ - "derive_more", - "enum-iterator", - "hkdf", - "identified-vec-of", - "iota-crypto", - "k256 0.13.3", - "once_cell 1.19.0", - "radix-common", - "radix-engine-interface", - "sargon-core", - "sargon-hierarchical-deterministic", - "serde", - "serde_json 1.0.108", - "serde_with 3.4.0", - "zeroize 1.7.0", -] - -[[package]] -name = "sargon-factors-supporting-types" -version = "1.1.99" -dependencies = [ - "async-trait", - "identified-vec-of", - "sargon-core", - "sargon-factors", - "sargon-hierarchical-deterministic", -] - -[[package]] -name = "sargon-hierarchical-deterministic" -version = "1.1.99" -dependencies = [ - "bip39", - "derive_more", - "enum-iterator", - "identified-vec-of", - "iota-crypto", - "itertools 0.12.0", - "paste 1.0.14", - "radix-common", - "sargon-core", - "serde", - "serde_json 1.0.108", - "serde_with 3.4.0", - "zeroize 1.7.0", -] - -[[package]] -name = "sargon-keys-collector" -version = "1.1.99" -dependencies = [ - "actix-rt", - "async-trait", - "derive_more", - "log", - "sargon-addresses", - "sargon-core", - "sargon-factors", - "sargon-factors-supporting-types", - "sargon-hierarchical-deterministic", -] - -[[package]] -name = "sargon-manifests" -version = "1.1.99" -dependencies = [ - "cargo_toml 0.15.3 (git+https://gitlab.com/lib.rs/cargo_toml?rev=e498c94fc42a660c1ca1a28999ce1d757cfe77fe)", - "derive_more", - "gateway-models", - "identified-vec-of", - "pretty_assertions", - "radix-common", - "radix-engine", - "radix-engine-interface", - "radix-engine-toolkit", - "radix-rust", - "radix-transactions", - "sargon-addresses", - "sargon-core", - "sargon-core-utils", - "sargon-factors", - "sargon-hierarchical-deterministic", - "sargon-profile", - "sargon-transaction-models", - "sbor", - "serde", - "serde_json 1.0.108", -] - -[[package]] -name = "sargon-profile" -version = "1.1.99" -dependencies = [ - "cargo_toml 0.15.3 (git+https://gitlab.com/lib.rs/cargo_toml?rev=e498c94fc42a660c1ca1a28999ce1d757cfe77fe)", - "derive_more", - "enum-iterator", - "hkdf", - "identified-vec-of", - "k256 0.13.3", - "once_cell 1.19.0", - "pretty_assertions", - "sargon-addresses", - "sargon-core", - "sargon-factors", - "sargon-hierarchical-deterministic", - "sargon-keys-collector", - "sargon-profile-app-preferences", - "sargon-profile-security-structures", - "sargon-transaction-models", - "serde", - "serde_json 1.0.108", - "serde_repr", - "strum 0.26.1", -] - -[[package]] -name = "sargon-profile-app-preferences" -version = "1.1.99" -dependencies = [ - "derive_more", - "identified-vec-of", - "sargon-addresses", - "sargon-core", - "sargon-factors", - "sargon-hierarchical-deterministic", - "sargon-keys-collector", - "sargon-profile-gateway", - "sargon-profile-security-structures", - "sargon-transaction-models", - "serde", - "serde_json 1.0.108", -] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "sargon-profile-gateway" -version = "1.1.99" +name = "rustc-hash" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "derive_more", - "identified-vec-of", - "sargon-addresses", - "sargon-core", - "sargon-factors", - "sargon-hierarchical-deterministic", - "sargon-keys-collector", - "sargon-transaction-models", - "serde", - "serde_json 1.0.108", + "semver", ] [[package]] -name = "sargon-profile-logic" -version = "1.1.99" +name = "rustix" +version = "0.38.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" dependencies = [ - "derive_more", - "identified-vec-of", - "itertools 0.12.0", - "pretty_assertions", - "sargon-addresses", - "sargon-core", - "sargon-factors", - "sargon-hierarchical-deterministic", - "sargon-profile", - "sargon-profile-supporting-types", - "serde", - "serde_json 1.0.108", + "bitflags 2.6.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", ] [[package]] -name = "sargon-profile-security-structures" -version = "1.1.99" +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "derive_more", - "enum-as-inner", - "identified-vec-of", - "next-derivation-index-ephemeral", - "pretty_assertions", - "radix-engine-interface", - "sargon-addresses", - "sargon-core", - "sargon-factors", - "sargon-hierarchical-deterministic", - "serde", - "thiserror 1.0.50", + "rustls-pki-types", ] [[package]] -name = "sargon-profile-supporting-types" -version = "1.1.99" +name = "rustls-pki-types" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" + +[[package]] +name = "rustversion" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" dependencies = [ - "derive_more", - "identified-vec-of", - "itertools 0.12.0", - "pretty_assertions", - "sargon-addresses", - "sargon-core", - "sargon-factors", - "sargon-hierarchical-deterministic", - "sargon-profile", - "serde", - "serde_json 1.0.108", + "winapi-util", ] [[package]] -name = "sargon-transaction-models" +name = "sargon" version = "1.1.99" dependencies = [ + "actix-rt", + "addresses", + "async-std", + "async-trait", + "base64 0.22.1 (git+https://github.com/marshallpierce/rust-base64.git?rev=e14400697453bcc85997119b874bc03d9601d0af)", "cargo_toml 0.15.3 (git+https://gitlab.com/lib.rs/cargo_toml?rev=e498c94fc42a660c1ca1a28999ce1d757cfe77fe)", + "clients", + "core-misc", "derive_more", + "drivers", + "encryption", + "enum-as-inner", "enum-iterator", + "factor-instances-provider", + "factors", + "futures", + "gateway-client-and-api", + "gateway-models", + "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", + "hierarchical-deterministic", "identified-vec-of", + "keys-collector", + "log", + "manifests", + "paste 1.0.14", "pretty_assertions", + "profile", + "profile-gateway", + "profile-logic", + "profile-security-structures", "radix-common", - "radix-common-derive", - "radix-engine", "radix-engine-interface", - "radix-engine-toolkit", "radix-engine-toolkit-common", - "radix-rust", "radix-transactions", - "sargon-addresses", - "sargon-core", - "sargon-factors", - "sargon-hierarchical-deterministic", - "sbor", + "security-framework", + "security-framework-sys", "serde", "serde_json 1.0.108", "serde_with 3.4.0", + "transaction-foundation", + "transaction-models", +] + +[[package]] +name = "sargon-core-utils" +version = "1.1.99" +dependencies = [ + "error", + "iso8601-timestamp", + "log", + "pretty_assertions", + "serde", + "serde_json 1.0.108", + "url", + "uuid 1.6.1", ] [[package]] @@ -3262,46 +3631,48 @@ name = "sargon-uniffi" version = "1.1.99" dependencies = [ "actix-rt", + "addresses", "assert-json-diff", "async-trait", "base64 0.22.1 (git+https://github.com/marshallpierce/rust-base64.git?rev=e14400697453bcc85997119b874bc03d9601d0af)", "camino 1.0.8", "clap 4.5.1", + "clients", + "core-misc", "delegate", "derive_more", + "drivers", + "encryption", "enum-as-inner", "enum-iterator", + "factor-instances-provider", + "factors", "gateway-client-and-api", "gateway-models", "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", + "hierarchical-deterministic", "identified-vec-of", + "indexmap 2.7.0", "iso8601-timestamp", "itertools 0.12.0", + "keys-collector", "log", + "manifests", "paste 1.0.14", "preinterpret", "pretty_assertions", "pretty_env_logger", + "profile", + "profile-logic", + "profile-security-structures", "radix-engine-toolkit", "rand", "regex 1.9.3 (git+https://github.com/rust-lang/regex/?rev=72f889ef3cca59ebac6a026f3646e8d92f056d88)", "sargon", - "sargon-addresses", - "sargon-clients", - "sargon-core", - "sargon-drivers", - "sargon-factor-instances-provider", - "sargon-factors", - "sargon-hierarchical-deterministic", - "sargon-keys-collector", - "sargon-manifests", - "sargon-profile", - "sargon-profile-logic", - "sargon-profile-security-structures", - "sargon-transaction-models", "sargon-uniffi-conversion-macros", "strum 0.26.1", "thiserror 1.0.50", + "transaction-models", "uniffi", "url", "uuid 1.6.1", @@ -3314,7 +3685,7 @@ version = "0.1.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.94", ] [[package]] @@ -3347,7 +3718,7 @@ version = "1.3.0" source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=v1.3.0#57309755e1fe81ba802e0bf92bbcaf4f116b9b62" dependencies = [ "const-sha1", - "indexmap 2.6.0", + "indexmap 2.7.0", "itertools 0.10.5", "proc-macro2", "quote", @@ -3365,15 +3736,15 @@ dependencies = [ "regex 1.9.3 (registry+https://github.com/rust-lang/crates.io-index)", "sbor", "serde", - "serde_json 1.0.132", - "serde_with 3.11.0", + "serde_json 1.0.134", + "serde_with 3.12.0", ] [[package]] name = "schannel" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ "windows-sys 0.59.0", ] @@ -3410,7 +3781,7 @@ checksum = "7f81c2fde025af7e69b1d1420531c8a8811ca898919db177141a85313b1cb932" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.94", ] [[package]] @@ -3446,7 +3817,7 @@ dependencies = [ "regex 1.9.3 (registry+https://github.com/rust-lang/crates.io-index)", "sbor", "serde", - "serde_json 1.0.132", + "serde_json 1.0.134", "syn 1.0.109", ] @@ -3507,31 +3878,31 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.23" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.213" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ea7893ff5e2466df8d720bb615088341b295f849602c6956047f8f80f0e9bc1" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.213" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e85ad2009c50b58e87caa8cd6dac16bdf511bbfb7af6c33df902396aa480fa5" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.94", ] [[package]] @@ -3539,7 +3910,7 @@ name = "serde_json" version = "1.0.108" source = "git+https://github.com/serde-rs/json/?rev=4bc1eaa03a6160593575bc9bc60c94dba4cab1e3#4bc1eaa03a6160593575bc9bc60c94dba4cab1e3" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.7.0", "itoa", "ryu", "serde", @@ -3547,11 +3918,11 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.132" +version = "1.0.134" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" +checksum = "d00f4175c42ee48b15416f6193a959ba3a0d67fc699a0db9ad12df9f83991c7d" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.7.0", "itoa", "memchr", "ryu", @@ -3565,7 +3936,7 @@ source = "git+https://github.com/dtolnay/serde-repr/?rev=94cce18a51bc169869f2cdc dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.94", ] [[package]] @@ -3598,28 +3969,28 @@ dependencies = [ "chrono", "hex 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "indexmap 1.9.3", - "indexmap 2.6.0", + "indexmap 2.7.0", "serde", - "serde_json 1.0.132", + "serde_json 1.0.134", "serde_with_macros 3.4.0", "time", ] [[package]] name = "serde_with" -version = "3.11.0" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e28bdad6db2b8340e449f7108f020b3b092e8583a9e3fb82713e1d4e71fe817" +checksum = "d6b6f7f2fcb69f747921f79f3926bd1e203fce4fef62c268dd3abfb6d86029aa" dependencies = [ "base64 0.22.1 (registry+https://github.com/rust-lang/crates.io-index)", "chrono", "hex 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "indexmap 1.9.3", - "indexmap 2.6.0", + "indexmap 2.7.0", "serde", "serde_derive", - "serde_json 1.0.132", - "serde_with_macros 3.11.0", + "serde_json 1.0.134", + "serde_with_macros 3.12.0", "time", ] @@ -3631,19 +4002,19 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.94", ] [[package]] name = "serde_with_macros" -version = "3.11.0" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d846214a9854ef724f3da161b426242d8de7c1fc7de2f89bb1efcb154dca79d" +checksum = "8d00caa5193a3c8362ac2b73be6b9e768aa5a4b2f721d8f4b339600c3cb51f8e" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.94", ] [[package]] @@ -3673,6 +4044,21 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "short-string" +version = "1.1.99" +dependencies = [ + "arraystring", + "assert-json", + "derive_more", + "has-sample-values", + "identified-vec-of", + "sargon-core-utils", + "serde", + "serde_json 1.0.108", + "serde_with 3.4.0", +] + [[package]] name = "signal-hook-registry" version = "1.4.2" @@ -3736,9 +4122,9 @@ checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" [[package]] name = "socket2" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" dependencies = [ "libc", "windows-sys 0.52.0", @@ -3760,6 +4146,12 @@ dependencies = [ "der", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "static_assertions" version = "1.1.0" @@ -3822,7 +4214,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.85", + "syn 2.0.94", ] [[package]] @@ -3844,9 +4236,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.85" +version = "2.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" +checksum = "987bc0be1cdea8b10216bd06e2ca407d40b9543468fafd3ddfb02f36e77f71f3" dependencies = [ "proc-macro2", "quote", @@ -3859,6 +4251,17 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.94", +] + [[package]] name = "tagptr" version = "0.2.0" @@ -3867,12 +4270,13 @@ checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" [[package]] name = "tempfile" -version = "3.13.0" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" +checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" dependencies = [ "cfg-if", "fastrand", + "getrandom", "once_cell 1.20.2", "rustix", "windows-sys 0.59.0", @@ -3906,11 +4310,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.65" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl 1.0.65", + "thiserror-impl 1.0.69", ] [[package]] @@ -3920,18 +4324,18 @@ source = "git+https://github.com/dtolnay/thiserror/?rev=a7d220d7915fb888413aa797 dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.94", ] [[package]] name = "thiserror-impl" -version = "1.0.65" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.94", ] [[package]] @@ -3945,9 +4349,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.36" +version = "0.3.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" dependencies = [ "deranged", "itoa", @@ -3966,19 +4370,37 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" dependencies = [ "num-conv", "time-core", ] +[[package]] +name = "time-utils" +version = "1.1.99" +dependencies = [ + "iso8601-timestamp", + "serde_json 1.0.108", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" dependencies = [ "tinyvec_macros", ] @@ -3991,12 +4413,12 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.41.0" +version = "1.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" +checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" dependencies = [ "backtrace", - "bytes", + "bytes 1.9.0", "libc", "mio", "parking_lot", @@ -4052,7 +4474,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.7.0", "serde", "serde_spanned", "toml_datetime", @@ -4067,9 +4489,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "pin-project-lite", "tracing-core", @@ -4077,13 +4499,68 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell 1.20.2", ] +[[package]] +name = "transaction-foundation" +version = "1.1.99" +dependencies = [ + "assert-json", + "bytes 1.1.99", + "derive_more", + "has-sample-values", + "paste 1.0.14", + "radix-engine-interface", + "serde", + "serde_json 1.0.108", +] + +[[package]] +name = "transaction-models" +version = "1.1.99" +dependencies = [ + "addresses", + "bytes 1.1.99", + "cargo_toml 0.15.3 (git+https://gitlab.com/lib.rs/cargo_toml?rev=e498c94fc42a660c1ca1a28999ce1d757cfe77fe)", + "core-collections", + "core-misc", + "derive_more", + "ecc", + "enum-as-inner", + "enum-iterator", + "factors", + "has-sample-values", + "hash", + "hierarchical-deterministic", + "identified-vec-of", + "log", + "metadata", + "network", + "numeric", + "paste 1.0.14", + "pretty_assertions", + "radix-common", + "radix-common-derive", + "radix-engine", + "radix-engine-interface", + "radix-engine-toolkit", + "radix-engine-toolkit-common", + "radix-rust", + "radix-transactions", + "sargon-core-utils", + "sbor", + "serde", + "serde_json 1.0.108", + "serde_with 3.4.0", + "strum 0.26.1", + "transaction-foundation", +] + [[package]] name = "triomphe" version = "0.1.14" @@ -4104,21 +4581,15 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicase" -version = "2.8.0" +version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" - -[[package]] -name = "unicode-bidi" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-normalization" @@ -4195,7 +4666,7 @@ version = "0.28.3" source = "git+https://github.com/mozilla/uniffi-rs/?rev=9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d#9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d" dependencies = [ "quote", - "syn 2.0.85", + "syn 2.0.94", ] [[package]] @@ -4204,7 +4675,7 @@ version = "0.28.3" source = "git+https://github.com/mozilla/uniffi-rs/?rev=9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d#9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d" dependencies = [ "anyhow", - "bytes", + "bytes 1.9.0", "once_cell 1.20.2", "paste 1.0.15", "static_assertions", @@ -4222,7 +4693,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.85", + "syn 2.0.94", "toml 0.5.11", "uniffi_meta", ] @@ -4233,7 +4704,7 @@ version = "0.28.3" source = "git+https://github.com/mozilla/uniffi-rs/?rev=9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d#9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d" dependencies = [ "anyhow", - "bytes", + "bytes 1.9.0", "siphasher", "uniffi_checksum_derive", ] @@ -4273,9 +4744,9 @@ dependencies = [ [[package]] name = "url" -version = "2.5.2" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", @@ -4283,6 +4754,18 @@ dependencies = [ "serde", ] +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" @@ -4352,9 +4835,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" +checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" dependencies = [ "cfg-if", "once_cell 1.20.2", @@ -4363,36 +4846,36 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" +checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" dependencies = [ "bumpalo", "log", - "once_cell 1.20.2", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.94", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.45" +version = "0.4.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" +checksum = "38176d9b44ea84e9184eff0bc34cc167ed044f816accfe5922e54d84cf48eca2" dependencies = [ "cfg-if", "js-sys", + "once_cell 1.20.2", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" +checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4400,22 +4883,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" +checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.94", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" +checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" [[package]] name = "wasm-encoder" @@ -4487,7 +4970,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9dbe55c8f9d0dbd25d9447a5a889ff90c0cc3feaa7395310d3d826b2c703eaab" dependencies = [ "bitflags 2.6.0", - "indexmap 2.6.0", + "indexmap 2.7.0", "semver", ] @@ -4512,9 +4995,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.72" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" +checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" dependencies = [ "js-sys", "wasm-bindgen", @@ -4713,6 +5196,18 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "x25519-dalek" version = "2.0.1" @@ -4730,6 +5225,30 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.94", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -4748,7 +5267,28 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.94", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.94", + "synstructure", ] [[package]] @@ -4776,7 +5316,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.94", ] [[package]] @@ -4786,5 +5326,27 @@ source = "git+https://github.com/RustCrypto/utils?rev=df6d2f48a5e8afe8eef04ba32e dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.94", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.94", ] diff --git a/Cargo.toml b/Cargo.toml index 6d22fe8c0..ca1c82360 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,74 +1,134 @@ [workspace] resolver = "2" members = [ - # sorted according to dependency, not alphabetically - "crates/sargon-core-utils", - "crates/sargon-core-error", - "crates/sargon-core-assert-json", - - "crates/identified-vec-of", - - "crates/sargon-core", - "crates/sargon-hierarchical-deterministic", - "crates/sargon-factors", - "crates/sargon-factors-supporting-types", - "crates/sargon-addresses", - "crates/sargon-keys-collector", - "crates/sargon-transaction-models", - "crates/sargon-manifests", - "crates/sargon-profile-supporting-types", - "crates/sargon-drivers", - "crates/http-client", - "crates/sargon-clients", - "crates/sargon-profile-gateway", - "crates/sargon-profile", - "crates/sargon-profile-app-preferences", - "crates/sargon-profile-security-structures", - "crates/sargon-profile-logic", - "crates/sargon-factor-instances-provider", - "crates/next-derivation-index-ephemeral", - - "crates/gateway-models", - "crates/gateway-client-and-api", - - "crates/sargon", # to be split - - "crates/sargon-uniffi-conversion-macros", - "crates/sargon-uniffi", + # === COMMON === + "crates/common/bytes", + "crates/common/entity-foundation", + "crates/common/host-info", + "crates/common/identified-vec-of", + "crates/common/metadata", + "crates/common/network", + "crates/common/numeric", + "crates/common/short-string", + + # === CORE === + "crates/core/assert-json", + "crates/core/collections", + "crates/core/error", + "crates/core/has-sample-values", + "crates/core/misc", + "crates/core/time-utils", + "crates/core/utils", + + # === CRYPTO === + "crates/crypto/addresses", + "crates/crypto/ecc", + "crates/crypto/encryption", + "crates/crypto/hash", + "crates/crypto/hd", + + # === FACTORS === + "crates/factors/factors", + "crates/factors/instances-provider", + "crates/factors/keys-collector", + "crates/factors/next-derivation-index-ephemeral", + "crates/factors/supporting-types", + + # === GATEWAY === + "crates/gateway/client-and-api", + "crates/gateway/models", + + # === PROFILE === + "crates/profile/logic/logic_SPLIT_ME", + "crates/profile/models/app-preferences", + "crates/profile/models/gateway", + "crates/profile/models/account-for-display", + "crates/profile/models/profile_SPLIT_ME", + "crates/profile/models/security-structures", + "crates/profile/models/supporting-types", + + # === SARGON - SPLIT ME === + "crates/sargon_SPLIT_ME", + + # === SYSTEM === + "crates/system/clients/clients", + "crates/system/clients/http", + "crates/system/drivers", + + # === TRANSACTION === + "crates/transaction/foundation", + "crates/transaction/manifests", + "crates/transaction/models", + + # === UNIFFI === + "crates/uniffi/uniffi_SPLIT_ME", + "crates/uniffi/conversion-macros", ] default-members = [ - # sorted according to dependency, not alphabetically - "crates/sargon-core-utils", - "crates/sargon-core-error", - "crates/sargon-core-assert-json", - - "crates/identified-vec-of", - - "crates/sargon-core", - "crates/sargon-hierarchical-deterministic", - "crates/sargon-factors", - "crates/sargon-factors-supporting-types", - "crates/sargon-addresses", - "crates/sargon-keys-collector", - "crates/sargon-transaction-models", - "crates/sargon-manifests", - "crates/sargon-profile-supporting-types", - "crates/sargon-drivers", - "crates/http-client", - "crates/sargon-clients", - "crates/sargon-profile-gateway", - "crates/sargon-profile", - "crates/sargon-profile-app-preferences", - "crates/sargon-profile-security-structures", - "crates/sargon-profile-logic", - "crates/sargon-factor-instances-provider", - "crates/next-derivation-index-ephemeral", - - "crates/gateway-models", - "crates/gateway-client-and-api", - - "crates/sargon", # to be split + # === COMMON === + "crates/common/bytes", + "crates/common/entity-foundation", + "crates/common/host-info", + "crates/common/identified-vec-of", + "crates/common/metadata", + "crates/common/network", + "crates/common/numeric", + "crates/common/short-string", + + # === CORE === + "crates/core/assert-json", + "crates/core/collections", + "crates/core/error", + "crates/core/has-sample-values", + "crates/core/misc", + "crates/core/time-utils", + "crates/core/utils", + + # === CRYPTO === + "crates/crypto/addresses", + "crates/crypto/ecc", + "crates/crypto/encryption", + "crates/crypto/hash", + "crates/crypto/hd", + + # === FACTORS === + "crates/factors/factors", + "crates/factors/instances-provider", + "crates/factors/keys-collector", + "crates/factors/next-derivation-index-ephemeral", + "crates/factors/supporting-types", + + # === GATEWAY === + "crates/gateway/client-and-api", + "crates/gateway/models", + + # === PROFILE === + "crates/profile/logic/logic_SPLIT_ME", + "crates/profile/models/app-preferences", + "crates/profile/models/gateway", + "crates/profile/models/account-for-display", + "crates/profile/models/profile_SPLIT_ME", + "crates/profile/models/security-structures", + "crates/profile/models/supporting-types", + + # === SARGON - SPLIT ME === + "crates/sargon_SPLIT_ME", + + # === SYSTEM === + "crates/system/clients/clients", + "crates/system/clients/http", + "crates/system/drivers", + + # === TRANSACTION === + "crates/transaction/foundation", + "crates/transaction/manifests", + "crates/transaction/models", + + # === UNIFFI === + # Uniffi is omitted for maximum compilation speed + # you can `cargo check --workspace` to check it. + # or cargo test --workspace to test it. ] [profile.release] @@ -173,8 +233,10 @@ hex = { git = "https://github.com/KokaKiwi/rust-hex/", rev = "b2b4370b5bf021b98e # hkdf = "0.12.4" hkdf = { git = "https://github.com/RustCrypto/KDFs/", rev = "1ac16e8b9d4ee7a67613c9396c6cc1327652eaba" } +indexmap = { version = "2.2.5", default-features = false } + # SLIP10 implementation -# iota_crypto = "0.23.2" +# iota-crypto = "0.23.2" iota-crypto = { git = "https://github.com/iotaledger/crypto.rs", rev = "8c13125541e762206e2dc57b8bfde89c7f6ce8e3", features = [ "slip10", "ed25519", diff --git a/apple/Sources/Sargon/Extensions/Methods/Transaction/AccountOrAddressOf+Wrap+Functions.swift b/apple/Sources/Sargon/Extensions/Methods/Transaction/AccountOrAddressOf+Wrap+Functions.swift index 5c14c5919..5df313883 100644 --- a/apple/Sources/Sargon/Extensions/Methods/Transaction/AccountOrAddressOf+Wrap+Functions.swift +++ b/apple/Sources/Sargon/Extensions/Methods/Transaction/AccountOrAddressOf+Wrap+Functions.swift @@ -1,6 +1,6 @@ import SargonUniFFI -extension OwnedOrThirdPartyAccountAddress { +extension AccountOrAddressOf { public var accountAddress: AccountAddress { accountOrAddressOfAccountAddress(recipient: self) } diff --git a/apple/Sources/Sargon/Extensions/SampleValues/Transaction/AccountOrAddressOf+SampleValues.swift b/apple/Sources/Sargon/Extensions/SampleValues/Transaction/AccountOrAddressOf+SampleValues.swift index 3ea15280b..d05f42837 100644 --- a/apple/Sources/Sargon/Extensions/SampleValues/Transaction/AccountOrAddressOf+SampleValues.swift +++ b/apple/Sources/Sargon/Extensions/SampleValues/Transaction/AccountOrAddressOf+SampleValues.swift @@ -1,7 +1,7 @@ import SargonUniFFI #if DEBUG -extension OwnedOrThirdPartyAccountAddress { +extension AccountOrAddressOf { public static let sample: Self = newAccountOrAddressOfSample() public static let sampleOther: Self = newAccountOrAddressOfSampleOther() } diff --git a/apple/Sources/Sargon/Extensions/Swiftified/Profile/Account/Account+Swiftified.swift b/apple/Sources/Sargon/Extensions/Swiftified/Profile/Account/Account+Swiftified.swift index c9cd9b90c..531553ca1 100644 --- a/apple/Sources/Sargon/Extensions/Swiftified/Profile/Account/Account+Swiftified.swift +++ b/apple/Sources/Sargon/Extensions/Swiftified/Profile/Account/Account+Swiftified.swift @@ -13,6 +13,10 @@ extension Account { public var appearanceID: AppearanceID { appearanceId } + + public var forDisplay: AccountForDisplay { + AccountForDisplay(address: address, displayName: displayName, appearanceId: appearanceID) + } } // MARK: - Account + EntityProtocol diff --git a/apple/Sources/Sargon/Extensions/Swiftified/Profile/Factor/FactorSource+Extras.swift b/apple/Sources/Sargon/Extensions/Swiftified/Profile/Factor/FactorSource+Extras.swift new file mode 100644 index 000000000..0205b2754 --- /dev/null +++ b/apple/Sources/Sargon/Extensions/Swiftified/Profile/Factor/FactorSource+Extras.swift @@ -0,0 +1,43 @@ +import SargonUniFFI + +extension DeviceFactorSource { + public func removingMainFlag() -> Self { + var copy = self + copy.common.flags.removeAll(where: { $0 == .main }) + return copy + } +} + +extension FactorSource { + public var isExplicitMain: Bool { + switch self { + case let .device(deviceFactorSource): + deviceFactorSource.isMainBDFS + default: false + } + } +} + +extension DeviceFactorSource { + /// **B**abylon **D**evice **F**actor **S**ource + public var isExplicitMainBDFS: Bool { + isBDFS && isExplicitMain + } + + /// **B**abylon **D**evice **F**actor **S**ource + public var isBDFS: Bool { + guard supportsBabylon else { return false } + if hint.mnemonicWordCount == .twentyFour { + return true + } else { + log.error("BDFS with non 24 words mnemonic found, probably this profile originated from Android? Which with 'BDFS Error' with 1.0.0 allowed usage of 12 word Olympia Mnemonic.") + return false + } + } +} + +extension FactorSourceProtocol { + public var isExplicitMain: Bool { + common.flags.contains(.main) + } +} diff --git a/apple/Sources/Sargon/Extensions/Swiftified/Profile/Factor/FactorSourceIntegrity+Swiftified.swift b/apple/Sources/Sargon/Extensions/Swiftified/Profile/Factor/FactorSourceIntegrity+Swiftified.swift new file mode 100644 index 000000000..02f7f9148 --- /dev/null +++ b/apple/Sources/Sargon/Extensions/Swiftified/Profile/Factor/FactorSourceIntegrity+Swiftified.swift @@ -0,0 +1,29 @@ +import SargonUniFFI + +extension FactorSourceIntegrity { + public var factorSource: FactorSource { + switch self { + case let .device(device): + device.factorSource.asGeneral + case let .ledger(ledger): + ledger.asGeneral + case let .arculusCard(arculus): + arculus.asGeneral + case let .password(password): + password.asGeneral + case let .offDeviceMnemonic(offDeviceMnemonic): + offDeviceMnemonic.asGeneral + } + } + + public var isExplicitMain: Bool { + switch self { + case let .device(device): + device.factorSource.isMainBDFS + case .ledger, .password, .offDeviceMnemonic, .arculusCard: + // TODO: Should we have the notion of "main" for + // other FactorSourceKinds than device? + false + } + } +} diff --git a/apple/Sources/Sargon/Extensions/Swiftified/Transaction/AccountOrAddressOf+Swiftified.swift b/apple/Sources/Sargon/Extensions/Swiftified/Transaction/AccountOrAddressOf+Swiftified.swift index 3eba93700..66ce64b49 100644 --- a/apple/Sources/Sargon/Extensions/Swiftified/Transaction/AccountOrAddressOf+Swiftified.swift +++ b/apple/Sources/Sargon/Extensions/Swiftified/Transaction/AccountOrAddressOf+Swiftified.swift @@ -1,17 +1,17 @@ import SargonUniFFI -// MARK: - OwnedOrThirdPartyAccountAddress + SargonModel -extension OwnedOrThirdPartyAccountAddress: SargonModel {} +// MARK: - AccountOrAddressOf + SargonModel +extension AccountOrAddressOf: SargonModel {} -// MARK: - OwnedOrThirdPartyAccountAddress + CustomStringConvertible -extension OwnedOrThirdPartyAccountAddress: CustomStringConvertible { +// MARK: - AccountOrAddressOf + CustomStringConvertible +extension AccountOrAddressOf: CustomStringConvertible { public var description: String { accountAddress.address } } -// MARK: - OwnedOrThirdPartyAccountAddress + Identifiable -extension OwnedOrThirdPartyAccountAddress: Identifiable { +// MARK: - AccountOrAddressOf + Identifiable +extension AccountOrAddressOf: Identifiable { public typealias ID = AccountAddress public var id: ID { accountAddress diff --git a/apple/Tests/TestCases/RET/ManifestBuilding/ManifestBuildingTests.swift b/apple/Tests/TestCases/RET/ManifestBuilding/ManifestBuildingTests.swift index 169f4ad14..56f4a7ca4 100644 --- a/apple/Tests/TestCases/RET/ManifestBuilding/ManifestBuildingTests.swift +++ b/apple/Tests/TestCases/RET/ManifestBuilding/ManifestBuildingTests.swift @@ -232,7 +232,7 @@ extension TestCase { func rtm( _ rtmFile: String, - in crate: String = "sargon-transaction-models" + in crate: String = "transaction/models" ) throws -> TransactionManifest { let data = try openTransactionFile(rtmFile, extension: "rtm", in: crate) let instructionsString = try XCTUnwrap(String(data: data, encoding: .utf8)) @@ -247,7 +247,7 @@ extension TestCase { private func openTransactionFile( _ fileName: String, extension fileExtension: String, - in crate: String = "sargon-transaction-models" + in crate: String = "transaction/models" ) throws -> Data { try openFile(subPath: "transaction", fileName, extension: fileExtension, in: crate) } diff --git a/apple/Tests/TestCases/RadixConnect/WalletInteraction/WalletToDappInteractionResponseTests.swift b/apple/Tests/TestCases/RadixConnect/WalletInteraction/WalletToDappInteractionResponseTests.swift index 9636335ec..074451075 100644 --- a/apple/Tests/TestCases/RadixConnect/WalletInteraction/WalletToDappInteractionResponseTests.swift +++ b/apple/Tests/TestCases/RadixConnect/WalletInteraction/WalletToDappInteractionResponseTests.swift @@ -10,7 +10,7 @@ final class WalletToDappInteractionResponseTests: Test { +final class AccountOrAddressOfTests: Test { func test_id_is_account_address() { XCTAssertEqual(SUT.sample.id, SUT.sample.accountAddress) } diff --git a/apple/Tests/Utils/Test.swift b/apple/Tests/Utils/Test.swift index 5d1e5758e..56d82f40b 100644 --- a/apple/Tests/Utils/Test.swift +++ b/apple/Tests/Utils/Test.swift @@ -11,9 +11,9 @@ class TestCase: XCTestCase { } override class func setUp() { -// if shouldEnableRustLog() { -// -// } + // if shouldEnableRustLog() { + // + // } super.setUp() } @@ -25,11 +25,15 @@ class TestCase: XCTestCase { subPath: String, _ fileName: String, extension fileExtension: String, - in crate: String = "sargon-profile" + in crate: String = "profile/models/profile_SPLIT_ME" ) throws -> Data { - let testsDirectory: String = URL(fileURLWithPath: "\(#file)").pathComponents.dropLast(4).joined(separator: "/") + let testsDirectory: String = URL(fileURLWithPath: "\(#file)").pathComponents.dropLast(4).joined( + separator: "/") - let fileURL = try XCTUnwrap(URL(fileURLWithPath: "\(testsDirectory)/crates/\(crate)/fixtures/\(subPath)/\(fileName).\(fileExtension)")) + let fileURL = try XCTUnwrap( + URL( + fileURLWithPath: + "\(testsDirectory)/crates/\(crate)/fixtures/\(subPath)/\(fileName).\(fileExtension)")) return try Data(contentsOf: fileURL) } @@ -47,9 +51,10 @@ class TestCase: XCTestCase { func jsonFixture( as: T.Type = T.self, file fileName: String, + in crate: String = "profile/models/profile_SPLIT_ME", decode: (Data) throws -> T ) throws -> (model: T, json: Data) { - let json = try openFile(subPath: "vector", fileName, extension: "json") + let json = try openFile(subPath: "vector", fileName, extension: "json", in: crate) let model: T = try decode(json) return (model, json) } @@ -57,9 +62,15 @@ class TestCase: XCTestCase { func jsonString( as: T.Type = T.self, file fileName: String, + in crate: String = "profile/models/profile_SPLIT_ME", decode: (String) throws -> T ) throws -> (model: T, jsonString: String) { - let jsonData = try openFile(subPath: "vector", fileName, extension: "json") + let jsonData = try openFile( + subPath: "vector", + fileName, + extension: "json", + in: crate + ) let jsonString = try XCTUnwrap(String(data: jsonData, encoding: .utf8)) let model: T = try decode(jsonString) return (model, jsonString) diff --git a/crates/common/bytes/Cargo.toml b/crates/common/bytes/Cargo.toml new file mode 100644 index 000000000..b2efa63ac --- /dev/null +++ b/crates/common/bytes/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "bytes" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +assert-json = { path = "../../core/assert-json" } +error = { path = "../../core/error" } +has-sample-values = { path = "../../core/has-sample-values" } + +# === RADIX DEPENDENCIES === +# None + +# === EXTERNAL DEPENDENCIES === +delegate = { workspace = true } +derive_more = { workspace = true } +hex = { workspace = true } +paste = { workspace = true } +rand = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +serde_with = { workspace = true } +zeroize = { workspace = true } diff --git a/crates/sargon-core/src/types/bag_of_bytes.rs b/crates/common/bytes/src/bag_of_bytes.rs similarity index 96% rename from crates/sargon-core/src/types/bag_of_bytes.rs rename to crates/common/bytes/src/bag_of_bytes.rs index 3976b3ec3..7744c3857 100644 --- a/crates/sargon-core/src/types/bag_of_bytes.rs +++ b/crates/common/bytes/src/bag_of_bytes.rs @@ -65,13 +65,6 @@ impl BagOfBytes { } } -impl From for BagOfBytes { - /// Instantiates a new `BagOfBytes` from the `Hash` (32 bytes). - fn from(value: Hash) -> Self { - value.bytes().as_slice().into() - } -} - impl From> for BagOfBytes { fn from(value: Vec) -> Self { Self { bytes: value } @@ -205,6 +198,8 @@ impl BagOfBytes { #[cfg(test)] mod tests { + use std::collections::HashSet; + use super::*; #[allow(clippy::upper_case_acronyms)] @@ -289,12 +284,6 @@ mod tests { assert_eq!(format!("{}", hex_bytes), str); } - #[test] - fn from_hash() { - let digest = hash_of(vec![0xde, 0xad]); - assert_eq!(SUT::from(digest).to_vec(), digest.bytes()); - } - #[test] fn to_hex() { let str = diff --git a/crates/sargon-core/src/types/exactly_n_bytes.rs b/crates/common/bytes/src/exactly_n_bytes.rs similarity index 99% rename from crates/sargon-core/src/types/exactly_n_bytes.rs rename to crates/common/bytes/src/exactly_n_bytes.rs index ac0f776ae..f5c63b4ec 100644 --- a/crates/sargon-core/src/types/exactly_n_bytes.rs +++ b/crates/common/bytes/src/exactly_n_bytes.rs @@ -8,7 +8,7 @@ macro_rules! decl_exactly_n_bytes { $byte_count:literal, $exp_sample_value:literal, ) => { - paste! { + paste::paste! { impl From<&[u8; $byte_count]> for BagOfBytes { fn from(value: &[u8; $byte_count]) -> BagOfBytes { BagOfBytes::from(value.as_ref()) @@ -206,6 +206,8 @@ macro_rules! decl_exactly_n_bytes { assert!(SUT::sample() < SUT::sample_other()); } + use std::collections::HashSet; + #[test] fn hash() { assert_eq!( diff --git a/crates/common/bytes/src/lib.rs b/crates/common/bytes/src/lib.rs new file mode 100644 index 000000000..6dda8f146 --- /dev/null +++ b/crates/common/bytes/src/lib.rs @@ -0,0 +1,29 @@ +mod bag_of_bytes; +mod exactly_n_bytes; +mod non_empty_max_n_bytes; +mod secret_bytes; +mod secure_random_bytes; + +pub mod prelude { + pub use crate::bag_of_bytes::*; + pub use crate::exactly_n_bytes::*; + pub use crate::non_empty_max_n_bytes::*; + pub use crate::secret_bytes::*; + pub use crate::secure_random_bytes::*; + + pub use assert_json::prelude::*; + pub use error::prelude::*; + pub use has_sample_values::prelude::*; + + pub use ::hex::decode as hex_decode; + pub use ::hex::encode as hex_encode; + pub(crate) use serde_with::*; + pub(crate) use zeroize::*; + + #[cfg(test)] + pub(crate) use serde_json::json; + + pub use std::str::FromStr; +} + +pub use prelude::*; diff --git a/crates/sargon-core/src/types/non_empty_max_n_bytes.rs b/crates/common/bytes/src/non_empty_max_n_bytes.rs similarity index 97% rename from crates/sargon-core/src/types/non_empty_max_n_bytes.rs rename to crates/common/bytes/src/non_empty_max_n_bytes.rs index df4aa3d31..84beeeeb6 100644 --- a/crates/sargon-core/src/types/non_empty_max_n_bytes.rs +++ b/crates/common/bytes/src/non_empty_max_n_bytes.rs @@ -135,12 +135,6 @@ decl_non_empty_max_n_bytes!( 64 ); -impl From for NonEmptyMax64Bytes { - fn from(value: ScryptoBytesNonFungibleLocalId) -> Self { - Self::try_from(value.value()).expect("Should not be possible, since ScryptoBytesNonFungibleLocalId have validated length") - } -} - decl_non_empty_max_n_bytes!( /// 32 bytes, typically used as entropy for Mnemonics. 32 @@ -214,6 +208,8 @@ decl_samples_for_max_n_bytes!(NonEmptyMax32Bytes, 32); #[cfg(test)] mod tests_non_empty_max_64_bytes { + use std::collections::HashSet; + use crate::prelude::*; #[allow(clippy::upper_case_acronyms)] diff --git a/crates/sargon-core/src/types/secret_bytes.rs b/crates/common/bytes/src/secret_bytes.rs similarity index 99% rename from crates/sargon-core/src/types/secret_bytes.rs rename to crates/common/bytes/src/secret_bytes.rs index 72c2d8ae4..a86cd714e 100644 --- a/crates/sargon-core/src/types/secret_bytes.rs +++ b/crates/common/bytes/src/secret_bytes.rs @@ -9,7 +9,7 @@ macro_rules! decl_secret_bytes { $struct_name: ident, $byte_count: literal ) => { - paste! { + paste::paste! { $( #[doc = $expr] )* diff --git a/crates/sargon-core/src/secure_random_bytes.rs b/crates/common/bytes/src/secure_random_bytes.rs similarity index 100% rename from crates/sargon-core/src/secure_random_bytes.rs rename to crates/common/bytes/src/secure_random_bytes.rs diff --git a/crates/common/entity-foundation/Cargo.toml b/crates/common/entity-foundation/Cargo.toml new file mode 100644 index 000000000..500eaa06c --- /dev/null +++ b/crates/common/entity-foundation/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "entity-foundation" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +assert-json = { path = "../../core/assert-json" } +error = { path = "../../core/error" } +has-sample-values = { path = "../../core/has-sample-values" } + +# === RADIX DEPENDENCIES === +# None + +# === EXTERNAL DEPENDENCIES === +itertools = { workspace = true } +derive_more = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } diff --git a/crates/sargon-core/src/types/appearance_id.rs b/crates/common/entity-foundation/src/appearance_id.rs similarity index 98% rename from crates/sargon-core/src/types/appearance_id.rs rename to crates/common/entity-foundation/src/appearance_id.rs index c7c6ab516..141d0e807 100644 --- a/crates/sargon-core/src/types/appearance_id.rs +++ b/crates/common/entity-foundation/src/appearance_id.rs @@ -60,7 +60,7 @@ impl Default for AppearanceID { } impl TryFrom for AppearanceID { - type Error = crate::CommonError; + type Error = CommonError; fn try_from(value: u8) -> Result { AppearanceID::new(value) diff --git a/crates/sargon-core/src/types/entity_kind.rs b/crates/common/entity-foundation/src/entity_kind.rs similarity index 100% rename from crates/sargon-core/src/types/entity_kind.rs rename to crates/common/entity-foundation/src/entity_kind.rs diff --git a/crates/common/entity-foundation/src/lib.rs b/crates/common/entity-foundation/src/lib.rs new file mode 100644 index 000000000..6eca6dd54 --- /dev/null +++ b/crates/common/entity-foundation/src/lib.rs @@ -0,0 +1,20 @@ +mod appearance_id; +mod entity_kind; + +pub mod prelude { + pub use crate::appearance_id::*; + pub use crate::entity_kind::*; + + #[cfg(test)] + pub(crate) use assert_json::prelude::*; + pub(crate) use error::prelude::*; + pub(crate) use has_sample_values::prelude::*; + + pub(crate) use itertools::Itertools; + pub(crate) use serde::{Deserialize, Serialize}; + + #[cfg(test)] + pub(crate) use serde_json::json; + #[cfg(test)] + pub(crate) use std::collections::HashSet; +} diff --git a/crates/common/host-info/Cargo.toml b/crates/common/host-info/Cargo.toml new file mode 100644 index 000000000..8b1c0d925 --- /dev/null +++ b/crates/common/host-info/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "host-info" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +assert-json = { path = "../../core/assert-json" } +has-sample-values = { path = "../../core/has-sample-values" } +time-utils = { path = "../../core/time-utils" } + +# === RADIX DEPENDENCIES === +# None + +# === EXTERNAL DEPENDENCIES === +derive_more = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } diff --git a/crates/sargon-core/src/types/host_info/device_id.rs b/crates/common/host-info/src/host_info/device_id.rs similarity index 98% rename from crates/sargon-core/src/types/host_info/device_id.rs rename to crates/common/host-info/src/host_info/device_id.rs index 16e88ee31..f12b26985 100644 --- a/crates/sargon-core/src/types/host_info/device_id.rs +++ b/crates/common/host-info/src/host_info/device_id.rs @@ -18,7 +18,7 @@ pub struct DeviceID(pub Uuid); impl DeviceID { pub fn generate_new() -> Self { - Self(id()) + Self(Uuid::new_v4()) } } diff --git a/crates/sargon-core/src/types/host_info/device_info_description.rs b/crates/common/host-info/src/host_info/device_info_description.rs similarity index 99% rename from crates/sargon-core/src/types/host_info/device_info_description.rs rename to crates/common/host-info/src/host_info/device_info_description.rs index d015bb01e..f7fd09ef4 100644 --- a/crates/sargon-core/src/types/host_info/device_info_description.rs +++ b/crates/common/host-info/src/host_info/device_info_description.rs @@ -1,3 +1,5 @@ +use serde::Deserializer; + use crate::prelude::*; /// A name and model of a host device. diff --git a/crates/sargon-core/src/types/host_info/host_id.rs b/crates/common/host-info/src/host_info/host_id.rs similarity index 92% rename from crates/sargon-core/src/types/host_info/host_id.rs rename to crates/common/host-info/src/host_info/host_id.rs index 1b4755a41..2a1d29764 100644 --- a/crates/sargon-core/src/types/host_info/host_id.rs +++ b/crates/common/host-info/src/host_info/host_id.rs @@ -1,3 +1,5 @@ +use time_utils::now; + use crate::prelude::*; #[derive( @@ -71,7 +73,10 @@ mod tests { let host_infos: Vec = (0..100).map(|_| SUT::generate_new()).collect(); - assert_eq!(HashSet::from_iter(host_infos.iter().cloned()).len(), 100); + assert_eq!( + HashSet::::from_iter(host_infos.iter().cloned()).len(), + 100 + ); } #[test] diff --git a/crates/sargon-core/src/types/host_info/host_info.rs b/crates/common/host-info/src/host_info/host_info.rs similarity index 100% rename from crates/sargon-core/src/types/host_info/host_info.rs rename to crates/common/host-info/src/host_info/host_info.rs diff --git a/crates/sargon-core/src/types/host_info/host_os.rs b/crates/common/host-info/src/host_info/host_os.rs similarity index 99% rename from crates/sargon-core/src/types/host_info/host_os.rs rename to crates/common/host-info/src/host_info/host_os.rs index 4eaa2596e..e6bd6d934 100644 --- a/crates/sargon-core/src/types/host_info/host_os.rs +++ b/crates/common/host-info/src/host_info/host_os.rs @@ -1,4 +1,4 @@ -use crate::HasSampleValues; +use crate::prelude::*; use std::fmt::{Display, Formatter}; /// Describes the type of the Host machine and its version. Currently, as it stands at runtime diff --git a/crates/sargon-core/src/types/host_info/mod.rs b/crates/common/host-info/src/host_info/mod.rs similarity index 100% rename from crates/sargon-core/src/types/host_info/mod.rs rename to crates/common/host-info/src/host_info/mod.rs diff --git a/crates/common/host-info/src/lib.rs b/crates/common/host-info/src/lib.rs new file mode 100644 index 000000000..c4b6b2cb6 --- /dev/null +++ b/crates/common/host-info/src/lib.rs @@ -0,0 +1,19 @@ +mod host_info; + +pub mod prelude { + pub use crate::host_info::*; + + #[cfg(test)] + pub(crate) use assert_json::prelude::*; + pub(crate) use has_sample_values::prelude::*; + + pub(crate) use std::str::FromStr; + + pub(crate) use serde::{Deserialize, Serialize}; + + #[cfg(test)] + pub(crate) use serde_json::json; + + #[cfg(test)] + pub(crate) use std::collections::HashSet; +} diff --git a/crates/identified-vec-of/Cargo.toml b/crates/common/identified-vec-of/Cargo.toml similarity index 68% rename from crates/identified-vec-of/Cargo.toml rename to crates/common/identified-vec-of/Cargo.toml index 75472073a..e97a16706 100644 --- a/crates/identified-vec-of/Cargo.toml +++ b/crates/common/identified-vec-of/Cargo.toml @@ -5,14 +5,15 @@ edition = "2021" [dependencies] # === SARGON CRATES === -sargon-core-assert-json = { path = "../sargon-core-assert-json" } -sargon-core-error = { path = "../sargon-core-error" } +assert-json = { path = "../../core/assert-json" } +error = { path = "../../core/error" } # === RADIX DEPENDENCIES -radix-rust = { workspace = true } +# None # === EXTERNAL DEPENDENCIES derive_more = { workspace = true } +indexmap = { workspace = true } itertools = { workspace = true } paste = { workspace = true } serde = { workspace = true } diff --git a/crates/identified-vec-of/src/decl_identified_vec_of_with_samples.rs b/crates/common/identified-vec-of/src/decl_identified_vec_of_with_samples.rs similarity index 98% rename from crates/identified-vec-of/src/decl_identified_vec_of_with_samples.rs rename to crates/common/identified-vec-of/src/decl_identified_vec_of_with_samples.rs index cf16210c9..18e7c4c77 100644 --- a/crates/identified-vec-of/src/decl_identified_vec_of_with_samples.rs +++ b/crates/common/identified-vec-of/src/decl_identified_vec_of_with_samples.rs @@ -9,7 +9,7 @@ macro_rules! decl_identified_vec_of { $collection_type: ident, $element_type: ident ) => { - paste! { + paste::paste! { $( #[doc = $expr] )* @@ -104,7 +104,7 @@ macro_rules! decl_identified_vec_of { )* $element_type: ident ) => { - paste! { + paste::paste! { decl_identified_vec_of!( $( #[doc = $expr] diff --git a/crates/identified-vec-of/src/identifiable.rs b/crates/common/identified-vec-of/src/identifiable.rs similarity index 100% rename from crates/identified-vec-of/src/identifiable.rs rename to crates/common/identified-vec-of/src/identifiable.rs diff --git a/crates/identified-vec-of/src/identified_vec_of.rs b/crates/common/identified-vec-of/src/identified_vec_of.rs similarity index 98% rename from crates/identified-vec-of/src/identified_vec_of.rs rename to crates/common/identified-vec-of/src/identified_vec_of.rs index d759923cd..e3ba755ad 100644 --- a/crates/identified-vec-of/src/identified_vec_of.rs +++ b/crates/common/identified-vec-of/src/identified_vec_of.rs @@ -1,5 +1,3 @@ -use radix_rust::prelude::IndexMap; - use crate::prelude::*; use std::hash::Hash; diff --git a/crates/identified-vec-of/src/identified_vec_of_display_debug.rs b/crates/common/identified-vec-of/src/identified_vec_of_display_debug.rs similarity index 100% rename from crates/identified-vec-of/src/identified_vec_of_display_debug.rs rename to crates/common/identified-vec-of/src/identified_vec_of_display_debug.rs diff --git a/crates/identified-vec-of/src/identified_vec_of_iterator.rs b/crates/common/identified-vec-of/src/identified_vec_of_iterator.rs similarity index 98% rename from crates/identified-vec-of/src/identified_vec_of_iterator.rs rename to crates/common/identified-vec-of/src/identified_vec_of_iterator.rs index 8dde59e1f..b17508ed8 100644 --- a/crates/identified-vec-of/src/identified_vec_of_iterator.rs +++ b/crates/common/identified-vec-of/src/identified_vec_of_iterator.rs @@ -1,5 +1,3 @@ -use radix_rust::prelude::IndexMap; - use crate::prelude::*; impl IdentifiedVecOf { diff --git a/crates/identified-vec-of/src/identified_vec_of_modify.rs b/crates/common/identified-vec-of/src/identified_vec_of_modify.rs similarity index 100% rename from crates/identified-vec-of/src/identified_vec_of_modify.rs rename to crates/common/identified-vec-of/src/identified_vec_of_modify.rs diff --git a/crates/identified-vec-of/src/identified_vec_of_query.rs b/crates/common/identified-vec-of/src/identified_vec_of_query.rs similarity index 99% rename from crates/identified-vec-of/src/identified_vec_of_query.rs rename to crates/common/identified-vec-of/src/identified_vec_of_query.rs index e79067b7c..078ad1ef7 100644 --- a/crates/identified-vec-of/src/identified_vec_of_query.rs +++ b/crates/common/identified-vec-of/src/identified_vec_of_query.rs @@ -1,4 +1,3 @@ -use radix_rust::prelude::IndexSet; use std::borrow::Borrow; use crate::prelude::*; diff --git a/crates/identified-vec-of/src/identified_vec_of_serde.rs b/crates/common/identified-vec-of/src/identified_vec_of_serde.rs similarity index 100% rename from crates/identified-vec-of/src/identified_vec_of_serde.rs rename to crates/common/identified-vec-of/src/identified_vec_of_serde.rs diff --git a/crates/identified-vec-of/src/identified_vec_of_validation_import_export.rs b/crates/common/identified-vec-of/src/identified_vec_of_validation_import_export.rs similarity index 100% rename from crates/identified-vec-of/src/identified_vec_of_validation_import_export.rs rename to crates/common/identified-vec-of/src/identified_vec_of_validation_import_export.rs diff --git a/crates/identified-vec-of/src/lib.rs b/crates/common/identified-vec-of/src/lib.rs similarity index 86% rename from crates/identified-vec-of/src/lib.rs rename to crates/common/identified-vec-of/src/lib.rs index 3874ec35f..964e6c460 100644 --- a/crates/identified-vec-of/src/lib.rs +++ b/crates/common/identified-vec-of/src/lib.rs @@ -16,8 +16,8 @@ mod user; pub mod prelude { - pub use sargon_core_assert_json::prelude::*; - pub use sargon_core_error::prelude::*; + pub use assert_json::prelude::*; + pub use error::prelude::*; pub use crate::decl_identified_vec_of_with_samples::*; pub use crate::identifiable::*; @@ -26,6 +26,8 @@ pub mod prelude { pub use crate::identified_vec_of_modify::*; pub use crate::identified_vec_of_validation_import_export::*; + pub use indexmap::IndexMap; + pub use indexmap::IndexSet; pub use itertools::Itertools; pub use std::fmt::{Debug, Display}; pub use std::hash::Hash as StdHash; diff --git a/crates/identified-vec-of/src/user.rs b/crates/common/identified-vec-of/src/user.rs similarity index 100% rename from crates/identified-vec-of/src/user.rs rename to crates/common/identified-vec-of/src/user.rs diff --git a/crates/common/metadata/Cargo.toml b/crates/common/metadata/Cargo.toml new file mode 100644 index 000000000..fa2c55885 --- /dev/null +++ b/crates/common/metadata/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "metadata" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +has-sample-values = { path = "../../core/has-sample-values" } + +# === RADIX DEPENDENCIES === +radix-engine-interface = { workspace = true } + +# === EXTERNAL DEPENDENCIES === +derive_more = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +strum = { workspace = true } diff --git a/crates/common/metadata/src/lib.rs b/crates/common/metadata/src/lib.rs new file mode 100644 index 000000000..e9622cf98 --- /dev/null +++ b/crates/common/metadata/src/lib.rs @@ -0,0 +1,15 @@ +mod metadata; + +pub mod prelude { + pub use crate::metadata::*; + + pub(crate) use radix_engine_interface::prelude::{ + MetadataValue as ScryptoMetadataValue, + ToMetadataEntry as ScryptoToMetadataEntry, + }; + + pub(crate) use serde::{Deserialize, Serialize}; + + #[cfg(test)] + pub(crate) use std::str::FromStr; +} diff --git a/crates/sargon-core/src/metadata.rs b/crates/common/metadata/src/metadata.rs similarity index 100% rename from crates/sargon-core/src/metadata.rs rename to crates/common/metadata/src/metadata.rs diff --git a/crates/common/network/Cargo.toml b/crates/common/network/Cargo.toml new file mode 100644 index 000000000..7910dbd32 --- /dev/null +++ b/crates/common/network/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "network" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +assert-json = { path = "../../core/assert-json" } +has-sample-values = { path = "../../core/has-sample-values" } +numeric = { path = "../../common/numeric" } + +# === RADIX DEPENDENCIES === +radix-common = { workspace = true } + +# === EXTERNAL DEPENDENCIES === +enum-iterator = { workspace = true } +serde = { workspace = true } +strum = { workspace = true } +serde_repr = { workspace = true } +serde_json = { workspace = true } diff --git a/crates/sargon-core/src/is_network_aware.rs b/crates/common/network/src/is_network_aware.rs similarity index 100% rename from crates/sargon-core/src/is_network_aware.rs rename to crates/common/network/src/is_network_aware.rs diff --git a/crates/common/network/src/lib.rs b/crates/common/network/src/lib.rs new file mode 100644 index 000000000..e7fc9636c --- /dev/null +++ b/crates/common/network/src/lib.rs @@ -0,0 +1,19 @@ +mod is_network_aware; +mod network_id; + +pub mod prelude { + pub use crate::is_network_aware::*; + pub use crate::network_id::*; + + #[cfg(test)] + pub(crate) use assert_json::prelude::*; + pub(crate) use has_sample_values::prelude::*; + + pub(crate) use radix_common::network::NetworkDefinition as ScryptoNetworkDefinition; + pub(crate) use strum::FromRepr; + + #[cfg(test)] + pub(crate) use serde_json::json; + #[cfg(test)] + pub(crate) use std::collections::BTreeSet; +} diff --git a/crates/sargon-core/src/network_id.rs b/crates/common/network/src/network_id.rs similarity index 99% rename from crates/sargon-core/src/network_id.rs rename to crates/common/network/src/network_id.rs index f80d66291..307080a71 100644 --- a/crates/sargon-core/src/network_id.rs +++ b/crates/common/network/src/network_id.rs @@ -1,3 +1,6 @@ +use numeric::U31; +use serde_repr::{Deserialize_repr, Serialize_repr}; + use crate::prelude::*; use std::borrow::Cow; diff --git a/crates/common/numeric/Cargo.toml b/crates/common/numeric/Cargo.toml new file mode 100644 index 000000000..c78f02a28 --- /dev/null +++ b/crates/common/numeric/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "numeric" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === INTERNAL DEPENDENCIES === +error = { path = "../../core/error" } +has-sample-values = { path = "../../core/has-sample-values" } +bytes = { path = "../../common/bytes" } + +# === RADIX DEPENDENCIES === +radix-common = { workspace = true } + +# === EXTERNAL DEPENDENCIES === +enum-iterator = { workspace = true } +delegate = { workspace = true } +derive_more = { workspace = true } +serde = { workspace = true } +serde_repr = { workspace = true } +serde_with = { workspace = true } +serde_json = { workspace = true } +strum = { workspace = true } diff --git a/crates/sargon-core/src/types/decimal192.rs b/crates/common/numeric/src/decimal/decimal192.rs similarity index 100% rename from crates/sargon-core/src/types/decimal192.rs rename to crates/common/numeric/src/decimal/decimal192.rs diff --git a/crates/sargon-core/src/types/locale_config.rs b/crates/common/numeric/src/decimal/locale_config.rs similarity index 100% rename from crates/sargon-core/src/types/locale_config.rs rename to crates/common/numeric/src/decimal/locale_config.rs diff --git a/crates/common/numeric/src/decimal/mod.rs b/crates/common/numeric/src/decimal/mod.rs new file mode 100644 index 000000000..6cacbd11c --- /dev/null +++ b/crates/common/numeric/src/decimal/mod.rs @@ -0,0 +1,7 @@ +mod decimal192; +mod locale_config; +mod rounding_mode; + +pub use decimal192::*; +pub use locale_config::*; +pub use rounding_mode::*; diff --git a/crates/sargon-core/src/types/rounding_mode.rs b/crates/common/numeric/src/decimal/rounding_mode.rs similarity index 100% rename from crates/sargon-core/src/types/rounding_mode.rs rename to crates/common/numeric/src/decimal/rounding_mode.rs diff --git a/crates/common/numeric/src/lib.rs b/crates/common/numeric/src/lib.rs new file mode 100644 index 000000000..10f352c4c --- /dev/null +++ b/crates/common/numeric/src/lib.rs @@ -0,0 +1,30 @@ +mod decimal; +mod unsigned_ints; + +pub mod prelude { + pub use crate::decimal::*; + pub use crate::unsigned_ints::*; + + pub(crate) use bytes::prelude::*; + + pub(crate) use radix_common::math::{ + traits::CheckedMul as ScryptoCheckedMul, Decimal as ScryptoDecimal192, + RoundingMode as ScryptoRoundingMode, + }; + + pub(crate) use derive_more::{AsRef, Deref}; + pub use serde_repr::{Deserialize_repr, Serialize_repr}; + pub use serde_with::{DeserializeFromStr, SerializeDisplay}; + pub use strum::{FromRepr, IntoEnumIterator}; + + #[cfg(test)] + pub(crate) use std::collections::HashSet; + + #[cfg(test)] + pub(crate) use serde_json::json; + + pub use std::ops::{Add, AddAssign, Div, Mul, Neg, Sub}; + pub(crate) use std::str::FromStr; +} + +pub use prelude::*; diff --git a/crates/sargon-core/src/unsigned_ints/add_via_deref.rs b/crates/common/numeric/src/unsigned_ints/add_via_deref.rs similarity index 100% rename from crates/sargon-core/src/unsigned_ints/add_via_deref.rs rename to crates/common/numeric/src/unsigned_ints/add_via_deref.rs diff --git a/crates/sargon-core/src/unsigned_ints/global_index_constants.rs b/crates/common/numeric/src/unsigned_ints/global_index_constants.rs similarity index 100% rename from crates/sargon-core/src/unsigned_ints/global_index_constants.rs rename to crates/common/numeric/src/unsigned_ints/global_index_constants.rs diff --git a/crates/sargon-core/src/unsigned_ints/mod.rs b/crates/common/numeric/src/unsigned_ints/mod.rs similarity index 100% rename from crates/sargon-core/src/unsigned_ints/mod.rs rename to crates/common/numeric/src/unsigned_ints/mod.rs diff --git a/crates/sargon-core/src/unsigned_ints/u30.rs b/crates/common/numeric/src/unsigned_ints/u30.rs similarity index 100% rename from crates/sargon-core/src/unsigned_ints/u30.rs rename to crates/common/numeric/src/unsigned_ints/u30.rs diff --git a/crates/sargon-core/src/unsigned_ints/u31.rs b/crates/common/numeric/src/unsigned_ints/u31.rs similarity index 100% rename from crates/sargon-core/src/unsigned_ints/u31.rs rename to crates/common/numeric/src/unsigned_ints/u31.rs diff --git a/crates/common/short-string/Cargo.toml b/crates/common/short-string/Cargo.toml new file mode 100644 index 000000000..1becbee6c --- /dev/null +++ b/crates/common/short-string/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "short-string" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +identified-vec-of = { path = "../../common/identified-vec-of" } +assert-json = { path = "../../core/assert-json" } +sargon-core-utils = { path = "../../core/utils" } +has-sample-values = { path = "../../core/has-sample-values" } + +# === RADIX DEPENDENCIES === +# None + +# === EXTERNAL DEPENDENCIES === +arraystring = { workspace = true } +derive_more = { workspace = true } +serde = { workspace = true } +serde_with = { workspace = true } +serde_json = { workspace = true } diff --git a/crates/sargon-core/src/types/display_name.rs b/crates/common/short-string/src/display_name.rs similarity index 96% rename from crates/sargon-core/src/types/display_name.rs rename to crates/common/short-string/src/display_name.rs index 100194960..487624d75 100644 --- a/crates/sargon-core/src/types/display_name.rs +++ b/crates/common/short-string/src/display_name.rs @@ -1,3 +1,5 @@ +use sargon_core_utils::prelude::prefix_str; + use crate::prelude::*; /// A max 30 chars long string used for display purposes, e.g. @@ -87,7 +89,7 @@ impl DisplayName { pub fn random() -> Self { Self::new(format!( "random-{}", - id().to_string().drain(0..20).collect::() + Uuid::new_v4().to_string().drain(0..20).collect::() )) .unwrap() } diff --git a/crates/sargon-core/src/types/email_address.rs b/crates/common/short-string/src/email_address.rs similarity index 98% rename from crates/sargon-core/src/types/email_address.rs rename to crates/common/short-string/src/email_address.rs index f9d086db2..2a8a3f6bf 100644 --- a/crates/sargon-core/src/types/email_address.rs +++ b/crates/common/short-string/src/email_address.rs @@ -1,3 +1,5 @@ +use identified_vec_of::Identifiable; + use crate::prelude::*; /// An email address. diff --git a/crates/common/short-string/src/lib.rs b/crates/common/short-string/src/lib.rs new file mode 100644 index 000000000..52bf09b1a --- /dev/null +++ b/crates/common/short-string/src/lib.rs @@ -0,0 +1,21 @@ +mod display_name; +mod email_address; +mod short_string; + +pub mod prelude { + pub use crate::display_name::*; + pub use crate::email_address::*; + pub use crate::short_string::*; + + #[cfg(test)] + pub(crate) use assert_json::prelude::*; + pub(crate) use has_sample_values::prelude::*; + + pub(crate) use std::str::FromStr; + + pub(crate) use serde::{Deserialize, Serialize}; + pub(crate) use serde_with::{DeserializeFromStr, SerializeDisplay}; + + #[cfg(test)] + pub(crate) use serde_json::json; +} diff --git a/crates/sargon-core/src/types/short_string.rs b/crates/common/short-string/src/short_string.rs similarity index 100% rename from crates/sargon-core/src/types/short_string.rs rename to crates/common/short-string/src/short_string.rs diff --git a/crates/sargon-core-assert-json/Cargo.toml b/crates/core/assert-json/Cargo.toml similarity index 80% rename from crates/sargon-core-assert-json/Cargo.toml rename to crates/core/assert-json/Cargo.toml index 084528e93..82d572e6f 100644 --- a/crates/sargon-core-assert-json/Cargo.toml +++ b/crates/core/assert-json/Cargo.toml @@ -1,11 +1,11 @@ [package] -name = "sargon-core-assert-json" +name = "assert-json" version = "1.1.99" edition = "2021" [dependencies] # === SARGON CRATES === -sargon-core-error = { path = "../sargon-core-error" } +error = { path = "../../core/error" } # === RADIX DEPENDENCIES === # None diff --git a/crates/sargon-core-assert-json/src/assert_json.rs b/crates/core/assert-json/src/assert_json.rs similarity index 100% rename from crates/sargon-core-assert-json/src/assert_json.rs rename to crates/core/assert-json/src/assert_json.rs diff --git a/crates/sargon-core-assert-json/src/lib.rs b/crates/core/assert-json/src/lib.rs similarity index 100% rename from crates/sargon-core-assert-json/src/lib.rs rename to crates/core/assert-json/src/lib.rs diff --git a/crates/core/collections/Cargo.toml b/crates/core/collections/Cargo.toml new file mode 100644 index 000000000..3488c635a --- /dev/null +++ b/crates/core/collections/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "core-collections" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +has-sample-values = { path = "../../core/has-sample-values" } + +# === RADIX DEPENDENCIES === +# None + +# === EXTERNAL DEPENDENCIES === +indexmap = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } diff --git a/crates/sargon-core/src/appendable_collection.rs b/crates/core/collections/src/appendable_collection.rs similarity index 98% rename from crates/sargon-core/src/appendable_collection.rs rename to crates/core/collections/src/appendable_collection.rs index 4bb34a9d1..502e717bd 100644 --- a/crates/sargon-core/src/appendable_collection.rs +++ b/crates/core/collections/src/appendable_collection.rs @@ -1,4 +1,4 @@ -use crate::prelude::*; +use indexmap::{IndexMap, IndexSet}; use std::borrow::Borrow; /// A map which value type conforms to `AppendableCollection`, this simplifies diff --git a/crates/sargon-core/src/types/collections/just.rs b/crates/core/collections/src/collections/just.rs similarity index 96% rename from crates/sargon-core/src/types/collections/just.rs rename to crates/core/collections/src/collections/just.rs index a4d361051..7a7332ba7 100644 --- a/crates/sargon-core/src/types/collections/just.rs +++ b/crates/core/collections/src/collections/just.rs @@ -1,6 +1,5 @@ -use radix_rust::prelude::{IndexMap, IndexSet}; - -use crate::prelude::*; +use indexmap::{IndexMap, IndexSet}; +use std::collections::{HashMap, HashSet}; pub trait Just { fn just(item: Item) -> Self; diff --git a/crates/sargon-core/src/types/collections/mod.rs b/crates/core/collections/src/collections/mod.rs similarity index 100% rename from crates/sargon-core/src/types/collections/mod.rs rename to crates/core/collections/src/collections/mod.rs diff --git a/crates/core/collections/src/lib.rs b/crates/core/collections/src/lib.rs new file mode 100644 index 000000000..68b7d30a9 --- /dev/null +++ b/crates/core/collections/src/lib.rs @@ -0,0 +1,7 @@ +mod appendable_collection; +mod collections; + +pub mod prelude { + pub use crate::appendable_collection::*; + pub use crate::collections::*; +} diff --git a/crates/sargon-core-error/Cargo.toml b/crates/core/error/Cargo.toml similarity index 90% rename from crates/sargon-core-error/Cargo.toml rename to crates/core/error/Cargo.toml index f97a27d46..d514a0dfb 100644 --- a/crates/sargon-core-error/Cargo.toml +++ b/crates/core/error/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "sargon-core-error" +name = "error" version = "1.1.99" edition = "2021" diff --git a/crates/sargon-core-error/src/common_error.rs b/crates/core/error/src/common_error.rs similarity index 100% rename from crates/sargon-core-error/src/common_error.rs rename to crates/core/error/src/common_error.rs diff --git a/crates/sargon-core-error/src/lib.rs b/crates/core/error/src/lib.rs similarity index 100% rename from crates/sargon-core-error/src/lib.rs rename to crates/core/error/src/lib.rs diff --git a/crates/core/has-sample-values/Cargo.toml b/crates/core/has-sample-values/Cargo.toml new file mode 100644 index 000000000..86c3f2a44 --- /dev/null +++ b/crates/core/has-sample-values/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "has-sample-values" +version = "1.1.99" +edition = "2021" + +[dependencies] +error = { path = "../../core/error" } + +# ==== RADIX DEPENDENCIES ==== +# None + +# ==== EXTERNAL DEPENDENCIES ==== +indexmap = { workspace = true } +iso8601-timestamp = { workspace = true } +url = { workspace = true } +uuid = { workspace = true } diff --git a/crates/sargon-core/src/has_sample_values.rs b/crates/core/has-sample-values/src/has_sample_values.rs similarity index 100% rename from crates/sargon-core/src/has_sample_values.rs rename to crates/core/has-sample-values/src/has_sample_values.rs index f324e74b7..4588ab2c7 100644 --- a/crates/sargon-core/src/has_sample_values.rs +++ b/crates/core/has-sample-values/src/has_sample_values.rs @@ -45,25 +45,6 @@ impl HasSampleValues for u64 { } } -impl HasSampleValues for Uuid { - fn sample() -> Self { - Self::from_bytes([0xff; 16]) - } - - fn sample_other() -> Self { - Self::from_bytes([0xde; 16]) - } -} -impl HasSampleValues for Timestamp { - fn sample() -> Self { - Self::parse("2023-09-11T16:05:56Z").unwrap() - } - - fn sample_other() -> Self { - Self::parse("2023-12-24T17:13:56.123Z").unwrap() - } -} - impl HasSampleValues for u32 { fn sample() -> Self { 42 @@ -94,16 +75,6 @@ impl HasSampleValues for u16 { } } -impl HasSampleValues for Url { - fn sample() -> Self { - "http://example.com".parse().unwrap() - } - - fn sample_other() -> Self { - "http://example.org".parse().unwrap() - } -} - impl HasSampleValues for Vec where T: HasSampleValues, @@ -117,23 +88,6 @@ where } } -impl HasSampleValues for IndexSet -where - T: HasSampleValues + Eq + std::hash::Hash, -{ - fn sample() -> Self { - let mut set = Self::new(); - set.insert(T::sample()); - set - } - - fn sample_other() -> Self { - let mut set = Self::new(); - set.insert(T::sample_other()); - set - } -} - impl HasSampleValues for Option where T: HasSampleValues, @@ -164,3 +118,49 @@ where map } } + +impl HasSampleValues for Url { + fn sample() -> Self { + "http://example.com".parse().unwrap() + } + + fn sample_other() -> Self { + "http://example.org".parse().unwrap() + } +} + +impl HasSampleValues for Uuid { + fn sample() -> Self { + Self::from_bytes([0xff; 16]) + } + + fn sample_other() -> Self { + Self::from_bytes([0xde; 16]) + } +} +impl HasSampleValues for Timestamp { + fn sample() -> Self { + Self::parse("2023-09-11T16:05:56Z").unwrap() + } + + fn sample_other() -> Self { + Self::parse("2023-12-24T17:13:56.123Z").unwrap() + } +} + +impl HasSampleValues for IndexSet +where + T: HasSampleValues + Eq + std::hash::Hash, +{ + fn sample() -> Self { + let mut set = Self::new(); + set.insert(T::sample()); + set + } + + fn sample_other() -> Self { + let mut set = Self::new(); + set.insert(T::sample_other()); + set + } +} diff --git a/crates/core/has-sample-values/src/lib.rs b/crates/core/has-sample-values/src/lib.rs new file mode 100644 index 000000000..36a6f41bb --- /dev/null +++ b/crates/core/has-sample-values/src/lib.rs @@ -0,0 +1,16 @@ +mod has_sample_values; + +pub mod prelude { + pub use crate::has_sample_values::*; + + pub use error::prelude::*; + + pub(crate) use indexmap::IndexSet; + pub use iso8601_timestamp::Timestamp; + pub use url::Url; + pub use uuid::Uuid; + + pub(crate) use std::collections::HashMap; +} + +pub use prelude::*; diff --git a/crates/core/misc/Cargo.toml b/crates/core/misc/Cargo.toml new file mode 100644 index 000000000..e00648059 --- /dev/null +++ b/crates/core/misc/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "core-misc" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +assert-json = { path = "../../core/assert-json" } +error = { path = "../../core/error" } +sargon-core-utils = { path = "../../core/utils" } +has-sample-values = { path = "../../core/has-sample-values" } + +# === RADIX DEPENDENCIES === +radix-common = { workspace = true } + +# === EXTERNAL DEPENDENCIES === +derive_more = { workspace = true } +iso8601-timestamp = { workspace = true } +itertools = { workspace = true } +log = { workspace = true } +pretty_assertions = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +strum = { workspace = true } diff --git a/crates/sargon-core/src/types/bool_type.rs b/crates/core/misc/src/bool_type.rs similarity index 98% rename from crates/sargon-core/src/types/bool_type.rs rename to crates/core/misc/src/bool_type.rs index b8747ab2b..bd28c24b8 100644 --- a/crates/sargon-core/src/types/bool_type.rs +++ b/crates/core/misc/src/bool_type.rs @@ -1,7 +1,6 @@ use crate::prelude::*; #[macro_export] - macro_rules! decl_bool_type { ($name:ident, $default_value:expr) => { #[derive( @@ -33,7 +32,7 @@ macro_rules! decl_bool_type { } } - impl Deref for $name { + impl std::ops::Deref for $name { type Target = bool; fn deref(&self) -> &Self::Target { diff --git a/crates/sargon-core/src/types/hidden_constructor.rs b/crates/core/misc/src/hidden_constructor.rs similarity index 100% rename from crates/sargon-core/src/types/hidden_constructor.rs rename to crates/core/misc/src/hidden_constructor.rs diff --git a/crates/sargon-core/src/image_url_utils.rs b/crates/core/misc/src/image_url_utils.rs similarity index 98% rename from crates/sargon-core/src/image_url_utils.rs rename to crates/core/misc/src/image_url_utils.rs index 65cc12e09..ed1ef2324 100644 --- a/crates/sargon-core/src/image_url_utils.rs +++ b/crates/core/misc/src/image_url_utils.rs @@ -1,4 +1,7 @@ -use crate::{parse_url, prelude::*}; +use sargon_core_utils::prelude::url_encode; + +use crate::prelude::*; +use std::collections::HashMap; pub fn is_vector_image(url: &str, image_type: VectorImageType) -> bool { let parsed_url = match parse_url(url) { diff --git a/crates/sargon-core/src/types/instant.rs b/crates/core/misc/src/instant.rs similarity index 98% rename from crates/sargon-core/src/types/instant.rs rename to crates/core/misc/src/instant.rs index a155f183c..b22176106 100644 --- a/crates/sargon-core/src/types/instant.rs +++ b/crates/core/misc/src/instant.rs @@ -111,6 +111,9 @@ mod tests { test(1337); } + use iso8601_timestamp::*; + use std::ops::Add; + #[test] fn from_timestamp() { let timestamp = Timestamp::UNIX_EPOCH; diff --git a/crates/core/misc/src/lib.rs b/crates/core/misc/src/lib.rs new file mode 100644 index 000000000..8b51b0f2c --- /dev/null +++ b/crates/core/misc/src/lib.rs @@ -0,0 +1,34 @@ +mod bool_type; +mod hidden_constructor; +mod image_url_utils; +mod instant; +mod parse_url; +mod requested_number_quantifier; +mod requested_quantity; +mod unsafe_id_stepper; +mod vector_image_type; + +pub mod prelude { + pub(crate) use crate::bool_type::*; + pub use crate::hidden_constructor::*; + pub use crate::image_url_utils::*; + pub use crate::instant::*; + pub use crate::parse_url::*; + pub use crate::requested_number_quantifier::*; + pub use crate::requested_quantity::*; + pub use crate::unsafe_id_stepper::*; + pub use crate::vector_image_type::*; + + #[cfg(test)] + pub(crate) use assert_json::prelude::*; + pub(crate) use has_sample_values::prelude::*; + + pub(crate) use radix_common::prelude::Instant as ScryptoInstant; + + pub(crate) use serde::{Deserialize, Serialize}; + + #[cfg(test)] + pub(crate) use serde_json::json; +} + +pub use prelude::*; diff --git a/crates/core/misc/src/parse_url.rs b/crates/core/misc/src/parse_url.rs new file mode 100644 index 000000000..298a56440 --- /dev/null +++ b/crates/core/misc/src/parse_url.rs @@ -0,0 +1,7 @@ +use crate::prelude::*; + +pub fn parse_url(s: impl AsRef) -> Result { + Url::try_from(s.as_ref()).map_err(|_| CommonError::InvalidURL { + bad_value: s.as_ref().to_owned(), + }) +} diff --git a/crates/sargon-core/src/types/requested_number_quantifier.rs b/crates/core/misc/src/requested_number_quantifier.rs similarity index 100% rename from crates/sargon-core/src/types/requested_number_quantifier.rs rename to crates/core/misc/src/requested_number_quantifier.rs diff --git a/crates/sargon-core/src/types/requested_quantity.rs b/crates/core/misc/src/requested_quantity.rs similarity index 99% rename from crates/sargon-core/src/types/requested_quantity.rs rename to crates/core/misc/src/requested_quantity.rs index 93df2cdb3..f50d42f6c 100644 --- a/crates/sargon-core/src/types/requested_quantity.rs +++ b/crates/core/misc/src/requested_quantity.rs @@ -85,7 +85,7 @@ impl RequestedQuantity { #[cfg(test)] mod tests { - use crate::prelude::*; + use super::*; #[allow(clippy::upper_case_acronyms)] type SUT = RequestedQuantity; diff --git a/crates/sargon-core/src/unsafe_id_stepper.rs b/crates/core/misc/src/unsafe_id_stepper.rs similarity index 97% rename from crates/sargon-core/src/unsafe_id_stepper.rs rename to crates/core/misc/src/unsafe_id_stepper.rs index b7160124f..79cde38f2 100644 --- a/crates/sargon-core/src/unsafe_id_stepper.rs +++ b/crates/core/misc/src/unsafe_id_stepper.rs @@ -3,6 +3,7 @@ use std::borrow::Borrow; use std::borrow::BorrowMut; use std::marker::PhantomData; use std::ops::AddAssign; +use std::sync::Arc; use std::sync::Mutex; /// An UNSAFE IDStepper, which `next` returns the consecutive next ID, @@ -40,6 +41,7 @@ impl> IDStepper { #[cfg(test)] mod tests { use crate::prelude::*; + use itertools::Itertools; #[test] fn new_starts_at_zero() { diff --git a/crates/sargon-core/src/types/vector_image_type.rs b/crates/core/misc/src/vector_image_type.rs similarity index 100% rename from crates/sargon-core/src/types/vector_image_type.rs rename to crates/core/misc/src/vector_image_type.rs diff --git a/crates/core/time-utils/Cargo.toml b/crates/core/time-utils/Cargo.toml new file mode 100644 index 000000000..4693e4e3f --- /dev/null +++ b/crates/core/time-utils/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "time-utils" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +# None + +# === RADIX DEPENDENCIES === +# None + +# === EXTERNAL DEPENDENCIES === +iso8601-timestamp = { workspace = true } +serde_json = { workspace = true } diff --git a/crates/core/time-utils/src/lib.rs b/crates/core/time-utils/src/lib.rs new file mode 100644 index 000000000..22f5c0f86 --- /dev/null +++ b/crates/core/time-utils/src/lib.rs @@ -0,0 +1,12 @@ +use iso8601_timestamp::Timestamp; + +/// A JSON "stable" timestamp, that is to say, this has already been JSON +/// roundtripped, ensuring the same value will be decoded once encoded, this is +/// a bit hacky solution to the fact that `07:18:08.284647000Z` when encoded +/// and then decoded become `07:18:08.284000000Z` resulting in problems for +/// equality checks. +pub fn now() -> Timestamp { + let t = Timestamp::now_utc(); + let json = serde_json::to_vec(&t).unwrap(); + serde_json::from_slice(json.as_slice()).unwrap() +} diff --git a/crates/sargon-core-utils/Cargo.toml b/crates/core/utils/Cargo.toml similarity index 87% rename from crates/sargon-core-utils/Cargo.toml rename to crates/core/utils/Cargo.toml index 406e1a03c..d37b55e80 100644 --- a/crates/sargon-core-utils/Cargo.toml +++ b/crates/core/utils/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" [dependencies] # === SARGON CRATES === -sargon-core-error = { path = "../sargon-core-error" } +error = { path = "../../core/error" } # === EXTERNAL DEPENDENCIES === iso8601-timestamp = { workspace = true } diff --git a/crates/sargon-core-utils/src/common_error_map.rs b/crates/core/utils/src/common_error_map.rs similarity index 97% rename from crates/sargon-core-utils/src/common_error_map.rs rename to crates/core/utils/src/common_error_map.rs index e90801b14..caa225a48 100644 --- a/crates/sargon-core-utils/src/common_error_map.rs +++ b/crates/core/utils/src/common_error_map.rs @@ -1,5 +1,5 @@ use crate::prelude::*; -use sargon_core_error::prelude::CommonError; +use error::prelude::CommonError; pub trait MapToFailedToDeserializeJSONToValue { fn map_failed_to_deserialize_string( diff --git a/crates/sargon-core-utils/src/constants.rs b/crates/core/utils/src/constants.rs similarity index 91% rename from crates/sargon-core-utils/src/constants.rs rename to crates/core/utils/src/constants.rs index 649fe36b5..344436c4a 100644 --- a/crates/sargon-core-utils/src/constants.rs +++ b/crates/core/utils/src/constants.rs @@ -30,3 +30,13 @@ pub const POLLING_DELAY_INCREMENT_IN_SECONDS: u64 = 1; /// Number of minutes per day. pub const MINUTES_PER_DAY: u32 = 24 * 60; + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn number_of_minutes_per_day() { + assert_eq!(MINUTES_PER_DAY, 1440); + } +} diff --git a/crates/core/utils/src/factory.rs b/crates/core/utils/src/factory.rs new file mode 100644 index 000000000..945fb61b9 --- /dev/null +++ b/crates/core/utils/src/factory.rs @@ -0,0 +1,30 @@ +use crate::prelude::*; + +pub fn iso8601(dt: &Timestamp) -> String { + let (h, m, s) = dt.as_hms(); + format!("{} {:02}:{:02}:{:02}", date(dt), h, m, s) +} + +pub fn date(dt: &Timestamp) -> String { + dt.date().to_string() +} + +#[cfg(test)] +mod tests { + use std::collections::BTreeSet; + + use crate::prelude::*; + + #[test] + fn id_unique() { + let n = 100; + let set = (0..n).map(|_| Uuid::new_v4()).collect::>(); + assert_eq!(set.len(), n); + } + + #[test] + fn date_str() { + assert_eq!(date(&Timestamp::UNIX_EPOCH), "1970-01-01"); + assert_eq!(iso8601(&Timestamp::UNIX_EPOCH), "1970-01-01 00:00:00"); + } +} diff --git a/crates/sargon-core-utils/src/lib.rs b/crates/core/utils/src/lib.rs similarity index 100% rename from crates/sargon-core-utils/src/lib.rs rename to crates/core/utils/src/lib.rs diff --git a/crates/sargon-core-utils/src/logged_panic.rs b/crates/core/utils/src/logged_panic.rs similarity index 100% rename from crates/sargon-core-utils/src/logged_panic.rs rename to crates/core/utils/src/logged_panic.rs diff --git a/crates/sargon-core-utils/src/serialization.rs b/crates/core/utils/src/serialization.rs similarity index 99% rename from crates/sargon-core-utils/src/serialization.rs rename to crates/core/utils/src/serialization.rs index 710abdce8..bfb1d9767 100644 --- a/crates/sargon-core-utils/src/serialization.rs +++ b/crates/core/utils/src/serialization.rs @@ -1,5 +1,5 @@ use crate::prelude::*; -use sargon_core_error::prelude::*; +use error::prelude::*; use serde::{de::DeserializeOwned, Serialize}; pub trait SerializeToBytes { diff --git a/crates/sargon-core-utils/src/string_utils.rs b/crates/core/utils/src/string_utils.rs similarity index 100% rename from crates/sargon-core-utils/src/string_utils.rs rename to crates/core/utils/src/string_utils.rs diff --git a/crates/sargon-addresses/Cargo.toml b/crates/crypto/addresses/Cargo.toml similarity index 50% rename from crates/sargon-addresses/Cargo.toml rename to crates/crypto/addresses/Cargo.toml index 8a3a819e4..7e62504a6 100644 --- a/crates/sargon-addresses/Cargo.toml +++ b/crates/crypto/addresses/Cargo.toml @@ -1,13 +1,20 @@ [package] -name = "sargon-addresses" +name = "addresses" version = "1.1.99" edition = "2021" [dependencies] # === SARGON CRATES === -sargon-core = { path = "../sargon-core" } -sargon-factors = { path = "../sargon-factors" } -sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } +identified-vec-of = { path = "../../common/identified-vec-of" } +factors = { path = "../../factors/factors" } +hierarchical-deterministic = { path = "../../crypto/hd" } +hash = { path = "../../crypto/hash" } +ecc = { path = "../../crypto/ecc" } +bytes = { path = "../../common/bytes" } +network = { path = "../../common/network" } +has-sample-values = { path = "../../core/has-sample-values" } +assert-json = { path = "../../core/assert-json" } +sargon-core-utils = { path = "../../core/utils" } # ==== RADIX DEPENDENCIES ==== radix-common = { workspace = true } @@ -18,8 +25,10 @@ radix-rust = { workspace = true } # ==== EXTERNAL DEPENDENCIES ==== derive_more = { workspace = true } +enum-as-inner = { workspace = true } enum-iterator = { workspace = true } log = { workspace = true } +paste = { workspace = true } pretty_assertions = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } diff --git a/crates/sargon-addresses/src/address/access_controller_address.rs b/crates/crypto/addresses/src/address/access_controller_address.rs similarity index 100% rename from crates/sargon-addresses/src/address/access_controller_address.rs rename to crates/crypto/addresses/src/address/access_controller_address.rs diff --git a/crates/sargon-addresses/src/address/account_address.rs b/crates/crypto/addresses/src/address/account_address.rs similarity index 100% rename from crates/sargon-addresses/src/address/account_address.rs rename to crates/crypto/addresses/src/address/account_address.rs diff --git a/crates/sargon-addresses/src/address/address.rs b/crates/crypto/addresses/src/address/address.rs similarity index 100% rename from crates/sargon-addresses/src/address/address.rs rename to crates/crypto/addresses/src/address/address.rs diff --git a/crates/sargon-addresses/src/address/address_format.rs b/crates/crypto/addresses/src/address/address_format.rs similarity index 100% rename from crates/sargon-addresses/src/address/address_format.rs rename to crates/crypto/addresses/src/address/address_format.rs diff --git a/crates/sargon-addresses/src/address/address_of_account_or_persona.rs b/crates/crypto/addresses/src/address/address_of_account_or_persona.rs similarity index 100% rename from crates/sargon-addresses/src/address/address_of_account_or_persona.rs rename to crates/crypto/addresses/src/address/address_of_account_or_persona.rs diff --git a/crates/sargon-addresses/src/address/address_union.rs b/crates/crypto/addresses/src/address/address_union.rs similarity index 99% rename from crates/sargon-addresses/src/address/address_union.rs rename to crates/crypto/addresses/src/address/address_union.rs index 80e08dfe4..8dc83fb3a 100644 --- a/crates/sargon-addresses/src/address/address_union.rs +++ b/crates/crypto/addresses/src/address/address_union.rs @@ -10,7 +10,7 @@ macro_rules! address_union { $variant_type: ty )+ ) => { - paste! { + paste::paste! { $( #[doc = $expr] )* @@ -259,7 +259,7 @@ macro_rules! address_union { $address_type: ident ),+ ) => { - paste! { + paste::paste! { address_union!( $( #[doc = $expr] diff --git a/crates/sargon-addresses/src/address/component_address.rs b/crates/crypto/addresses/src/address/component_address.rs similarity index 100% rename from crates/sargon-addresses/src/address/component_address.rs rename to crates/crypto/addresses/src/address/component_address.rs diff --git a/crates/sargon-addresses/src/address/entity_address.rs b/crates/crypto/addresses/src/address/entity_address.rs similarity index 100% rename from crates/sargon-addresses/src/address/entity_address.rs rename to crates/crypto/addresses/src/address/entity_address.rs diff --git a/crates/sargon-addresses/src/address/identity_address.rs b/crates/crypto/addresses/src/address/identity_address.rs similarity index 100% rename from crates/sargon-addresses/src/address/identity_address.rs rename to crates/crypto/addresses/src/address/identity_address.rs diff --git a/crates/sargon-addresses/src/address/legacy_olympia_account_address.rs b/crates/crypto/addresses/src/address/legacy_olympia_account_address.rs similarity index 99% rename from crates/sargon-addresses/src/address/legacy_olympia_account_address.rs rename to crates/crypto/addresses/src/address/legacy_olympia_account_address.rs index 1c94e5086..a06344b11 100644 --- a/crates/sargon-addresses/src/address/legacy_olympia_account_address.rs +++ b/crates/crypto/addresses/src/address/legacy_olympia_account_address.rs @@ -5,6 +5,7 @@ use radix_engine_toolkit::functions::derive::{ }; use radix_engine_toolkit::functions::derive::OlympiaNetwork as ScryptoOlympiaNetwork; +use sargon_core_utils::prelude::format_string; #[derive( Clone, diff --git a/crates/sargon-addresses/src/address/locker_address.rs b/crates/crypto/addresses/src/address/locker_address.rs similarity index 100% rename from crates/sargon-addresses/src/address/locker_address.rs rename to crates/crypto/addresses/src/address/locker_address.rs diff --git a/crates/sargon-addresses/src/address/mod.rs b/crates/crypto/addresses/src/address/mod.rs similarity index 100% rename from crates/sargon-addresses/src/address/mod.rs rename to crates/crypto/addresses/src/address/mod.rs diff --git a/crates/sargon-addresses/src/address/non_fungible_global_id.rs b/crates/crypto/addresses/src/address/non_fungible_global_id.rs similarity index 99% rename from crates/sargon-addresses/src/address/non_fungible_global_id.rs rename to crates/crypto/addresses/src/address/non_fungible_global_id.rs index 904a9e5a8..5235dc344 100644 --- a/crates/sargon-addresses/src/address/non_fungible_global_id.rs +++ b/crates/crypto/addresses/src/address/non_fungible_global_id.rs @@ -1,6 +1,7 @@ use crate::prelude::*; use radix_common::address::{AddressBech32Decoder, AddressBech32Encoder}; use radix_engine_toolkit::utils::*; +use sargon_core_utils::prelude::format_string; #[derive( Clone, diff --git a/crates/sargon-addresses/src/address/non_fungible_local_id.rs b/crates/crypto/addresses/src/address/non_fungible_local_id.rs similarity index 98% rename from crates/sargon-addresses/src/address/non_fungible_local_id.rs rename to crates/crypto/addresses/src/address/non_fungible_local_id.rs index 9afb97f66..1e13e8e8d 100644 --- a/crates/sargon-addresses/src/address/non_fungible_local_id.rs +++ b/crates/crypto/addresses/src/address/non_fungible_local_id.rs @@ -1,3 +1,5 @@ +use sargon_core_utils::prelude::format_string; + use crate::prelude::*; #[derive( @@ -134,7 +136,9 @@ impl From for NonFungibleLocalId { value: value.value(), }, ScryptoNonFungibleLocalId::Bytes(value) => Self::Bytes { - value: value.into(), + value: NonEmptyMax64Bytes::try_from(value.value()).expect( + "ScryptoBytesNonFungibleLocalId should have 64 bytes", + ), }, ScryptoNonFungibleLocalId::RUID(value) => Self::Ruid { value: value.value().into(), diff --git a/crates/sargon-addresses/src/address/non_fungible_local_id_string.rs b/crates/crypto/addresses/src/address/non_fungible_local_id_string.rs similarity index 100% rename from crates/sargon-addresses/src/address/non_fungible_local_id_string.rs rename to crates/crypto/addresses/src/address/non_fungible_local_id_string.rs diff --git a/crates/sargon-addresses/src/address/non_fungible_resource_address.rs b/crates/crypto/addresses/src/address/non_fungible_resource_address.rs similarity index 99% rename from crates/sargon-addresses/src/address/non_fungible_resource_address.rs rename to crates/crypto/addresses/src/address/non_fungible_resource_address.rs index 553078fd4..be846f039 100644 --- a/crates/sargon-addresses/src/address/non_fungible_resource_address.rs +++ b/crates/crypto/addresses/src/address/non_fungible_resource_address.rs @@ -11,7 +11,7 @@ macro_rules! decl_specialized_address { $validation_err: ident ) => { - paste! { + paste::paste! { $( #[doc = $expr] )* @@ -68,7 +68,7 @@ macro_rules! decl_specialized_address { } } - impl Deref for $specialized_address_type { + impl std::ops::Deref for $specialized_address_type { type Target = $base_addr; fn deref(&self) -> &Self::Target { diff --git a/crates/sargon-addresses/src/address/package_address.rs b/crates/crypto/addresses/src/address/package_address.rs similarity index 100% rename from crates/sargon-addresses/src/address/package_address.rs rename to crates/crypto/addresses/src/address/package_address.rs diff --git a/crates/sargon-addresses/src/address/pool_address.rs b/crates/crypto/addresses/src/address/pool_address.rs similarity index 100% rename from crates/sargon-addresses/src/address/pool_address.rs rename to crates/crypto/addresses/src/address/pool_address.rs diff --git a/crates/sargon-addresses/src/address/public_key_hash.rs b/crates/crypto/addresses/src/address/public_key_hash.rs similarity index 100% rename from crates/sargon-addresses/src/address/public_key_hash.rs rename to crates/crypto/addresses/src/address/public_key_hash.rs diff --git a/crates/sargon-addresses/src/address/resource_address.rs b/crates/crypto/addresses/src/address/resource_address.rs similarity index 100% rename from crates/sargon-addresses/src/address/resource_address.rs rename to crates/crypto/addresses/src/address/resource_address.rs diff --git a/crates/sargon-addresses/src/address/validator_address.rs b/crates/crypto/addresses/src/address/validator_address.rs similarity index 100% rename from crates/sargon-addresses/src/address/validator_address.rs rename to crates/crypto/addresses/src/address/validator_address.rs diff --git a/crates/sargon-addresses/src/address/vault_address.rs b/crates/crypto/addresses/src/address/vault_address.rs similarity index 100% rename from crates/sargon-addresses/src/address/vault_address.rs rename to crates/crypto/addresses/src/address/vault_address.rs diff --git a/crates/sargon-addresses/src/address/wrap_ret_address.rs b/crates/crypto/addresses/src/address/wrap_ret_address.rs similarity index 98% rename from crates/sargon-addresses/src/address/wrap_ret_address.rs rename to crates/crypto/addresses/src/address/wrap_ret_address.rs index e0a6334ba..e8f1701a7 100644 --- a/crates/sargon-addresses/src/address/wrap_ret_address.rs +++ b/crates/crypto/addresses/src/address/wrap_ret_address.rs @@ -1,5 +1,7 @@ use crate::prelude::*; +use hash::hash_of; + pub trait AddressViaRet: Sized { fn new( node_id: impl Into, @@ -48,7 +50,7 @@ macro_rules! decl_ret_wrapped_address { )* $address_type: ident ) => { - paste! { + paste::paste! { use std::str::FromStr; $( #[doc = $expr] @@ -111,6 +113,7 @@ macro_rules! decl_ret_wrapped_address { } } + use std::cmp::Ordering; impl Ord for [< $address_type:camel Address >] { fn cmp(&self, other: &Self) -> Ordering { self.address().cmp(&other.address()) @@ -123,6 +126,9 @@ macro_rules! decl_ret_wrapped_address { } } + use bytes::prelude::generate_byte_array; + use sargon_core_utils::prelude::format_string; + impl [< $address_type:camel Address >] { pub fn random(network_id: NetworkID) -> Self { @@ -152,6 +158,7 @@ macro_rules! decl_ret_wrapped_address { Self::from(ret_address) } + pub fn formatted(&self, format: AddressFormat) -> String { match format { AddressFormat::Default => format_string(self.address(), 4, 6), diff --git a/crates/sargon-addresses/src/address_conversion/addresses_manifest_builder_support.rs b/crates/crypto/addresses/src/address_conversion/addresses_manifest_builder_support.rs similarity index 98% rename from crates/sargon-addresses/src/address_conversion/addresses_manifest_builder_support.rs rename to crates/crypto/addresses/src/address_conversion/addresses_manifest_builder_support.rs index 5fcac9780..467d843ff 100644 --- a/crates/sargon-addresses/src/address_conversion/addresses_manifest_builder_support.rs +++ b/crates/crypto/addresses/src/address_conversion/addresses_manifest_builder_support.rs @@ -2,7 +2,7 @@ use crate::prelude::*; macro_rules! from_scrypto_global_address { ($address_type: ty) => { - paste! { + paste::paste! { impl TryFrom<(ScryptoGlobalAddress, NetworkID)> for $address_type { type Error = crate::CommonError; fn try_from(value: (ScryptoGlobalAddress, NetworkID)) -> Result { @@ -26,7 +26,7 @@ from_scrypto_global_address!(LockerAddress); macro_rules! from_scrypto_address_variant { ($address_type: ty) => { - paste! { + paste::paste! { impl From<([< Scrypto $address_type >], NetworkID)> for $address_type { fn from(value: ([< Scrypto $address_type >], NetworkID)) -> Self { let target_type_name = stringify!($address_type); @@ -42,7 +42,7 @@ from_scrypto_address_variant!(ResourceAddress); macro_rules! from_scrypto_component_address { ($address_type: ty) => { - paste! { + paste::paste! { impl From<(ScryptoComponentAddress, NetworkID)> for $address_type { fn from(value: (ScryptoComponentAddress, NetworkID)) -> Self { <$address_type as AddressViaRet>::new(value.0.into_node_id(), value.1) diff --git a/crates/sargon-addresses/src/address_conversion/mod.rs b/crates/crypto/addresses/src/address_conversion/mod.rs similarity index 100% rename from crates/sargon-addresses/src/address_conversion/mod.rs rename to crates/crypto/addresses/src/address_conversion/mod.rs diff --git a/crates/sargon-addresses/src/address_conversion/resource_address_from.rs b/crates/crypto/addresses/src/address_conversion/resource_address_from.rs similarity index 100% rename from crates/sargon-addresses/src/address_conversion/resource_address_from.rs rename to crates/crypto/addresses/src/address_conversion/resource_address_from.rs diff --git a/crates/sargon-addresses/src/lib.rs b/crates/crypto/addresses/src/lib.rs similarity index 85% rename from crates/sargon-addresses/src/lib.rs rename to crates/crypto/addresses/src/lib.rs index aaa188bc4..20f88b3fe 100644 --- a/crates/sargon-addresses/src/lib.rs +++ b/crates/crypto/addresses/src/lib.rs @@ -3,9 +3,13 @@ mod address_conversion; mod resource; pub mod prelude { - pub(crate) use sargon_core::prelude::*; - pub(crate) use sargon_factors::prelude::*; - pub(crate) use sargon_hierarchical_deterministic::prelude::*; + + pub(crate) use bytes::prelude::*; + pub(crate) use ecc::prelude::*; + pub(crate) use factors::prelude::*; + pub(crate) use hierarchical_deterministic::prelude::*; + pub(crate) use identified_vec_of::prelude::*; + pub(crate) use network::prelude::*; pub use crate::address::*; pub use crate::resource::*; @@ -81,6 +85,18 @@ pub mod prelude { }, node_id::TypedNodeId as RetTypedNodeId, }; + + pub(crate) use enum_as_inner::EnumAsInner; + pub(crate) use log::*; + pub(crate) use serde::{Deserialize, Serialize}; + pub(crate) use serde_with::{DeserializeFromStr, SerializeDisplay}; + pub(crate) use std::str::FromStr; + + #[cfg(test)] + pub(crate) use serde_json::json; + + #[cfg(test)] + pub(crate) use std::collections::HashSet; } pub use prelude::*; diff --git a/crates/sargon-addresses/src/resource/mod.rs b/crates/crypto/addresses/src/resource/mod.rs similarity index 100% rename from crates/sargon-addresses/src/resource/mod.rs rename to crates/crypto/addresses/src/resource/mod.rs diff --git a/crates/sargon-addresses/src/resource/resource_or_non_fungible.rs b/crates/crypto/addresses/src/resource/resource_or_non_fungible.rs similarity index 100% rename from crates/sargon-addresses/src/resource/resource_or_non_fungible.rs rename to crates/crypto/addresses/src/resource/resource_or_non_fungible.rs diff --git a/crates/crypto/ecc/Cargo.toml b/crates/crypto/ecc/Cargo.toml new file mode 100644 index 000000000..a3d0241ce --- /dev/null +++ b/crates/crypto/ecc/Cargo.toml @@ -0,0 +1,30 @@ +[package] +name = "ecc" +version = "1.1.99" +edition = "2021" + +[dependencies] +# ==== INTERNAL DEPENDENCIES ==== +has-sample-values = { path = "../../core/has-sample-values" } +error = { path = "../../core/error" } +assert-json = { path = "../../core/assert-json" } +bytes = { path = "../../common/bytes" } +hash = { path = "../../crypto/hash" } +identified-vec-of = { path = "../../common/identified-vec-of" } + +# ==== RADIX DEPENDENCIES ==== +radix-common = { workspace = true } +radix-transactions = { workspace = true } + +# ==== EXTERNAL DEPENDENCIES ==== +derive_more = { workspace = true } +enum-as-inner = { workspace = true } +hex = { workspace = true } +iota-crypto = { workspace = true } +k256 = { workspace = true } +log = { workspace = true } +pretty_assertions = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +serde_with = { workspace = true } +zeroize = { workspace = true } diff --git a/crates/sargon-core/src/types/keys/ed25519/mod.rs b/crates/crypto/ecc/src/keys/ed25519/mod.rs similarity index 100% rename from crates/sargon-core/src/types/keys/ed25519/mod.rs rename to crates/crypto/ecc/src/keys/ed25519/mod.rs diff --git a/crates/sargon-core/src/types/keys/ed25519/private_key.rs b/crates/crypto/ecc/src/keys/ed25519/private_key.rs similarity index 100% rename from crates/sargon-core/src/types/keys/ed25519/private_key.rs rename to crates/crypto/ecc/src/keys/ed25519/private_key.rs diff --git a/crates/sargon-core/src/types/keys/ed25519/public_key.rs b/crates/crypto/ecc/src/keys/ed25519/public_key.rs similarity index 100% rename from crates/sargon-core/src/types/keys/ed25519/public_key.rs rename to crates/crypto/ecc/src/keys/ed25519/public_key.rs diff --git a/crates/sargon-core/src/types/keys/is_private_key.rs b/crates/crypto/ecc/src/keys/is_private_key.rs similarity index 100% rename from crates/sargon-core/src/types/keys/is_private_key.rs rename to crates/crypto/ecc/src/keys/is_private_key.rs diff --git a/crates/sargon-core/src/types/keys/is_public_key.rs b/crates/crypto/ecc/src/keys/is_public_key.rs similarity index 100% rename from crates/sargon-core/src/types/keys/is_public_key.rs rename to crates/crypto/ecc/src/keys/is_public_key.rs diff --git a/crates/sargon-core/src/types/keys/key_agreement/mod.rs b/crates/crypto/ecc/src/keys/key_agreement/mod.rs similarity index 100% rename from crates/sargon-core/src/types/keys/key_agreement/mod.rs rename to crates/crypto/ecc/src/keys/key_agreement/mod.rs diff --git a/crates/sargon-core/src/types/keys/key_agreement/private_key.rs b/crates/crypto/ecc/src/keys/key_agreement/private_key.rs similarity index 100% rename from crates/sargon-core/src/types/keys/key_agreement/private_key.rs rename to crates/crypto/ecc/src/keys/key_agreement/private_key.rs diff --git a/crates/sargon-core/src/types/keys/key_agreement/public_key.rs b/crates/crypto/ecc/src/keys/key_agreement/public_key.rs similarity index 100% rename from crates/sargon-core/src/types/keys/key_agreement/public_key.rs rename to crates/crypto/ecc/src/keys/key_agreement/public_key.rs diff --git a/crates/sargon-core/src/types/keys/mod.rs b/crates/crypto/ecc/src/keys/mod.rs similarity index 100% rename from crates/sargon-core/src/types/keys/mod.rs rename to crates/crypto/ecc/src/keys/mod.rs diff --git a/crates/sargon-core/src/types/keys/private_key.rs b/crates/crypto/ecc/src/keys/private_key.rs similarity index 100% rename from crates/sargon-core/src/types/keys/private_key.rs rename to crates/crypto/ecc/src/keys/private_key.rs diff --git a/crates/sargon-core/src/types/keys/public_key.rs b/crates/crypto/ecc/src/keys/public_key.rs similarity index 99% rename from crates/sargon-core/src/types/keys/public_key.rs rename to crates/crypto/ecc/src/keys/public_key.rs index db09b9b1b..459fd974c 100644 --- a/crates/sargon-core/src/types/keys/public_key.rs +++ b/crates/crypto/ecc/src/keys/public_key.rs @@ -1,3 +1,5 @@ +use serde::{de, ser::SerializeStruct, Deserializer, Serializer}; + use crate::prelude::*; /// A tagged union of supported public keys on different curves, supported diff --git a/crates/sargon-core/src/types/keys/secp256k1/mod.rs b/crates/crypto/ecc/src/keys/secp256k1/mod.rs similarity index 100% rename from crates/sargon-core/src/types/keys/secp256k1/mod.rs rename to crates/crypto/ecc/src/keys/secp256k1/mod.rs diff --git a/crates/sargon-core/src/types/keys/secp256k1/private_key.rs b/crates/crypto/ecc/src/keys/secp256k1/private_key.rs similarity index 100% rename from crates/sargon-core/src/types/keys/secp256k1/private_key.rs rename to crates/crypto/ecc/src/keys/secp256k1/private_key.rs diff --git a/crates/sargon-core/src/types/keys/secp256k1/public_key.rs b/crates/crypto/ecc/src/keys/secp256k1/public_key.rs similarity index 100% rename from crates/sargon-core/src/types/keys/secp256k1/public_key.rs rename to crates/crypto/ecc/src/keys/secp256k1/public_key.rs diff --git a/crates/sargon-core/src/types/keys/slip10_curve.rs b/crates/crypto/ecc/src/keys/slip10_curve.rs similarity index 100% rename from crates/sargon-core/src/types/keys/slip10_curve.rs rename to crates/crypto/ecc/src/keys/slip10_curve.rs diff --git a/crates/crypto/ecc/src/lib.rs b/crates/crypto/ecc/src/lib.rs new file mode 100644 index 000000000..f6f3faa99 --- /dev/null +++ b/crates/crypto/ecc/src/lib.rs @@ -0,0 +1,44 @@ +mod keys; +mod signatures; + +pub mod prelude { + pub use crate::keys::*; + pub use crate::signatures::*; + + pub(crate) use bytes::prelude::*; + pub(crate) use hash::prelude::*; + pub(crate) use identified_vec_of::prelude::*; + + pub(crate) use radix_common::crypto::{ + verify_ed25519 as scrypto_verify_ed25519, + verify_secp256k1 as scrypto_verify_secp256k1, + Ed25519PrivateKey as ScryptoEd25519PrivateKey, + Ed25519PublicKey as ScryptoEd25519PublicKey, + Ed25519Signature as ScryptoEd25519Signature, IsHash as ScryptoIsHash, + PublicKey as ScryptoPublicKey, + Secp256k1PrivateKey as ScryptoSecp256k1PrivateKey, + Secp256k1PublicKey as ScryptoSecp256k1PublicKey, + Secp256k1Signature as ScryptoSecp256k1Signature, + }; + + pub use radix_transactions::model::{ + SignatureV1 as ScryptoSignature, + SignatureWithPublicKeyV1 as ScryptoSignatureWithPublicKey, + }; + + pub(crate) use enum_as_inner::EnumAsInner; + pub(crate) use log::error; + + #[cfg(test)] + pub(crate) use serde_json::json; + + pub(crate) use serde::{Deserialize, Serialize}; + pub(crate) use serde_with::{ + serde_as, DeserializeFromStr, SerializeDisplay, + }; + + #[cfg(test)] + pub(crate) use std::collections::{BTreeSet, HashSet}; +} + +pub use prelude::*; diff --git a/crates/sargon-core/src/types/signatures/ed25519_signature.rs b/crates/crypto/ecc/src/signatures/ed25519_signature.rs similarity index 100% rename from crates/sargon-core/src/types/signatures/ed25519_signature.rs rename to crates/crypto/ecc/src/signatures/ed25519_signature.rs diff --git a/crates/sargon-core/src/types/signatures/mod.rs b/crates/crypto/ecc/src/signatures/mod.rs similarity index 100% rename from crates/sargon-core/src/types/signatures/mod.rs rename to crates/crypto/ecc/src/signatures/mod.rs diff --git a/crates/sargon-core/src/types/signatures/secp256k1_signature.rs b/crates/crypto/ecc/src/signatures/secp256k1_signature.rs similarity index 100% rename from crates/sargon-core/src/types/signatures/secp256k1_signature.rs rename to crates/crypto/ecc/src/signatures/secp256k1_signature.rs diff --git a/crates/sargon-core/src/types/signatures/signature.rs b/crates/crypto/ecc/src/signatures/signature.rs similarity index 100% rename from crates/sargon-core/src/types/signatures/signature.rs rename to crates/crypto/ecc/src/signatures/signature.rs diff --git a/crates/sargon-core/src/types/signatures/signature_with_public_key.rs b/crates/crypto/ecc/src/signatures/signature_with_public_key.rs similarity index 100% rename from crates/sargon-core/src/types/signatures/signature_with_public_key.rs rename to crates/crypto/ecc/src/signatures/signature_with_public_key.rs diff --git a/crates/crypto/encryption/Cargo.toml b/crates/crypto/encryption/Cargo.toml new file mode 100644 index 000000000..52a1687f6 --- /dev/null +++ b/crates/crypto/encryption/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "encryption" +version = "1.1.99" +edition = "2021" + +[dependencies] +# ==== INTERNAL DEPENDENCIES ==== +has-sample-values = { path = "../../core/has-sample-values" } +error = { path = "../../core/error" } +assert-json = { path = "../../core/assert-json" } +bytes = { path = "../../common/bytes" } + +# ==== RADIX DEPENDENCIES ==== +# None + +# ==== EXTERNAL DEPENDENCIES ==== +aes-gcm = { workspace = true } +derive_more = { workspace = true } +hex = { workspace = true } +hkdf = { workspace = true } +iota-crypto = { workspace = true } +k256 = { workspace = true } +log = { workspace = true } +serde = { workspace = true } +serde_repr = { workspace = true } +zeroize = { workspace = true } diff --git a/crates/sargon-core/src/encryption/aes_gcm_256.rs b/crates/crypto/encryption/src/encryption/aes_gcm_256.rs similarity index 100% rename from crates/sargon-core/src/encryption/aes_gcm_256.rs rename to crates/crypto/encryption/src/encryption/aes_gcm_256.rs diff --git a/crates/sargon-core/src/encryption/aes_gcm_sealed_box.rs b/crates/crypto/encryption/src/encryption/aes_gcm_sealed_box.rs similarity index 100% rename from crates/sargon-core/src/encryption/aes_gcm_sealed_box.rs rename to crates/crypto/encryption/src/encryption/aes_gcm_sealed_box.rs diff --git a/crates/sargon-core/src/encryption/encryption_key.rs b/crates/crypto/encryption/src/encryption/encryption_key.rs similarity index 100% rename from crates/sargon-core/src/encryption/encryption_key.rs rename to crates/crypto/encryption/src/encryption/encryption_key.rs diff --git a/crates/sargon-core/src/encryption/encryption_scheme.rs b/crates/crypto/encryption/src/encryption/encryption_scheme.rs similarity index 98% rename from crates/sargon-core/src/encryption/encryption_scheme.rs rename to crates/crypto/encryption/src/encryption/encryption_scheme.rs index 2eb3e605f..9cb22bb20 100644 --- a/crates/sargon-core/src/encryption/encryption_scheme.rs +++ b/crates/crypto/encryption/src/encryption/encryption_scheme.rs @@ -1,3 +1,5 @@ +use serde::{de, ser::SerializeStruct, Deserializer, Serializer}; + use crate::prelude::*; #[derive(Clone, PartialEq, Eq, Hash, derive_more::Debug)] diff --git a/crates/sargon-core/src/encryption/encryption_scheme_version.rs b/crates/crypto/encryption/src/encryption/encryption_scheme_version.rs similarity index 84% rename from crates/sargon-core/src/encryption/encryption_scheme_version.rs rename to crates/crypto/encryption/src/encryption/encryption_scheme_version.rs index d4c92a3be..45ede3186 100644 --- a/crates/sargon-core/src/encryption/encryption_scheme_version.rs +++ b/crates/crypto/encryption/src/encryption/encryption_scheme_version.rs @@ -1,4 +1,4 @@ -use crate::prelude::*; +use serde_repr::{Deserialize_repr, Serialize_repr}; /// Versioned Encryption scheme #[repr(u32)] diff --git a/crates/sargon-core/src/encryption/mod.rs b/crates/crypto/encryption/src/encryption/mod.rs similarity index 100% rename from crates/sargon-core/src/encryption/mod.rs rename to crates/crypto/encryption/src/encryption/mod.rs diff --git a/crates/sargon-core/src/encryption/version_of_algorithm.rs b/crates/crypto/encryption/src/encryption/version_of_algorithm.rs similarity index 100% rename from crates/sargon-core/src/encryption/version_of_algorithm.rs rename to crates/crypto/encryption/src/encryption/version_of_algorithm.rs diff --git a/crates/sargon-core/src/encryption/versioned_encryption.rs b/crates/crypto/encryption/src/encryption/versioned_encryption.rs similarity index 100% rename from crates/sargon-core/src/encryption/versioned_encryption.rs rename to crates/crypto/encryption/src/encryption/versioned_encryption.rs diff --git a/crates/sargon-profile/src/encrypted/key_derivation/mod.rs b/crates/crypto/encryption/src/key_derivation/mod.rs similarity index 100% rename from crates/sargon-profile/src/encrypted/key_derivation/mod.rs rename to crates/crypto/encryption/src/key_derivation/mod.rs diff --git a/crates/sargon-profile/src/encrypted/key_derivation/password_based_key_derivation_scheme.rs b/crates/crypto/encryption/src/key_derivation/password_based_key_derivation_scheme.rs similarity index 98% rename from crates/sargon-profile/src/encrypted/key_derivation/password_based_key_derivation_scheme.rs rename to crates/crypto/encryption/src/key_derivation/password_based_key_derivation_scheme.rs index 7044fd6e1..74125d7df 100644 --- a/crates/sargon-profile/src/encrypted/key_derivation/password_based_key_derivation_scheme.rs +++ b/crates/crypto/encryption/src/key_derivation/password_based_key_derivation_scheme.rs @@ -1,3 +1,5 @@ +use serde::{de, ser::SerializeStruct, Deserializer, Serializer}; + use crate::prelude::*; #[derive(Debug, Clone, PartialEq, Eq, Hash)] diff --git a/crates/sargon-profile/src/encrypted/key_derivation/password_based_key_derivation_scheme_version.rs b/crates/crypto/encryption/src/key_derivation/password_based_key_derivation_scheme_version.rs similarity index 90% rename from crates/sargon-profile/src/encrypted/key_derivation/password_based_key_derivation_scheme_version.rs rename to crates/crypto/encryption/src/key_derivation/password_based_key_derivation_scheme_version.rs index 06d39f2ec..4c82b24e2 100644 --- a/crates/sargon-profile/src/encrypted/key_derivation/password_based_key_derivation_scheme_version.rs +++ b/crates/crypto/encryption/src/key_derivation/password_based_key_derivation_scheme_version.rs @@ -1,4 +1,4 @@ -use crate::prelude::*; +use serde_repr::{Deserialize_repr, Serialize_repr}; /// The KDF algorithm used to derive the decryption key from a user provided password. #[repr(u32)] diff --git a/crates/sargon-profile/src/encrypted/key_derivation/versioned_password_based_key_derivation.rs b/crates/crypto/encryption/src/key_derivation/versioned_password_based_key_derivation.rs similarity index 100% rename from crates/sargon-profile/src/encrypted/key_derivation/versioned_password_based_key_derivation.rs rename to crates/crypto/encryption/src/key_derivation/versioned_password_based_key_derivation.rs diff --git a/crates/crypto/encryption/src/lib.rs b/crates/crypto/encryption/src/lib.rs new file mode 100644 index 000000000..068f9529e --- /dev/null +++ b/crates/crypto/encryption/src/lib.rs @@ -0,0 +1,19 @@ +mod encryption; +mod key_derivation; +mod pb_hkdf_sha256; +mod versioned_algorithm; + +pub mod prelude { + pub use crate::encryption::*; + pub use crate::key_derivation::*; + pub use crate::pb_hkdf_sha256::*; + pub use crate::versioned_algorithm::*; + + pub use bytes::prelude::*; + + pub(crate) use log::*; + pub(crate) use serde::{Deserialize, Serialize}; + pub(crate) use zeroize::*; +} + +pub use prelude::*; diff --git a/crates/sargon-profile/src/encrypted/pb_hkdf_sha256.rs b/crates/crypto/encryption/src/pb_hkdf_sha256.rs similarity index 90% rename from crates/sargon-profile/src/encrypted/pb_hkdf_sha256.rs rename to crates/crypto/encryption/src/pb_hkdf_sha256.rs index d36957466..26962af09 100644 --- a/crates/sargon-profile/src/encrypted/pb_hkdf_sha256.rs +++ b/crates/crypto/encryption/src/pb_hkdf_sha256.rs @@ -1,11 +1,7 @@ +use crate::prelude::*; + use hkdf::Hkdf; use k256::sha2::Sha256; -use sargon_core::{Exactly32Bytes, VersionOfAlgorithm}; - -use super::{ - PasswordBasedKeyDerivationSchemeVersion, - VersionedPasswordBasedKeyDerivation, -}; /// A simple `HKDF` based scheme using UTF8 encoding of the password as input. #[derive( diff --git a/crates/sargon-profile/src/encrypted/versioned_algorithm.rs b/crates/crypto/encryption/src/versioned_algorithm.rs similarity index 100% rename from crates/sargon-profile/src/encrypted/versioned_algorithm.rs rename to crates/crypto/encryption/src/versioned_algorithm.rs diff --git a/crates/crypto/hash/Cargo.toml b/crates/crypto/hash/Cargo.toml new file mode 100644 index 000000000..c18b7c864 --- /dev/null +++ b/crates/crypto/hash/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "hash" +version = "1.1.99" +edition = "2021" + +[dependencies] +# ==== INTERNAL DEPENDENCIES ==== +bytes = { path = "../../common/bytes" } + +# ==== RADIX DEPENDENCIES ==== +radix-common = { workspace = true } + +# ==== EXTERNAL DEPENDENCIES ==== +derive_more = { workspace = true } +serde = { workspace = true } diff --git a/crates/sargon-core/src/hash.rs b/crates/crypto/hash/src/hash.rs similarity index 91% rename from crates/sargon-core/src/hash.rs rename to crates/crypto/hash/src/hash.rs index ee3cac28b..c5a1cfd20 100644 --- a/crates/sargon-core/src/hash.rs +++ b/crates/crypto/hash/src/hash.rs @@ -13,6 +13,13 @@ use crate::prelude::*; )] pub struct Hash(pub ScryptoHash); +impl From for BagOfBytes { + /// Instantiates a new `BagOfBytes` from the `Hash` (32 bytes). + fn from(value: Hash) -> Self { + value.bytes().as_slice().into() + } +} + impl AsRef for Hash { fn as_ref(&self) -> &ScryptoHash { &self.0 @@ -106,6 +113,12 @@ mod tests { #[allow(clippy::upper_case_acronyms)] type SUT = Hash; + #[test] + fn bag_of_bytes_from_hash() { + let digest = hash_of(vec![0xde, 0xad]); + assert_eq!(BagOfBytes::from(digest).to_vec(), digest.bytes()); + } + #[test] fn equality() { assert_eq!(SUT::sample(), SUT::sample()); diff --git a/crates/crypto/hash/src/lib.rs b/crates/crypto/hash/src/lib.rs new file mode 100644 index 000000000..f34dc57c5 --- /dev/null +++ b/crates/crypto/hash/src/lib.rs @@ -0,0 +1,15 @@ +mod hash; + +pub mod prelude { + pub use crate::hash::*; + + pub(crate) use bytes::prelude::*; + + pub(crate) use radix_common::crypto::{ + blake2b_256_hash, Hash as ScryptoHash, IsHash as ScryptoIsHash, + }; + + pub(crate) use std::str::FromStr; +} + +pub use prelude::*; diff --git a/crates/sargon-hierarchical-deterministic/Cargo.toml b/crates/crypto/hd/Cargo.toml similarity index 52% rename from crates/sargon-hierarchical-deterministic/Cargo.toml rename to crates/crypto/hd/Cargo.toml index 6892323c0..c5624a14b 100644 --- a/crates/sargon-hierarchical-deterministic/Cargo.toml +++ b/crates/crypto/hd/Cargo.toml @@ -1,12 +1,18 @@ [package] -name = "sargon-hierarchical-deterministic" +name = "hierarchical-deterministic" version = "1.1.99" edition = "2021" [dependencies] # ==== INTERNAL DEPENDENCIES ==== -identified-vec-of = { path = "../identified-vec-of" } -sargon-core = { path = "../sargon-core" } +identified-vec-of = { path = "../../common/identified-vec-of" } +ecc = { path = "../../crypto/ecc" } +hash = { path = "../../crypto/hash" } +bytes = { path = "../../common/bytes" } +has-sample-values = { path = "../../core/has-sample-values" } +assert-json = { path = "../../core/assert-json" } +network = { path = "../../common/network" } +numeric = { path = "../../common/numeric" } # ==== RADIX DEPENDENCIES ==== radix-common = { workspace = true } @@ -14,6 +20,7 @@ radix-common = { workspace = true } # ==== EXTERNAL DEPENDENCIES ==== bip39 = { workspace = true } derive_more = { workspace = true } +enum-as-inner = { workspace = true } enum-iterator = { workspace = true } iota-crypto = { workspace = true } itertools = { workspace = true } @@ -21,4 +28,5 @@ paste = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } serde_with = { workspace = true } +strum = { workspace = true } zeroize = { workspace = true } diff --git a/crates/sargon-hierarchical-deterministic/src/bip32/hd_path.rs b/crates/crypto/hd/src/bip32/hd_path.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/bip32/hd_path.rs rename to crates/crypto/hd/src/bip32/hd_path.rs diff --git a/crates/sargon-hierarchical-deterministic/src/bip32/hd_path_component.rs b/crates/crypto/hd/src/bip32/hd_path_component.rs similarity index 99% rename from crates/sargon-hierarchical-deterministic/src/bip32/hd_path_component.rs rename to crates/crypto/hd/src/bip32/hd_path_component.rs index 137092b5f..4a6df8bac 100644 --- a/crates/sargon-hierarchical-deterministic/src/bip32/hd_path_component.rs +++ b/crates/crypto/hd/src/bip32/hd_path_component.rs @@ -1,3 +1,5 @@ +use std::cmp::Ordering; + use crate::prelude::*; /// A component for a BIP32 hd path, mappable into a `u32`. Retains information about the creating context, if this component is securified or not. And if it is not securified it is hardened or not. diff --git a/crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/hardened.rs b/crates/crypto/hd/src/bip32/key_space/components/hardened.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/hardened.rs rename to crates/crypto/hd/src/bip32/key_space/components/hardened.rs diff --git a/crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/mod.rs b/crates/crypto/hd/src/bip32/key_space/components/mod.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/mod.rs rename to crates/crypto/hd/src/bip32/key_space/components/mod.rs diff --git a/crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/securified.rs b/crates/crypto/hd/src/bip32/key_space/components/securified.rs similarity index 99% rename from crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/securified.rs rename to crates/crypto/hd/src/bip32/key_space/components/securified.rs index 93e4716ef..523760481 100644 --- a/crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/securified.rs +++ b/crates/crypto/hd/src/bip32/key_space/components/securified.rs @@ -50,9 +50,9 @@ use crate::prelude::*; PartialOrd, Ord, Hash, - Deref, DeserializeFromStr, SerializeDisplay, + derive_more::Deref, derive_more::Display, derive_more::Debug, )] diff --git a/crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/unhardened.rs b/crates/crypto/hd/src/bip32/key_space/components/unhardened.rs similarity index 99% rename from crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/unhardened.rs rename to crates/crypto/hd/src/bip32/key_space/components/unhardened.rs index 6ed5e394c..77503ece1 100644 --- a/crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/unhardened.rs +++ b/crates/crypto/hd/src/bip32/key_space/components/unhardened.rs @@ -38,9 +38,9 @@ use crate::prelude::*; PartialOrd, Ord, Hash, - Deref, DeserializeFromStr, SerializeDisplay, + derive_more::Deref, derive_more::Display, derive_more::Debug, )] diff --git a/crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/unsecurified.rs b/crates/crypto/hd/src/bip32/key_space/components/unsecurified.rs similarity index 99% rename from crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/unsecurified.rs rename to crates/crypto/hd/src/bip32/key_space/components/unsecurified.rs index 7c7422e7a..a3c6c5b96 100644 --- a/crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/unsecurified.rs +++ b/crates/crypto/hd/src/bip32/key_space/components/unsecurified.rs @@ -1,3 +1,5 @@ +use std::cmp::Ordering; + use crate::prelude::*; /// Represents an "unsecurified" component in a BIP32 path, known to be unhardened or hardened. If it is hardened we will add `GLOBAL_OFFSET_HARDENED` to it when mapped to global key space. diff --git a/crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/unsecurified_hardened.rs b/crates/crypto/hd/src/bip32/key_space/components/unsecurified_hardened.rs similarity index 99% rename from crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/unsecurified_hardened.rs rename to crates/crypto/hd/src/bip32/key_space/components/unsecurified_hardened.rs index 83acfb011..c2da2ab19 100644 --- a/crates/sargon-hierarchical-deterministic/src/bip32/key_space/components/unsecurified_hardened.rs +++ b/crates/crypto/hd/src/bip32/key_space/components/unsecurified_hardened.rs @@ -37,10 +37,10 @@ use crate::prelude::*; PartialOrd, Ord, Hash, - Deref, - AsRef, DeserializeFromStr, SerializeDisplay, + derive_more::Deref, + derive_more::AsRef, derive_more::Display, derive_more::Debug, )] diff --git a/crates/sargon-hierarchical-deterministic/src/bip32/key_space/key_space.rs b/crates/crypto/hd/src/bip32/key_space/key_space.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/bip32/key_space/key_space.rs rename to crates/crypto/hd/src/bip32/key_space/key_space.rs diff --git a/crates/sargon-hierarchical-deterministic/src/bip32/key_space/mod.rs b/crates/crypto/hd/src/bip32/key_space/mod.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/bip32/key_space/mod.rs rename to crates/crypto/hd/src/bip32/key_space/mod.rs diff --git a/crates/sargon-hierarchical-deterministic/src/bip32/key_space/traits/add_via_global.rs b/crates/crypto/hd/src/bip32/key_space/traits/add_via_global.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/bip32/key_space/traits/add_via_global.rs rename to crates/crypto/hd/src/bip32/key_space/traits/add_via_global.rs diff --git a/crates/sargon-hierarchical-deterministic/src/bip32/key_space/traits/from_global_key_space.rs b/crates/crypto/hd/src/bip32/key_space/traits/from_global_key_space.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/bip32/key_space/traits/from_global_key_space.rs rename to crates/crypto/hd/src/bip32/key_space/traits/from_global_key_space.rs diff --git a/crates/sargon-hierarchical-deterministic/src/bip32/key_space/traits/from_local_key_space.rs b/crates/crypto/hd/src/bip32/key_space/traits/from_local_key_space.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/bip32/key_space/traits/from_local_key_space.rs rename to crates/crypto/hd/src/bip32/key_space/traits/from_local_key_space.rs diff --git a/crates/sargon-hierarchical-deterministic/src/bip32/key_space/traits/has_offset_from_global_key_space.rs b/crates/crypto/hd/src/bip32/key_space/traits/has_offset_from_global_key_space.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/bip32/key_space/traits/has_offset_from_global_key_space.rs rename to crates/crypto/hd/src/bip32/key_space/traits/has_offset_from_global_key_space.rs diff --git a/crates/sargon-hierarchical-deterministic/src/bip32/key_space/traits/is_in_local_key_space.rs b/crates/crypto/hd/src/bip32/key_space/traits/is_in_local_key_space.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/bip32/key_space/traits/is_in_local_key_space.rs rename to crates/crypto/hd/src/bip32/key_space/traits/is_in_local_key_space.rs diff --git a/crates/sargon-hierarchical-deterministic/src/bip32/key_space/traits/is_mappable_to_global_key_space.rs b/crates/crypto/hd/src/bip32/key_space/traits/is_mappable_to_global_key_space.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/bip32/key_space/traits/is_mappable_to_global_key_space.rs rename to crates/crypto/hd/src/bip32/key_space/traits/is_mappable_to_global_key_space.rs diff --git a/crates/sargon-hierarchical-deterministic/src/bip32/key_space/traits/mod.rs b/crates/crypto/hd/src/bip32/key_space/traits/mod.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/bip32/key_space/traits/mod.rs rename to crates/crypto/hd/src/bip32/key_space/traits/mod.rs diff --git a/crates/sargon-hierarchical-deterministic/src/bip32/mod.rs b/crates/crypto/hd/src/bip32/mod.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/bip32/mod.rs rename to crates/crypto/hd/src/bip32/mod.rs diff --git a/crates/sargon-hierarchical-deterministic/src/bip32/traits/from_bip32_str.rs b/crates/crypto/hd/src/bip32/traits/from_bip32_str.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/bip32/traits/from_bip32_str.rs rename to crates/crypto/hd/src/bip32/traits/from_bip32_str.rs diff --git a/crates/sargon-hierarchical-deterministic/src/bip32/traits/is_path_component_string_convertible.rs b/crates/crypto/hd/src/bip32/traits/is_path_component_string_convertible.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/bip32/traits/is_path_component_string_convertible.rs rename to crates/crypto/hd/src/bip32/traits/is_path_component_string_convertible.rs diff --git a/crates/sargon-hierarchical-deterministic/src/bip32/traits/is_security_state_aware.rs b/crates/crypto/hd/src/bip32/traits/is_security_state_aware.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/bip32/traits/is_security_state_aware.rs rename to crates/crypto/hd/src/bip32/traits/is_security_state_aware.rs diff --git a/crates/sargon-hierarchical-deterministic/src/bip32/traits/mod.rs b/crates/crypto/hd/src/bip32/traits/mod.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/bip32/traits/mod.rs rename to crates/crypto/hd/src/bip32/traits/mod.rs diff --git a/crates/sargon-hierarchical-deterministic/src/bip32/traits/to_bip32_str.rs b/crates/crypto/hd/src/bip32/traits/to_bip32_str.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/bip32/traits/to_bip32_str.rs rename to crates/crypto/hd/src/bip32/traits/to_bip32_str.rs diff --git a/crates/sargon-hierarchical-deterministic/src/bip39/bip39_entropy.rs b/crates/crypto/hd/src/bip39/bip39_entropy.rs similarity index 99% rename from crates/sargon-hierarchical-deterministic/src/bip39/bip39_entropy.rs rename to crates/crypto/hd/src/bip39/bip39_entropy.rs index 3aeaa1e64..375a86cd5 100644 --- a/crates/sargon-hierarchical-deterministic/src/bip39/bip39_entropy.rs +++ b/crates/crypto/hd/src/bip39/bip39_entropy.rs @@ -1,5 +1,5 @@ use crate::prelude::*; -use sargon_core::decl_secret_bytes; +use bytes::*; macro_rules! entropy_with_byte_counts { ( @@ -11,7 +11,7 @@ macro_rules! entropy_with_byte_counts { $byte_count: literal, )+ ) => { - paste! { + paste::paste! { $( decl_secret_bytes!( [< Entropy $byte_count Bytes >], diff --git a/crates/sargon-hierarchical-deterministic/src/bip39/bip39_passphrase.rs b/crates/crypto/hd/src/bip39/bip39_passphrase.rs similarity index 83% rename from crates/sargon-hierarchical-deterministic/src/bip39/bip39_passphrase.rs rename to crates/crypto/hd/src/bip39/bip39_passphrase.rs index 7866b4fd6..4b160e17d 100644 --- a/crates/sargon-hierarchical-deterministic/src/bip39/bip39_passphrase.rs +++ b/crates/crypto/hd/src/bip39/bip39_passphrase.rs @@ -28,12 +28,6 @@ impl BIP39Passphrase { .to_string() } } -impl SafeToLog for BIP39Passphrase { - /// Logs the word count and FactorSourceID o - fn non_sensitive(&self) -> impl std::fmt::Debug { - self.partially_obfuscated_string() - } -} impl BIP39Passphrase { pub fn new(s: impl AsRef) -> Self { @@ -109,18 +103,6 @@ mod tests { assert_eq!(format!("{}", SUT::default()), ""); } - #[test] - fn non_sensitive() { - assert_eq!( - format!("{:?}", SUT::new("so secret").non_sensitive()), - format!("{:?}", "") - ); - assert_eq!( - format!("{:?}", SUT::default().non_sensitive()), - format!("{:?}", "") - ); - } - #[test] fn zeroize() { let mut sut = SUT::sample(); diff --git a/crates/sargon-hierarchical-deterministic/src/bip39/bip39_seed.rs b/crates/crypto/hd/src/bip39/bip39_seed.rs similarity index 99% rename from crates/sargon-hierarchical-deterministic/src/bip39/bip39_seed.rs rename to crates/crypto/hd/src/bip39/bip39_seed.rs index 2066dcd9f..ef0d10b9c 100644 --- a/crates/sargon-hierarchical-deterministic/src/bip39/bip39_seed.rs +++ b/crates/crypto/hd/src/bip39/bip39_seed.rs @@ -1,5 +1,5 @@ use crate::prelude::*; -use sargon_core::decl_secret_bytes; +use bytes::decl_secret_bytes; decl_secret_bytes!( /// A BIP39 seed for hierarchal deterministic wallets, as per the [BIP39 standard][doc]. diff --git a/crates/sargon-hierarchical-deterministic/src/bip39/bip39_word/bip39_language.rs b/crates/crypto/hd/src/bip39/bip39_word/bip39_language.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/bip39/bip39_word/bip39_language.rs rename to crates/crypto/hd/src/bip39/bip39_word/bip39_language.rs diff --git a/crates/sargon-hierarchical-deterministic/src/bip39/bip39_word/bip39_word.rs b/crates/crypto/hd/src/bip39/bip39_word/bip39_word.rs similarity index 99% rename from crates/sargon-hierarchical-deterministic/src/bip39/bip39_word/bip39_word.rs rename to crates/crypto/hd/src/bip39/bip39_word/bip39_word.rs index 8376665a6..7ca0ed57f 100644 --- a/crates/sargon-hierarchical-deterministic/src/bip39/bip39_word/bip39_word.rs +++ b/crates/crypto/hd/src/bip39/bip39_word/bip39_word.rs @@ -1,3 +1,5 @@ +use std::cmp::Ordering; + use crate::prelude::*; /// A word in the BIP39 word list of `language` at known `index` (0-2047). diff --git a/crates/sargon-hierarchical-deterministic/src/bip39/bip39_word/mod.rs b/crates/crypto/hd/src/bip39/bip39_word/mod.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/bip39/bip39_word/mod.rs rename to crates/crypto/hd/src/bip39/bip39_word/mod.rs diff --git a/crates/sargon-hierarchical-deterministic/src/bip39/bip39_word/u11.rs b/crates/crypto/hd/src/bip39/bip39_word/u11.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/bip39/bip39_word/u11.rs rename to crates/crypto/hd/src/bip39/bip39_word/u11.rs diff --git a/crates/sargon-hierarchical-deterministic/src/bip39/bip39_word_count.rs b/crates/crypto/hd/src/bip39/bip39_word_count.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/bip39/bip39_word_count.rs rename to crates/crypto/hd/src/bip39/bip39_word_count.rs diff --git a/crates/sargon-hierarchical-deterministic/src/bip39/mnemonic.rs b/crates/crypto/hd/src/bip39/mnemonic.rs similarity index 98% rename from crates/sargon-hierarchical-deterministic/src/bip39/mnemonic.rs rename to crates/crypto/hd/src/bip39/mnemonic.rs index 39b5f6078..d9df133de 100644 --- a/crates/sargon-hierarchical-deterministic/src/bip39/mnemonic.rs +++ b/crates/crypto/hd/src/bip39/mnemonic.rs @@ -1,3 +1,5 @@ +use serde::Serializer; + use crate::prelude::*; #[derive( @@ -41,12 +43,6 @@ impl Mnemonic { ) } } -impl SafeToLog for Mnemonic { - /// Logs the word count and FactorSourceID o - fn non_sensitive(&self) -> impl std::fmt::Debug { - self.partially_obfuscated_string() - } -} impl Mnemonic { pub fn to_obfuscated_string(&self) -> String { @@ -470,15 +466,6 @@ mod tests { assert_eq!(format!("{}", mnemonic), "Mnemonic in English obfuscated.") } - #[test] - fn non_sensitive() { - let mnemonic = SUT::sample(); - assert_eq!( - format!("{:?}", mnemonic.non_sensitive()), - format!("{:?}", "24 words (bright...mandate)") - ); - } - #[test] fn language() { let mnemonic: SUT = diff --git a/crates/sargon-hierarchical-deterministic/src/bip39/mod.rs b/crates/crypto/hd/src/bip39/mod.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/bip39/mod.rs rename to crates/crypto/hd/src/bip39/mod.rs diff --git a/crates/sargon-hierarchical-deterministic/src/bip44/bip44_like_path.rs b/crates/crypto/hd/src/bip44/bip44_like_path.rs similarity index 99% rename from crates/sargon-hierarchical-deterministic/src/bip44/bip44_like_path.rs rename to crates/crypto/hd/src/bip44/bip44_like_path.rs index 2c43b23a6..a400581b5 100644 --- a/crates/sargon-hierarchical-deterministic/src/bip44/bip44_like_path.rs +++ b/crates/crypto/hd/src/bip44/bip44_like_path.rs @@ -1,5 +1,4 @@ use crate::prelude::*; -use sargon_core::prelude::*; /// Either a canonical BIP44 derivation path like so: /// diff --git a/crates/sargon-hierarchical-deterministic/src/bip44/mod.rs b/crates/crypto/hd/src/bip44/mod.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/bip44/mod.rs rename to crates/crypto/hd/src/bip44/mod.rs diff --git a/crates/sargon-hierarchical-deterministic/src/cap26/cap26_entity_kind.rs b/crates/crypto/hd/src/cap26/cap26_entity_kind.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/cap26/cap26_entity_kind.rs rename to crates/crypto/hd/src/cap26/cap26_entity_kind.rs diff --git a/crates/sargon-hierarchical-deterministic/src/cap26/cap26_key_kind.rs b/crates/crypto/hd/src/cap26/cap26_key_kind.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/cap26/cap26_key_kind.rs rename to crates/crypto/hd/src/cap26/cap26_key_kind.rs diff --git a/crates/sargon-hierarchical-deterministic/src/cap26/mod.rs b/crates/crypto/hd/src/cap26/mod.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/cap26/mod.rs rename to crates/crypto/hd/src/cap26/mod.rs diff --git a/crates/sargon-hierarchical-deterministic/src/cap26/paths/account_path.rs b/crates/crypto/hd/src/cap26/paths/account_path.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/cap26/paths/account_path.rs rename to crates/crypto/hd/src/cap26/paths/account_path.rs diff --git a/crates/sargon-hierarchical-deterministic/src/cap26/paths/get_id_path.rs b/crates/crypto/hd/src/cap26/paths/get_id_path.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/cap26/paths/get_id_path.rs rename to crates/crypto/hd/src/cap26/paths/get_id_path.rs diff --git a/crates/sargon-hierarchical-deterministic/src/cap26/paths/identity_path.rs b/crates/crypto/hd/src/cap26/paths/identity_path.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/cap26/paths/identity_path.rs rename to crates/crypto/hd/src/cap26/paths/identity_path.rs diff --git a/crates/sargon-hierarchical-deterministic/src/cap26/paths/mod.rs b/crates/crypto/hd/src/cap26/paths/mod.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/cap26/paths/mod.rs rename to crates/crypto/hd/src/cap26/paths/mod.rs diff --git a/crates/sargon-hierarchical-deterministic/src/cap26/paths/traits.rs b/crates/crypto/hd/src/cap26/paths/traits.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/cap26/paths/traits.rs rename to crates/crypto/hd/src/cap26/paths/traits.rs diff --git a/crates/sargon-hierarchical-deterministic/src/cap26/paths/unvalidated_cap26_path.rs b/crates/crypto/hd/src/cap26/paths/unvalidated_cap26_path.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/cap26/paths/unvalidated_cap26_path.rs rename to crates/crypto/hd/src/cap26/paths/unvalidated_cap26_path.rs diff --git a/crates/sargon-hierarchical-deterministic/src/derivation/derivation_path.rs b/crates/crypto/hd/src/derivation/derivation_path.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/derivation/derivation_path.rs rename to crates/crypto/hd/src/derivation/derivation_path.rs diff --git a/crates/sargon-hierarchical-deterministic/src/derivation/derivation_path_scheme.rs b/crates/crypto/hd/src/derivation/derivation_path_scheme.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/derivation/derivation_path_scheme.rs rename to crates/crypto/hd/src/derivation/derivation_path_scheme.rs diff --git a/crates/sargon-hierarchical-deterministic/src/derivation/has_derivation_path_scheme.rs b/crates/crypto/hd/src/derivation/has_derivation_path_scheme.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/derivation/has_derivation_path_scheme.rs rename to crates/crypto/hd/src/derivation/has_derivation_path_scheme.rs diff --git a/crates/sargon-hierarchical-deterministic/src/derivation/hierarchical_deterministic_private_key.rs b/crates/crypto/hd/src/derivation/hierarchical_deterministic_private_key.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/derivation/hierarchical_deterministic_private_key.rs rename to crates/crypto/hd/src/derivation/hierarchical_deterministic_private_key.rs diff --git a/crates/sargon-hierarchical-deterministic/src/derivation/hierarchical_deterministic_public_key.rs b/crates/crypto/hd/src/derivation/hierarchical_deterministic_public_key.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/derivation/hierarchical_deterministic_public_key.rs rename to crates/crypto/hd/src/derivation/hierarchical_deterministic_public_key.rs diff --git a/crates/sargon-hierarchical-deterministic/src/derivation/mnemonic_with_passphrase.rs b/crates/crypto/hd/src/derivation/mnemonic_with_passphrase.rs similarity index 95% rename from crates/sargon-hierarchical-deterministic/src/derivation/mnemonic_with_passphrase.rs rename to crates/crypto/hd/src/derivation/mnemonic_with_passphrase.rs index fcc77d4d8..74fd9719c 100644 --- a/crates/sargon-hierarchical-deterministic/src/derivation/mnemonic_with_passphrase.rs +++ b/crates/crypto/hd/src/derivation/mnemonic_with_passphrase.rs @@ -30,12 +30,6 @@ impl MnemonicWithPassphrase { ) } } -impl SafeToLog for MnemonicWithPassphrase { - /// Logs the word count and FactorSourceID o - fn non_sensitive(&self) -> impl std::fmt::Debug { - self.partially_obfuscated_string() - } -} impl MnemonicWithPassphrase { pub fn with_passphrase( @@ -282,22 +276,6 @@ mod tests { ); } - #[test] - fn non_sensitive_sample() { - assert_eq!( - format!("{:?}", SUT::sample().non_sensitive()), - format!("{:?}", "24 words (device...swim) + ") - ); - } - - #[test] - fn non_sensitive_sample_other() { - assert_eq!( - format!("{:?}", SUT::sample_other().non_sensitive()), - format!("{:?}", "24 words (pledge...cactus) + ") - ); - } - #[test] fn with_passphrase() { let phrase = "equip will roof matter pink blind book anxiety banner elbow sun young"; diff --git a/crates/sargon-hierarchical-deterministic/src/derivation/mod.rs b/crates/crypto/hd/src/derivation/mod.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/derivation/mod.rs rename to crates/crypto/hd/src/derivation/mod.rs diff --git a/crates/sargon-hierarchical-deterministic/src/has_key_kind.rs b/crates/crypto/hd/src/has_key_kind.rs similarity index 100% rename from crates/sargon-hierarchical-deterministic/src/has_key_kind.rs rename to crates/crypto/hd/src/has_key_kind.rs diff --git a/crates/crypto/hd/src/lib.rs b/crates/crypto/hd/src/lib.rs new file mode 100644 index 000000000..6eabb41c7 --- /dev/null +++ b/crates/crypto/hd/src/lib.rs @@ -0,0 +1,41 @@ +#![feature(let_chains)] + +mod bip32; +mod bip39; +mod bip44; +mod cap26; +mod derivation; + +mod has_key_kind; + +pub mod prelude { + pub(crate) use bytes::prelude::*; + pub(crate) use ecc::prelude::*; + pub(crate) use hash::prelude::*; + pub(crate) use identified_vec_of::prelude::*; + pub(crate) use network::prelude::*; + pub(crate) use numeric::prelude::*; + + pub use crate::bip32::*; + pub use crate::bip39::*; + pub use crate::bip44::*; + pub use crate::cap26::*; + pub use crate::derivation::*; + pub use crate::has_key_kind::*; + + pub(crate) use enum_as_inner::EnumAsInner; + pub(crate) use serde::{Deserialize, Serialize}; + #[cfg(test)] + pub(crate) use serde_json::json; + pub(crate) use serde_with::{DeserializeFromStr, SerializeDisplay}; + pub(crate) use strum::FromRepr; + pub(crate) use zeroize::*; + + pub(crate) use radix_common::crypto::IsHash as ScryptoIsHash; + #[cfg(test)] + pub(crate) use std::collections::BTreeSet; + pub(crate) use std::collections::HashSet; + pub(crate) use std::str::FromStr; +} + +pub use prelude::*; diff --git a/crates/factors/factors/Cargo.toml b/crates/factors/factors/Cargo.toml new file mode 100644 index 000000000..c733e7211 --- /dev/null +++ b/crates/factors/factors/Cargo.toml @@ -0,0 +1,41 @@ +[package] +name = "factors" +version = "1.1.99" +edition = "2021" +build = "build.rs" + +[dependencies] +# ==== INTERNAL DEPENDENCIES ==== +identified-vec-of = { path = "../../common/identified-vec-of" } +bytes = { path = "../../common/bytes" } +hierarchical-deterministic = { path = "../../crypto/hd" } +encryption = { path = "../../crypto/encryption" } +hash = { path = "../../crypto/hash" } +ecc = { path = "../../crypto/ecc" } +numeric = { path = "../../common/numeric" } +network = { path = "../../common/network" } +time-utils = { path = "../../core/time-utils" } +short-string = { path = "../../common/short-string" } +host-info = { path = "../../common/host-info" } +core-misc = { path = "../../core/misc" } +sargon-core-utils = { path = "../../core/utils" } +core-collections = { path = "../../core/collections" } + +# ==== RADIX DEPENDENCIES ==== +radix-common = { workspace = true } +radix-engine-interface = { workspace = true } + +# ==== EXTERNAL DEPENDENCIES ==== +derive_more = { workspace = true } +enum-as-inner = { workspace = true } +enum-iterator = { workspace = true } +hkdf = { workspace = true } +iota-crypto = { workspace = true } +indexmap = { workspace = true } +k256 = { workspace = true } +once_cell = { workspace = true } +paste = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +serde_with = { workspace = true } +zeroize = { workspace = true } diff --git a/crates/sargon-factors/build.rs b/crates/factors/factors/build.rs similarity index 100% rename from crates/sargon-factors/build.rs rename to crates/factors/factors/build.rs diff --git a/crates/sargon-factors/fixtures/vector/security_questions_factor_source_sample.json b/crates/factors/factors/fixtures/vector/security_questions_factor_source_sample.json similarity index 100% rename from crates/sargon-factors/fixtures/vector/security_questions_factor_source_sample.json rename to crates/factors/factors/fixtures/vector/security_questions_factor_source_sample.json diff --git a/crates/sargon-factors/fixtures/vector/security_questions_factor_source_sample_other.json b/crates/factors/factors/fixtures/vector/security_questions_factor_source_sample_other.json similarity index 100% rename from crates/sargon-factors/fixtures/vector/security_questions_factor_source_sample_other.json rename to crates/factors/factors/fixtures/vector/security_questions_factor_source_sample_other.json diff --git a/crates/sargon-factors/src/factor_instance/badge_virtual_source.rs b/crates/factors/factors/src/factor_instance/badge_virtual_source.rs similarity index 99% rename from crates/sargon-factors/src/factor_instance/badge_virtual_source.rs rename to crates/factors/factors/src/factor_instance/badge_virtual_source.rs index 7d4ca9d20..ba227d71c 100644 --- a/crates/sargon-factors/src/factor_instance/badge_virtual_source.rs +++ b/crates/factors/factors/src/factor_instance/badge_virtual_source.rs @@ -1,3 +1,5 @@ +use serde::ser::SerializeStruct; + use crate::prelude::*; #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, Hash)] diff --git a/crates/sargon-factors/src/factor_instance/factor_instance.rs b/crates/factors/factors/src/factor_instance/factor_instance.rs similarity index 100% rename from crates/sargon-factors/src/factor_instance/factor_instance.rs rename to crates/factors/factors/src/factor_instance/factor_instance.rs diff --git a/crates/sargon-factors/src/factor_instance/factor_instance_badge.rs b/crates/factors/factors/src/factor_instance/factor_instance_badge.rs similarity index 99% rename from crates/sargon-factors/src/factor_instance/factor_instance_badge.rs rename to crates/factors/factors/src/factor_instance/factor_instance_badge.rs index 966bba2c1..1300d69f7 100644 --- a/crates/sargon-factors/src/factor_instance/factor_instance_badge.rs +++ b/crates/factors/factors/src/factor_instance/factor_instance_badge.rs @@ -1,3 +1,5 @@ +use serde::ser::SerializeStruct; + use crate::prelude::*; /// Either a "physical" badge (resource) or some source for recreation of a producer diff --git a/crates/sargon-factors/src/factor_instance/factor_instances.rs b/crates/factors/factors/src/factor_instance/factor_instances.rs similarity index 98% rename from crates/sargon-factors/src/factor_instance/factor_instances.rs rename to crates/factors/factors/src/factor_instance/factor_instances.rs index ea1c2bdb1..a7991d31f 100644 --- a/crates/sargon-factors/src/factor_instance/factor_instances.rs +++ b/crates/factors/factors/src/factor_instance/factor_instances.rs @@ -1,3 +1,6 @@ +use core_collections::prelude::{AppendableCollection, Just}; +use core_misc::HiddenConstructor; + use crate::prelude::*; /// A collection of factor instances. diff --git a/crates/sargon-factors/src/factor_instance/mod.rs b/crates/factors/factors/src/factor_instance/mod.rs similarity index 100% rename from crates/sargon-factors/src/factor_instance/mod.rs rename to crates/factors/factors/src/factor_instance/mod.rs diff --git a/crates/sargon-factors/src/factor_instance/private_hierarchical_deterministic_factor_instance.rs b/crates/factors/factors/src/factor_instance/private_hierarchical_deterministic_factor_instance.rs similarity index 100% rename from crates/sargon-factors/src/factor_instance/private_hierarchical_deterministic_factor_instance.rs rename to crates/factors/factors/src/factor_instance/private_hierarchical_deterministic_factor_instance.rs diff --git a/crates/sargon-factors/src/factor_source.rs b/crates/factors/factors/src/factor_source.rs similarity index 99% rename from crates/sargon-factors/src/factor_source.rs rename to crates/factors/factors/src/factor_source.rs index fdb2915c5..8a687fac8 100644 --- a/crates/sargon-factors/src/factor_source.rs +++ b/crates/factors/factors/src/factor_source.rs @@ -1,3 +1,5 @@ +use std::cmp::Ordering; + use crate::prelude::*; #[allow(clippy::large_enum_variant)] diff --git a/crates/sargon-factors/src/factor_source_category.rs b/crates/factors/factors/src/factor_source_category.rs similarity index 100% rename from crates/sargon-factors/src/factor_source_category.rs rename to crates/factors/factors/src/factor_source_category.rs diff --git a/crates/sargon-factors/src/factor_source_common.rs b/crates/factors/factors/src/factor_source_common.rs similarity index 99% rename from crates/sargon-factors/src/factor_source_common.rs rename to crates/factors/factors/src/factor_source_common.rs index 078a1decc..d38eb0680 100644 --- a/crates/sargon-factors/src/factor_source_common.rs +++ b/crates/factors/factors/src/factor_source_common.rs @@ -1,3 +1,5 @@ +use time_utils::now; + use crate::prelude::*; /// Flags which describe a certain state a FactorSource might be in, e.g. `Main` (BDFS). diff --git a/crates/sargon-factors/src/factor_source_crypto_parameters.rs b/crates/factors/factors/src/factor_source_crypto_parameters.rs similarity index 100% rename from crates/sargon-factors/src/factor_source_crypto_parameters.rs rename to crates/factors/factors/src/factor_source_crypto_parameters.rs diff --git a/crates/sargon-factors/src/factor_source_flag.rs b/crates/factors/factors/src/factor_source_flag.rs similarity index 100% rename from crates/sargon-factors/src/factor_source_flag.rs rename to crates/factors/factors/src/factor_source_flag.rs diff --git a/crates/sargon-factors/src/factor_source_id.rs b/crates/factors/factors/src/factor_source_id.rs similarity index 100% rename from crates/sargon-factors/src/factor_source_id.rs rename to crates/factors/factors/src/factor_source_id.rs diff --git a/crates/sargon-factors/src/factor_source_id_from_address.rs b/crates/factors/factors/src/factor_source_id_from_address.rs similarity index 98% rename from crates/sargon-factors/src/factor_source_id_from_address.rs rename to crates/factors/factors/src/factor_source_id_from_address.rs index f47e53ed6..215e2f688 100644 --- a/crates/sargon-factors/src/factor_source_id_from_address.rs +++ b/crates/factors/factors/src/factor_source_id_from_address.rs @@ -1,3 +1,5 @@ +use short_string::prelude::ShortString; + use crate::prelude::*; /// FactorSourceID from an AccountAddress, typically used by `trustedContact` FactorSource. diff --git a/crates/sargon-factors/src/factor_source_id_from_hash.rs b/crates/factors/factors/src/factor_source_id_from_hash.rs similarity index 99% rename from crates/sargon-factors/src/factor_source_id_from_hash.rs rename to crates/factors/factors/src/factor_source_id_from_hash.rs index c9bcde7c8..e1b654dd2 100644 --- a/crates/sargon-factors/src/factor_source_id_from_hash.rs +++ b/crates/factors/factors/src/factor_source_id_from_hash.rs @@ -1,3 +1,5 @@ +use hash::hash_of; + use crate::prelude::*; /// FactorSourceID from the blake2b hash of the special HD public key derived at `CAP26::GetID`, diff --git a/crates/sargon-factors/src/factor_source_kind.rs b/crates/factors/factors/src/factor_source_kind.rs similarity index 99% rename from crates/sargon-factors/src/factor_source_kind.rs rename to crates/factors/factors/src/factor_source_kind.rs index 02adb0689..d968951e4 100644 --- a/crates/sargon-factors/src/factor_source_kind.rs +++ b/crates/factors/factors/src/factor_source_kind.rs @@ -170,6 +170,8 @@ impl FromStr for FactorSourceKind { #[cfg(test)] mod tests { + use std::collections::BTreeSet; + use super::*; #[allow(clippy::upper_case_acronyms)] diff --git a/crates/sargon-factors/src/factor_sources/device_factor_source/device_factor_source.rs b/crates/factors/factors/src/factor_sources/device_factor_source/device_factor_source.rs similarity index 99% rename from crates/sargon-factors/src/factor_sources/device_factor_source/device_factor_source.rs rename to crates/factors/factors/src/factor_sources/device_factor_source/device_factor_source.rs index 7c558334a..266a9921d 100644 --- a/crates/sargon-factors/src/factor_sources/device_factor_source/device_factor_source.rs +++ b/crates/factors/factors/src/factor_sources/device_factor_source/device_factor_source.rs @@ -1,3 +1,5 @@ +use host_info::prelude::HostInfo; + use crate::prelude::*; /// A factor source representing the host device which SargonOS runs on, typically diff --git a/crates/sargon-factors/src/factor_sources/device_factor_source/device_factor_source_hint.rs b/crates/factors/factors/src/factor_sources/device_factor_source/device_factor_source_hint.rs similarity index 99% rename from crates/sargon-factors/src/factor_sources/device_factor_source/device_factor_source_hint.rs rename to crates/factors/factors/src/factor_sources/device_factor_source/device_factor_source_hint.rs index 62a095b25..4bbf93309 100644 --- a/crates/sargon-factors/src/factor_sources/device_factor_source/device_factor_source_hint.rs +++ b/crates/factors/factors/src/factor_sources/device_factor_source/device_factor_source_hint.rs @@ -1,3 +1,5 @@ +use host_info::prelude::HostInfo; + use crate::prelude::*; /// Properties describing a DeviceFactorSource to help user disambiguate between diff --git a/crates/sargon-factors/src/factor_sources/device_factor_source/mod.rs b/crates/factors/factors/src/factor_sources/device_factor_source/mod.rs similarity index 100% rename from crates/sargon-factors/src/factor_sources/device_factor_source/mod.rs rename to crates/factors/factors/src/factor_sources/device_factor_source/mod.rs diff --git a/crates/sargon-factors/src/factor_sources/factor_sources.rs b/crates/factors/factors/src/factor_sources/factor_sources.rs similarity index 100% rename from crates/sargon-factors/src/factor_sources/factor_sources.rs rename to crates/factors/factors/src/factor_sources/factor_sources.rs diff --git a/crates/sargon-factors/src/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_factor_source.rs b/crates/factors/factors/src/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_factor_source.rs similarity index 100% rename from crates/sargon-factors/src/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_factor_source.rs rename to crates/factors/factors/src/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_factor_source.rs diff --git a/crates/sargon-factors/src/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_hint.rs b/crates/factors/factors/src/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_hint.rs similarity index 100% rename from crates/sargon-factors/src/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_hint.rs rename to crates/factors/factors/src/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_hint.rs diff --git a/crates/sargon-factors/src/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_model.rs b/crates/factors/factors/src/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_model.rs similarity index 95% rename from crates/sargon-factors/src/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_model.rs rename to crates/factors/factors/src/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_model.rs index 77b06ed00..d06d0a3bd 100644 --- a/crates/sargon-factors/src/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_model.rs +++ b/crates/factors/factors/src/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_model.rs @@ -1,3 +1,5 @@ +use sargon_core_utils::prelude::{DeserializeStr, SerializeToString}; + use crate::prelude::*; /// The model of a Ledger HQ hardware wallet NanoS, e.g. @@ -52,6 +54,8 @@ impl HasSampleValues for LedgerHardwareWalletModel { #[cfg(test)] mod tests { + use std::collections::BTreeSet; + use crate::prelude::*; #[allow(clippy::upper_case_acronyms)] diff --git a/crates/sargon-factors/src/factor_sources/ledger_hardware_wallet_factor_source/mod.rs b/crates/factors/factors/src/factor_sources/ledger_hardware_wallet_factor_source/mod.rs similarity index 100% rename from crates/sargon-factors/src/factor_sources/ledger_hardware_wallet_factor_source/mod.rs rename to crates/factors/factors/src/factor_sources/ledger_hardware_wallet_factor_source/mod.rs diff --git a/crates/sargon-factors/src/factor_sources/mod.rs b/crates/factors/factors/src/factor_sources/mod.rs similarity index 100% rename from crates/sargon-factors/src/factor_sources/mod.rs rename to crates/factors/factors/src/factor_sources/mod.rs diff --git a/crates/sargon-factors/src/factor_sources/private_hierarchical_deterministic_factor_source.rs b/crates/factors/factors/src/factor_sources/private_hierarchical_deterministic_factor_source.rs similarity index 94% rename from crates/sargon-factors/src/factor_sources/private_hierarchical_deterministic_factor_source.rs rename to crates/factors/factors/src/factor_sources/private_hierarchical_deterministic_factor_source.rs index 7f7ed21b3..86dd75371 100644 --- a/crates/sargon-factors/src/factor_sources/private_hierarchical_deterministic_factor_source.rs +++ b/crates/factors/factors/src/factor_sources/private_hierarchical_deterministic_factor_source.rs @@ -1,3 +1,5 @@ +use host_info::prelude::HostInfo; + use crate::prelude::*; #[derive(Zeroize, Debug, Clone, PartialEq, Eq, Hash)] @@ -192,16 +194,6 @@ impl HasSampleValues for PrivateHierarchicalDeterministicFactorSource { } } -impl SafeToLog for PrivateHierarchicalDeterministicFactorSource { - /// Logs the word count and FactorSourceID. - fn non_sensitive(&self) -> impl std::fmt::Debug { - format!( - "{} {}", - self.factor_source.hint.mnemonic_word_count, self.factor_source.id - ) - } -} - #[cfg(test)] mod tests { use super::*; @@ -248,9 +240,4 @@ mod tests { .unwrap(); assert_eq!(sut.mnemonic_with_passphrase.mnemonic.phrase(), "zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo vote"); } - - #[test] - fn non_sensitive() { - assert_eq!(format!("{:?}", SUT::sample().non_sensitive()), "\"12 words device:f1a93d324dd0f2bff89963ab81ed6e0c2ee7e18c0827dc1d3576b2d9f26bbd0a\""); - } } diff --git a/crates/sargon-factors/src/factor_sources_of_kind.rs b/crates/factors/factors/src/factor_sources_of_kind.rs similarity index 99% rename from crates/sargon-factors/src/factor_sources_of_kind.rs rename to crates/factors/factors/src/factor_sources_of_kind.rs index 5fb9cd98a..9f5207164 100644 --- a/crates/sargon-factors/src/factor_sources_of_kind.rs +++ b/crates/factors/factors/src/factor_sources_of_kind.rs @@ -64,6 +64,8 @@ pub fn sort_group_factors( #[cfg(test)] mod tests { + use core_collections::prelude::Just; + use super::*; #[allow(clippy::upper_case_acronyms)] type SUT = FactorSourcesOfKind; diff --git a/crates/sargon-factors/src/hd_factor_instance_account_creation.rs b/crates/factors/factors/src/hd_factor_instance_account_creation.rs similarity index 100% rename from crates/sargon-factors/src/hd_factor_instance_account_creation.rs rename to crates/factors/factors/src/hd_factor_instance_account_creation.rs diff --git a/crates/sargon-factors/src/hd_factor_instance_identity_creation.rs b/crates/factors/factors/src/hd_factor_instance_identity_creation.rs similarity index 100% rename from crates/sargon-factors/src/hd_factor_instance_identity_creation.rs rename to crates/factors/factors/src/hd_factor_instance_identity_creation.rs diff --git a/crates/sargon-factors/src/hd_transaction_signing_factor_instance.rs b/crates/factors/factors/src/hd_transaction_signing_factor_instance.rs similarity index 99% rename from crates/sargon-factors/src/hd_transaction_signing_factor_instance.rs rename to crates/factors/factors/src/hd_transaction_signing_factor_instance.rs index 5745099bc..4503c4919 100644 --- a/crates/sargon-factors/src/hd_transaction_signing_factor_instance.rs +++ b/crates/factors/factors/src/hd_transaction_signing_factor_instance.rs @@ -74,6 +74,8 @@ impl From> #[cfg(test)] mod tests { + use numeric::U31; + use crate::prelude::*; #[test] diff --git a/crates/sargon-factors/src/hierarchical_deterministic_factor_instance.rs b/crates/factors/factors/src/hierarchical_deterministic_factor_instance.rs similarity index 100% rename from crates/sargon-factors/src/hierarchical_deterministic_factor_instance.rs rename to crates/factors/factors/src/hierarchical_deterministic_factor_instance.rs diff --git a/crates/sargon-factors/src/is_entity_path.rs b/crates/factors/factors/src/is_entity_path.rs similarity index 100% rename from crates/sargon-factors/src/is_entity_path.rs rename to crates/factors/factors/src/is_entity_path.rs diff --git a/crates/sargon-factors/src/is_factor_source.rs b/crates/factors/factors/src/is_factor_source.rs similarity index 100% rename from crates/sargon-factors/src/is_factor_source.rs rename to crates/factors/factors/src/is_factor_source.rs diff --git a/crates/sargon-factors/src/lib.rs b/crates/factors/factors/src/lib.rs similarity index 78% rename from crates/sargon-factors/src/lib.rs rename to crates/factors/factors/src/lib.rs index 22b38e6d2..8d31a99e8 100644 --- a/crates/sargon-factors/src/lib.rs +++ b/crates/factors/factors/src/lib.rs @@ -24,9 +24,12 @@ mod samples; pub mod prelude { + pub(crate) use bytes::prelude::*; pub(crate) use identified_vec_of::prelude::*; - pub(crate) use sargon_core::prelude::*; - pub(crate) use sargon_hierarchical_deterministic::prelude::*; + + pub(crate) use ecc::prelude::*; + pub(crate) use hierarchical_deterministic::prelude::*; + pub(crate) use network::prelude::*; pub(crate) use once_cell::sync::Lazy; @@ -57,6 +60,17 @@ pub mod prelude { types::FromPublicKey as _, }; pub(crate) use radix_engine_interface::blueprints::resource::ResourceOrNonFungible as ScryptoResourceOrNonFungible; + + pub(crate) use enum_as_inner::EnumAsInner; + pub(crate) use indexmap::{IndexMap, IndexSet}; + pub(crate) use serde::{ + de, ser::SerializeStruct, Deserialize, Deserializer, Serialize, + Serializer, + }; + #[cfg(test)] + pub(crate) use serde_json::json; + pub(crate) use std::collections::{HashMap, HashSet}; + pub(crate) use zeroize::*; } pub use prelude::*; diff --git a/crates/sargon-factors/src/mfa_factor_sources/arculus_card_factor_source/arculus_card_factor_source.rs b/crates/factors/factors/src/mfa_factor_sources/arculus_card_factor_source/arculus_card_factor_source.rs similarity index 100% rename from crates/sargon-factors/src/mfa_factor_sources/arculus_card_factor_source/arculus_card_factor_source.rs rename to crates/factors/factors/src/mfa_factor_sources/arculus_card_factor_source/arculus_card_factor_source.rs diff --git a/crates/sargon-factors/src/mfa_factor_sources/arculus_card_factor_source/arculus_card_hint.rs b/crates/factors/factors/src/mfa_factor_sources/arculus_card_factor_source/arculus_card_hint.rs similarity index 100% rename from crates/sargon-factors/src/mfa_factor_sources/arculus_card_factor_source/arculus_card_hint.rs rename to crates/factors/factors/src/mfa_factor_sources/arculus_card_factor_source/arculus_card_hint.rs diff --git a/crates/sargon-factors/src/mfa_factor_sources/arculus_card_factor_source/arculus_card_model.rs b/crates/factors/factors/src/mfa_factor_sources/arculus_card_factor_source/arculus_card_model.rs similarity index 96% rename from crates/sargon-factors/src/mfa_factor_sources/arculus_card_factor_source/arculus_card_model.rs rename to crates/factors/factors/src/mfa_factor_sources/arculus_card_factor_source/arculus_card_model.rs index 7d15e8473..365da292d 100644 --- a/crates/sargon-factors/src/mfa_factor_sources/arculus_card_factor_source/arculus_card_model.rs +++ b/crates/factors/factors/src/mfa_factor_sources/arculus_card_factor_source/arculus_card_model.rs @@ -1,3 +1,5 @@ +use sargon_core_utils::prelude::{DeserializeStr, SerializeToString}; + use crate::prelude::*; /// The model of a Arculus Card. diff --git a/crates/sargon-factors/src/mfa_factor_sources/arculus_card_factor_source/mod.rs b/crates/factors/factors/src/mfa_factor_sources/arculus_card_factor_source/mod.rs similarity index 100% rename from crates/sargon-factors/src/mfa_factor_sources/arculus_card_factor_source/mod.rs rename to crates/factors/factors/src/mfa_factor_sources/arculus_card_factor_source/mod.rs diff --git a/crates/sargon-factors/src/mfa_factor_sources/mod.rs b/crates/factors/factors/src/mfa_factor_sources/mod.rs similarity index 100% rename from crates/sargon-factors/src/mfa_factor_sources/mod.rs rename to crates/factors/factors/src/mfa_factor_sources/mod.rs diff --git a/crates/sargon-factors/src/mfa_factor_sources/off_device_mnemonic_factor_source/mod.rs b/crates/factors/factors/src/mfa_factor_sources/off_device_mnemonic_factor_source/mod.rs similarity index 100% rename from crates/sargon-factors/src/mfa_factor_sources/off_device_mnemonic_factor_source/mod.rs rename to crates/factors/factors/src/mfa_factor_sources/off_device_mnemonic_factor_source/mod.rs diff --git a/crates/sargon-factors/src/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_factor_source_hint.rs b/crates/factors/factors/src/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_factor_source_hint.rs similarity index 96% rename from crates/sargon-factors/src/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_factor_source_hint.rs rename to crates/factors/factors/src/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_factor_source_hint.rs index ed951b9eb..533c822d6 100644 --- a/crates/sargon-factors/src/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_factor_source_hint.rs +++ b/crates/factors/factors/src/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_factor_source_hint.rs @@ -1,3 +1,5 @@ +use short_string::prelude::DisplayName; + use crate::prelude::*; /// Properties describing a DeviceFactorSource to help user disambiguate between diff --git a/crates/sargon-factors/src/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_mnemonic_factor_source.rs b/crates/factors/factors/src/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_mnemonic_factor_source.rs similarity index 100% rename from crates/sargon-factors/src/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_mnemonic_factor_source.rs rename to crates/factors/factors/src/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_mnemonic_factor_source.rs diff --git a/crates/sargon-factors/src/mfa_factor_sources/password_factor_source/mod.rs b/crates/factors/factors/src/mfa_factor_sources/password_factor_source/mod.rs similarity index 100% rename from crates/sargon-factors/src/mfa_factor_sources/password_factor_source/mod.rs rename to crates/factors/factors/src/mfa_factor_sources/password_factor_source/mod.rs diff --git a/crates/sargon-factors/src/mfa_factor_sources/password_factor_source/password_factor_source.rs b/crates/factors/factors/src/mfa_factor_sources/password_factor_source/password_factor_source.rs similarity index 100% rename from crates/sargon-factors/src/mfa_factor_sources/password_factor_source/password_factor_source.rs rename to crates/factors/factors/src/mfa_factor_sources/password_factor_source/password_factor_source.rs diff --git a/crates/sargon-factors/src/mfa_factor_sources/password_factor_source/password_factor_source_hint.rs b/crates/factors/factors/src/mfa_factor_sources/password_factor_source/password_factor_source_hint.rs similarity index 100% rename from crates/sargon-factors/src/mfa_factor_sources/password_factor_source/password_factor_source_hint.rs rename to crates/factors/factors/src/mfa_factor_sources/password_factor_source/password_factor_source_hint.rs diff --git a/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/answer/mod.rs b/crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/answer/mod.rs similarity index 100% rename from crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/answer/mod.rs rename to crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/answer/mod.rs diff --git a/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/answer/security_question_and_answer.rs b/crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/answer/security_question_and_answer.rs similarity index 100% rename from crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/answer/security_question_and_answer.rs rename to crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/answer/security_question_and_answer.rs diff --git a/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/answer/security_questions_and_answers.rs b/crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/answer/security_questions_and_answers.rs similarity index 100% rename from crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/answer/security_questions_and_answers.rs rename to crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/answer/security_questions_and_answers.rs diff --git a/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/is_security_questions_kdf_scheme.rs b/crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/kdf/is_security_questions_kdf_scheme.rs similarity index 89% rename from crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/is_security_questions_kdf_scheme.rs rename to crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/kdf/is_security_questions_kdf_scheme.rs index 202b5d9e6..e2ff5d049 100644 --- a/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/is_security_questions_kdf_scheme.rs +++ b/crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/kdf/is_security_questions_kdf_scheme.rs @@ -1,3 +1,5 @@ +use encryption::EncryptionKey; + use crate::prelude::*; pub trait IsSecurityQuestionsKDFScheme { diff --git a/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/mod.rs b/crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/kdf/mod.rs similarity index 100% rename from crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/mod.rs rename to crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/kdf/mod.rs diff --git a/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/security_questions_keys_from_questions_and_answer_scheme.rs b/crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/kdf/security_questions_keys_from_questions_and_answer_scheme.rs similarity index 99% rename from crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/security_questions_keys_from_questions_and_answer_scheme.rs rename to crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/kdf/security_questions_keys_from_questions_and_answer_scheme.rs index 1e7de3f6d..fc82a2cc0 100644 --- a/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/security_questions_keys_from_questions_and_answer_scheme.rs +++ b/crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/kdf/security_questions_keys_from_questions_and_answer_scheme.rs @@ -1,3 +1,5 @@ +use encryption::EncryptionKey; + use crate::prelude::*; /// ❗️ NOT PRODUCTION READY YET ❗️ diff --git a/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/keys_by_diffie_hellman_fold.rs b/crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/keys_by_diffie_hellman_fold.rs similarity index 98% rename from crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/keys_by_diffie_hellman_fold.rs rename to crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/keys_by_diffie_hellman_fold.rs index 6203d5fb6..d0a0e71d4 100644 --- a/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/keys_by_diffie_hellman_fold.rs +++ b/crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/keys_by_diffie_hellman_fold.rs @@ -1,6 +1,7 @@ use crate::prelude::*; use crypto::keys::x25519::PublicKey as X25519PublicKey; use crypto::keys::x25519::SecretKey as X25519PrivateKey; +use encryption::EncryptionKey; /// ❗️ NOT PRODUCTION READY YET ❗️ /// A key derivation function which produces Encryption Keys from a set of diff --git a/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/mod.rs b/crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/mod.rs similarity index 100% rename from crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/mod.rs rename to crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/mod.rs diff --git a/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/keys_from_questions_and_answers_lower_trim_utf8.rs b/crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/keys_from_questions_and_answers_lower_trim_utf8.rs similarity index 100% rename from crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/keys_from_questions_and_answers_lower_trim_utf8.rs rename to crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/keys_from_questions_and_answers_lower_trim_utf8.rs diff --git a/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/mod.rs b/crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/mod.rs similarity index 100% rename from crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/mod.rs rename to crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/mod.rs diff --git a/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/security_question_and_answer_as_bytes.rs b/crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/security_question_and_answer_as_bytes.rs similarity index 100% rename from crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/security_question_and_answer_as_bytes.rs rename to crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/security_question_and_answer_as_bytes.rs diff --git a/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/security_question_answer_as_bytes.rs b/crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/security_question_answer_as_bytes.rs similarity index 100% rename from crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/security_question_answer_as_bytes.rs rename to crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/security_question_answer_as_bytes.rs diff --git a/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/mod.rs b/crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/mod.rs similarity index 100% rename from crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/mod.rs rename to crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/mod.rs diff --git a/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/mod.rs b/crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/mod.rs similarity index 100% rename from crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/mod.rs rename to crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/mod.rs diff --git a/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/question/mod.rs b/crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/question/mod.rs similarity index 100% rename from crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/question/mod.rs rename to crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/question/mod.rs diff --git a/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/question/security_question.rs b/crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/question/security_question.rs similarity index 100% rename from crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/question/security_question.rs rename to crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/question/security_question.rs diff --git a/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/question/security_question_kind.rs b/crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/question/security_question_kind.rs similarity index 100% rename from crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/question/security_question_kind.rs rename to crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/question/security_question_kind.rs diff --git a/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/question/security_questions.rs b/crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/question/security_questions.rs similarity index 100% rename from crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/question/security_questions.rs rename to crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/question/security_questions.rs diff --git a/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/security_questions_factor_source.rs b/crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/security_questions_factor_source.rs similarity index 99% rename from crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/security_questions_factor_source.rs rename to crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/security_questions_factor_source.rs index ac79cbd9d..6761e458c 100644 --- a/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/security_questions_factor_source.rs +++ b/crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/security_questions_factor_source.rs @@ -1,3 +1,5 @@ +use encryption::EncryptionScheme; + use crate::prelude::*; /// ❗️ NOT PRODUCTION READY YET ❗️ diff --git a/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/security_questions_sealed_mnemonic.rs b/crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/security_questions_sealed_mnemonic.rs similarity index 99% rename from crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/security_questions_sealed_mnemonic.rs rename to crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/security_questions_sealed_mnemonic.rs index 776bf5ade..9e4366f84 100644 --- a/crates/sargon-factors/src/mfa_factor_sources/security_questions_factor_source/security_questions_sealed_mnemonic.rs +++ b/crates/factors/factors/src/mfa_factor_sources/security_questions_factor_source/security_questions_sealed_mnemonic.rs @@ -1,3 +1,5 @@ +use encryption::{EncryptionScheme, VersionedEncryption}; + use crate::prelude::*; /// ❗️ NOT PRODUCTION READY YET ❗️ diff --git a/crates/sargon-factors/src/mfa_factor_sources/trusted_contact_factor_source/mod.rs b/crates/factors/factors/src/mfa_factor_sources/trusted_contact_factor_source/mod.rs similarity index 100% rename from crates/sargon-factors/src/mfa_factor_sources/trusted_contact_factor_source/mod.rs rename to crates/factors/factors/src/mfa_factor_sources/trusted_contact_factor_source/mod.rs diff --git a/crates/sargon-factors/src/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source.rs b/crates/factors/factors/src/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source.rs similarity index 99% rename from crates/sargon-factors/src/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source.rs rename to crates/factors/factors/src/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source.rs index 6b9dcb391..84a0ce572 100644 --- a/crates/sargon-factors/src/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source.rs +++ b/crates/factors/factors/src/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source.rs @@ -1,3 +1,5 @@ +use short_string::prelude::{DisplayName, EmailAddress}; + use crate::prelude::*; /// A factor source representing a person, company, organization or otherwise diff --git a/crates/sargon-factors/src/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source_contact.rs b/crates/factors/factors/src/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source_contact.rs similarity index 96% rename from crates/sargon-factors/src/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source_contact.rs rename to crates/factors/factors/src/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source_contact.rs index e839b8460..72d4e654c 100644 --- a/crates/sargon-factors/src/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source_contact.rs +++ b/crates/factors/factors/src/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source_contact.rs @@ -1,3 +1,5 @@ +use short_string::prelude::{DisplayName, EmailAddress}; + use crate::prelude::*; /// Hints about the trusted contact. diff --git a/crates/sargon-factors/src/samples/factor_source_id_samples.rs b/crates/factors/factors/src/samples/factor_source_id_samples.rs similarity index 100% rename from crates/sargon-factors/src/samples/factor_source_id_samples.rs rename to crates/factors/factors/src/samples/factor_source_id_samples.rs diff --git a/crates/sargon-factors/src/samples/factor_source_ids_with_samples.rs b/crates/factors/factors/src/samples/factor_source_ids_with_samples.rs similarity index 100% rename from crates/sargon-factors/src/samples/factor_source_ids_with_samples.rs rename to crates/factors/factors/src/samples/factor_source_ids_with_samples.rs diff --git a/crates/sargon-factors/src/samples/factor_source_samples.rs b/crates/factors/factors/src/samples/factor_source_samples.rs similarity index 97% rename from crates/sargon-factors/src/samples/factor_source_samples.rs rename to crates/factors/factors/src/samples/factor_source_samples.rs index c38a662ed..81d5e8476 100644 --- a/crates/sargon-factors/src/samples/factor_source_samples.rs +++ b/crates/factors/factors/src/samples/factor_source_samples.rs @@ -1,3 +1,6 @@ +use encryption::EncryptionScheme; +use short_string::prelude::DisplayName; + use crate::prelude::*; #[allow(dead_code)] diff --git a/crates/sargon-factors/src/samples/hierarchical_deterministic_factor_instance_samples.rs b/crates/factors/factors/src/samples/hierarchical_deterministic_factor_instance_samples.rs similarity index 100% rename from crates/sargon-factors/src/samples/hierarchical_deterministic_factor_instance_samples.rs rename to crates/factors/factors/src/samples/hierarchical_deterministic_factor_instance_samples.rs diff --git a/crates/sargon-factors/src/samples/mod.rs b/crates/factors/factors/src/samples/mod.rs similarity index 100% rename from crates/sargon-factors/src/samples/mod.rs rename to crates/factors/factors/src/samples/mod.rs diff --git a/crates/factors/instances-provider/Cargo.toml b/crates/factors/instances-provider/Cargo.toml new file mode 100644 index 000000000..6788227b6 --- /dev/null +++ b/crates/factors/instances-provider/Cargo.toml @@ -0,0 +1,32 @@ +[package] +name = "factor-instances-provider" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +identified-vec-of = { path = "../../common/identified-vec-of" } +assert-json = { path = "../../core/assert-json" } +sargon-core-utils = { path = "../../core/utils" } +error = { path = "../../core/error" } +factors = { path = "../../factors/factors" } +hierarchical-deterministic = { path = "../../crypto/hd" } +keys-collector = { path = "../../factors/keys-collector" } +addresses = { path = "../../crypto/addresses" } +profile = { path = "../../profile/models/profile_SPLIT_ME" } +profile-logic = { path = "../../profile/logic/logic_SPLIT_ME" } +clients = { path = "../../system/clients/clients" } +profile-supporting-types = { path = "../../profile/models/supporting-types" } +next-derivation-index-ephemeral = { path = "../../factors/next-derivation-index-ephemeral" } + +# ==== RADIX DEPENDENCIES ==== +# None + +# ==== EXTERNAL DEPENDENCIES ==== +derive_more = { workspace = true } +futures = { workspace = true } +indexmap = { workspace = true } +serde = { workspace = true } + +[dev-dependencies] +actix-rt = { workspace = true } diff --git a/crates/factors/instances-provider/src/lib.rs b/crates/factors/instances-provider/src/lib.rs new file mode 100644 index 000000000..b0d8a867f --- /dev/null +++ b/crates/factors/instances-provider/src/lib.rs @@ -0,0 +1,17 @@ +mod next_index_assigner; +mod provider; +mod types; + +pub mod prelude { + pub(crate) use addresses::*; + pub(crate) use clients::prelude::*; + pub(crate) use keys_collector::prelude::*; + pub(crate) use profile_logic::prelude::*; + + pub use crate::next_index_assigner::*; + pub use crate::provider::*; + pub use crate::types::*; + pub(crate) use indexmap::{IndexMap, IndexSet}; +} + +pub use prelude::*; diff --git a/crates/sargon-factor-instances-provider/src/next_index_assigner/mod.rs b/crates/factors/instances-provider/src/next_index_assigner/mod.rs similarity index 100% rename from crates/sargon-factor-instances-provider/src/next_index_assigner/mod.rs rename to crates/factors/instances-provider/src/next_index_assigner/mod.rs diff --git a/crates/sargon-factor-instances-provider/src/next_index_assigner/next_derivation_entity_index_assigner.rs b/crates/factors/instances-provider/src/next_index_assigner/next_derivation_entity_index_assigner.rs similarity index 100% rename from crates/sargon-factor-instances-provider/src/next_index_assigner/next_derivation_entity_index_assigner.rs rename to crates/factors/instances-provider/src/next_index_assigner/next_derivation_entity_index_assigner.rs diff --git a/crates/sargon-factor-instances-provider/src/next_index_assigner/next_derivation_entity_index_cache_analyzing_assigner.rs b/crates/factors/instances-provider/src/next_index_assigner/next_derivation_entity_index_cache_analyzing_assigner.rs similarity index 100% rename from crates/sargon-factor-instances-provider/src/next_index_assigner/next_derivation_entity_index_cache_analyzing_assigner.rs rename to crates/factors/instances-provider/src/next_index_assigner/next_derivation_entity_index_cache_analyzing_assigner.rs diff --git a/crates/sargon-factor-instances-provider/src/next_index_assigner/next_derivation_entity_index_profile_analyzing_assigner.rs b/crates/factors/instances-provider/src/next_index_assigner/next_derivation_entity_index_profile_analyzing_assigner.rs similarity index 100% rename from crates/sargon-factor-instances-provider/src/next_index_assigner/next_derivation_entity_index_profile_analyzing_assigner.rs rename to crates/factors/instances-provider/src/next_index_assigner/next_derivation_entity_index_profile_analyzing_assigner.rs diff --git a/crates/sargon-factor-instances-provider/src/provider/factor_instances_provider.rs b/crates/factors/instances-provider/src/provider/factor_instances_provider.rs similarity index 100% rename from crates/sargon-factor-instances-provider/src/provider/factor_instances_provider.rs rename to crates/factors/instances-provider/src/provider/factor_instances_provider.rs diff --git a/crates/sargon-factor-instances-provider/src/provider/instances_in_cache_consumer.rs b/crates/factors/instances-provider/src/provider/instances_in_cache_consumer.rs similarity index 100% rename from crates/sargon-factor-instances-provider/src/provider/instances_in_cache_consumer.rs rename to crates/factors/instances-provider/src/provider/instances_in_cache_consumer.rs diff --git a/crates/sargon-factor-instances-provider/src/provider/mod.rs b/crates/factors/instances-provider/src/provider/mod.rs similarity index 100% rename from crates/sargon-factor-instances-provider/src/provider/mod.rs rename to crates/factors/instances-provider/src/provider/mod.rs diff --git a/crates/sargon-factor-instances-provider/src/provider/outcome/factor_instances_provider_outcome.rs b/crates/factors/instances-provider/src/provider/outcome/factor_instances_provider_outcome.rs similarity index 100% rename from crates/sargon-factor-instances-provider/src/provider/outcome/factor_instances_provider_outcome.rs rename to crates/factors/instances-provider/src/provider/outcome/factor_instances_provider_outcome.rs diff --git a/crates/sargon-factor-instances-provider/src/provider/outcome/factor_instances_provider_outcome_for_factor.rs b/crates/factors/instances-provider/src/provider/outcome/factor_instances_provider_outcome_for_factor.rs similarity index 100% rename from crates/sargon-factor-instances-provider/src/provider/outcome/factor_instances_provider_outcome_for_factor.rs rename to crates/factors/instances-provider/src/provider/outcome/factor_instances_provider_outcome_for_factor.rs diff --git a/crates/sargon-factor-instances-provider/src/provider/outcome/internal_factor_instances_provider_outcome.rs b/crates/factors/instances-provider/src/provider/outcome/internal_factor_instances_provider_outcome.rs similarity index 100% rename from crates/sargon-factor-instances-provider/src/provider/outcome/internal_factor_instances_provider_outcome.rs rename to crates/factors/instances-provider/src/provider/outcome/internal_factor_instances_provider_outcome.rs diff --git a/crates/sargon-factor-instances-provider/src/provider/outcome/internal_factor_instances_provider_outcome_for_factor.rs b/crates/factors/instances-provider/src/provider/outcome/internal_factor_instances_provider_outcome_for_factor.rs similarity index 100% rename from crates/sargon-factor-instances-provider/src/provider/outcome/internal_factor_instances_provider_outcome_for_factor.rs rename to crates/factors/instances-provider/src/provider/outcome/internal_factor_instances_provider_outcome_for_factor.rs diff --git a/crates/sargon-factor-instances-provider/src/provider/outcome/mod.rs b/crates/factors/instances-provider/src/provider/outcome/mod.rs similarity index 100% rename from crates/sargon-factor-instances-provider/src/provider/outcome/mod.rs rename to crates/factors/instances-provider/src/provider/outcome/mod.rs diff --git a/crates/sargon-factor-instances-provider/src/provider/provider_adopters/cache_filler.rs b/crates/factors/instances-provider/src/provider/provider_adopters/cache_filler.rs similarity index 100% rename from crates/sargon-factor-instances-provider/src/provider/provider_adopters/cache_filler.rs rename to crates/factors/instances-provider/src/provider/provider_adopters/cache_filler.rs diff --git a/crates/sargon-factor-instances-provider/src/provider/provider_adopters/mod.rs b/crates/factors/instances-provider/src/provider/provider_adopters/mod.rs similarity index 100% rename from crates/sargon-factor-instances-provider/src/provider/provider_adopters/mod.rs rename to crates/factors/instances-provider/src/provider/provider_adopters/mod.rs diff --git a/crates/sargon-factor-instances-provider/src/provider/provider_adopters/securify_entity_factor_instances_provider.rs b/crates/factors/instances-provider/src/provider/provider_adopters/securify_entity_factor_instances_provider.rs similarity index 100% rename from crates/sargon-factor-instances-provider/src/provider/provider_adopters/securify_entity_factor_instances_provider.rs rename to crates/factors/instances-provider/src/provider/provider_adopters/securify_entity_factor_instances_provider.rs diff --git a/crates/sargon-factor-instances-provider/src/provider/provider_adopters/virtual_entity_creating_instance_provider.rs b/crates/factors/instances-provider/src/provider/provider_adopters/virtual_entity_creating_instance_provider.rs similarity index 99% rename from crates/sargon-factor-instances-provider/src/provider/provider_adopters/virtual_entity_creating_instance_provider.rs rename to crates/factors/instances-provider/src/provider/provider_adopters/virtual_entity_creating_instance_provider.rs index 1f8465586..892dfa751 100644 --- a/crates/sargon-factor-instances-provider/src/provider/provider_adopters/virtual_entity_creating_instance_provider.rs +++ b/crates/factors/instances-provider/src/provider/provider_adopters/virtual_entity_creating_instance_provider.rs @@ -140,6 +140,8 @@ impl VirtualEntityCreatingInstanceProvider { #[cfg(test)] mod tests { + use std::collections::HashSet; + use super::*; #[allow(clippy::upper_case_acronyms)] type SUT = VirtualEntityCreatingInstanceProvider; diff --git a/crates/sargon-factor-instances-provider/src/types/mod.rs b/crates/factors/instances-provider/src/types/mod.rs similarity index 100% rename from crates/sargon-factor-instances-provider/src/types/mod.rs rename to crates/factors/instances-provider/src/types/mod.rs diff --git a/crates/sargon-factor-instances-provider/src/types/test_derivation_interactor_from_secure_storage_client.rs b/crates/factors/instances-provider/src/types/test_derivation_interactor_from_secure_storage_client.rs similarity index 100% rename from crates/sargon-factor-instances-provider/src/types/test_derivation_interactor_from_secure_storage_client.rs rename to crates/factors/instances-provider/src/types/test_derivation_interactor_from_secure_storage_client.rs diff --git a/crates/factors/keys-collector/Cargo.toml b/crates/factors/keys-collector/Cargo.toml new file mode 100644 index 000000000..0523686d6 --- /dev/null +++ b/crates/factors/keys-collector/Cargo.toml @@ -0,0 +1,28 @@ +[package] +name = "keys-collector" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +has-sample-values = { path = "../../core/has-sample-values" } +factors = { path = "../../factors/factors" } +numeric = { path = "../../common/numeric" } +hierarchical-deterministic = { path = "../../crypto/hd" } +addresses = { path = "../../crypto/addresses" } +network = { path = "../../common/network" } +error = { path = "../../core/error" } +core-misc = { path = "../../core/misc" } # HiddenConstructor +core-collections = { path = "../../core/collections" } +factors-supporting-types = { path = "../../factors/supporting-types" } + +# === RADIX DEPENDENCIES === +# None + +# === EXTERNAL DEPENDENCIES === +actix-rt = { workspace = true } +async-trait = { workspace = true } +derive_more = { workspace = true } +itertools = { workspace = true } +indexmap = { workspace = true } +log = { workspace = true } diff --git a/crates/sargon-keys-collector/src/collector/derivation_purpose.rs b/crates/factors/keys-collector/src/collector/derivation_purpose.rs similarity index 98% rename from crates/sargon-keys-collector/src/collector/derivation_purpose.rs rename to crates/factors/keys-collector/src/collector/derivation_purpose.rs index 7f3db0c91..183c13011 100644 --- a/crates/sargon-keys-collector/src/collector/derivation_purpose.rs +++ b/crates/factors/keys-collector/src/collector/derivation_purpose.rs @@ -67,6 +67,7 @@ impl DerivationPurpose { #[cfg(test)] mod tests { use super::*; + use has_sample_values::prelude::*; #[allow(clippy::upper_case_acronyms)] type SUT = DerivationPurpose; diff --git a/crates/sargon-keys-collector/src/collector/key_derivation_outcome.rs b/crates/factors/keys-collector/src/collector/key_derivation_outcome.rs similarity index 96% rename from crates/sargon-keys-collector/src/collector/key_derivation_outcome.rs rename to crates/factors/keys-collector/src/collector/key_derivation_outcome.rs index 7598972c2..678ebd3b0 100644 --- a/crates/sargon-keys-collector/src/collector/key_derivation_outcome.rs +++ b/crates/factors/keys-collector/src/collector/key_derivation_outcome.rs @@ -1,4 +1,5 @@ use crate::prelude::*; +use core_misc::HiddenConstructor; /// A collection of all `HierarchicalDeterministicFactorInstance` /// (Public Keys) which were derived from the referenced diff --git a/crates/sargon-keys-collector/src/collector/key_ring.rs b/crates/factors/keys-collector/src/collector/key_ring.rs similarity index 100% rename from crates/sargon-keys-collector/src/collector/key_ring.rs rename to crates/factors/keys-collector/src/collector/key_ring.rs diff --git a/crates/sargon-keys-collector/src/collector/keys_collector.rs b/crates/factors/keys-collector/src/collector/keys_collector.rs similarity index 100% rename from crates/sargon-keys-collector/src/collector/keys_collector.rs rename to crates/factors/keys-collector/src/collector/keys_collector.rs diff --git a/crates/sargon-keys-collector/src/collector/keys_collector_dependencies.rs b/crates/factors/keys-collector/src/collector/keys_collector_dependencies.rs similarity index 100% rename from crates/sargon-keys-collector/src/collector/keys_collector_dependencies.rs rename to crates/factors/keys-collector/src/collector/keys_collector_dependencies.rs diff --git a/crates/sargon-keys-collector/src/collector/keys_collector_preprocessor.rs b/crates/factors/keys-collector/src/collector/keys_collector_preprocessor.rs similarity index 100% rename from crates/sargon-keys-collector/src/collector/keys_collector_preprocessor.rs rename to crates/factors/keys-collector/src/collector/keys_collector_preprocessor.rs diff --git a/crates/sargon-keys-collector/src/collector/keys_collector_state.rs b/crates/factors/keys-collector/src/collector/keys_collector_state.rs similarity index 100% rename from crates/sargon-keys-collector/src/collector/keys_collector_state.rs rename to crates/factors/keys-collector/src/collector/keys_collector_state.rs diff --git a/crates/sargon-keys-collector/src/collector/mod.rs b/crates/factors/keys-collector/src/collector/mod.rs similarity index 100% rename from crates/sargon-keys-collector/src/collector/mod.rs rename to crates/factors/keys-collector/src/collector/mod.rs diff --git a/crates/sargon-keys-collector/src/derivation_testing/mod.rs b/crates/factors/keys-collector/src/derivation_testing/mod.rs similarity index 100% rename from crates/sargon-keys-collector/src/derivation_testing/mod.rs rename to crates/factors/keys-collector/src/derivation_testing/mod.rs diff --git a/crates/sargon-keys-collector/src/derivation_testing/stateless_dummy_indices.rs b/crates/factors/keys-collector/src/derivation_testing/stateless_dummy_indices.rs similarity index 95% rename from crates/sargon-keys-collector/src/derivation_testing/stateless_dummy_indices.rs rename to crates/factors/keys-collector/src/derivation_testing/stateless_dummy_indices.rs index 8da85c3b3..e5f1d4097 100644 --- a/crates/sargon-keys-collector/src/derivation_testing/stateless_dummy_indices.rs +++ b/crates/factors/keys-collector/src/derivation_testing/stateless_dummy_indices.rs @@ -1,6 +1,8 @@ #![cfg(test)] #![allow(unused)] +use network::prelude::NetworkID; + use crate::prelude::*; use crate::DerivationPathConstructors; diff --git a/crates/sargon-keys-collector/src/derivation_testing/test_keys_collector/mod.rs b/crates/factors/keys-collector/src/derivation_testing/test_keys_collector/mod.rs similarity index 100% rename from crates/sargon-keys-collector/src/derivation_testing/test_keys_collector/mod.rs rename to crates/factors/keys-collector/src/derivation_testing/test_keys_collector/mod.rs diff --git a/crates/sargon-keys-collector/src/derivation_testing/test_keys_collector/test_derivation_interactor.rs b/crates/factors/keys-collector/src/derivation_testing/test_keys_collector/test_derivation_interactor.rs similarity index 100% rename from crates/sargon-keys-collector/src/derivation_testing/test_keys_collector/test_derivation_interactor.rs rename to crates/factors/keys-collector/src/derivation_testing/test_keys_collector/test_derivation_interactor.rs diff --git a/crates/sargon-keys-collector/src/derivation_testing/test_keys_collector/test_keys_collector.rs b/crates/factors/keys-collector/src/derivation_testing/test_keys_collector/test_keys_collector.rs similarity index 98% rename from crates/sargon-keys-collector/src/derivation_testing/test_keys_collector/test_keys_collector.rs rename to crates/factors/keys-collector/src/derivation_testing/test_keys_collector/test_keys_collector.rs index 151ac0cd5..c7ec01357 100644 --- a/crates/sargon-keys-collector/src/derivation_testing/test_keys_collector/test_keys_collector.rs +++ b/crates/factors/keys-collector/src/derivation_testing/test_keys_collector/test_keys_collector.rs @@ -1,6 +1,8 @@ #![cfg(test)] #![allow(unused)] +use network::prelude::NetworkID; + use crate::prelude::*; impl KeysCollector { diff --git a/crates/sargon-keys-collector/src/host_interaction/key_derivation_interactor.rs b/crates/factors/keys-collector/src/host_interaction/key_derivation_interactor.rs similarity index 100% rename from crates/sargon-keys-collector/src/host_interaction/key_derivation_interactor.rs rename to crates/factors/keys-collector/src/host_interaction/key_derivation_interactor.rs diff --git a/crates/sargon-keys-collector/src/host_interaction/key_derivation_request.rs b/crates/factors/keys-collector/src/host_interaction/key_derivation_request.rs similarity index 100% rename from crates/sargon-keys-collector/src/host_interaction/key_derivation_request.rs rename to crates/factors/keys-collector/src/host_interaction/key_derivation_request.rs diff --git a/crates/sargon-keys-collector/src/host_interaction/key_derivation_response.rs b/crates/factors/keys-collector/src/host_interaction/key_derivation_response.rs similarity index 100% rename from crates/sargon-keys-collector/src/host_interaction/key_derivation_response.rs rename to crates/factors/keys-collector/src/host_interaction/key_derivation_response.rs diff --git a/crates/sargon-keys-collector/src/host_interaction/mod.rs b/crates/factors/keys-collector/src/host_interaction/mod.rs similarity index 100% rename from crates/sargon-keys-collector/src/host_interaction/mod.rs rename to crates/factors/keys-collector/src/host_interaction/mod.rs diff --git a/crates/factors/keys-collector/src/lib.rs b/crates/factors/keys-collector/src/lib.rs new file mode 100644 index 000000000..3c2481a39 --- /dev/null +++ b/crates/factors/keys-collector/src/lib.rs @@ -0,0 +1,36 @@ +#![feature(async_closure)] + +mod collector; +mod host_interaction; + +#[cfg(test)] +mod tests; + +mod derivation_testing; + +#[cfg(test)] +pub(crate) use tests::*; + +pub mod prelude { + + pub(crate) use addresses::prelude::*; + pub(crate) use core_collections::prelude::Just; + pub(crate) use error::prelude::*; + pub(crate) use factors::prelude::*; + pub(crate) use factors_supporting_types::prelude::*; + pub(crate) use hierarchical_deterministic::prelude::*; + + pub use crate::collector::*; + pub use crate::derivation_testing::*; + pub use crate::host_interaction::*; + + pub(crate) use std::sync::{Arc, RwLock}; + + pub(crate) use itertools::Itertools; + pub(crate) use log::*; + + pub(crate) use indexmap::{IndexMap, IndexSet}; + pub(crate) use std::collections::{HashMap, HashSet}; +} + +pub use prelude::*; diff --git a/crates/sargon-keys-collector/src/tests/derivation_tests.rs b/crates/factors/keys-collector/src/tests/derivation_tests.rs similarity index 99% rename from crates/sargon-keys-collector/src/tests/derivation_tests.rs rename to crates/factors/keys-collector/src/tests/derivation_tests.rs index 7bc3e0d01..c5e355722 100644 --- a/crates/sargon-keys-collector/src/tests/derivation_tests.rs +++ b/crates/factors/keys-collector/src/tests/derivation_tests.rs @@ -1,3 +1,6 @@ +use network::prelude::NetworkID; +use numeric::prelude::*; + use crate::prelude::*; pub trait DerivationPathConstructors: Sized { @@ -208,8 +211,8 @@ mod basic_tests { mod key_derivation_tests { use super::*; - use sargon_hierarchical_deterministic::CAP26EntityKind::*; - use sargon_hierarchical_deterministic::CAP26KeyKind::*; + use hierarchical_deterministic::CAP26EntityKind::*; + use hierarchical_deterministic::CAP26KeyKind::*; use NetworkID::*; #[actix_rt::test] @@ -262,6 +265,7 @@ mod key_derivation_tests { assert!(outcome.all_factors().factor_instances().is_empty()) } mod multi_key { + use super::*; #[actix_rt::test] diff --git a/crates/sargon-keys-collector/src/tests/mod.rs b/crates/factors/keys-collector/src/tests/mod.rs similarity index 100% rename from crates/sargon-keys-collector/src/tests/mod.rs rename to crates/factors/keys-collector/src/tests/mod.rs diff --git a/crates/factors/next-derivation-index-ephemeral/Cargo.toml b/crates/factors/next-derivation-index-ephemeral/Cargo.toml new file mode 100644 index 000000000..44640740e --- /dev/null +++ b/crates/factors/next-derivation-index-ephemeral/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "next-derivation-index-ephemeral" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +identified-vec-of = { path = "../../common/identified-vec-of" } +assert-json = { path = "../../core/assert-json" } +error = { path = "../../core/error" } +hierarchical-deterministic = { path = "../../crypto/hd" } +has-sample-values = { path = "../../core/has-sample-values" } +factors = { path = "../../factors/factors" } +addresses = { path = "../../crypto/addresses" } +network = { path = "../../common/network" } + +# === RADIX DEPENDENCIES +#None + +# === EXTERNAL DEPENDENCIES +enum-iterator = { workspace = true } +derive_more = { workspace = true } +indexmap = { workspace = true } +serde = { workspace = true } +serde_with = { workspace = true } +serde_json = { workspace = true } diff --git a/crates/next-derivation-index-ephemeral/src/agnostic_paths/derivation_preset.rs b/crates/factors/next-derivation-index-ephemeral/src/agnostic_paths/derivation_preset.rs similarity index 100% rename from crates/next-derivation-index-ephemeral/src/agnostic_paths/derivation_preset.rs rename to crates/factors/next-derivation-index-ephemeral/src/agnostic_paths/derivation_preset.rs diff --git a/crates/next-derivation-index-ephemeral/src/agnostic_paths/index_agnostic_path.rs b/crates/factors/next-derivation-index-ephemeral/src/agnostic_paths/index_agnostic_path.rs similarity index 100% rename from crates/next-derivation-index-ephemeral/src/agnostic_paths/index_agnostic_path.rs rename to crates/factors/next-derivation-index-ephemeral/src/agnostic_paths/index_agnostic_path.rs diff --git a/crates/next-derivation-index-ephemeral/src/agnostic_paths/mod.rs b/crates/factors/next-derivation-index-ephemeral/src/agnostic_paths/mod.rs similarity index 100% rename from crates/next-derivation-index-ephemeral/src/agnostic_paths/mod.rs rename to crates/factors/next-derivation-index-ephemeral/src/agnostic_paths/mod.rs diff --git a/crates/next-derivation-index-ephemeral/src/agnostic_paths/quantified_derivation_preset.rs b/crates/factors/next-derivation-index-ephemeral/src/agnostic_paths/quantified_derivation_preset.rs similarity index 100% rename from crates/next-derivation-index-ephemeral/src/agnostic_paths/quantified_derivation_preset.rs rename to crates/factors/next-derivation-index-ephemeral/src/agnostic_paths/quantified_derivation_preset.rs diff --git a/crates/next-derivation-index-ephemeral/src/agnostic_paths/quantities.rs b/crates/factors/next-derivation-index-ephemeral/src/agnostic_paths/quantities.rs similarity index 100% rename from crates/next-derivation-index-ephemeral/src/agnostic_paths/quantities.rs rename to crates/factors/next-derivation-index-ephemeral/src/agnostic_paths/quantities.rs diff --git a/crates/factors/next-derivation-index-ephemeral/src/lib.rs b/crates/factors/next-derivation-index-ephemeral/src/lib.rs new file mode 100644 index 000000000..fb26f3631 --- /dev/null +++ b/crates/factors/next-derivation-index-ephemeral/src/lib.rs @@ -0,0 +1,28 @@ +#![feature(trivial_bounds)] +#![allow(trivial_bounds)] + +mod agnostic_paths; +mod next_derivation_entity_index_with_ephemeral_offsets; +mod next_derivation_entity_index_with_ephemeral_offsets_for_factor_source; + +pub mod prelude { + pub use crate::agnostic_paths::*; + pub use crate::next_derivation_entity_index_with_ephemeral_offsets::*; + pub use crate::next_derivation_entity_index_with_ephemeral_offsets_for_factor_source::*; + + pub(crate) use addresses::prelude::*; + pub(crate) use factors::prelude::*; + pub(crate) use has_sample_values::prelude::*; + pub(crate) use hierarchical_deterministic::prelude::*; + pub(crate) use identified_vec_of::prelude::*; + pub(crate) use network::prelude::*; + + pub(crate) use indexmap::IndexSet; + pub(crate) use std::collections::HashMap; + pub(crate) use std::str::FromStr; + pub(crate) use std::sync::RwLock; + + #[cfg(test)] + pub(crate) use serde_json::json; + pub(crate) use serde_with::{DeserializeFromStr, SerializeDisplay}; +} diff --git a/crates/next-derivation-index-ephemeral/src/next_derivation_entity_index_with_ephemeral_offsets.rs b/crates/factors/next-derivation-index-ephemeral/src/next_derivation_entity_index_with_ephemeral_offsets.rs similarity index 100% rename from crates/next-derivation-index-ephemeral/src/next_derivation_entity_index_with_ephemeral_offsets.rs rename to crates/factors/next-derivation-index-ephemeral/src/next_derivation_entity_index_with_ephemeral_offsets.rs diff --git a/crates/next-derivation-index-ephemeral/src/next_derivation_entity_index_with_ephemeral_offsets_for_factor_source.rs b/crates/factors/next-derivation-index-ephemeral/src/next_derivation_entity_index_with_ephemeral_offsets_for_factor_source.rs similarity index 100% rename from crates/next-derivation-index-ephemeral/src/next_derivation_entity_index_with_ephemeral_offsets_for_factor_source.rs rename to crates/factors/next-derivation-index-ephemeral/src/next_derivation_entity_index_with_ephemeral_offsets_for_factor_source.rs diff --git a/crates/factors/supporting-types/Cargo.toml b/crates/factors/supporting-types/Cargo.toml new file mode 100644 index 000000000..117da1b32 --- /dev/null +++ b/crates/factors/supporting-types/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "factors-supporting-types" +version = "1.1.99" +edition = "2021" + +[dependencies] +# ==== INTERNAL DEPENDENCIES ==== +identified-vec-of = { path = "../../common/identified-vec-of" } +hierarchical-deterministic = { path = "../../crypto/hd" } +factors = { path = "../../factors/factors" } +error = { path = "../../core/error" } + +# === RADIX DEPENDENCIES === +# None + +# === EXTERNAL DEPENDENCIES === +async-trait = { workspace = true } diff --git a/crates/factors/supporting-types/src/lib.rs b/crates/factors/supporting-types/src/lib.rs new file mode 100644 index 000000000..115805573 --- /dev/null +++ b/crates/factors/supporting-types/src/lib.rs @@ -0,0 +1,11 @@ +mod mnemonic_loading; + +pub mod prelude { + pub use crate::mnemonic_loading::*; + + pub(crate) use error::prelude::*; + pub(crate) use factors::prelude::*; + pub(crate) use hierarchical_deterministic::prelude::*; +} + +pub use prelude::*; diff --git a/crates/sargon-factors-supporting-types/src/mnemonic_loading.rs b/crates/factors/supporting-types/src/mnemonic_loading.rs similarity index 100% rename from crates/sargon-factors-supporting-types/src/mnemonic_loading.rs rename to crates/factors/supporting-types/src/mnemonic_loading.rs diff --git a/crates/gateway-client-and-api/Cargo.toml b/crates/gateway-client-and-api/Cargo.toml deleted file mode 100644 index 0ad1c1df0..000000000 --- a/crates/gateway-client-and-api/Cargo.toml +++ /dev/null @@ -1,25 +0,0 @@ -[package] -name = "gateway-client-and-api" -version = "1.1.99" -edition = "2021" - -[dependencies] -# === SARGON CRATES === -sargon-core-assert-json = { path = "../sargon-core-assert-json" } -sargon-core = { path = "../sargon-core" } -sargon-addresses = { path = "../sargon-addresses" } -sargon-drivers = { path = "../sargon-drivers" } -http-client = { path = "../http-client" } -gateway-models = { path = "../gateway-models" } -sargon-transaction-models = { path = "../sargon-transaction-models" } -sargon-profile-gateway = { path = "../sargon-profile-gateway" } - -# === RADIX DEPENDENCIES === -radix-common = { workspace = true } - -# === EXTERNAL DEPENDENCIES === -serde = { workspace = true } -serde_json = { workspace = true } - -[dev-dependencies] -actix-rt = { workspace = true } diff --git a/crates/gateway/client-and-api/Cargo.toml b/crates/gateway/client-and-api/Cargo.toml new file mode 100644 index 000000000..c1df55c41 --- /dev/null +++ b/crates/gateway/client-and-api/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "gateway-client-and-api" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +assert-json = { path = "../../core/assert-json" } +sargon-core-utils = { path = "../../core/utils" } +metadata = { path = "../../common/metadata" } +addresses = { path = "../../crypto/addresses" } +drivers = { path = "../../system/drivers" } +http-client = { path = "../../system/clients/http" } +gateway-models = { path = "../../gateway/models" } +transaction-models = { path = "../../transaction/models" } +profile-gateway = { path = "../../profile/models/gateway" } + +# === RADIX DEPENDENCIES === +radix-common = { workspace = true } + +# === EXTERNAL DEPENDENCIES === +serde = { workspace = true } +serde_json = { workspace = true } + +[dev-dependencies] +actix-rt = { workspace = true } diff --git a/crates/gateway-client-and-api/src/assert_network_request.rs b/crates/gateway/client-and-api/src/assert_network_request.rs similarity index 100% rename from crates/gateway-client-and-api/src/assert_network_request.rs rename to crates/gateway/client-and-api/src/assert_network_request.rs diff --git a/crates/gateway-client-and-api/src/client/gateway_client.rs b/crates/gateway/client-and-api/src/client/gateway_client.rs similarity index 99% rename from crates/gateway-client-and-api/src/client/gateway_client.rs rename to crates/gateway/client-and-api/src/client/gateway_client.rs index 5c048e3ae..2e5b2c058 100644 --- a/crates/gateway-client-and-api/src/client/gateway_client.rs +++ b/crates/gateway/client-and-api/src/client/gateway_client.rs @@ -1,4 +1,4 @@ -use sargon_profile_gateway::prelude::Gateway; +use profile_gateway::prelude::Gateway; use crate::prelude::*; diff --git a/crates/gateway-client-and-api/src/client/gateway_client_dispatch_request.rs b/crates/gateway/client-and-api/src/client/gateway_client_dispatch_request.rs similarity index 100% rename from crates/gateway-client-and-api/src/client/gateway_client_dispatch_request.rs rename to crates/gateway/client-and-api/src/client/gateway_client_dispatch_request.rs diff --git a/crates/gateway-client-and-api/src/client/mod.rs b/crates/gateway/client-and-api/src/client/mod.rs similarity index 100% rename from crates/gateway-client-and-api/src/client/mod.rs rename to crates/gateway/client-and-api/src/client/mod.rs diff --git a/crates/gateway-client-and-api/src/endpoints/mod.rs b/crates/gateway/client-and-api/src/endpoints/mod.rs similarity index 100% rename from crates/gateway-client-and-api/src/endpoints/mod.rs rename to crates/gateway/client-and-api/src/endpoints/mod.rs diff --git a/crates/gateway-client-and-api/src/endpoints/state_endpoints.rs b/crates/gateway/client-and-api/src/endpoints/state_endpoints.rs similarity index 100% rename from crates/gateway-client-and-api/src/endpoints/state_endpoints.rs rename to crates/gateway/client-and-api/src/endpoints/state_endpoints.rs diff --git a/crates/gateway-client-and-api/src/endpoints/status_endpoints.rs b/crates/gateway/client-and-api/src/endpoints/status_endpoints.rs similarity index 100% rename from crates/gateway-client-and-api/src/endpoints/status_endpoints.rs rename to crates/gateway/client-and-api/src/endpoints/status_endpoints.rs diff --git a/crates/gateway-client-and-api/src/endpoints/transaction_endpoints.rs b/crates/gateway/client-and-api/src/endpoints/transaction_endpoints.rs similarity index 100% rename from crates/gateway-client-and-api/src/endpoints/transaction_endpoints.rs rename to crates/gateway/client-and-api/src/endpoints/transaction_endpoints.rs diff --git a/crates/gateway-client-and-api/src/lib.rs b/crates/gateway/client-and-api/src/lib.rs similarity index 54% rename from crates/gateway-client-and-api/src/lib.rs rename to crates/gateway/client-and-api/src/lib.rs index dcb924c71..544be149e 100644 --- a/crates/gateway-client-and-api/src/lib.rs +++ b/crates/gateway/client-and-api/src/lib.rs @@ -7,12 +7,19 @@ pub mod prelude { pub use crate::assert_network_request::*; pub use crate::client::*; + pub use drivers::prelude::*; pub use gateway_models::prelude::*; pub use http_client::prelude::*; - pub use sargon_drivers::prelude::*; - pub use sargon_transaction_models::prelude::*; + pub use metadata::prelude::*; + pub use sargon_core_utils::prelude::*; + pub use transaction_models::prelude::*; pub use serde::{Deserialize, Serialize}; + + pub(crate) use std::sync::Arc; + + #[cfg(test)] + pub(crate) use std::collections::BTreeSet; } pub use prelude::*; diff --git a/crates/gateway-client-and-api/src/methods/mod.rs b/crates/gateway/client-and-api/src/methods/mod.rs similarity index 100% rename from crates/gateway-client-and-api/src/methods/mod.rs rename to crates/gateway/client-and-api/src/methods/mod.rs diff --git a/crates/gateway-client-and-api/src/methods/page_methods.rs b/crates/gateway/client-and-api/src/methods/page_methods.rs similarity index 99% rename from crates/gateway-client-and-api/src/methods/page_methods.rs rename to crates/gateway/client-and-api/src/methods/page_methods.rs index bdb8659da..d8f1560db 100644 --- a/crates/gateway-client-and-api/src/methods/page_methods.rs +++ b/crates/gateway/client-and-api/src/methods/page_methods.rs @@ -38,7 +38,7 @@ impl GatewayClient { #[cfg(test)] mod tests { - use sargon_profile_gateway::prelude::Gateway; + use profile_gateway::prelude::Gateway; use crate::prelude::*; diff --git a/crates/gateway-client-and-api/src/methods/state_methods.rs b/crates/gateway/client-and-api/src/methods/state_methods.rs similarity index 99% rename from crates/gateway-client-and-api/src/methods/state_methods.rs rename to crates/gateway/client-and-api/src/methods/state_methods.rs index 703814acc..2c6fddfd0 100644 --- a/crates/gateway-client-and-api/src/methods/state_methods.rs +++ b/crates/gateway/client-and-api/src/methods/state_methods.rs @@ -412,7 +412,7 @@ impl GatewayClient { #[cfg(test)] mod fetch_all_resources_tests { use crate::prelude::*; - use sargon_profile_gateway::prelude::Gateway; + use profile_gateway::prelude::Gateway; #[allow(clippy::upper_case_acronyms)] type SUT = GatewayClient; @@ -683,7 +683,7 @@ mod fetch_all_resources_tests { #[cfg(test)] mod filter_transferable_tests { use crate::prelude::*; - use sargon_profile_gateway::prelude::Gateway; + use profile_gateway::prelude::Gateway; #[allow(clippy::upper_case_acronyms)] type SUT = GatewayClient; diff --git a/crates/gateway-client-and-api/src/methods/transaction_methods.rs b/crates/gateway/client-and-api/src/methods/transaction_methods.rs similarity index 100% rename from crates/gateway-client-and-api/src/methods/transaction_methods.rs rename to crates/gateway/client-and-api/src/methods/transaction_methods.rs diff --git a/crates/gateway-models/Cargo.toml b/crates/gateway/models/Cargo.toml similarity index 55% rename from crates/gateway-models/Cargo.toml rename to crates/gateway/models/Cargo.toml index 4c5e270ef..d125bb4a0 100644 --- a/crates/gateway-models/Cargo.toml +++ b/crates/gateway/models/Cargo.toml @@ -6,10 +6,11 @@ build = "build.rs" [dependencies] # === SARGON CRATES === -sargon-core-assert-json = { path = "../sargon-core-assert-json" } -sargon-core = { path = "../sargon-core" } -sargon-addresses = { path = "../sargon-addresses" } -sargon-transaction-models = { path = "../sargon-transaction-models" } +assert-json = { path = "../../core/assert-json" } +addresses = { path = "../../crypto/addresses" } +transaction-models = { path = "../../transaction/models" } +core-misc = { path = "../../core/misc" } # decl_bool_type +metadata = { path = "../../common/metadata" } # === RADIX DEPENDENCIES === radix-engine-toolkit-common = { workspace = true } @@ -17,5 +18,6 @@ radix-transactions = { workspace = true } radix-engine-interface = { workspace = true } # === EXTERNAL DEPENDENCIES === +enum-as-inner = { workspace = true } derive_more = { workspace = true } serde = { workspace = true } diff --git a/crates/gateway-models/build.rs b/crates/gateway/models/build.rs similarity index 100% rename from crates/gateway-models/build.rs rename to crates/gateway/models/build.rs diff --git a/crates/gateway-models/fixtures/models/state/request_entity_details__single_account_no_assets.json b/crates/gateway/models/fixtures/models/state/request_entity_details__single_account_no_assets.json similarity index 100% rename from crates/gateway-models/fixtures/models/state/request_entity_details__single_account_no_assets.json rename to crates/gateway/models/fixtures/models/state/request_entity_details__single_account_no_assets.json diff --git a/crates/gateway-models/fixtures/models/state/request_entity_details__single_resource.json b/crates/gateway/models/fixtures/models/state/request_entity_details__single_resource.json similarity index 100% rename from crates/gateway-models/fixtures/models/state/request_entity_details__single_resource.json rename to crates/gateway/models/fixtures/models/state/request_entity_details__single_resource.json diff --git a/crates/gateway-models/fixtures/models/state/request_entity_details__two_accounts.json b/crates/gateway/models/fixtures/models/state/request_entity_details__two_accounts.json similarity index 100% rename from crates/gateway-models/fixtures/models/state/request_entity_details__two_accounts.json rename to crates/gateway/models/fixtures/models/state/request_entity_details__two_accounts.json diff --git a/crates/gateway-models/fixtures/models/state/response_entity_details__single_account_many_nfts_and_fungibles.json b/crates/gateway/models/fixtures/models/state/response_entity_details__single_account_many_nfts_and_fungibles.json similarity index 100% rename from crates/gateway-models/fixtures/models/state/response_entity_details__single_account_many_nfts_and_fungibles.json rename to crates/gateway/models/fixtures/models/state/response_entity_details__single_account_many_nfts_and_fungibles.json diff --git a/crates/gateway-models/fixtures/models/state/response_entity_details__single_account_no_assets.json b/crates/gateway/models/fixtures/models/state/response_entity_details__single_account_no_assets.json similarity index 100% rename from crates/gateway-models/fixtures/models/state/response_entity_details__single_account_no_assets.json rename to crates/gateway/models/fixtures/models/state/response_entity_details__single_account_no_assets.json diff --git a/crates/gateway-models/fixtures/models/state/response_entity_details__single_resource.json b/crates/gateway/models/fixtures/models/state/response_entity_details__single_resource.json similarity index 100% rename from crates/gateway-models/fixtures/models/state/response_entity_details__single_resource.json rename to crates/gateway/models/fixtures/models/state/response_entity_details__single_resource.json diff --git a/crates/gateway-models/fixtures/models/state/response_entity_details__single_resource_no_metadata.json b/crates/gateway/models/fixtures/models/state/response_entity_details__single_resource_no_metadata.json similarity index 100% rename from crates/gateway-models/fixtures/models/state/response_entity_details__single_resource_no_metadata.json rename to crates/gateway/models/fixtures/models/state/response_entity_details__single_resource_no_metadata.json diff --git a/crates/gateway-models/fixtures/models/state/response_entity_details__two_accounts.json b/crates/gateway/models/fixtures/models/state/response_entity_details__two_accounts.json similarity index 100% rename from crates/gateway-models/fixtures/models/state/response_entity_details__two_accounts.json rename to crates/gateway/models/fixtures/models/state/response_entity_details__two_accounts.json diff --git a/crates/gateway-models/fixtures/models/state/response_entity_details_details__fungible_resource.json b/crates/gateway/models/fixtures/models/state/response_entity_details_details__fungible_resource.json similarity index 100% rename from crates/gateway-models/fixtures/models/state/response_entity_details_details__fungible_resource.json rename to crates/gateway/models/fixtures/models/state/response_entity_details_details__fungible_resource.json diff --git a/crates/gateway-models/fixtures/models/state/response_entity_details_details__non_fungible_resource.json b/crates/gateway/models/fixtures/models/state/response_entity_details_details__non_fungible_resource.json similarity index 100% rename from crates/gateway-models/fixtures/models/state/response_entity_details_details__non_fungible_resource.json rename to crates/gateway/models/fixtures/models/state/response_entity_details_details__non_fungible_resource.json diff --git a/crates/gateway-models/fixtures/models/transaction/request_preview.json b/crates/gateway/models/fixtures/models/transaction/request_preview.json similarity index 100% rename from crates/gateway-models/fixtures/models/transaction/request_preview.json rename to crates/gateway/models/fixtures/models/transaction/request_preview.json diff --git a/crates/gateway-models/fixtures/models/transaction/request_status.json b/crates/gateway/models/fixtures/models/transaction/request_status.json similarity index 100% rename from crates/gateway-models/fixtures/models/transaction/request_status.json rename to crates/gateway/models/fixtures/models/transaction/request_status.json diff --git a/crates/gateway-models/fixtures/models/transaction/request_submit.json b/crates/gateway/models/fixtures/models/transaction/request_submit.json similarity index 100% rename from crates/gateway-models/fixtures/models/transaction/request_submit.json rename to crates/gateway/models/fixtures/models/transaction/request_submit.json diff --git a/crates/gateway-models/fixtures/models/transaction/response_construction.json b/crates/gateway/models/fixtures/models/transaction/response_construction.json similarity index 100% rename from crates/gateway-models/fixtures/models/transaction/response_construction.json rename to crates/gateway/models/fixtures/models/transaction/response_construction.json diff --git a/crates/gateway-models/fixtures/models/transaction/response_preview.json b/crates/gateway/models/fixtures/models/transaction/response_preview.json similarity index 100% rename from crates/gateway-models/fixtures/models/transaction/response_preview.json rename to crates/gateway/models/fixtures/models/transaction/response_preview.json diff --git a/crates/gateway-models/fixtures/models/transaction/response_status__committed_success.json b/crates/gateway/models/fixtures/models/transaction/response_status__committed_success.json similarity index 100% rename from crates/gateway-models/fixtures/models/transaction/response_status__committed_success.json rename to crates/gateway/models/fixtures/models/transaction/response_status__committed_success.json diff --git a/crates/gateway-models/fixtures/models/transaction/response_status__pending.json b/crates/gateway/models/fixtures/models/transaction/response_status__pending.json similarity index 100% rename from crates/gateway-models/fixtures/models/transaction/response_status__pending.json rename to crates/gateway/models/fixtures/models/transaction/response_status__pending.json diff --git a/crates/gateway-models/fixtures/models/transaction/response_submit.json b/crates/gateway/models/fixtures/models/transaction/response_submit.json similarity index 100% rename from crates/gateway-models/fixtures/models/transaction/response_submit.json rename to crates/gateway/models/fixtures/models/transaction/response_submit.json diff --git a/crates/gateway-models/src/lib.rs b/crates/gateway/models/src/lib.rs similarity index 92% rename from crates/gateway-models/src/lib.rs rename to crates/gateway/models/src/lib.rs index f631fa112..25a6392f4 100644 --- a/crates/gateway-models/src/lib.rs +++ b/crates/gateway/models/src/lib.rs @@ -3,9 +3,8 @@ mod types; pub mod prelude { pub use crate::types::*; - pub use sargon_addresses::prelude::*; - pub use sargon_core::prelude::*; - pub(crate) use sargon_transaction_models::prelude::*; + pub use addresses::prelude::*; + pub(crate) use transaction_models::prelude::*; pub use radix_engine_toolkit_common::receipt::SerializableToolkitTransactionReceipt as ScryptoSerializableToolkitTransactionReceipt; @@ -61,6 +60,12 @@ pub mod prelude { TransactionManifestV2Builder as ScryptoTransactionManifestV2Builder, }, }; + + pub(crate) use enum_as_inner::EnumAsInner; + pub(crate) use serde::{ + de, ser::SerializeStruct, Deserialize, Deserializer, Serialize, + Serializer, + }; } pub use prelude::*; diff --git a/crates/gateway-models/src/types/mod.rs b/crates/gateway/models/src/types/mod.rs similarity index 100% rename from crates/gateway-models/src/types/mod.rs rename to crates/gateway/models/src/types/mod.rs diff --git a/crates/gateway-models/src/types/request/gw_public_key.rs b/crates/gateway/models/src/types/request/gw_public_key.rs similarity index 100% rename from crates/gateway-models/src/types/request/gw_public_key.rs rename to crates/gateway/models/src/types/request/gw_public_key.rs diff --git a/crates/gateway-models/src/types/request/gw_public_key_serde.rs b/crates/gateway/models/src/types/request/gw_public_key_serde.rs similarity index 100% rename from crates/gateway-models/src/types/request/gw_public_key_serde.rs rename to crates/gateway/models/src/types/request/gw_public_key_serde.rs diff --git a/crates/gateway-models/src/types/request/ledger_state_selector.rs b/crates/gateway/models/src/types/request/ledger_state_selector.rs similarity index 100% rename from crates/gateway-models/src/types/request/ledger_state_selector.rs rename to crates/gateway/models/src/types/request/ledger_state_selector.rs diff --git a/crates/gateway-models/src/types/request/mod.rs b/crates/gateway/models/src/types/request/mod.rs similarity index 100% rename from crates/gateway-models/src/types/request/mod.rs rename to crates/gateway/models/src/types/request/mod.rs diff --git a/crates/gateway-models/src/types/request/state/account/mod.rs b/crates/gateway/models/src/types/request/state/account/mod.rs similarity index 100% rename from crates/gateway-models/src/types/request/state/account/mod.rs rename to crates/gateway/models/src/types/request/state/account/mod.rs diff --git a/crates/gateway-models/src/types/request/state/account/page/authorized_depositors.rs b/crates/gateway/models/src/types/request/state/account/page/authorized_depositors.rs similarity index 100% rename from crates/gateway-models/src/types/request/state/account/page/authorized_depositors.rs rename to crates/gateway/models/src/types/request/state/account/page/authorized_depositors.rs diff --git a/crates/gateway-models/src/types/request/state/account/page/mod.rs b/crates/gateway/models/src/types/request/state/account/page/mod.rs similarity index 100% rename from crates/gateway-models/src/types/request/state/account/page/mod.rs rename to crates/gateway/models/src/types/request/state/account/page/mod.rs diff --git a/crates/gateway-models/src/types/request/state/account/page/resource_preferences.rs b/crates/gateway/models/src/types/request/state/account/page/resource_preferences.rs similarity index 100% rename from crates/gateway-models/src/types/request/state/account/page/resource_preferences.rs rename to crates/gateway/models/src/types/request/state/account/page/resource_preferences.rs diff --git a/crates/gateway-models/src/types/request/state/entity/details/mod.rs b/crates/gateway/models/src/types/request/state/entity/details/mod.rs similarity index 100% rename from crates/gateway-models/src/types/request/state/entity/details/mod.rs rename to crates/gateway/models/src/types/request/state/entity/details/mod.rs diff --git a/crates/gateway-models/src/types/request/state/entity/details/opt_ins.rs b/crates/gateway/models/src/types/request/state/entity/details/opt_ins.rs similarity index 93% rename from crates/gateway-models/src/types/request/state/entity/details/opt_ins.rs rename to crates/gateway/models/src/types/request/state/entity/details/opt_ins.rs index a2cc93fe4..f2358e419 100644 --- a/crates/gateway-models/src/types/request/state/entity/details/opt_ins.rs +++ b/crates/gateway/models/src/types/request/state/entity/details/opt_ins.rs @@ -1,3 +1,5 @@ +use metadata::prelude::MetadataKey; + use crate::prelude::*; #[derive( diff --git a/crates/gateway-models/src/types/request/state/entity/details/request.rs b/crates/gateway/models/src/types/request/state/entity/details/request.rs similarity index 98% rename from crates/gateway-models/src/types/request/state/entity/details/request.rs rename to crates/gateway/models/src/types/request/state/entity/details/request.rs index 94b6ff46b..fb6221baa 100644 --- a/crates/gateway-models/src/types/request/state/entity/details/request.rs +++ b/crates/gateway/models/src/types/request/state/entity/details/request.rs @@ -1,3 +1,5 @@ +use metadata::prelude::MetadataKey; + use crate::prelude::*; #[derive( diff --git a/crates/gateway-models/src/types/request/state/entity/mod.rs b/crates/gateway/models/src/types/request/state/entity/mod.rs similarity index 100% rename from crates/gateway-models/src/types/request/state/entity/mod.rs rename to crates/gateway/models/src/types/request/state/entity/mod.rs diff --git a/crates/gateway-models/src/types/request/state/entity/page/fungibles.rs b/crates/gateway/models/src/types/request/state/entity/page/fungibles.rs similarity index 100% rename from crates/gateway-models/src/types/request/state/entity/page/fungibles.rs rename to crates/gateway/models/src/types/request/state/entity/page/fungibles.rs diff --git a/crates/gateway-models/src/types/request/state/entity/page/mod.rs b/crates/gateway/models/src/types/request/state/entity/page/mod.rs similarity index 100% rename from crates/gateway-models/src/types/request/state/entity/page/mod.rs rename to crates/gateway/models/src/types/request/state/entity/page/mod.rs diff --git a/crates/gateway-models/src/types/request/state/entity/page/non_fungible_vault_ids.rs b/crates/gateway/models/src/types/request/state/entity/page/non_fungible_vault_ids.rs similarity index 100% rename from crates/gateway-models/src/types/request/state/entity/page/non_fungible_vault_ids.rs rename to crates/gateway/models/src/types/request/state/entity/page/non_fungible_vault_ids.rs diff --git a/crates/gateway-models/src/types/request/state/entity/page/non_fungible_vaults.rs b/crates/gateway/models/src/types/request/state/entity/page/non_fungible_vaults.rs similarity index 100% rename from crates/gateway-models/src/types/request/state/entity/page/non_fungible_vaults.rs rename to crates/gateway/models/src/types/request/state/entity/page/non_fungible_vaults.rs diff --git a/crates/gateway-models/src/types/request/state/entity/page/non_fungibles.rs b/crates/gateway/models/src/types/request/state/entity/page/non_fungibles.rs similarity index 100% rename from crates/gateway-models/src/types/request/state/entity/page/non_fungibles.rs rename to crates/gateway/models/src/types/request/state/entity/page/non_fungibles.rs diff --git a/crates/gateway-models/src/types/request/state/mod.rs b/crates/gateway/models/src/types/request/state/mod.rs similarity index 100% rename from crates/gateway-models/src/types/request/state/mod.rs rename to crates/gateway/models/src/types/request/state/mod.rs diff --git a/crates/gateway-models/src/types/request/state/non_fungible/location.rs b/crates/gateway/models/src/types/request/state/non_fungible/location.rs similarity index 100% rename from crates/gateway-models/src/types/request/state/non_fungible/location.rs rename to crates/gateway/models/src/types/request/state/non_fungible/location.rs diff --git a/crates/gateway-models/src/types/request/state/non_fungible/mod.rs b/crates/gateway/models/src/types/request/state/non_fungible/mod.rs similarity index 100% rename from crates/gateway-models/src/types/request/state/non_fungible/mod.rs rename to crates/gateway/models/src/types/request/state/non_fungible/mod.rs diff --git a/crates/gateway-models/src/types/request/transaction/mod.rs b/crates/gateway/models/src/types/request/transaction/mod.rs similarity index 100% rename from crates/gateway-models/src/types/request/transaction/mod.rs rename to crates/gateway/models/src/types/request/transaction/mod.rs diff --git a/crates/gateway-models/src/types/request/transaction/preview/mod.rs b/crates/gateway/models/src/types/request/transaction/preview/mod.rs similarity index 100% rename from crates/gateway-models/src/types/request/transaction/preview/mod.rs rename to crates/gateway/models/src/types/request/transaction/preview/mod.rs diff --git a/crates/gateway-models/src/types/request/transaction/preview/opt_ins.rs b/crates/gateway/models/src/types/request/transaction/preview/opt_ins.rs similarity index 100% rename from crates/gateway-models/src/types/request/transaction/preview/opt_ins.rs rename to crates/gateway/models/src/types/request/transaction/preview/opt_ins.rs diff --git a/crates/gateway-models/src/types/request/transaction/preview/opt_ins_v2.rs b/crates/gateway/models/src/types/request/transaction/preview/opt_ins_v2.rs similarity index 100% rename from crates/gateway-models/src/types/request/transaction/preview/opt_ins_v2.rs rename to crates/gateway/models/src/types/request/transaction/preview/opt_ins_v2.rs diff --git a/crates/gateway-models/src/types/request/transaction/preview/request_flags.rs b/crates/gateway/models/src/types/request/transaction/preview/request_flags.rs similarity index 98% rename from crates/gateway-models/src/types/request/transaction/preview/request_flags.rs rename to crates/gateway/models/src/types/request/transaction/preview/request_flags.rs index 5bc69fc03..df8590149 100644 --- a/crates/gateway-models/src/types/request/transaction/preview/request_flags.rs +++ b/crates/gateway/models/src/types/request/transaction/preview/request_flags.rs @@ -1,4 +1,4 @@ -use sargon_core::decl_bool_type; +use core_misc::decl_bool_type; use crate::prelude::*; diff --git a/crates/gateway-models/src/types/request/transaction/preview/transaction_preview.rs b/crates/gateway/models/src/types/request/transaction/preview/transaction_preview.rs similarity index 100% rename from crates/gateway-models/src/types/request/transaction/preview/transaction_preview.rs rename to crates/gateway/models/src/types/request/transaction/preview/transaction_preview.rs diff --git a/crates/gateway-models/src/types/request/transaction/preview/transaction_preview_v2.rs b/crates/gateway/models/src/types/request/transaction/preview/transaction_preview_v2.rs similarity index 100% rename from crates/gateway-models/src/types/request/transaction/preview/transaction_preview_v2.rs rename to crates/gateway/models/src/types/request/transaction/preview/transaction_preview_v2.rs diff --git a/crates/gateway-models/src/types/request/transaction/status/mod.rs b/crates/gateway/models/src/types/request/transaction/status/mod.rs similarity index 100% rename from crates/gateway-models/src/types/request/transaction/status/mod.rs rename to crates/gateway/models/src/types/request/transaction/status/mod.rs diff --git a/crates/gateway-models/src/types/request/transaction/status/subintent_status.rs b/crates/gateway/models/src/types/request/transaction/status/subintent_status.rs similarity index 100% rename from crates/gateway-models/src/types/request/transaction/status/subintent_status.rs rename to crates/gateway/models/src/types/request/transaction/status/subintent_status.rs diff --git a/crates/gateway-models/src/types/request/transaction/status/transaction_status.rs b/crates/gateway/models/src/types/request/transaction/status/transaction_status.rs similarity index 100% rename from crates/gateway-models/src/types/request/transaction/status/transaction_status.rs rename to crates/gateway/models/src/types/request/transaction/status/transaction_status.rs diff --git a/crates/gateway-models/src/types/request/transaction/submit/mod.rs b/crates/gateway/models/src/types/request/transaction/submit/mod.rs similarity index 100% rename from crates/gateway-models/src/types/request/transaction/submit/mod.rs rename to crates/gateway/models/src/types/request/transaction/submit/mod.rs diff --git a/crates/gateway-models/src/types/request/transaction/submit/transaction_submit.rs b/crates/gateway/models/src/types/request/transaction/submit/transaction_submit.rs similarity index 100% rename from crates/gateway-models/src/types/request/transaction/submit/transaction_submit.rs rename to crates/gateway/models/src/types/request/transaction/submit/transaction_submit.rs diff --git a/crates/gateway-models/src/types/response/ledger_state.rs b/crates/gateway/models/src/types/response/ledger_state.rs similarity index 100% rename from crates/gateway-models/src/types/response/ledger_state.rs rename to crates/gateway/models/src/types/response/ledger_state.rs diff --git a/crates/gateway-models/src/types/response/mod.rs b/crates/gateway/models/src/types/response/mod.rs similarity index 100% rename from crates/gateway-models/src/types/response/mod.rs rename to crates/gateway/models/src/types/response/mod.rs diff --git a/crates/gateway-models/src/types/response/page_response.rs b/crates/gateway/models/src/types/response/page_response.rs similarity index 100% rename from crates/gateway-models/src/types/response/page_response.rs rename to crates/gateway/models/src/types/response/page_response.rs diff --git a/crates/gateway-models/src/types/response/state/account/mod.rs b/crates/gateway/models/src/types/response/state/account/mod.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/account/mod.rs rename to crates/gateway/models/src/types/response/state/account/mod.rs diff --git a/crates/gateway-models/src/types/response/state/account/page/authorized_depositor.rs b/crates/gateway/models/src/types/response/state/account/page/authorized_depositor.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/account/page/authorized_depositor.rs rename to crates/gateway/models/src/types/response/state/account/page/authorized_depositor.rs diff --git a/crates/gateway-models/src/types/response/state/account/page/mod.rs b/crates/gateway/models/src/types/response/state/account/page/mod.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/account/page/mod.rs rename to crates/gateway/models/src/types/response/state/account/page/mod.rs diff --git a/crates/gateway-models/src/types/response/state/account/page/resource_preference.rs b/crates/gateway/models/src/types/response/state/account/page/resource_preference.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/account/page/resource_preference.rs rename to crates/gateway/models/src/types/response/state/account/page/resource_preference.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/details/item.rs b/crates/gateway/models/src/types/response/state/entity/details/details/item.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/details/details/item.rs rename to crates/gateway/models/src/types/response/state/entity/details/details/item.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/details/item_component.rs b/crates/gateway/models/src/types/response/state/entity/details/details/item_component.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/details/details/item_component.rs rename to crates/gateway/models/src/types/response/state/entity/details/details/item_component.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/details/item_fungible_resource.rs b/crates/gateway/models/src/types/response/state/entity/details/details/item_fungible_resource.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/details/details/item_fungible_resource.rs rename to crates/gateway/models/src/types/response/state/entity/details/details/item_fungible_resource.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/details/item_non_fungible_resource.rs b/crates/gateway/models/src/types/response/state/entity/details/details/item_non_fungible_resource.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/details/details/item_non_fungible_resource.rs rename to crates/gateway/models/src/types/response/state/entity/details/details/item_non_fungible_resource.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/details/item_package.rs b/crates/gateway/models/src/types/response/state/entity/details/details/item_package.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/details/details/item_package.rs rename to crates/gateway/models/src/types/response/state/entity/details/details/item_package.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/details/mod.rs b/crates/gateway/models/src/types/response/state/entity/details/details/mod.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/details/details/mod.rs rename to crates/gateway/models/src/types/response/state/entity/details/details/mod.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/assignment.rs b/crates/gateway/models/src/types/response/state/entity/details/details/role_assignments/assignment.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/assignment.rs rename to crates/gateway/models/src/types/response/state/entity/details/details/role_assignments/assignment.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/collection.rs b/crates/gateway/models/src/types/response/state/entity/details/details/role_assignments/collection.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/collection.rs rename to crates/gateway/models/src/types/response/state/entity/details/details/role_assignments/collection.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/entry.rs b/crates/gateway/models/src/types/response/state/entity/details/details/role_assignments/entry.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/entry.rs rename to crates/gateway/models/src/types/response/state/entity/details/details/role_assignments/entry.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/explicit_rule.rs b/crates/gateway/models/src/types/response/state/entity/details/details/role_assignments/explicit_rule.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/explicit_rule.rs rename to crates/gateway/models/src/types/response/state/entity/details/details/role_assignments/explicit_rule.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/mod.rs b/crates/gateway/models/src/types/response/state/entity/details/details/role_assignments/mod.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/mod.rs rename to crates/gateway/models/src/types/response/state/entity/details/details/role_assignments/mod.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/module.rs b/crates/gateway/models/src/types/response/state/entity/details/details/role_assignments/module.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/module.rs rename to crates/gateway/models/src/types/response/state/entity/details/details/role_assignments/module.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/owner.rs b/crates/gateway/models/src/types/response/state/entity/details/details/role_assignments/owner.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/owner.rs rename to crates/gateway/models/src/types/response/state/entity/details/details/role_assignments/owner.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/resolution.rs b/crates/gateway/models/src/types/response/state/entity/details/details/role_assignments/resolution.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/resolution.rs rename to crates/gateway/models/src/types/response/state/entity/details/details/role_assignments/resolution.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/role_key.rs b/crates/gateway/models/src/types/response/state/entity/details/details/role_assignments/role_key.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/details/details/role_assignments/role_key.rs rename to crates/gateway/models/src/types/response/state/entity/details/details/role_assignments/role_key.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/fungible/collection.rs b/crates/gateway/models/src/types/response/state/entity/details/fungible/collection.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/details/fungible/collection.rs rename to crates/gateway/models/src/types/response/state/entity/details/fungible/collection.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/fungible/collection_item.rs b/crates/gateway/models/src/types/response/state/entity/details/fungible/collection_item.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/details/fungible/collection_item.rs rename to crates/gateway/models/src/types/response/state/entity/details/fungible/collection_item.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/fungible/collection_item_global.rs b/crates/gateway/models/src/types/response/state/entity/details/fungible/collection_item_global.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/details/fungible/collection_item_global.rs rename to crates/gateway/models/src/types/response/state/entity/details/fungible/collection_item_global.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/fungible/mod.rs b/crates/gateway/models/src/types/response/state/entity/details/fungible/mod.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/details/fungible/mod.rs rename to crates/gateway/models/src/types/response/state/entity/details/fungible/mod.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/metadata/collection.rs b/crates/gateway/models/src/types/response/state/entity/details/metadata/collection.rs similarity index 96% rename from crates/gateway-models/src/types/response/state/entity/details/metadata/collection.rs rename to crates/gateway/models/src/types/response/state/entity/details/metadata/collection.rs index bb1d00568..888f39cb0 100644 --- a/crates/gateway-models/src/types/response/state/entity/details/metadata/collection.rs +++ b/crates/gateway/models/src/types/response/state/entity/details/metadata/collection.rs @@ -1,3 +1,5 @@ +use metadata::prelude::MetadataKey; + use crate::prelude::*; #[derive(Deserialize, Serialize, Clone, PartialEq, Eq, Debug)] diff --git a/crates/gateway-models/src/types/response/state/entity/details/metadata/item.rs b/crates/gateway/models/src/types/response/state/entity/details/metadata/item.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/details/metadata/item.rs rename to crates/gateway/models/src/types/response/state/entity/details/metadata/item.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/metadata/item_value.rs b/crates/gateway/models/src/types/response/state/entity/details/metadata/item_value.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/details/metadata/item_value.rs rename to crates/gateway/models/src/types/response/state/entity/details/metadata/item_value.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/metadata/mod.rs b/crates/gateway/models/src/types/response/state/entity/details/metadata/mod.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/details/metadata/mod.rs rename to crates/gateway/models/src/types/response/state/entity/details/metadata/mod.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/metadata/typed_value.rs b/crates/gateway/models/src/types/response/state/entity/details/metadata/typed_value.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/details/metadata/typed_value.rs rename to crates/gateway/models/src/types/response/state/entity/details/metadata/typed_value.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/mod.rs b/crates/gateway/models/src/types/response/state/entity/details/mod.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/details/mod.rs rename to crates/gateway/models/src/types/response/state/entity/details/mod.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/non_fungible/collection.rs b/crates/gateway/models/src/types/response/state/entity/details/non_fungible/collection.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/details/non_fungible/collection.rs rename to crates/gateway/models/src/types/response/state/entity/details/non_fungible/collection.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/non_fungible/collection_item.rs b/crates/gateway/models/src/types/response/state/entity/details/non_fungible/collection_item.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/details/non_fungible/collection_item.rs rename to crates/gateway/models/src/types/response/state/entity/details/non_fungible/collection_item.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/non_fungible/collection_item_global.rs b/crates/gateway/models/src/types/response/state/entity/details/non_fungible/collection_item_global.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/details/non_fungible/collection_item_global.rs rename to crates/gateway/models/src/types/response/state/entity/details/non_fungible/collection_item_global.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/non_fungible/mod.rs b/crates/gateway/models/src/types/response/state/entity/details/non_fungible/mod.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/details/non_fungible/mod.rs rename to crates/gateway/models/src/types/response/state/entity/details/non_fungible/mod.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/response.rs b/crates/gateway/models/src/types/response/state/entity/details/response.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/details/response.rs rename to crates/gateway/models/src/types/response/state/entity/details/response.rs diff --git a/crates/gateway-models/src/types/response/state/entity/details/response_item.rs b/crates/gateway/models/src/types/response/state/entity/details/response_item.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/details/response_item.rs rename to crates/gateway/models/src/types/response/state/entity/details/response_item.rs diff --git a/crates/gateway-models/src/types/response/state/entity/mod.rs b/crates/gateway/models/src/types/response/state/entity/mod.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/mod.rs rename to crates/gateway/models/src/types/response/state/entity/mod.rs diff --git a/crates/gateway-models/src/types/response/state/entity/page/mod.rs b/crates/gateway/models/src/types/response/state/entity/page/mod.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/page/mod.rs rename to crates/gateway/models/src/types/response/state/entity/page/mod.rs diff --git a/crates/gateway-models/src/types/response/state/entity/page/non_fungible_vault_item.rs b/crates/gateway/models/src/types/response/state/entity/page/non_fungible_vault_item.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/entity/page/non_fungible_vault_item.rs rename to crates/gateway/models/src/types/response/state/entity/page/non_fungible_vault_item.rs diff --git a/crates/gateway-models/src/types/response/state/mod.rs b/crates/gateway/models/src/types/response/state/mod.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/mod.rs rename to crates/gateway/models/src/types/response/state/mod.rs diff --git a/crates/gateway-models/src/types/response/state/non_fungible/location.rs b/crates/gateway/models/src/types/response/state/non_fungible/location.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/non_fungible/location.rs rename to crates/gateway/models/src/types/response/state/non_fungible/location.rs diff --git a/crates/gateway-models/src/types/response/state/non_fungible/mod.rs b/crates/gateway/models/src/types/response/state/non_fungible/mod.rs similarity index 100% rename from crates/gateway-models/src/types/response/state/non_fungible/mod.rs rename to crates/gateway/models/src/types/response/state/non_fungible/mod.rs diff --git a/crates/gateway-models/src/types/response/status/gateway_status.rs b/crates/gateway/models/src/types/response/status/gateway_status.rs similarity index 100% rename from crates/gateway-models/src/types/response/status/gateway_status.rs rename to crates/gateway/models/src/types/response/status/gateway_status.rs diff --git a/crates/gateway-models/src/types/response/status/mod.rs b/crates/gateway/models/src/types/response/status/mod.rs similarity index 100% rename from crates/gateway-models/src/types/response/status/mod.rs rename to crates/gateway/models/src/types/response/status/mod.rs diff --git a/crates/gateway-models/src/types/response/transaction/construction/mod.rs b/crates/gateway/models/src/types/response/transaction/construction/mod.rs similarity index 100% rename from crates/gateway-models/src/types/response/transaction/construction/mod.rs rename to crates/gateway/models/src/types/response/transaction/construction/mod.rs diff --git a/crates/gateway-models/src/types/response/transaction/construction/transaction_construction_response.rs b/crates/gateway/models/src/types/response/transaction/construction/transaction_construction_response.rs similarity index 100% rename from crates/gateway-models/src/types/response/transaction/construction/transaction_construction_response.rs rename to crates/gateway/models/src/types/response/transaction/construction/transaction_construction_response.rs diff --git a/crates/gateway-models/src/types/response/transaction/mod.rs b/crates/gateway/models/src/types/response/transaction/mod.rs similarity index 100% rename from crates/gateway-models/src/types/response/transaction/mod.rs rename to crates/gateway/models/src/types/response/transaction/mod.rs diff --git a/crates/gateway-models/src/types/response/transaction/preview/logs_inner.rs b/crates/gateway/models/src/types/response/transaction/preview/logs_inner.rs similarity index 100% rename from crates/gateway-models/src/types/response/transaction/preview/logs_inner.rs rename to crates/gateway/models/src/types/response/transaction/preview/logs_inner.rs diff --git a/crates/gateway-models/src/types/response/transaction/preview/mod.rs b/crates/gateway/models/src/types/response/transaction/preview/mod.rs similarity index 100% rename from crates/gateway-models/src/types/response/transaction/preview/mod.rs rename to crates/gateway/models/src/types/response/transaction/preview/mod.rs diff --git a/crates/gateway-models/src/types/response/transaction/preview/transaction_preview_response.rs b/crates/gateway/models/src/types/response/transaction/preview/transaction_preview_response.rs similarity index 100% rename from crates/gateway-models/src/types/response/transaction/preview/transaction_preview_response.rs rename to crates/gateway/models/src/types/response/transaction/preview/transaction_preview_response.rs diff --git a/crates/gateway-models/src/types/response/transaction/preview/transaction_preview_response_v2.rs b/crates/gateway/models/src/types/response/transaction/preview/transaction_preview_response_v2.rs similarity index 100% rename from crates/gateway-models/src/types/response/transaction/preview/transaction_preview_response_v2.rs rename to crates/gateway/models/src/types/response/transaction/preview/transaction_preview_response_v2.rs diff --git a/crates/gateway-models/src/types/response/transaction/preview/transaction_receipt.rs b/crates/gateway/models/src/types/response/transaction/preview/transaction_receipt.rs similarity index 100% rename from crates/gateway-models/src/types/response/transaction/preview/transaction_receipt.rs rename to crates/gateway/models/src/types/response/transaction/preview/transaction_receipt.rs diff --git a/crates/gateway-models/src/types/response/transaction/preview/transaction_receipt_status.rs b/crates/gateway/models/src/types/response/transaction/preview/transaction_receipt_status.rs similarity index 100% rename from crates/gateway-models/src/types/response/transaction/preview/transaction_receipt_status.rs rename to crates/gateway/models/src/types/response/transaction/preview/transaction_receipt_status.rs diff --git a/crates/gateway-models/src/types/response/transaction/status/mod.rs b/crates/gateway/models/src/types/response/transaction/status/mod.rs similarity index 100% rename from crates/gateway-models/src/types/response/transaction/status/mod.rs rename to crates/gateway/models/src/types/response/transaction/status/mod.rs diff --git a/crates/gateway-models/src/types/response/transaction/status/payload_item.rs b/crates/gateway/models/src/types/response/transaction/status/payload_item.rs similarity index 100% rename from crates/gateway-models/src/types/response/transaction/status/payload_item.rs rename to crates/gateway/models/src/types/response/transaction/status/payload_item.rs diff --git a/crates/gateway-models/src/types/response/transaction/status/payload_status.rs b/crates/gateway/models/src/types/response/transaction/status/payload_status.rs similarity index 100% rename from crates/gateway-models/src/types/response/transaction/status/payload_status.rs rename to crates/gateway/models/src/types/response/transaction/status/payload_status.rs diff --git a/crates/gateway-models/src/types/response/transaction/status/transaction_status.rs b/crates/gateway/models/src/types/response/transaction/status/transaction_status.rs similarity index 100% rename from crates/gateway-models/src/types/response/transaction/status/transaction_status.rs rename to crates/gateway/models/src/types/response/transaction/status/transaction_status.rs diff --git a/crates/gateway-models/src/types/response/transaction/subintent_status/mod.rs b/crates/gateway/models/src/types/response/transaction/subintent_status/mod.rs similarity index 100% rename from crates/gateway-models/src/types/response/transaction/subintent_status/mod.rs rename to crates/gateway/models/src/types/response/transaction/subintent_status/mod.rs diff --git a/crates/gateway-models/src/types/response/transaction/subintent_status/response.rs b/crates/gateway/models/src/types/response/transaction/subintent_status/response.rs similarity index 100% rename from crates/gateway-models/src/types/response/transaction/subintent_status/response.rs rename to crates/gateway/models/src/types/response/transaction/subintent_status/response.rs diff --git a/crates/gateway-models/src/types/response/transaction/subintent_status/status.rs b/crates/gateway/models/src/types/response/transaction/subintent_status/status.rs similarity index 100% rename from crates/gateway-models/src/types/response/transaction/subintent_status/status.rs rename to crates/gateway/models/src/types/response/transaction/subintent_status/status.rs diff --git a/crates/gateway-models/src/types/response/transaction/submit/mod.rs b/crates/gateway/models/src/types/response/transaction/submit/mod.rs similarity index 100% rename from crates/gateway-models/src/types/response/transaction/submit/mod.rs rename to crates/gateway/models/src/types/response/transaction/submit/mod.rs diff --git a/crates/gateway-models/src/types/response/transaction/submit/submit.rs b/crates/gateway/models/src/types/response/transaction/submit/submit.rs similarity index 100% rename from crates/gateway-models/src/types/response/transaction/submit/submit.rs rename to crates/gateway/models/src/types/response/transaction/submit/submit.rs diff --git a/crates/gateway-models/src/types/support/fetch_resources_output.rs b/crates/gateway/models/src/types/support/fetch_resources_output.rs similarity index 100% rename from crates/gateway-models/src/types/support/fetch_resources_output.rs rename to crates/gateway/models/src/types/support/fetch_resources_output.rs diff --git a/crates/gateway-models/src/types/support/fetch_transferable_resources_output.rs b/crates/gateway/models/src/types/support/fetch_transferable_resources_output.rs similarity index 100% rename from crates/gateway-models/src/types/support/fetch_transferable_resources_output.rs rename to crates/gateway/models/src/types/support/fetch_transferable_resources_output.rs diff --git a/crates/gateway-models/src/types/support/mod.rs b/crates/gateway/models/src/types/support/mod.rs similarity index 100% rename from crates/gateway-models/src/types/support/mod.rs rename to crates/gateway/models/src/types/support/mod.rs diff --git a/crates/http-client/src/lib.rs b/crates/http-client/src/lib.rs deleted file mode 100644 index 6a7121c21..000000000 --- a/crates/http-client/src/lib.rs +++ /dev/null @@ -1,10 +0,0 @@ -mod http_client; - -pub mod prelude { - pub use crate::http_client::*; - - pub(crate) use sargon_core::prelude::*; - pub(crate) use sargon_drivers::prelude::*; -} - -pub use prelude::*; diff --git a/crates/next-derivation-index-ephemeral/Cargo.toml b/crates/next-derivation-index-ephemeral/Cargo.toml deleted file mode 100644 index 211c5bd30..000000000 --- a/crates/next-derivation-index-ephemeral/Cargo.toml +++ /dev/null @@ -1,22 +0,0 @@ -[package] -name = "next-derivation-index-ephemeral" -version = "1.1.99" -edition = "2021" - -[dependencies] -# === SARGON CRATES === -sargon-core-assert-json = { path = "../sargon-core-assert-json" } -sargon-core-error = { path = "../sargon-core-error" } -sargon-core = { path = "../sargon-core" } -sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } -sargon-factors = { path = "../sargon-factors" } -sargon-addresses = { path = "../sargon-addresses" } - -# === RADIX DEPENDENCIES -#None - -# === EXTERNAL DEPENDENCIES -enum-iterator = { workspace = true } -derive_more = { workspace = true } -serde = { workspace = true } -serde_with = { workspace = true } diff --git a/crates/next-derivation-index-ephemeral/src/lib.rs b/crates/next-derivation-index-ephemeral/src/lib.rs deleted file mode 100644 index ea850973b..000000000 --- a/crates/next-derivation-index-ephemeral/src/lib.rs +++ /dev/null @@ -1,14 +0,0 @@ -mod agnostic_paths; -mod next_derivation_entity_index_with_ephemeral_offsets; -mod next_derivation_entity_index_with_ephemeral_offsets_for_factor_source; - -pub mod prelude { - pub use crate::agnostic_paths::*; - pub use crate::next_derivation_entity_index_with_ephemeral_offsets::*; - pub use crate::next_derivation_entity_index_with_ephemeral_offsets_for_factor_source::*; - - pub(crate) use sargon_addresses::prelude::*; - pub(crate) use sargon_core::prelude::*; - pub(crate) use sargon_factors::prelude::*; - pub(crate) use sargon_hierarchical_deterministic::prelude::*; -} diff --git a/crates/profile/logic/logic_SPLIT_ME/Cargo.toml b/crates/profile/logic/logic_SPLIT_ME/Cargo.toml new file mode 100644 index 000000000..f43b4491b --- /dev/null +++ b/crates/profile/logic/logic_SPLIT_ME/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "profile-logic" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +identified-vec-of = { path = "../../../common/identified-vec-of" } +hierarchical-deterministic = { path = "../../../crypto/hd" } +factors = { path = "../../../factors/factors" } +addresses = { path = "../../../crypto/addresses" } +profile = { path = "../../../profile/models/profile_SPLIT_ME" } +profile-supporting-types = { path = "../../../profile/models/supporting-types" } +time-utils = { path = "../../../core/time-utils" } + +# === RADIX DEPENDENCIES === +# None + +# === EXTERNAL DEPENDENCIES === +derive_more = { workspace = true } +itertools = { workspace = true } +paste = { workspace = true } +pretty_assertions = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } diff --git a/crates/profile/logic/logic_SPLIT_ME/src/lib.rs b/crates/profile/logic/logic_SPLIT_ME/src/lib.rs new file mode 100644 index 000000000..daf53ad67 --- /dev/null +++ b/crates/profile/logic/logic_SPLIT_ME/src/lib.rs @@ -0,0 +1,15 @@ +mod logic; +mod tests; + +pub mod prelude { + pub use crate::logic::*; + + pub use profile::prelude::*; + pub use profile_supporting_types::prelude::*; + + pub use itertools::*; + + pub(crate) use serde::{Deserialize, Serialize}; +} + +pub use prelude::*; diff --git a/crates/sargon-profile-logic/src/logic/account/account_visibility.rs b/crates/profile/logic/logic_SPLIT_ME/src/logic/account/account_visibility.rs similarity index 100% rename from crates/sargon-profile-logic/src/logic/account/account_visibility.rs rename to crates/profile/logic/logic_SPLIT_ME/src/logic/account/account_visibility.rs diff --git a/crates/sargon-profile-logic/src/logic/account/accounts_visibility.rs b/crates/profile/logic/logic_SPLIT_ME/src/logic/account/accounts_visibility.rs similarity index 100% rename from crates/sargon-profile-logic/src/logic/account/accounts_visibility.rs rename to crates/profile/logic/logic_SPLIT_ME/src/logic/account/accounts_visibility.rs diff --git a/crates/sargon-profile-logic/src/logic/account/mod.rs b/crates/profile/logic/logic_SPLIT_ME/src/logic/account/mod.rs similarity index 100% rename from crates/sargon-profile-logic/src/logic/account/mod.rs rename to crates/profile/logic/logic_SPLIT_ME/src/logic/account/mod.rs diff --git a/crates/sargon-profile-logic/src/logic/account/query_accounts.rs b/crates/profile/logic/logic_SPLIT_ME/src/logic/account/query_accounts.rs similarity index 100% rename from crates/sargon-profile-logic/src/logic/account/query_accounts.rs rename to crates/profile/logic/logic_SPLIT_ME/src/logic/account/query_accounts.rs diff --git a/crates/sargon-profile-logic/src/logic/account/query_security_structures.rs b/crates/profile/logic/logic_SPLIT_ME/src/logic/account/query_security_structures.rs similarity index 100% rename from crates/sargon-profile-logic/src/logic/account/query_security_structures.rs rename to crates/profile/logic/logic_SPLIT_ME/src/logic/account/query_security_structures.rs diff --git a/crates/sargon-profile-logic/src/logic/authorized_dapps_logic.rs b/crates/profile/logic/logic_SPLIT_ME/src/logic/authorized_dapps_logic.rs similarity index 100% rename from crates/sargon-profile-logic/src/logic/authorized_dapps_logic.rs rename to crates/profile/logic/logic_SPLIT_ME/src/logic/authorized_dapps_logic.rs diff --git a/crates/sargon-profile-logic/src/logic/gateway/current_gateway.rs b/crates/profile/logic/logic_SPLIT_ME/src/logic/gateway/current_gateway.rs similarity index 100% rename from crates/sargon-profile-logic/src/logic/gateway/current_gateway.rs rename to crates/profile/logic/logic_SPLIT_ME/src/logic/gateway/current_gateway.rs diff --git a/crates/sargon-profile-logic/src/logic/gateway/mod.rs b/crates/profile/logic/logic_SPLIT_ME/src/logic/gateway/mod.rs similarity index 100% rename from crates/sargon-profile-logic/src/logic/gateway/mod.rs rename to crates/profile/logic/logic_SPLIT_ME/src/logic/gateway/mod.rs diff --git a/crates/sargon-profile-logic/src/logic/instances_deriving_with_factor_sources.rs b/crates/profile/logic/logic_SPLIT_ME/src/logic/instances_deriving_with_factor_sources.rs similarity index 100% rename from crates/sargon-profile-logic/src/logic/instances_deriving_with_factor_sources.rs rename to crates/profile/logic/logic_SPLIT_ME/src/logic/instances_deriving_with_factor_sources.rs diff --git a/crates/sargon-profile-logic/src/logic/mod.rs b/crates/profile/logic/logic_SPLIT_ME/src/logic/mod.rs similarity index 100% rename from crates/sargon-profile-logic/src/logic/mod.rs rename to crates/profile/logic/logic_SPLIT_ME/src/logic/mod.rs diff --git a/crates/sargon-profile-logic/src/logic/persona/mod.rs b/crates/profile/logic/logic_SPLIT_ME/src/logic/persona/mod.rs similarity index 100% rename from crates/sargon-profile-logic/src/logic/persona/mod.rs rename to crates/profile/logic/logic_SPLIT_ME/src/logic/persona/mod.rs diff --git a/crates/sargon-profile-logic/src/logic/persona/persona_data_ids.rs b/crates/profile/logic/logic_SPLIT_ME/src/logic/persona/persona_data_ids.rs similarity index 100% rename from crates/sargon-profile-logic/src/logic/persona/persona_data_ids.rs rename to crates/profile/logic/logic_SPLIT_ME/src/logic/persona/persona_data_ids.rs diff --git a/crates/sargon-profile-logic/src/logic/persona/query_personas.rs b/crates/profile/logic/logic_SPLIT_ME/src/logic/persona/query_personas.rs similarity index 100% rename from crates/sargon-profile-logic/src/logic/persona/query_personas.rs rename to crates/profile/logic/logic_SPLIT_ME/src/logic/persona/query_personas.rs diff --git a/crates/sargon-profile-logic/src/logic/persona/shared_persona_data_ids.rs b/crates/profile/logic/logic_SPLIT_ME/src/logic/persona/shared_persona_data_ids.rs similarity index 100% rename from crates/sargon-profile-logic/src/logic/persona/shared_persona_data_ids.rs rename to crates/profile/logic/logic_SPLIT_ME/src/logic/persona/shared_persona_data_ids.rs diff --git a/crates/sargon-profile-logic/src/logic/profile_header.rs b/crates/profile/logic/logic_SPLIT_ME/src/logic/profile_header.rs similarity index 98% rename from crates/sargon-profile-logic/src/logic/profile_header.rs rename to crates/profile/logic/logic_SPLIT_ME/src/logic/profile_header.rs index 806877d8b..67627273d 100644 --- a/crates/sargon-profile-logic/src/logic/profile_header.rs +++ b/crates/profile/logic/logic_SPLIT_ME/src/logic/profile_header.rs @@ -1,3 +1,5 @@ +use time_utils::now; + use crate::prelude::*; pub trait HeaderUpdating { diff --git a/crates/sargon-profile-logic/src/logic/profile_network/mod.rs b/crates/profile/logic/logic_SPLIT_ME/src/logic/profile_network/mod.rs similarity index 100% rename from crates/sargon-profile-logic/src/logic/profile_network/mod.rs rename to crates/profile/logic/logic_SPLIT_ME/src/logic/profile_network/mod.rs diff --git a/crates/sargon-profile-logic/src/logic/profile_network/profile_network_details.rs b/crates/profile/logic/logic_SPLIT_ME/src/logic/profile_network/profile_network_details.rs similarity index 99% rename from crates/sargon-profile-logic/src/logic/profile_network/profile_network_details.rs rename to crates/profile/logic/logic_SPLIT_ME/src/logic/profile_network/profile_network_details.rs index f98154353..4e2d9a05f 100644 --- a/crates/sargon-profile-logic/src/logic/profile_network/profile_network_details.rs +++ b/crates/profile/logic/logic_SPLIT_ME/src/logic/profile_network/profile_network_details.rs @@ -191,6 +191,8 @@ impl ProfileNetworkDetailsForAuthorizedDapp for ProfileNetwork { #[cfg(test)] mod tests { + use time_utils::now; + use super::*; #[allow(clippy::upper_case_acronyms)] diff --git a/crates/sargon-profile-logic/src/logic/profile_network/profile_network_entities_linked_to_factor_source.rs b/crates/profile/logic/logic_SPLIT_ME/src/logic/profile_network/profile_network_entities_linked_to_factor_source.rs similarity index 100% rename from crates/sargon-profile-logic/src/logic/profile_network/profile_network_entities_linked_to_factor_source.rs rename to crates/profile/logic/logic_SPLIT_ME/src/logic/profile_network/profile_network_entities_linked_to_factor_source.rs diff --git a/crates/sargon-profile-logic/src/logic/profile_network/profile_network_get_entities.rs b/crates/profile/logic/logic_SPLIT_ME/src/logic/profile_network/profile_network_get_entities.rs similarity index 100% rename from crates/sargon-profile-logic/src/logic/profile_network/profile_network_get_entities.rs rename to crates/profile/logic/logic_SPLIT_ME/src/logic/profile_network/profile_network_get_entities.rs diff --git a/crates/sargon-profile-logic/src/logic/profile_networks.rs b/crates/profile/logic/logic_SPLIT_ME/src/logic/profile_networks.rs similarity index 100% rename from crates/sargon-profile-logic/src/logic/profile_networks.rs rename to crates/profile/logic/logic_SPLIT_ME/src/logic/profile_networks.rs diff --git a/crates/sargon-profile-logic/src/logic/profile_update.rs b/crates/profile/logic/logic_SPLIT_ME/src/logic/profile_update.rs similarity index 99% rename from crates/sargon-profile-logic/src/logic/profile_update.rs rename to crates/profile/logic/logic_SPLIT_ME/src/logic/profile_update.rs index e77db21dd..6e46f1673 100644 --- a/crates/sargon-profile-logic/src/logic/profile_update.rs +++ b/crates/profile/logic/logic_SPLIT_ME/src/logic/profile_update.rs @@ -1,3 +1,5 @@ +use time_utils::now; + use crate::prelude::*; pub trait ProfileDiagnosticsFactorInstances { diff --git a/crates/sargon-profile-logic/src/logic/query_factor_sources.rs b/crates/profile/logic/logic_SPLIT_ME/src/logic/query_factor_sources.rs similarity index 100% rename from crates/sargon-profile-logic/src/logic/query_factor_sources.rs rename to crates/profile/logic/logic_SPLIT_ME/src/logic/query_factor_sources.rs diff --git a/crates/sargon-profile-logic/src/tests/matrix_of_factor_instances_index_agnostic.rs b/crates/profile/logic/logic_SPLIT_ME/src/tests/matrix_of_factor_instances_index_agnostic.rs similarity index 100% rename from crates/sargon-profile-logic/src/tests/matrix_of_factor_instances_index_agnostic.rs rename to crates/profile/logic/logic_SPLIT_ME/src/tests/matrix_of_factor_instances_index_agnostic.rs diff --git a/crates/sargon-profile-logic/src/tests/mod.rs b/crates/profile/logic/logic_SPLIT_ME/src/tests/mod.rs similarity index 100% rename from crates/sargon-profile-logic/src/tests/mod.rs rename to crates/profile/logic/logic_SPLIT_ME/src/tests/mod.rs diff --git a/crates/profile/models/account-for-display/Cargo.toml b/crates/profile/models/account-for-display/Cargo.toml new file mode 100644 index 000000000..49a5d8bb7 --- /dev/null +++ b/crates/profile/models/account-for-display/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "account-for-display" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +addresses = { path = "../../../crypto/addresses" } +short-string = { path = "../../../common/short-string" } +entity-foundation = { path = "../../../common/entity-foundation" } +identified-vec-of = { path = "../../../common/identified-vec-of" } +network = { path = "../../../common/network" } +has-sample-values = { path = "../../../core/has-sample-values" } + +# === RADIX DEPENDENCIES === +# None + +# === EXTERNAL DEPENDENCIES === +derive_more = { workspace = true } +serde = { workspace = true } diff --git a/crates/sargon-profile/src/supporting_types/account_for_display.rs b/crates/profile/models/account-for-display/src/account_for_display.rs similarity index 78% rename from crates/sargon-profile/src/supporting_types/account_for_display.rs rename to crates/profile/models/account-for-display/src/account_for_display.rs index c0312cf78..87e75146c 100644 --- a/crates/sargon-profile/src/supporting_types/account_for_display.rs +++ b/crates/profile/models/account-for-display/src/account_for_display.rs @@ -55,12 +55,6 @@ impl HasSampleValues for AccountForDisplay { } } -impl From for AccountForDisplay { - fn from(value: Account) -> Self { - Self::new(value.address, value.display_name, value.appearance_id) - } -} - impl Identifiable for AccountForDisplay { type ID = AccountAddress; @@ -97,17 +91,4 @@ mod tests { fn test_is_network_aware() { assert_eq!(SUT::sample().network_id(), NetworkID::Mainnet); } - - #[test] - fn from_account() { - let lhs = SUT::from(Account::sample()); - assert_eq!( - lhs, - SUT::new( - "account_rdx128dtethfy8ujrsfdztemyjk0kvhnah6dafr57frz85dcw2c8z0td87".parse::().unwrap(), - DisplayName::new("Alice").unwrap(), - AppearanceID::new(0).unwrap(), - ) - ) - } } diff --git a/crates/profile/models/account-for-display/src/lib.rs b/crates/profile/models/account-for-display/src/lib.rs new file mode 100644 index 000000000..db7e8caf6 --- /dev/null +++ b/crates/profile/models/account-for-display/src/lib.rs @@ -0,0 +1,16 @@ +mod account_for_display; + +pub mod prelude { + pub use crate::account_for_display::*; + + pub(crate) use addresses::AccountAddress; + pub(crate) use entity_foundation::prelude::AppearanceID; + pub(crate) use has_sample_values::prelude::HasSampleValues; + pub(crate) use identified_vec_of::prelude::Identifiable; + pub(crate) use network::prelude::{IsNetworkAware, NetworkID}; + pub(crate) use short_string::prelude::DisplayName; + + pub(crate) use serde::{Deserialize, Serialize}; +} + +pub use prelude::*; diff --git a/crates/profile/models/app-preferences/Cargo.toml b/crates/profile/models/app-preferences/Cargo.toml new file mode 100644 index 000000000..0a7bc90d6 --- /dev/null +++ b/crates/profile/models/app-preferences/Cargo.toml @@ -0,0 +1,28 @@ +[package] +name = "profile-app-preferences" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === INTERNAL DEPENDENCIES === +identified-vec-of = { path = "../../../common/identified-vec-of" } +hierarchical-deterministic = { path = "../../../crypto/hd" } +factors = { path = "../../../factors/factors" } +numeric = { path = "../../../common/numeric" } +core-misc = { path = "../../../core/misc" } # decl_bool_Type +keys-collector = { path = "../../../factors/keys-collector" } +addresses = { path = "../../../crypto/addresses" } +transaction-models = { path = "../../../transaction/models" } +profile-gateway = { path = "../../../profile/models/gateway" } +profile-security-structures = { path = "../../../profile/models/security-structures" } + +# === RADIX DEPENDENCIES === +# None + +# === EXTERNAL DEPENDENCIES === +derive_more = { workspace = true } +indexmap = { workspace = true } +log = { workspace = true } +paste = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } diff --git a/crates/sargon-profile-app-preferences/src/app_display_settings/app_display_settings.rs b/crates/profile/models/app-preferences/src/app_display_settings/app_display_settings.rs similarity index 100% rename from crates/sargon-profile-app-preferences/src/app_display_settings/app_display_settings.rs rename to crates/profile/models/app-preferences/src/app_display_settings/app_display_settings.rs diff --git a/crates/sargon-profile-app-preferences/src/app_display_settings/fiat_currency.rs b/crates/profile/models/app-preferences/src/app_display_settings/fiat_currency.rs similarity index 100% rename from crates/sargon-profile-app-preferences/src/app_display_settings/fiat_currency.rs rename to crates/profile/models/app-preferences/src/app_display_settings/fiat_currency.rs diff --git a/crates/sargon-profile-app-preferences/src/app_display_settings/mod.rs b/crates/profile/models/app-preferences/src/app_display_settings/mod.rs similarity index 100% rename from crates/sargon-profile-app-preferences/src/app_display_settings/mod.rs rename to crates/profile/models/app-preferences/src/app_display_settings/mod.rs diff --git a/crates/sargon-profile-app-preferences/src/app_preferences.rs b/crates/profile/models/app-preferences/src/app_preferences.rs similarity index 100% rename from crates/sargon-profile-app-preferences/src/app_preferences.rs rename to crates/profile/models/app-preferences/src/app_preferences.rs diff --git a/crates/sargon-profile-app-preferences/src/lib.rs b/crates/profile/models/app-preferences/src/lib.rs similarity index 60% rename from crates/sargon-profile-app-preferences/src/lib.rs rename to crates/profile/models/app-preferences/src/lib.rs index 769ec8458..862d31272 100644 --- a/crates/sargon-profile-app-preferences/src/lib.rs +++ b/crates/profile/models/app-preferences/src/lib.rs @@ -9,6 +9,9 @@ pub mod prelude { pub use crate::security::*; pub use crate::transaction_preferences::*; - pub use sargon_profile_gateway::prelude::*; - pub use sargon_profile_security_structures::prelude::*; + pub use numeric::prelude::*; + pub use profile_gateway::prelude::*; + pub use profile_security_structures::prelude::*; + + pub(crate) use serde::{Deserialize, Serialize}; } diff --git a/crates/sargon-profile-app-preferences/src/security.rs b/crates/profile/models/app-preferences/src/security.rs similarity index 99% rename from crates/sargon-profile-app-preferences/src/security.rs rename to crates/profile/models/app-preferences/src/security.rs index 6453571a2..49e2b6bc1 100644 --- a/crates/sargon-profile-app-preferences/src/security.rs +++ b/crates/profile/models/app-preferences/src/security.rs @@ -1,4 +1,4 @@ -use sargon_core::decl_bool_type; +use core_misc::decl_bool_type; use crate::prelude::*; diff --git a/crates/sargon-profile-app-preferences/src/transaction_preferences.rs b/crates/profile/models/app-preferences/src/transaction_preferences.rs similarity index 100% rename from crates/sargon-profile-app-preferences/src/transaction_preferences.rs rename to crates/profile/models/app-preferences/src/transaction_preferences.rs diff --git a/crates/profile/models/gateway/Cargo.toml b/crates/profile/models/gateway/Cargo.toml new file mode 100644 index 000000000..07825212f --- /dev/null +++ b/crates/profile/models/gateway/Cargo.toml @@ -0,0 +1,29 @@ +[package] +name = "profile-gateway" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === INTERNAL DEPENDENCIES === +identified-vec-of = { path = "../../../common/identified-vec-of" } +hierarchical-deterministic = { path = "../../../crypto/hd" } +factors = { path = "../../../factors/factors" } +keys-collector = { path = "../../../factors/keys-collector" } +addresses = { path = "../../../crypto/addresses" } +transaction-models = { path = "../../../transaction/models" } +network = { path = "../../../common/network" } +error = { path = "../../../core/error" } +core-misc = { path = "../../../core/misc" } +assert-json = { path = "../../../core/assert-json" } +has-sample-values = { path = "../../../core/has-sample-values" } + +# === RADIX DEPENDENCIES === +# None + +# === EXTERNAL DEPENDENCIES === +derive_more = { workspace = true } +log = { workspace = true } +paste = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +url = { workspace = true } diff --git a/crates/sargon-profile-gateway/src/gateway.rs b/crates/profile/models/gateway/src/gateway.rs similarity index 99% rename from crates/sargon-profile-gateway/src/gateway.rs rename to crates/profile/models/gateway/src/gateway.rs index 60c1690ff..a40264ec0 100644 --- a/crates/sargon-profile-gateway/src/gateway.rs +++ b/crates/profile/models/gateway/src/gateway.rs @@ -1,4 +1,4 @@ -use sargon_core::parse_url; +use core_misc::parse_url; use crate::prelude::*; diff --git a/crates/profile/models/gateway/src/lib.rs b/crates/profile/models/gateway/src/lib.rs new file mode 100644 index 000000000..75032e3b8 --- /dev/null +++ b/crates/profile/models/gateway/src/lib.rs @@ -0,0 +1,24 @@ +mod gateway; +mod network_definition; +mod saved_gateways; + +pub mod prelude { + pub use crate::gateway::*; + pub use crate::network_definition::*; + pub use crate::saved_gateways::*; + + pub(crate) use has_sample_values::prelude::*; + pub(crate) use identified_vec_of::prelude::*; + pub(crate) use network::prelude::*; + + pub(crate) use log::*; + pub(crate) use serde::{ + de, ser::SerializeStruct, Deserialize, Deserializer, Serialize, + Serializer, + }; + pub(crate) use std::collections::HashMap; + #[cfg(test)] + pub(crate) use std::collections::HashSet; +} + +pub use prelude::*; diff --git a/crates/sargon-profile-gateway/src/network_definition.rs b/crates/profile/models/gateway/src/network_definition.rs similarity index 99% rename from crates/sargon-profile-gateway/src/network_definition.rs rename to crates/profile/models/gateway/src/network_definition.rs index 5ae9af1ab..7db5e39b5 100644 --- a/crates/sargon-profile-gateway/src/network_definition.rs +++ b/crates/profile/models/gateway/src/network_definition.rs @@ -43,7 +43,6 @@ impl NetworkDefinition { } } -use sargon_core::NetworkID; use NetworkID::*; impl NetworkDefinition { /// The Radix mainnet, the "real" Network on which all launched Dapps and diff --git a/crates/sargon-profile-gateway/src/saved_gateways.rs b/crates/profile/models/gateway/src/saved_gateways.rs similarity index 99% rename from crates/sargon-profile-gateway/src/saved_gateways.rs rename to crates/profile/models/gateway/src/saved_gateways.rs index f6bf7d15c..32aa5876a 100644 --- a/crates/sargon-profile-gateway/src/saved_gateways.rs +++ b/crates/profile/models/gateway/src/saved_gateways.rs @@ -1,4 +1,4 @@ -use sargon_core::decl_identified_vec_of; +use identified_vec_of::decl_identified_vec_of; use crate::prelude::*; diff --git a/crates/profile/models/profile_SPLIT_ME/Cargo.toml b/crates/profile/models/profile_SPLIT_ME/Cargo.toml new file mode 100644 index 000000000..3084d1d6e --- /dev/null +++ b/crates/profile/models/profile_SPLIT_ME/Cargo.toml @@ -0,0 +1,46 @@ +[package] +name = "profile" +version = "1.1.99" +edition = "2021" +build = "build.rs" + +[dependencies] +# === INTERNAL DEPENDENCIES === +encryption = { path = "../../../crypto/encryption" } +identified-vec-of = { path = "../../../common/identified-vec-of" } +hierarchical-deterministic = { path = "../../../crypto/hd" } +factors = { path = "../../../factors/factors" } +core-misc = { path = "../../../core/misc" } +entity-foundation = { path = "../../../common/entity-foundation" } +has-sample-values = { path = "../../../core/has-sample-values" } +keys-collector = { path = "../../../factors/keys-collector" } +addresses = { path = "../../../crypto/addresses" } +transaction-models = { path = "../../../transaction/models" } +profile-app-preferences = { path = "../../../profile/models/app-preferences" } +account-for-display = { path = "../../../profile/models/account-for-display" } +profile-security-structures = { path = "../../../profile/models/security-structures" } +time-utils = { path = "../../../core/time-utils" } +host-info = { path = "../../../common/host-info" } + +# === RADIX DEPENDENCIES === +# None + +# === EXTERNAL DEPENDENCIES === +derive_more = { workspace = true } +enum-as-inner = { workspace = true } +enum-iterator = { workspace = true } +hkdf = { workspace = true } +k256 = { workspace = true } +itertools = { workspace = true } +log = { workspace = true } +once_cell = { workspace = true } +paste = { workspace = true } +pretty_assertions = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +serde_repr = { workspace = true } +serde_with = { workspace = true } +strum = { workspace = true } + +[build-dependencies] +cargo_toml = { workspace = true } diff --git a/crates/sargon-profile/build.rs b/crates/profile/models/profile_SPLIT_ME/build.rs similarity index 100% rename from crates/sargon-profile/build.rs rename to crates/profile/models/profile_SPLIT_ME/build.rs diff --git a/crates/sargon-profile/fixtures/vector/huge_profile_1000_accounts.json b/crates/profile/models/profile_SPLIT_ME/fixtures/vector/huge_profile_1000_accounts.json similarity index 100% rename from crates/sargon-profile/fixtures/vector/huge_profile_1000_accounts.json rename to crates/profile/models/profile_SPLIT_ME/fixtures/vector/huge_profile_1000_accounts.json diff --git a/crates/sargon-profile/fixtures/vector/multi_profile_snapshots_test_version_100_patch_after_app_version_120.json b/crates/profile/models/profile_SPLIT_ME/fixtures/vector/multi_profile_snapshots_test_version_100_patch_after_app_version_120.json similarity index 100% rename from crates/sargon-profile/fixtures/vector/multi_profile_snapshots_test_version_100_patch_after_app_version_120.json rename to crates/profile/models/profile_SPLIT_ME/fixtures/vector/multi_profile_snapshots_test_version_100_patch_after_app_version_120.json diff --git a/crates/sargon-profile/fixtures/vector/only_plaintext_profile_snapshot_version_100.json b/crates/profile/models/profile_SPLIT_ME/fixtures/vector/only_plaintext_profile_snapshot_version_100.json similarity index 100% rename from crates/sargon-profile/fixtures/vector/only_plaintext_profile_snapshot_version_100.json rename to crates/profile/models/profile_SPLIT_ME/fixtures/vector/only_plaintext_profile_snapshot_version_100.json diff --git a/crates/sargon-profile/fixtures/vector/profile_encrypted_by_password_empty.json b/crates/profile/models/profile_SPLIT_ME/fixtures/vector/profile_encrypted_by_password_empty.json similarity index 100% rename from crates/sargon-profile/fixtures/vector/profile_encrypted_by_password_empty.json rename to crates/profile/models/profile_SPLIT_ME/fixtures/vector/profile_encrypted_by_password_empty.json diff --git a/crates/sargon-profile/fixtures/vector/profile_encrypted_by_password_of_babylon.json b/crates/profile/models/profile_SPLIT_ME/fixtures/vector/profile_encrypted_by_password_of_babylon.json similarity index 100% rename from crates/sargon-profile/fixtures/vector/profile_encrypted_by_password_of_babylon.json rename to crates/profile/models/profile_SPLIT_ME/fixtures/vector/profile_encrypted_by_password_of_babylon.json diff --git a/crates/sargon-profile/src/encrypted/encrypted_profile/encrypted_profile_snapshot.rs b/crates/profile/models/profile_SPLIT_ME/src/encrypted_profile/encrypted_profile_snapshot.rs similarity index 97% rename from crates/sargon-profile/src/encrypted/encrypted_profile/encrypted_profile_snapshot.rs rename to crates/profile/models/profile_SPLIT_ME/src/encrypted_profile/encrypted_profile_snapshot.rs index 37ddd4697..f5237e048 100644 --- a/crates/sargon-profile/src/encrypted/encrypted_profile/encrypted_profile_snapshot.rs +++ b/crates/profile/models/profile_SPLIT_ME/src/encrypted_profile/encrypted_profile_snapshot.rs @@ -1,3 +1,8 @@ +use encryption::{ + EncryptionKey, EncryptionScheme, PasswordBasedKeyDerivationScheme, + VersionedEncryption, VersionedPasswordBasedKeyDerivation, +}; + use crate::prelude::*; /// An encryption of a `ProfileSnapshot` with crypto metadata about how it was encrypted, which can diff --git a/crates/sargon-profile/src/encrypted/encrypted_profile/mod.rs b/crates/profile/models/profile_SPLIT_ME/src/encrypted_profile/mod.rs similarity index 100% rename from crates/sargon-profile/src/encrypted/encrypted_profile/mod.rs rename to crates/profile/models/profile_SPLIT_ME/src/encrypted_profile/mod.rs diff --git a/crates/profile/models/profile_SPLIT_ME/src/lib.rs b/crates/profile/models/profile_SPLIT_ME/src/lib.rs new file mode 100644 index 000000000..a48b4c6cd --- /dev/null +++ b/crates/profile/models/profile_SPLIT_ME/src/lib.rs @@ -0,0 +1,44 @@ +#![allow(trivial_bounds)] +#![allow(incomplete_features)] +#![feature(trivial_bounds)] +#![feature(let_chains)] +#![feature(generic_const_exprs)] + +mod encrypted_profile; +mod profilesnapshot_version; +mod samples; +mod supporting_types; +mod v100; + +pub mod prelude { + + pub use account_for_display::prelude::*; + pub use addresses::prelude::*; + pub use core_misc::prelude::*; + pub use entity_foundation::prelude::*; + pub use factors::prelude::*; + pub use has_sample_values::prelude::*; + pub use hierarchical_deterministic::prelude::*; + pub use host_info::prelude::*; + pub use identified_vec_of::prelude::*; + pub use profile_app_preferences::prelude::*; + pub use transaction_models::prelude::*; + + pub use crate::encrypted_profile::*; + pub use crate::profilesnapshot_version::*; + pub use crate::samples::*; + pub use crate::supporting_types::*; + pub use crate::v100::*; + + pub(crate) use enum_as_inner::EnumAsInner; + + pub(crate) use serde::{ + ser::SerializeStruct, Deserialize, Deserializer, Serialize, Serializer, + }; + + #[cfg(test)] + pub(crate) use serde_json::json; + + #[cfg(test)] + pub(crate) use std::collections::HashSet; +} diff --git a/crates/sargon-profile/src/profilesnapshot_version.rs b/crates/profile/models/profile_SPLIT_ME/src/profilesnapshot_version.rs similarity index 100% rename from crates/sargon-profile/src/profilesnapshot_version.rs rename to crates/profile/models/profile_SPLIT_ME/src/profilesnapshot_version.rs diff --git a/crates/sargon-profile/src/samples/access_controller_address_samples.rs b/crates/profile/models/profile_SPLIT_ME/src/samples/access_controller_address_samples.rs similarity index 100% rename from crates/sargon-profile/src/samples/access_controller_address_samples.rs rename to crates/profile/models/profile_SPLIT_ME/src/samples/access_controller_address_samples.rs diff --git a/crates/sargon-profile/src/samples/account_address_samples.rs b/crates/profile/models/profile_SPLIT_ME/src/samples/account_address_samples.rs similarity index 100% rename from crates/sargon-profile/src/samples/account_address_samples.rs rename to crates/profile/models/profile_SPLIT_ME/src/samples/account_address_samples.rs diff --git a/crates/sargon-profile/src/samples/account_samples.rs b/crates/profile/models/profile_SPLIT_ME/src/samples/account_samples.rs similarity index 100% rename from crates/sargon-profile/src/samples/account_samples.rs rename to crates/profile/models/profile_SPLIT_ME/src/samples/account_samples.rs diff --git a/crates/sargon-profile/src/samples/identity_address_samples.rs b/crates/profile/models/profile_SPLIT_ME/src/samples/identity_address_samples.rs similarity index 100% rename from crates/sargon-profile/src/samples/identity_address_samples.rs rename to crates/profile/models/profile_SPLIT_ME/src/samples/identity_address_samples.rs diff --git a/crates/sargon-profile/src/samples/mod.rs b/crates/profile/models/profile_SPLIT_ME/src/samples/mod.rs similarity index 100% rename from crates/sargon-profile/src/samples/mod.rs rename to crates/profile/models/profile_SPLIT_ME/src/samples/mod.rs diff --git a/crates/sargon-profile/src/samples/persona_samples.rs b/crates/profile/models/profile_SPLIT_ME/src/samples/persona_samples.rs similarity index 100% rename from crates/sargon-profile/src/samples/persona_samples.rs rename to crates/profile/models/profile_SPLIT_ME/src/samples/persona_samples.rs diff --git a/crates/sargon-profile/src/samples/profile_samples.rs b/crates/profile/models/profile_SPLIT_ME/src/samples/profile_samples.rs similarity index 100% rename from crates/sargon-profile/src/samples/profile_samples.rs rename to crates/profile/models/profile_SPLIT_ME/src/samples/profile_samples.rs diff --git a/crates/sargon-profile/src/supporting_types/account_or_persona.rs b/crates/profile/models/profile_SPLIT_ME/src/supporting_types/account_or_persona.rs similarity index 100% rename from crates/sargon-profile/src/supporting_types/account_or_persona.rs rename to crates/profile/models/profile_SPLIT_ME/src/supporting_types/account_or_persona.rs diff --git a/crates/sargon-profile/src/supporting_types/accounts_for_display.rs b/crates/profile/models/profile_SPLIT_ME/src/supporting_types/accounts_for_display.rs similarity index 100% rename from crates/sargon-profile/src/supporting_types/accounts_for_display.rs rename to crates/profile/models/profile_SPLIT_ME/src/supporting_types/accounts_for_display.rs diff --git a/crates/sargon-profile/src/supporting_types/accounts_or_personas.rs b/crates/profile/models/profile_SPLIT_ME/src/supporting_types/accounts_or_personas.rs similarity index 100% rename from crates/sargon-profile/src/supporting_types/accounts_or_personas.rs rename to crates/profile/models/profile_SPLIT_ME/src/supporting_types/accounts_or_personas.rs diff --git a/crates/sargon-profile/src/supporting_types/authorized_dapp_detailed.rs b/crates/profile/models/profile_SPLIT_ME/src/supporting_types/authorized_dapp_detailed.rs similarity index 100% rename from crates/sargon-profile/src/supporting_types/authorized_dapp_detailed.rs rename to crates/profile/models/profile_SPLIT_ME/src/supporting_types/authorized_dapp_detailed.rs diff --git a/crates/sargon-profile/src/supporting_types/authorized_persona_detailed.rs b/crates/profile/models/profile_SPLIT_ME/src/supporting_types/authorized_persona_detailed.rs similarity index 100% rename from crates/sargon-profile/src/supporting_types/authorized_persona_detailed.rs rename to crates/profile/models/profile_SPLIT_ME/src/supporting_types/authorized_persona_detailed.rs diff --git a/crates/sargon-profile/src/supporting_types/detailed_authorized_personas.rs b/crates/profile/models/profile_SPLIT_ME/src/supporting_types/detailed_authorized_personas.rs similarity index 100% rename from crates/sargon-profile/src/supporting_types/detailed_authorized_personas.rs rename to crates/profile/models/profile_SPLIT_ME/src/supporting_types/detailed_authorized_personas.rs diff --git a/crates/sargon-profile/src/supporting_types/mod.rs b/crates/profile/models/profile_SPLIT_ME/src/supporting_types/mod.rs similarity index 88% rename from crates/sargon-profile/src/supporting_types/mod.rs rename to crates/profile/models/profile_SPLIT_ME/src/supporting_types/mod.rs index a2da50a39..ff89155c4 100644 --- a/crates/sargon-profile/src/supporting_types/mod.rs +++ b/crates/profile/models/profile_SPLIT_ME/src/supporting_types/mod.rs @@ -1,4 +1,3 @@ -mod account_for_display; mod account_or_persona; mod accounts_for_display; mod accounts_or_personas; @@ -7,7 +6,6 @@ mod authorized_persona_detailed; mod detailed_authorized_personas; mod on_same_network_validating; -pub use account_for_display::*; pub use account_or_persona::*; pub use accounts_for_display::*; pub use accounts_or_personas::*; diff --git a/crates/sargon-profile/src/supporting_types/on_same_network_validating.rs b/crates/profile/models/profile_SPLIT_ME/src/supporting_types/on_same_network_validating.rs similarity index 100% rename from crates/sargon-profile/src/supporting_types/on_same_network_validating.rs rename to crates/profile/models/profile_SPLIT_ME/src/supporting_types/on_same_network_validating.rs diff --git a/crates/sargon-profile/src/v100/entities_linked_to_factor_source/entities_linked_to_factor_source.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entities_linked_to_factor_source/entities_linked_to_factor_source.rs similarity index 100% rename from crates/sargon-profile/src/v100/entities_linked_to_factor_source/entities_linked_to_factor_source.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entities_linked_to_factor_source/entities_linked_to_factor_source.rs diff --git a/crates/sargon-profile/src/v100/entities_linked_to_factor_source/integrity/device.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entities_linked_to_factor_source/integrity/device.rs similarity index 100% rename from crates/sargon-profile/src/v100/entities_linked_to_factor_source/integrity/device.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entities_linked_to_factor_source/integrity/device.rs diff --git a/crates/sargon-profile/src/v100/entities_linked_to_factor_source/integrity/integrity.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entities_linked_to_factor_source/integrity/integrity.rs similarity index 100% rename from crates/sargon-profile/src/v100/entities_linked_to_factor_source/integrity/integrity.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entities_linked_to_factor_source/integrity/integrity.rs diff --git a/crates/sargon-profile/src/v100/entities_linked_to_factor_source/integrity/mod.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entities_linked_to_factor_source/integrity/mod.rs similarity index 100% rename from crates/sargon-profile/src/v100/entities_linked_to_factor_source/integrity/mod.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entities_linked_to_factor_source/integrity/mod.rs diff --git a/crates/sargon-profile/src/v100/entities_linked_to_factor_source/mod.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entities_linked_to_factor_source/mod.rs similarity index 100% rename from crates/sargon-profile/src/v100/entities_linked_to_factor_source/mod.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entities_linked_to_factor_source/mod.rs diff --git a/crates/sargon-profile/src/v100/entities_linked_to_factor_source/profile_to_check.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entities_linked_to_factor_source/profile_to_check.rs similarity index 100% rename from crates/sargon-profile/src/v100/entities_linked_to_factor_source/profile_to_check.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entities_linked_to_factor_source/profile_to_check.rs diff --git a/crates/sargon-profile/src/v100/entity/abstract_entity_type.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity/abstract_entity_type.rs similarity index 100% rename from crates/sargon-profile/src/v100/entity/abstract_entity_type.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entity/abstract_entity_type.rs diff --git a/crates/sargon-profile/src/v100/entity/account/account.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity/account/account.rs similarity index 97% rename from crates/sargon-profile/src/v100/entity/account/account.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entity/account/account.rs index ef0510cb2..d7971f0a4 100644 --- a/crates/sargon-profile/src/v100/entity/account/account.rs +++ b/crates/profile/models/profile_SPLIT_ME/src/v100/entity/account/account.rs @@ -72,6 +72,12 @@ pub struct Account { pub on_ledger_settings: OnLedgerSettings, } +impl From for AccountForDisplay { + fn from(value: Account) -> Self { + Self::new(value.address, value.display_name, value.appearance_id) + } +} + impl HasEntityKind for Account { fn entity_kind() -> CAP26EntityKind { CAP26EntityKind::Account @@ -504,6 +510,19 @@ mod tests { ); } + #[test] + fn to_account_for_display() { + let lhs = AccountForDisplay::from(Account::sample()); + assert_eq!( + lhs, + AccountForDisplay::new( + "account_rdx128dtethfy8ujrsfdztemyjk0kvhnah6dafr57frz85dcw2c8z0td87".parse::().unwrap(), + DisplayName::new("Alice").unwrap(), + AppearanceID::new(0).unwrap(), + ) + ) + } + #[test] fn json_roundtrip_mainnet_alice() { let model = SUT::sample_mainnet_alice(); diff --git a/crates/sargon-profile/src/v100/entity/account/mod.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity/account/mod.rs similarity index 100% rename from crates/sargon-profile/src/v100/entity/account/mod.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entity/account/mod.rs diff --git a/crates/sargon-profile/src/v100/entity/account/on_ledger_settings/mod.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity/account/on_ledger_settings/mod.rs similarity index 100% rename from crates/sargon-profile/src/v100/entity/account/on_ledger_settings/mod.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entity/account/on_ledger_settings/mod.rs diff --git a/crates/sargon-profile/src/v100/entity/account/on_ledger_settings/on_ledger_settings.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity/account/on_ledger_settings/on_ledger_settings.rs similarity index 100% rename from crates/sargon-profile/src/v100/entity/account/on_ledger_settings/on_ledger_settings.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entity/account/on_ledger_settings/on_ledger_settings.rs diff --git a/crates/sargon-profile/src/v100/entity/entity_flag.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity/entity_flag.rs similarity index 100% rename from crates/sargon-profile/src/v100/entity/entity_flag.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entity/entity_flag.rs diff --git a/crates/sargon-profile/src/v100/entity/entity_flags.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity/entity_flags.rs similarity index 100% rename from crates/sargon-profile/src/v100/entity/entity_flags.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entity/entity_flags.rs diff --git a/crates/sargon-profile/src/v100/entity/has_security_state.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity/has_security_state.rs similarity index 100% rename from crates/sargon-profile/src/v100/entity/has_security_state.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entity/has_security_state.rs diff --git a/crates/sargon-profile/src/v100/entity/is_entity.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity/is_entity.rs similarity index 100% rename from crates/sargon-profile/src/v100/entity/is_entity.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entity/is_entity.rs diff --git a/crates/sargon-profile/src/v100/entity/mod.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity/mod.rs similarity index 100% rename from crates/sargon-profile/src/v100/entity/mod.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entity/mod.rs diff --git a/crates/sargon-profile/src/v100/entity/persona/mod.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/mod.rs similarity index 100% rename from crates/sargon-profile/src/v100/entity/persona/mod.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/mod.rs diff --git a/crates/sargon-profile/src/v100/entity/persona/persona.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona.rs similarity index 100% rename from crates/sargon-profile/src/v100/entity/persona/persona.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona.rs diff --git a/crates/sargon-profile/src/v100/entity/persona/persona_data/collection_of_email_addresses.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/collection_of_email_addresses.rs similarity index 100% rename from crates/sargon-profile/src/v100/entity/persona/persona_data/collection_of_email_addresses.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/collection_of_email_addresses.rs diff --git a/crates/sargon-profile/src/v100/entity/persona/persona_data/collection_of_phone_numbers.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/collection_of_phone_numbers.rs similarity index 100% rename from crates/sargon-profile/src/v100/entity/persona/persona_data/collection_of_phone_numbers.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/collection_of_phone_numbers.rs diff --git a/crates/sargon-profile/src/v100/entity/persona/persona_data/entry_kinds/mod.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/entry_kinds/mod.rs similarity index 100% rename from crates/sargon-profile/src/v100/entity/persona/persona_data/entry_kinds/mod.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/entry_kinds/mod.rs diff --git a/crates/sargon-profile/src/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_email_address.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_email_address.rs similarity index 100% rename from crates/sargon-profile/src/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_email_address.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_email_address.rs diff --git a/crates/sargon-profile/src/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_name.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_name.rs similarity index 100% rename from crates/sargon-profile/src/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_name.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_name.rs diff --git a/crates/sargon-profile/src/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_phone_number.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_phone_number.rs similarity index 100% rename from crates/sargon-profile/src/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_phone_number.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_phone_number.rs diff --git a/crates/sargon-profile/src/v100/entity/persona/persona_data/mod.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/mod.rs similarity index 100% rename from crates/sargon-profile/src/v100/entity/persona/persona_data/mod.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/mod.rs diff --git a/crates/sargon-profile/src/v100/entity/persona/persona_data/persona_data.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/persona_data.rs similarity index 100% rename from crates/sargon-profile/src/v100/entity/persona/persona_data/persona_data.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/persona_data.rs diff --git a/crates/sargon-profile/src/v100/entity/persona/persona_data/persona_data_entry_id.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/persona_data_entry_id.rs similarity index 99% rename from crates/sargon-profile/src/v100/entity/persona/persona_data/persona_data_entry_id.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/persona_data_entry_id.rs index 22fdae84a..14d9e621b 100644 --- a/crates/sargon-profile/src/v100/entity/persona/persona_data/persona_data_entry_id.rs +++ b/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/persona_data_entry_id.rs @@ -34,7 +34,7 @@ impl std::ops::Deref for PersonaDataEntryID { impl PersonaDataEntryID { /// Generates a new `PersonaDataEntryID` (using Uuid::new_v4()) pub fn generate() -> Self { - id().into() + Uuid::new_v4().into() } } diff --git a/crates/sargon-profile/src/v100/entity/persona/persona_data/persona_data_identified_collection_types.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/persona_data_identified_collection_types.rs similarity index 99% rename from crates/sargon-profile/src/v100/entity/persona/persona_data/persona_data_identified_collection_types.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/persona_data_identified_collection_types.rs index c33d5bd86..e5fa04f55 100644 --- a/crates/sargon-profile/src/v100/entity/persona/persona_data/persona_data_identified_collection_types.rs +++ b/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/persona_data_identified_collection_types.rs @@ -214,7 +214,7 @@ macro_rules! declare_collection_of_identified_entry { $expected_sample_debug: literal, $expected_sample_json: literal ) => { - paste! { + paste::paste! { declare_collection_of_identified_entry!( $( #[doc = $expr] diff --git a/crates/sargon-profile/src/v100/entity/persona/persona_data/persona_data_identified_entry_types.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/persona_data_identified_entry_types.rs similarity index 99% rename from crates/sargon-profile/src/v100/entity/persona/persona_data/persona_data_identified_entry_types.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/persona_data_identified_entry_types.rs index e2a81ad25..cac8b4dd9 100644 --- a/crates/sargon-profile/src/v100/entity/persona/persona_data/persona_data_identified_entry_types.rs +++ b/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/persona_data_identified_entry_types.rs @@ -153,7 +153,7 @@ macro_rules! declare_identified_entry { $expected_sample_debug: literal, $expected_sample_json: literal ) => { - paste! { + paste::paste! { declare_identified_entry!( $( #[doc = $expr] diff --git a/crates/sargon-profile/src/v100/entity_security_state/entity_security_state.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity_security_state/entity_security_state.rs similarity index 100% rename from crates/sargon-profile/src/v100/entity_security_state/entity_security_state.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entity_security_state/entity_security_state.rs diff --git a/crates/sargon-profile/src/v100/entity_security_state/mod.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity_security_state/mod.rs similarity index 100% rename from crates/sargon-profile/src/v100/entity_security_state/mod.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entity_security_state/mod.rs diff --git a/crates/sargon-profile/src/v100/entity_security_state/provisional_securified_config.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity_security_state/provisional_securified_config.rs similarity index 100% rename from crates/sargon-profile/src/v100/entity_security_state/provisional_securified_config.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entity_security_state/provisional_securified_config.rs diff --git a/crates/sargon-profile/src/v100/entity_security_state/provisional_securified_transaction_queued.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity_security_state/provisional_securified_transaction_queued.rs similarity index 100% rename from crates/sargon-profile/src/v100/entity_security_state/provisional_securified_transaction_queued.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entity_security_state/provisional_securified_transaction_queued.rs diff --git a/crates/sargon-profile/src/v100/entity_security_state/unsecured_entity_control.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity_security_state/unsecured_entity_control.rs similarity index 100% rename from crates/sargon-profile/src/v100/entity_security_state/unsecured_entity_control.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/entity_security_state/unsecured_entity_control.rs diff --git a/crates/sargon-profile/src/v100/header/content_hint.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/header/content_hint.rs similarity index 100% rename from crates/sargon-profile/src/v100/header/content_hint.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/header/content_hint.rs diff --git a/crates/sargon-profile/src/v100/header/device_info.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/header/device_info.rs similarity index 99% rename from crates/sargon-profile/src/v100/header/device_info.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/header/device_info.rs index df64f0c83..a541b9c7d 100644 --- a/crates/sargon-profile/src/v100/header/device_info.rs +++ b/crates/profile/models/profile_SPLIT_ME/src/v100/header/device_info.rs @@ -95,6 +95,9 @@ impl DeviceInfo { } } +#[cfg(test)] +use time_utils::now; + #[cfg(test)] impl DeviceInfo { fn new_unknown() -> Self { diff --git a/crates/sargon-profile/src/v100/header/header.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/header/header.rs similarity index 99% rename from crates/sargon-profile/src/v100/header/header.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/header/header.rs index 9e9f8d526..cc5668e7a 100644 --- a/crates/sargon-profile/src/v100/header/header.rs +++ b/crates/profile/models/profile_SPLIT_ME/src/v100/header/header.rs @@ -1,3 +1,5 @@ +use time_utils::now; + use crate::prelude::*; /// The header of a Profile(Snapshot) contains crucial metadata diff --git a/crates/sargon-profile/src/v100/header/mod.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/header/mod.rs similarity index 100% rename from crates/sargon-profile/src/v100/header/mod.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/header/mod.rs diff --git a/crates/sargon-profile/src/v100/header/profile_id.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/header/profile_id.rs similarity index 98% rename from crates/sargon-profile/src/v100/header/profile_id.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/header/profile_id.rs index c67f7509d..9bfd98cbc 100644 --- a/crates/sargon-profile/src/v100/header/profile_id.rs +++ b/crates/profile/models/profile_SPLIT_ME/src/v100/header/profile_id.rs @@ -1,7 +1,7 @@ use crate::prelude::*; pub fn profile_id() -> ProfileID { - ProfileID(id()) + ProfileID(Uuid::new_v4()) } /// A stable and globally unique identifier of a Profile. diff --git a/crates/sargon-profile/src/v100/mod.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/mod.rs similarity index 100% rename from crates/sargon-profile/src/v100/mod.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/mod.rs diff --git a/crates/sargon-profile/src/v100/networks/mod.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/networks/mod.rs similarity index 100% rename from crates/sargon-profile/src/v100/networks/mod.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/networks/mod.rs diff --git a/crates/sargon-profile/src/v100/networks/network/accounts.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/accounts.rs similarity index 100% rename from crates/sargon-profile/src/v100/networks/network/accounts.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/accounts.rs diff --git a/crates/sargon-profile/src/v100/networks/network/authorized_dapp/authorized_dapp.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/authorized_dapp.rs similarity index 100% rename from crates/sargon-profile/src/v100/networks/network/authorized_dapp/authorized_dapp.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/authorized_dapp.rs diff --git a/crates/sargon-profile/src/v100/networks/network/authorized_dapp/authorized_persona_simple.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/authorized_persona_simple.rs similarity index 100% rename from crates/sargon-profile/src/v100/networks/network/authorized_dapp/authorized_persona_simple.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/authorized_persona_simple.rs diff --git a/crates/sargon-profile/src/v100/networks/network/authorized_dapp/mod.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/mod.rs similarity index 100% rename from crates/sargon-profile/src/v100/networks/network/authorized_dapp/mod.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/mod.rs diff --git a/crates/sargon-profile/src/v100/networks/network/authorized_dapp/preferences/authorized_dapp_preference_deposits.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/preferences/authorized_dapp_preference_deposits.rs similarity index 100% rename from crates/sargon-profile/src/v100/networks/network/authorized_dapp/preferences/authorized_dapp_preference_deposits.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/preferences/authorized_dapp_preference_deposits.rs diff --git a/crates/sargon-profile/src/v100/networks/network/authorized_dapp/preferences/authorized_dapp_preferences.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/preferences/authorized_dapp_preferences.rs similarity index 100% rename from crates/sargon-profile/src/v100/networks/network/authorized_dapp/preferences/authorized_dapp_preferences.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/preferences/authorized_dapp_preferences.rs diff --git a/crates/sargon-profile/src/v100/networks/network/authorized_dapp/preferences/mod.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/preferences/mod.rs similarity index 100% rename from crates/sargon-profile/src/v100/networks/network/authorized_dapp/preferences/mod.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/preferences/mod.rs diff --git a/crates/sargon-profile/src/v100/networks/network/authorized_dapp/references_to_authorized_personas.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/references_to_authorized_personas.rs similarity index 100% rename from crates/sargon-profile/src/v100/networks/network/authorized_dapp/references_to_authorized_personas.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/references_to_authorized_personas.rs diff --git a/crates/sargon-profile/src/v100/networks/network/authorized_dapp/shared_persona_data.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/shared_persona_data.rs similarity index 100% rename from crates/sargon-profile/src/v100/networks/network/authorized_dapp/shared_persona_data.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/shared_persona_data.rs diff --git a/crates/sargon-profile/src/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_account_addresses.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_account_addresses.rs similarity index 100% rename from crates/sargon-profile/src/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_account_addresses.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_account_addresses.rs diff --git a/crates/sargon-profile/src/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_ids_of_persona_data_entries.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_ids_of_persona_data_entries.rs similarity index 100% rename from crates/sargon-profile/src/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_ids_of_persona_data_entries.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_ids_of_persona_data_entries.rs diff --git a/crates/sargon-profile/src/v100/networks/network/authorized_dapp/shared_with_dapp.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/shared_with_dapp.rs similarity index 99% rename from crates/sargon-profile/src/v100/networks/network/authorized_dapp/shared_with_dapp.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/shared_with_dapp.rs index 128bc8529..fe36eb305 100644 --- a/crates/sargon-profile/src/v100/networks/network/authorized_dapp/shared_with_dapp.rs +++ b/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/shared_with_dapp.rs @@ -158,7 +158,7 @@ macro_rules! declare_shared_with_dapp { $expected_sample_debug: literal, $expected_sample_json: literal ) => { - paste! { + paste::paste! { declare_shared_with_dapp!( $( #[doc = $expr] diff --git a/crates/sargon-profile/src/v100/networks/network/authorized_dapps.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapps.rs similarity index 100% rename from crates/sargon-profile/src/v100/networks/network/authorized_dapps.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapps.rs diff --git a/crates/sargon-profile/src/v100/networks/network/mod.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/mod.rs similarity index 100% rename from crates/sargon-profile/src/v100/networks/network/mod.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/mod.rs diff --git a/crates/sargon-profile/src/v100/networks/network/personas.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/personas.rs similarity index 100% rename from crates/sargon-profile/src/v100/networks/network/personas.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/personas.rs diff --git a/crates/sargon-profile/src/v100/networks/network/profile_network.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/profile_network.rs similarity index 100% rename from crates/sargon-profile/src/v100/networks/network/profile_network.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/profile_network.rs diff --git a/crates/sargon-profile/src/v100/networks/network/resource_preferences/hidden_resources.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/resource_preferences/hidden_resources.rs similarity index 100% rename from crates/sargon-profile/src/v100/networks/network/resource_preferences/hidden_resources.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/resource_preferences/hidden_resources.rs diff --git a/crates/sargon-profile/src/v100/networks/network/resource_preferences/mod.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/resource_preferences/mod.rs similarity index 100% rename from crates/sargon-profile/src/v100/networks/network/resource_preferences/mod.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/resource_preferences/mod.rs diff --git a/crates/sargon-profile/src/v100/networks/network/resource_preferences/resource_app_preference.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/resource_preferences/resource_app_preference.rs similarity index 100% rename from crates/sargon-profile/src/v100/networks/network/resource_preferences/resource_app_preference.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/resource_preferences/resource_app_preference.rs diff --git a/crates/sargon-profile/src/v100/networks/network/resource_preferences/resource_identifier.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/resource_preferences/resource_identifier.rs similarity index 100% rename from crates/sargon-profile/src/v100/networks/network/resource_preferences/resource_identifier.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/resource_preferences/resource_identifier.rs diff --git a/crates/sargon-profile/src/v100/networks/network/resource_preferences/resource_preferences.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/resource_preferences/resource_preferences.rs similarity index 100% rename from crates/sargon-profile/src/v100/networks/network/resource_preferences/resource_preferences.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/resource_preferences/resource_preferences.rs diff --git a/crates/sargon-profile/src/v100/networks/network/resource_preferences/resource_visibility.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/resource_preferences/resource_visibility.rs similarity index 100% rename from crates/sargon-profile/src/v100/networks/network/resource_preferences/resource_visibility.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/resource_preferences/resource_visibility.rs diff --git a/crates/sargon-profile/src/v100/networks/profile_networks.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/networks/profile_networks.rs similarity index 100% rename from crates/sargon-profile/src/v100/networks/profile_networks.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/networks/profile_networks.rs diff --git a/crates/sargon-profile/src/v100/profile.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/profile.rs similarity index 100% rename from crates/sargon-profile/src/v100/profile.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/profile.rs diff --git a/crates/sargon-profile/src/v100/profile_file_contents.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/profile_file_contents.rs similarity index 100% rename from crates/sargon-profile/src/v100/profile_file_contents.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/profile_file_contents.rs diff --git a/crates/sargon-profile/src/v100/proto_profile_maybe_with_legacy_p2p_links.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/proto_profile_maybe_with_legacy_p2p_links.rs similarity index 100% rename from crates/sargon-profile/src/v100/proto_profile_maybe_with_legacy_p2p_links.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/proto_profile_maybe_with_legacy_p2p_links.rs diff --git a/crates/sargon-profile/src/v100/secured_entity_control/mod.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/secured_entity_control/mod.rs similarity index 100% rename from crates/sargon-profile/src/v100/secured_entity_control/mod.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/secured_entity_control/mod.rs diff --git a/crates/sargon-profile/src/v100/secured_entity_control/secured_entity_control.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/secured_entity_control/secured_entity_control.rs similarity index 100% rename from crates/sargon-profile/src/v100/secured_entity_control/secured_entity_control.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/secured_entity_control/secured_entity_control.rs diff --git a/crates/profile/models/security-structures/Cargo.toml b/crates/profile/models/security-structures/Cargo.toml new file mode 100644 index 000000000..380f46cf2 --- /dev/null +++ b/crates/profile/models/security-structures/Cargo.toml @@ -0,0 +1,30 @@ +[package] +name = "profile-security-structures" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === INTERNAL DEPENDENCIES === +identified-vec-of = { path = "../../../common/identified-vec-of" } +hierarchical-deterministic = { path = "../../../crypto/hd" } +factors = { path = "../../../factors/factors" } +has-sample-values = { path = "../../../core/has-sample-values" } +addresses = { path = "../../../crypto/addresses" } +next-derivation-index-ephemeral = { path = "../../../factors/next-derivation-index-ephemeral" } +network = { path = "../../../common/network" } +core-collections = { path = "../../../core/collections" } +time-utils = { path = "../../../core/time-utils" } +short-string = { path = "../../../common/short-string" } +sargon-core-utils = { path = "../../../core/utils" } + +# === RADIX DEPENDENCIES === +radix-engine-interface = { workspace = true } + +# === EXTERNAL DEPENDENCIES === +derive_more = { workspace = true } +enum-as-inner = { workspace = true } +log = { workspace = true } +pretty_assertions = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +thiserror = { workspace = true } diff --git a/crates/sargon-profile-security-structures/src/factor_list_kind.rs b/crates/profile/models/security-structures/src/factor_list_kind.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/factor_list_kind.rs rename to crates/profile/models/security-structures/src/factor_list_kind.rs diff --git a/crates/sargon-profile-security-structures/src/lib.rs b/crates/profile/models/security-structures/src/lib.rs similarity index 54% rename from crates/sargon-profile-security-structures/src/lib.rs rename to crates/profile/models/security-structures/src/lib.rs index c43d2f1ca..db91d4094 100644 --- a/crates/sargon-profile-security-structures/src/lib.rs +++ b/crates/profile/models/security-structures/src/lib.rs @@ -11,11 +11,16 @@ pub mod prelude { pub use crate::role_kind::*; pub use crate::roles_matrices_structures::*; + pub use addresses::prelude::*; + pub use core_collections::prelude::{Just, JustKV}; + pub use factors::prelude::*; + pub use has_sample_values::prelude::*; + pub use hierarchical_deterministic::prelude::*; + pub use identified_vec_of::prelude::*; + pub use network::prelude::*; pub use next_derivation_index_ephemeral::prelude::*; - pub use sargon_addresses::prelude::*; - pub use sargon_core::prelude::*; - pub use sargon_factors::prelude::*; - pub use sargon_hierarchical_deterministic::prelude::*; + pub use sargon_core_utils::prelude::*; + pub use short_string::prelude::*; pub(crate) use radix_engine_interface::{ blueprints::{ @@ -28,4 +33,15 @@ pub mod prelude { CompositeRequirement as ScryptoCompositeRequirement, }, }; + + pub(crate) use enum_as_inner::EnumAsInner; + pub(crate) use serde::{Deserialize, Serialize}; + #[cfg(test)] + pub(crate) use serde_json::json; + + pub(crate) use std::collections::HashSet; + + pub(crate) use std::str::FromStr; + + pub(crate) use std::sync::RwLock; } diff --git a/crates/sargon-profile-security-structures/src/role_kind.rs b/crates/profile/models/security-structures/src/role_kind.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/role_kind.rs rename to crates/profile/models/security-structures/src/role_kind.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/automatic_shield_builder/auto_build_outcome_for_testing.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/automatic_shield_builder/auto_build_outcome_for_testing.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/automatic_shield_builder/auto_build_outcome_for_testing.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/automatic_shield_builder/auto_build_outcome_for_testing.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/automatic_shield_builder/automatic_shield_builder.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/automatic_shield_builder/automatic_shield_builder.rs similarity index 99% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/automatic_shield_builder/automatic_shield_builder.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/automatic_shield_builder/automatic_shield_builder.rs index c2c8d1eec..3ef02f593 100644 --- a/crates/sargon-profile-security-structures/src/roles_matrices_structures/automatic_shield_builder/automatic_shield_builder.rs +++ b/crates/profile/models/security-structures/src/roles_matrices_structures/automatic_shield_builder/automatic_shield_builder.rs @@ -437,7 +437,6 @@ impl SecurityShieldBuilder { #[cfg(test)] mod tests { - use indexmap::IndexSet; use super::*; diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/automatic_shield_builder/factor_selector.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/automatic_shield_builder/factor_selector.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/automatic_shield_builder/factor_selector.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/automatic_shield_builder/factor_selector.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/automatic_shield_builder/mod.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/automatic_shield_builder/mod.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/automatic_shield_builder/mod.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/automatic_shield_builder/mod.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/automatic_shield_builder/proto_shield.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/automatic_shield_builder/proto_shield.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/automatic_shield_builder/proto_shield.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/automatic_shield_builder/proto_shield.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/automatic_shield_builder/quantity.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/automatic_shield_builder/quantity.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/automatic_shield_builder/quantity.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/automatic_shield_builder/quantity.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/general_role_with_hd_factor_instance_samples.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/general_role_with_hd_factor_instance_samples.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/general_role_with_hd_factor_instance_samples.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/general_role_with_hd_factor_instance_samples.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/has_role_kind.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/has_role_kind.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/has_role_kind.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/has_role_kind.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/abstract_matrix_builder_or_built.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/matrices/abstract_matrix_builder_or_built.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/abstract_matrix_builder_or_built.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/matrices/abstract_matrix_builder_or_built.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/builder/error.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/matrices/builder/error.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/builder/error.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/matrices/builder/error.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/builder/matrix_builder.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/matrices/builder/matrix_builder.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/builder/matrix_builder.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/matrices/builder/matrix_builder.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/builder/matrix_builder_unit_tests.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/matrices/builder/matrix_builder_unit_tests.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/builder/matrix_builder_unit_tests.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/matrices/builder/matrix_builder_unit_tests.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/builder/matrix_template.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/matrices/builder/matrix_template.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/builder/matrix_template.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/matrices/builder/matrix_template.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/builder/mod.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/matrices/builder/mod.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/builder/mod.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/matrices/builder/mod.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/matrix_of_factor_instances.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/matrices/matrix_of_factor_instances.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/matrix_of_factor_instances.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/matrices/matrix_of_factor_instances.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/matrix_of_factor_source_ids.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/matrices/matrix_of_factor_source_ids.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/matrix_of_factor_source_ids.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/matrices/matrix_of_factor_source_ids.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/matrix_of_factor_sources.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/matrices/matrix_of_factor_sources.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/matrix_of_factor_sources.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/matrices/matrix_of_factor_sources.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/mod.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/matrices/mod.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/mod.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/matrices/mod.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/mod.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/mod.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/mod.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/mod.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/abstract_role_builder_or_built.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/roles/abstract_role_builder_or_built.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/abstract_role_builder_or_built.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/roles/abstract_role_builder_or_built.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/builder/confirmation_roles_builder_unit_tests.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/roles/builder/confirmation_roles_builder_unit_tests.rs similarity index 99% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/builder/confirmation_roles_builder_unit_tests.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/roles/builder/confirmation_roles_builder_unit_tests.rs index 90e97ade9..65e3c1d32 100644 --- a/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/builder/confirmation_roles_builder_unit_tests.rs +++ b/crates/profile/models/security-structures/src/roles_matrices_structures/roles/builder/confirmation_roles_builder_unit_tests.rs @@ -1,6 +1,6 @@ #![cfg(test)] -use sargon_factors::FactorSourceKind; +use factors::FactorSourceKind; use crate::prelude::*; diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/builder/mod.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/roles/builder/mod.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/builder/mod.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/roles/builder/mod.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/builder/primary_roles_builder_unit_tests.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/roles/builder/primary_roles_builder_unit_tests.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/builder/primary_roles_builder_unit_tests.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/roles/builder/primary_roles_builder_unit_tests.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/builder/recovery_roles_builder_unit_tests.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/roles/builder/recovery_roles_builder_unit_tests.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/builder/recovery_roles_builder_unit_tests.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/roles/builder/recovery_roles_builder_unit_tests.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/builder/roles_builder.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/roles/builder/roles_builder.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/builder/roles_builder.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/roles/builder/roles_builder.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/builder/roles_builder_unit_tests.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/roles/builder/roles_builder_unit_tests.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/builder/roles_builder_unit_tests.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/roles/builder/roles_builder_unit_tests.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/confirmation_role_with_factor_instances.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/confirmation_role_with_factor_instances.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/confirmation_role_with_factor_instances.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/confirmation_role_with_factor_instances.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/general_role_with_hierarchical_deterministic_factor_instances.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/general_role_with_hierarchical_deterministic_factor_instances.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/general_role_with_hierarchical_deterministic_factor_instances.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/general_role_with_hierarchical_deterministic_factor_instances.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/mod.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/mod.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/mod.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/mod.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/primary_role_with_factor_instances.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/primary_role_with_factor_instances.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/primary_role_with_factor_instances.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/primary_role_with_factor_instances.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/recovery_role_with_factor_instances.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/recovery_role_with_factor_instances.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/recovery_role_with_factor_instances.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/recovery_role_with_factor_instances.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/role_into_scrypto_access_rule.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/role_into_scrypto_access_rule.rs similarity index 91% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/role_into_scrypto_access_rule.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/role_into_scrypto_access_rule.rs index 99c0e1330..ce8b1564e 100644 --- a/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/role_into_scrypto_access_rule.rs +++ b/crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/role_into_scrypto_access_rule.rs @@ -42,13 +42,3 @@ impl From for ScryptoRuleSet { } } } - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn number_of_minutes_per_day() { - assert_eq!(MINUTES_PER_DAY, 1440); - } -} diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/role_with_factor_instances.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/role_with_factor_instances.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/role_with_factor_instances.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_instance_level/role_with_factor_instances.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/confirmation_role_with_factor_source_ids.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/confirmation_role_with_factor_source_ids.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/confirmation_role_with_factor_source_ids.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/confirmation_role_with_factor_source_ids.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/mod.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/mod.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/mod.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/mod.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/primary_role_with_factor_source_ids.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/primary_role_with_factor_source_ids.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/primary_role_with_factor_source_ids.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/primary_role_with_factor_source_ids.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/recovery_role_with_factor_source_ids.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/recovery_role_with_factor_source_ids.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/recovery_role_with_factor_source_ids.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/recovery_role_with_factor_source_ids.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/roles_with_factor_ids.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/roles_with_factor_ids.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/roles_with_factor_ids.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_id_level/roles_with_factor_ids.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_kind_level/mod.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_kind_level/mod.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_kind_level/mod.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_kind_level/mod.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_kind_level/role_template.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_kind_level/role_template.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_kind_level/role_template.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_kind_level/role_template.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/confirmation_role_with_factor_sources.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/confirmation_role_with_factor_sources.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/confirmation_role_with_factor_sources.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/confirmation_role_with_factor_sources.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/mod.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/mod.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/mod.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/mod.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/primary_role_with_factor_sources.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/primary_role_with_factor_sources.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/primary_role_with_factor_sources.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/primary_role_with_factor_sources.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/recovery_role_with_factor_sources.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/recovery_role_with_factor_sources.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/recovery_role_with_factor_sources.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/recovery_role_with_factor_sources.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/roles_with_factor_sources.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/roles_with_factor_sources.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/roles_with_factor_sources.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/factor_source_level/roles_with_factor_sources.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/mod.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/mod.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/factor_levels/mod.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/roles/factor_levels/mod.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/mod.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/roles/mod.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/roles/mod.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/roles/mod.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/security_shield_builder.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/security_shield_builder.rs similarity index 99% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/security_shield_builder.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/security_shield_builder.rs index 0c8118f28..a1688130e 100644 --- a/crates/sargon-profile-security-structures/src/roles_matrices_structures/security_shield_builder.rs +++ b/crates/profile/models/security-structures/src/roles_matrices_structures/security_shield_builder.rs @@ -1,3 +1,5 @@ +use time_utils::now; + use crate::prelude::*; /// The mode of the shield builder, either `Lenient` or `Strict`, this has @@ -137,7 +139,7 @@ impl SecurityShieldBuilder { matrix_builder: RwLock::new(matrix_builder), name, authentication_signing_factor: RwLock::new(None), - shield_id: SecurityStructureID::from(id()), + shield_id: SecurityStructureID::from(Uuid::new_v4()), created_on: now(), } } @@ -803,7 +805,7 @@ mod tests { #[allow(clippy::mutable_key_type)] fn hash() { assert_eq!( - HashSet::from_iter([ + HashSet::::from_iter([ SUT::sample(), SUT::sample(), SUT::sample_other(), diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/security_shield_builder_invalid_reason.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/security_shield_builder_invalid_reason.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/security_shield_builder_invalid_reason.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/security_shield_builder_invalid_reason.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/security_shield_prerequisites_status.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/security_shield_prerequisites_status.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/security_shield_prerequisites_status.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/security_shield_prerequisites_status.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_id.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/security_structure_id.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_id.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/security_structure_id.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_metadata.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/security_structure_metadata.rs similarity index 98% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_metadata.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/security_structure_metadata.rs index 0dab0b0fb..e2cf4074b 100644 --- a/crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_metadata.rs +++ b/crates/profile/models/security-structures/src/roles_matrices_structures/security_structure_metadata.rs @@ -1,3 +1,5 @@ +use time_utils::now; + use crate::prelude::*; #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, Hash)] diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_of_factors/abstract_security_structure_of_factors.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/security_structure_of_factors/abstract_security_structure_of_factors.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_of_factors/abstract_security_structure_of_factors.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/security_structure_of_factors/abstract_security_structure_of_factors.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_of_factors/mod.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/security_structure_of_factors/mod.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_of_factors/mod.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/security_structure_of_factors/mod.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_of_factors/security_structure_of_factor_instances.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/security_structure_of_factors/security_structure_of_factor_instances.rs similarity index 99% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_of_factors/security_structure_of_factor_instances.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/security_structure_of_factors/security_structure_of_factor_instances.rs index 62794519a..48a745c75 100644 --- a/crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_of_factors/security_structure_of_factor_instances.rs +++ b/crates/profile/models/security-structures/src/roles_matrices_structures/security_structure_of_factors/security_structure_of_factor_instances.rs @@ -1,5 +1,3 @@ -use indexmap::IndexSet; - use crate::prelude::*; /// A structure of factors to use for certain roles, Primary, Recovery and diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_of_factors/security_structure_of_factor_source_ids.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/security_structure_of_factors/security_structure_of_factor_source_ids.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_of_factors/security_structure_of_factor_source_ids.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/security_structure_of_factors/security_structure_of_factor_source_ids.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_of_factors/security_structure_of_factor_sources.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/security_structure_of_factors/security_structure_of_factor_sources.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/security_structure_of_factors/security_structure_of_factor_sources.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/security_structure_of_factors/security_structure_of_factor_sources.rs diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/selected_factor_sources_status.rs b/crates/profile/models/security-structures/src/roles_matrices_structures/selected_factor_sources_status.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/roles_matrices_structures/selected_factor_sources_status.rs rename to crates/profile/models/security-structures/src/roles_matrices_structures/selected_factor_sources_status.rs diff --git a/crates/profile/models/supporting-types/Cargo.toml b/crates/profile/models/supporting-types/Cargo.toml new file mode 100644 index 000000000..071be2a6b --- /dev/null +++ b/crates/profile/models/supporting-types/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "profile-supporting-types" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +identified-vec-of = { path = "../../../common/identified-vec-of" } +hierarchical-deterministic = { path = "../../../crypto/hd" } +factors = { path = "../../../factors/factors" } +addresses = { path = "../../../crypto/addresses" } +profile = { path = "../../../profile/models/profile_SPLIT_ME" } + +# === RADIX DEPENDENCIES === +# None + +# === EXTERNAL DEPENDENCIES === +derive_more = { workspace = true } +enum-as-inner = { workspace = true } +itertools = { workspace = true } +pretty_assertions = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } diff --git a/crates/sargon-profile-supporting-types/src/abstract_securified_entity.rs b/crates/profile/models/supporting-types/src/abstract_securified_entity.rs similarity index 100% rename from crates/sargon-profile-supporting-types/src/abstract_securified_entity.rs rename to crates/profile/models/supporting-types/src/abstract_securified_entity.rs diff --git a/crates/sargon-profile-supporting-types/src/any_securified_entity.rs b/crates/profile/models/supporting-types/src/any_securified_entity.rs similarity index 100% rename from crates/sargon-profile-supporting-types/src/any_securified_entity.rs rename to crates/profile/models/supporting-types/src/any_securified_entity.rs diff --git a/crates/sargon-profile-supporting-types/src/assert_derivation_path.rs b/crates/profile/models/supporting-types/src/assert_derivation_path.rs similarity index 100% rename from crates/sargon-profile-supporting-types/src/assert_derivation_path.rs rename to crates/profile/models/supporting-types/src/assert_derivation_path.rs diff --git a/crates/sargon-profile-supporting-types/src/is_securified_entity.rs b/crates/profile/models/supporting-types/src/is_securified_entity.rs similarity index 100% rename from crates/sargon-profile-supporting-types/src/is_securified_entity.rs rename to crates/profile/models/supporting-types/src/is_securified_entity.rs diff --git a/crates/sargon-profile-supporting-types/src/lib.rs b/crates/profile/models/supporting-types/src/lib.rs similarity index 77% rename from crates/sargon-profile-supporting-types/src/lib.rs rename to crates/profile/models/supporting-types/src/lib.rs index 69b54f035..c8fbc7f80 100644 --- a/crates/sargon-profile-supporting-types/src/lib.rs +++ b/crates/profile/models/supporting-types/src/lib.rs @@ -19,9 +19,11 @@ pub mod prelude { pub use crate::unsecurified_entity::*; pub use crate::veci::*; - pub use sargon_core::prelude::*; - pub use sargon_hierarchical_deterministic::prelude::*; - pub use sargon_profile::prelude::*; + pub use hierarchical_deterministic::prelude::*; + pub use profile::prelude::*; + + pub(crate) use enum_as_inner::EnumAsInner; + pub(crate) use serde::{Deserialize, Serialize}; } pub use prelude::*; diff --git a/crates/sargon-profile-supporting-types/src/profile_state.rs b/crates/profile/models/supporting-types/src/profile_state.rs similarity index 100% rename from crates/sargon-profile-supporting-types/src/profile_state.rs rename to crates/profile/models/supporting-types/src/profile_state.rs diff --git a/crates/sargon-profile-supporting-types/src/securified_account.rs b/crates/profile/models/supporting-types/src/securified_account.rs similarity index 100% rename from crates/sargon-profile-supporting-types/src/securified_account.rs rename to crates/profile/models/supporting-types/src/securified_account.rs diff --git a/crates/sargon-profile-supporting-types/src/securified_persona.rs b/crates/profile/models/supporting-types/src/securified_persona.rs similarity index 100% rename from crates/sargon-profile-supporting-types/src/securified_persona.rs rename to crates/profile/models/supporting-types/src/securified_persona.rs diff --git a/crates/sargon-profile-supporting-types/src/unsecurified_entity.rs b/crates/profile/models/supporting-types/src/unsecurified_entity.rs similarity index 100% rename from crates/sargon-profile-supporting-types/src/unsecurified_entity.rs rename to crates/profile/models/supporting-types/src/unsecurified_entity.rs diff --git a/crates/sargon-profile-supporting-types/src/veci.rs b/crates/profile/models/supporting-types/src/veci.rs similarity index 100% rename from crates/sargon-profile-supporting-types/src/veci.rs rename to crates/profile/models/supporting-types/src/veci.rs diff --git a/crates/sargon-clients/Cargo.toml b/crates/sargon-clients/Cargo.toml deleted file mode 100644 index 940138843..000000000 --- a/crates/sargon-clients/Cargo.toml +++ /dev/null @@ -1,30 +0,0 @@ -[package] -name = "sargon-clients" -version = "1.1.99" -edition = "2021" - -[dependencies] -# === SARGON CRATES === -sargon-profile = { path = "../sargon-profile" } -sargon-profile-supporting-types = { path = "../sargon-profile-supporting-types" } -sargon-core = { path = "../sargon-core" } -sargon-factors-supporting-types = { path = "../sargon-factors-supporting-types" } -sargon-drivers = { path = "../sargon-drivers" } -http-client = { path = "../http-client" } -gateway-client-and-api = { path = "../gateway-client-and-api" } -sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } - -# === RADIX DEPENDENCIES === -# None - -# === EXTERNAL DEPENDENCIES === -async-trait = { workspace = true } -derive_more = { workspace = true } -enum-as-inner = { workspace = true } -pretty_assertions = { workspace = true } -serde = { workspace = true } -serde_json = { workspace = true } -serde_with = { workspace = true } - -[dev-dependencies] -actix-rt = { workspace = true } diff --git a/crates/sargon-clients/src/lib.rs b/crates/sargon-clients/src/lib.rs deleted file mode 100644 index 996a3a6b6..000000000 --- a/crates/sargon-clients/src/lib.rs +++ /dev/null @@ -1,14 +0,0 @@ -mod clients; - -pub mod prelude { - pub use gateway_client_and_api::prelude::*; - pub use sargon_factors_supporting_types::prelude::*; - pub use sargon_profile::prelude::*; - pub use sargon_profile_supporting_types::prelude::*; - - pub use crate::clients::*; - - pub use std::sync::Arc; -} - -pub use prelude::*; diff --git a/crates/sargon-core-utils/src/factory.rs b/crates/sargon-core-utils/src/factory.rs deleted file mode 100644 index 2ec7c50af..000000000 --- a/crates/sargon-core-utils/src/factory.rs +++ /dev/null @@ -1,45 +0,0 @@ -use crate::prelude::*; - -/// A JSON "stable" timestamp, that is to say, this has already been JSON -/// roundtripped, ensuring the same value will be decoded once encoded, this is -/// a bit hacky solution to the fact that `07:18:08.284647000Z` when encoded -/// and then decoded become `07:18:08.284000000Z` resulting in problems for -/// equality checks. -pub fn now() -> Timestamp { - let t = Timestamp::now_utc(); - let json = serde_json::to_vec(&t).unwrap(); - serde_json::from_slice(json.as_slice()).unwrap() -} - -pub fn id() -> Uuid { - Uuid::new_v4() -} - -pub fn iso8601(dt: &Timestamp) -> String { - let (h, m, s) = dt.as_hms(); - format!("{} {:02}:{:02}:{:02}", date(dt), h, m, s) -} - -pub fn date(dt: &Timestamp) -> String { - dt.date().to_string() -} - -#[cfg(test)] -mod tests { - use std::collections::BTreeSet; - - use crate::prelude::*; - - #[test] - fn id_unique() { - let n = 100; - let set = (0..n).map(|_| id()).collect::>(); - assert_eq!(set.len(), n); - } - - #[test] - fn date_str() { - assert_eq!(date(&Timestamp::UNIX_EPOCH), "1970-01-01"); - assert_eq!(iso8601(&Timestamp::UNIX_EPOCH), "1970-01-01 00:00:00"); - } -} diff --git a/crates/sargon-core/Cargo.toml b/crates/sargon-core/Cargo.toml deleted file mode 100644 index 844eda6bc..000000000 --- a/crates/sargon-core/Cargo.toml +++ /dev/null @@ -1,39 +0,0 @@ -[package] -name = "sargon-core" -version = "1.1.99" -edition = "2021" - -[dependencies] -identified-vec-of = { path = "../identified-vec-of" } -sargon-core-utils = { path = "../sargon-core-utils" } -sargon-core-error = { path = "../sargon-core-error" } -sargon-core-assert-json = { path = "../sargon-core-assert-json" } - -# ==== RADIX DEPENDENCIES ==== -radix-common = { workspace = true } -radix-engine-interface = { workspace = true } -radix-rust = { workspace = true } -radix-transactions = { workspace = true } - -# ==== EXTERNAL DEPENDENCIES ==== -aes-gcm = { workspace = true } -arraystring = { workspace = true } -delegate = { workspace = true } -derive_more = { workspace = true } -enum-as-inner = { workspace = true } -enum-iterator = { workspace = true } -hex = { workspace = true } -iota-crypto = { workspace = true } -k256 = { workspace = true } -log = { workspace = true } -paste = { workspace = true } -pretty_assertions = { workspace = true } -rand = { workspace = true } -serde = { workspace = true } -serde_json = { workspace = true } -serde_repr = { workspace = true } -serde_with = { workspace = true } -strum = { workspace = true } -url = { workspace = true } -uuid = { workspace = true } -zeroize = { workspace = true } diff --git a/crates/sargon-core/src/lib.rs b/crates/sargon-core/src/lib.rs deleted file mode 100644 index 4ebfc03d8..000000000 --- a/crates/sargon-core/src/lib.rs +++ /dev/null @@ -1,126 +0,0 @@ -#![allow(internal_features)] -#![feature(core_intrinsics)] -#![feature(trivial_bounds)] -#![allow(trivial_bounds)] - -mod appendable_collection; -mod encryption; -mod has_sample_values; -mod hash; -mod image_url_utils; -mod is_network_aware; -mod metadata; -mod network_id; -mod secure_random_bytes; -mod types; -mod unsafe_id_stepper; -mod unsigned_ints; - -pub fn parse_url(s: impl AsRef) -> Result { - Url::try_from(s.as_ref()).map_err(|_| CommonError::InvalidURL { - bad_value: s.as_ref().to_owned(), - }) -} - -pub mod prelude { - pub use identified_vec_of::prelude::*; - pub use sargon_core_utils::prelude::*; - - pub use crate::appendable_collection::*; - pub use crate::encryption::*; - pub use crate::has_sample_values::*; - pub use crate::hash::*; - pub use crate::image_url_utils::*; - pub use crate::is_network_aware::*; - pub use crate::metadata::*; - pub use crate::network_id::*; - pub use crate::secure_random_bytes::*; - pub use crate::types::*; - pub use crate::unsafe_id_stepper::*; - pub use crate::unsigned_ints::*; - - pub use radix_rust::prelude::{ - indexmap, BTreeSet, HashMap, HashSet, IndexMap, IndexSet, - }; - pub use std::marker::PhantomData; - - pub use ::hex::decode as hex_decode; - pub use ::hex::encode as hex_encode; - pub use log::{debug, error, info, trace, warn}; - pub use serde::{ - de, ser::SerializeStruct, Deserialize, Deserializer, Serialize, - Serializer, - }; - pub use serde_json::json; - pub use serde_repr::{Deserialize_repr, Serialize_repr}; - pub use serde_with::*; - pub use zeroize::{Zeroize, ZeroizeOnDrop}; - - pub use derive_more::derive::{AsRef, Debug as MoreDebug, Deref, Display}; - - pub use std::cell::RefCell; - pub use std::cmp::Ordering; - pub use std::collections::BTreeMap; - pub use std::fmt::{Debug, Display, Formatter}; - pub use std::fs; - pub use std::hash::Hash as StdHash; - pub use std::ops::{Add, AddAssign, Deref, Div, Mul, Neg, Sub}; - pub use std::str::FromStr; - pub use std::sync::{Arc, RwLock}; - - pub use strum::FromRepr; - pub use strum::IntoEnumIterator; - pub use url::Url; - pub use uuid::Uuid; - - pub use enum_as_inner::EnumAsInner; - pub use paste::*; - - pub(crate) use radix_common::{ - crypto::{ - blake2b_256_hash, verify_ed25519 as scrypto_verify_ed25519, - verify_secp256k1 as scrypto_verify_secp256k1, - Ed25519PrivateKey as ScryptoEd25519PrivateKey, - Ed25519PublicKey as ScryptoEd25519PublicKey, - Ed25519Signature as ScryptoEd25519Signature, Hash as ScryptoHash, - IsHash as ScryptoIsHash, PublicKey as ScryptoPublicKey, - Secp256k1PrivateKey as ScryptoSecp256k1PrivateKey, - Secp256k1PublicKey as ScryptoSecp256k1PublicKey, - Secp256k1Signature as ScryptoSecp256k1Signature, - }, - data::scrypto::model::BytesNonFungibleLocalId as ScryptoBytesNonFungibleLocalId, - math::{ - traits::CheckedMul as ScryptoCheckedMul, - Decimal as ScryptoDecimal192, RoundingMode as ScryptoRoundingMode, - }, - network::NetworkDefinition as ScryptoNetworkDefinition, - prelude::Instant as ScryptoInstant, - }; - - pub(crate) use radix_engine_interface::prelude::{ - Epoch as ScryptoEpoch, MetadataValue as ScryptoMetadataValue, - ToMetadataEntry as ScryptoToMetadataEntry, - }; - - pub use radix_transactions::model::{ - SignatureV1 as ScryptoSignature, - SignatureWithPublicKeyV1 as ScryptoSignatureWithPublicKey, - }; -} - -pub use prelude::*; - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_parse_url() { - assert!(parse_url("https://radixdlt.com").is_ok()); - } - - #[test] - fn test_parse_url_invalid() { - assert!(parse_url("https/radixdlt").is_err()); - } -} diff --git a/crates/sargon-core/src/types/logged_result.rs b/crates/sargon-core/src/types/logged_result.rs deleted file mode 100644 index df69922f5..000000000 --- a/crates/sargon-core/src/types/logged_result.rs +++ /dev/null @@ -1,54 +0,0 @@ -use crate::prelude::*; - -pub trait LoggedResult: Sized { - fn log_lvl_formatted(self, level: log::Level, format: F) -> Self - where - F: FnOnce(&T) -> String; - - fn log_lvl(self, level: log::Level, prefix: impl AsRef) -> Self { - self.log_lvl_formatted(level, |f| { - format!("{} - {:?}", prefix.as_ref(), f.non_sensitive()) - }) - } - fn log_info(self, prefix: impl AsRef) -> Self { - self.log_lvl(log::Level::Info, prefix) - } -} - -impl LoggedResult for Result { - fn log_lvl_formatted(self, level: log::Level, format: F) -> Self - where - F: FnOnce(&T) -> String, - { - self.inspect(|x| log::log!(level, "{}", format(x))) - .inspect_err(|e| log::error!("Err: {}", e)) - } -} - -#[cfg(test)] -mod tests { - use crate::prelude::*; - - #[test] - fn error() { - #[derive(PartialEq, Debug)] - struct Foo { - value: u8, - } - impl SafeToLog for Foo { - fn non_sensitive(&self) -> impl std::fmt::Debug { - "bar" - } - } - // should not change error - assert_eq!( - Err::(CommonError::Unknown).log_info("test Err"), - Err(CommonError::Unknown) - ); - // should not change value - assert_eq!( - Ok::(Foo { value: 42 }).log_info("test Ok"), - Ok(Foo { value: 42 }) - ); - } -} diff --git a/crates/sargon-core/src/types/mod.rs b/crates/sargon-core/src/types/mod.rs deleted file mode 100644 index 651f444cf..000000000 --- a/crates/sargon-core/src/types/mod.rs +++ /dev/null @@ -1,57 +0,0 @@ -mod appearance_id; -mod bag_of_bytes; -mod bool_type; -mod collections; -mod decimal192; -mod display_name; -mod email_address; -mod entity_kind; -mod epoch; -mod exactly_n_bytes; -mod hidden_constructor; -mod host_info; -mod instant; -mod intent_discriminator; -mod keys; -mod locale_config; -mod logged_result; -mod non_empty_max_n_bytes; -mod nonce; -mod requested_number_quantifier; -mod requested_quantity; -mod rounding_mode; -mod safe_to_log; -mod secret_bytes; -mod short_string; -mod signatures; -mod vector_image_type; -mod version_type; - -pub use appearance_id::*; -pub use bag_of_bytes::*; -pub(crate) use bool_type::*; -pub use collections::*; -pub use decimal192::*; -pub use display_name::*; -pub use email_address::*; -pub use entity_kind::*; -pub use epoch::*; -pub use exactly_n_bytes::*; -pub use hidden_constructor::*; -pub use host_info::*; -pub use instant::*; -pub use intent_discriminator::*; -pub use keys::*; -pub use locale_config::*; -pub use logged_result::*; -pub use non_empty_max_n_bytes::*; -pub use nonce::*; -pub use requested_number_quantifier::*; -pub use requested_quantity::*; -pub use rounding_mode::*; -pub use safe_to_log::*; -pub use secret_bytes::*; -pub use short_string::*; -pub use signatures::*; -pub use vector_image_type::*; -pub(crate) use version_type::*; diff --git a/crates/sargon-core/src/types/safe_to_log.rs b/crates/sargon-core/src/types/safe_to_log.rs deleted file mode 100644 index 490a18b76..000000000 --- a/crates/sargon-core/src/types/safe_to_log.rs +++ /dev/null @@ -1,9 +0,0 @@ -/// A trait used to mark that a values is safe to (debug) log, and -/// which debug representation of it to use. -/// -/// You MUST NOT return sensitive information by implementing types, -/// e.g. PrivateKeys or Mnemonics. -pub trait SafeToLog { - /// A safe to log representation of a type, MUST NOT contains sensitive information. - fn non_sensitive(&self) -> impl std::fmt::Debug; -} diff --git a/crates/sargon-drivers/src/lib.rs b/crates/sargon-drivers/src/lib.rs deleted file mode 100644 index 3644e690e..000000000 --- a/crates/sargon-drivers/src/lib.rs +++ /dev/null @@ -1,17 +0,0 @@ -#![feature(let_chains)] - -mod drivers; - -pub mod prelude { - pub(crate) use sargon_addresses::prelude::*; - pub(crate) use sargon_core::prelude::*; - pub(crate) use sargon_hierarchical_deterministic::prelude::*; - pub(crate) use sargon_profile::prelude::*; - pub(crate) use sargon_profile_supporting_types::prelude::*; - - pub use crate::drivers::*; - - pub(crate) use enum_iterator::*; -} - -pub use prelude::*; diff --git a/crates/sargon-factor-instances-provider/Cargo.toml b/crates/sargon-factor-instances-provider/Cargo.toml deleted file mode 100644 index 73c2d5bfa..000000000 --- a/crates/sargon-factor-instances-provider/Cargo.toml +++ /dev/null @@ -1,31 +0,0 @@ -[package] -name = "sargon-factor-instances-provider" -version = "1.1.99" -edition = "2021" - -[dependencies] -# === SARGON CRATES === -identified-vec-of = { path = "../identified-vec-of" } -sargon-core-assert-json = { path = "../sargon-core-assert-json" } -sargon-core-utils = { path = "../sargon-core-utils" } -sargon-core-error = { path = "../sargon-core-error" } -sargon-core = { path = "../sargon-core" } -sargon-factors = { path = "../sargon-factors" } -sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } -sargon-keys-collector = { path = "../sargon-keys-collector" } -sargon-addresses = { path = "../sargon-addresses" } -sargon-profile = { path = "../sargon-profile" } -sargon-profile-logic = { path = "../sargon-profile-logic" } -sargon-clients = { path = "../sargon-clients" } -sargon-profile-supporting-types = { path = "../sargon-profile-supporting-types" } -next-derivation-index-ephemeral = { path = "../next-derivation-index-ephemeral" } - -# ==== RADIX DEPENDENCIES ==== -# None - -# ==== EXTERNAL DEPENDENCIES ==== -derive_more = { workspace = true } -futures = { workspace = true } - -[dev-dependencies] -actix-rt = { workspace = true } diff --git a/crates/sargon-factor-instances-provider/src/lib.rs b/crates/sargon-factor-instances-provider/src/lib.rs deleted file mode 100644 index 45e19cb41..000000000 --- a/crates/sargon-factor-instances-provider/src/lib.rs +++ /dev/null @@ -1,17 +0,0 @@ -mod next_index_assigner; -mod provider; -mod types; - -pub mod prelude { - pub(crate) use identified_vec_of::prelude::*; - pub(crate) use sargon_addresses::prelude::*; - pub(crate) use sargon_clients::prelude::*; - pub(crate) use sargon_keys_collector::prelude::*; - pub(crate) use sargon_profile_logic::prelude::*; - - pub use crate::next_index_assigner::*; - pub use crate::provider::*; - pub use crate::types::*; -} - -pub use prelude::*; diff --git a/crates/sargon-factors-supporting-types/Cargo.toml b/crates/sargon-factors-supporting-types/Cargo.toml deleted file mode 100644 index b37d2c5b7..000000000 --- a/crates/sargon-factors-supporting-types/Cargo.toml +++ /dev/null @@ -1,18 +0,0 @@ -[package] -name = "sargon-factors-supporting-types" -version = "1.1.99" -edition = "2021" - -[dependencies] -# ==== INTERNAL DEPENDENCIES ==== -identified-vec-of = { path = "../identified-vec-of" } -sargon-core = { path = "../sargon-core" } -sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } -sargon-factors = { path = "../sargon-factors" } - - -# === RADIX DEPENDENCIES === -# None - -# === EXTERNAL DEPENDENCIES === -async-trait = { workspace = true } diff --git a/crates/sargon-factors-supporting-types/src/lib.rs b/crates/sargon-factors-supporting-types/src/lib.rs deleted file mode 100644 index 95951ab18..000000000 --- a/crates/sargon-factors-supporting-types/src/lib.rs +++ /dev/null @@ -1,11 +0,0 @@ -mod mnemonic_loading; - -pub mod prelude { - pub use crate::mnemonic_loading::*; - - pub(crate) use sargon_core::prelude::*; - pub(crate) use sargon_factors::prelude::*; - pub(crate) use sargon_hierarchical_deterministic::prelude::*; -} - -pub use prelude::*; diff --git a/crates/sargon-factors/Cargo.toml b/crates/sargon-factors/Cargo.toml deleted file mode 100644 index 95d9ec6da..000000000 --- a/crates/sargon-factors/Cargo.toml +++ /dev/null @@ -1,27 +0,0 @@ -[package] -name = "sargon-factors" -version = "1.1.99" -edition = "2021" -build = "build.rs" - -[dependencies] -# ==== INTERNAL DEPENDENCIES ==== -identified-vec-of = { path = "../identified-vec-of" } -sargon-core = { path = "../sargon-core" } -sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } - -# ==== RADIX DEPENDENCIES ==== -radix-common = { workspace = true } -radix-engine-interface = { workspace = true } - -# ==== EXTERNAL DEPENDENCIES ==== -derive_more = { workspace = true } -enum-iterator = { workspace = true } -hkdf = { workspace = true } -iota-crypto = { workspace = true } -k256 = { workspace = true } -once_cell = { workspace = true } -serde = { workspace = true } -serde_json = { workspace = true } -serde_with = { workspace = true } -zeroize = { workspace = true } diff --git a/crates/sargon-hierarchical-deterministic/src/lib.rs b/crates/sargon-hierarchical-deterministic/src/lib.rs deleted file mode 100644 index 2c179dc52..000000000 --- a/crates/sargon-hierarchical-deterministic/src/lib.rs +++ /dev/null @@ -1,24 +0,0 @@ -#![feature(let_chains)] - -mod bip32; -mod bip39; -mod bip44; -mod cap26; -mod derivation; - -mod has_key_kind; - -pub mod prelude { - pub(crate) use sargon_core::prelude::*; - - pub use crate::bip32::*; - pub use crate::bip39::*; - pub use crate::bip44::*; - pub use crate::cap26::*; - pub use crate::derivation::*; - pub use crate::has_key_kind::*; - - pub use radix_common::crypto::IsHash as ScryptoIsHash; -} - -pub use prelude::*; diff --git a/crates/sargon-keys-collector/Cargo.toml b/crates/sargon-keys-collector/Cargo.toml deleted file mode 100644 index 6bd8abeba..000000000 --- a/crates/sargon-keys-collector/Cargo.toml +++ /dev/null @@ -1,21 +0,0 @@ -[package] -name = "sargon-keys-collector" -version = "1.1.99" -edition = "2021" - -[dependencies] -# === SARGON CRATES === -sargon-core = { path = "../sargon-core" } -sargon-factors = { path = "../sargon-factors" } -sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } -sargon-addresses = { path = "../sargon-addresses" } -sargon-factors-supporting-types = { path = "../sargon-factors-supporting-types" } - -# === RADIX DEPENDENCIES === -# None - -# === EXTERNAL DEPENDENCIES === -actix-rt = { workspace = true } -async-trait = { workspace = true } -derive_more = { workspace = true } -log = { workspace = true } diff --git a/crates/sargon-keys-collector/src/lib.rs b/crates/sargon-keys-collector/src/lib.rs deleted file mode 100644 index 66bdb1307..000000000 --- a/crates/sargon-keys-collector/src/lib.rs +++ /dev/null @@ -1,27 +0,0 @@ -#![feature(async_closure)] - -mod collector; -mod host_interaction; - -#[cfg(test)] -mod tests; - -mod derivation_testing; - -#[cfg(test)] -pub(crate) use tests::*; - -pub mod prelude { - - pub(crate) use sargon_addresses::prelude::*; - pub(crate) use sargon_core::prelude::*; - pub(crate) use sargon_factors::prelude::*; - pub(crate) use sargon_factors_supporting_types::prelude::*; - pub(crate) use sargon_hierarchical_deterministic::prelude::*; - - pub use crate::collector::*; - pub use crate::derivation_testing::*; - pub use crate::host_interaction::*; -} - -pub use prelude::*; diff --git a/crates/sargon-manifests/Cargo.toml b/crates/sargon-manifests/Cargo.toml deleted file mode 100644 index a71118c8c..000000000 --- a/crates/sargon-manifests/Cargo.toml +++ /dev/null @@ -1,35 +0,0 @@ -[package] -name = "sargon-manifests" -version = "1.1.99" -edition = "2021" -build = "build.rs" - -[dependencies] -# === SARGON CRATES === -sargon-core = { path = "../sargon-core" } -sargon-core-utils = { path = "../sargon-core-utils" } -identified-vec-of = { path = "../identified-vec-of" } -sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } -sargon-factors = { path = "../sargon-factors" } -sargon-addresses = { path = "../sargon-addresses" } -sargon-transaction-models = { path = "../sargon-transaction-models" } -gateway-models = { path = "../gateway-models" } -sargon-profile = { path = "../sargon-profile" } - -# === RADIX DEPENDENCIES === -radix-common = { workspace = true } -radix-engine = { workspace = true } -radix-engine-interface = { workspace = true } -radix-engine-toolkit = { workspace = true } -radix-rust = { workspace = true } -radix-transactions = { workspace = true } -sbor = { workspace = true } - -# === EXTERNAL DEPENDENCIES === -derive_more = { workspace = true } -pretty_assertions = { workspace = true } -serde = { workspace = true } -serde_json = { workspace = true } - -[build-dependencies] -cargo_toml = { workspace = true } diff --git a/crates/sargon-profile-app-preferences/Cargo.toml b/crates/sargon-profile-app-preferences/Cargo.toml deleted file mode 100644 index c4d49fcb3..000000000 --- a/crates/sargon-profile-app-preferences/Cargo.toml +++ /dev/null @@ -1,24 +0,0 @@ -[package] -name = "sargon-profile-app-preferences" -version = "1.1.99" -edition = "2021" - -[dependencies] -# === INTERNAL DEPENDENCIES === -sargon-core = { path = "../sargon-core" } -identified-vec-of = { path = "../identified-vec-of" } -sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } -sargon-factors = { path = "../sargon-factors" } -sargon-keys-collector = { path = "../sargon-keys-collector" } -sargon-addresses = { path = "../sargon-addresses" } -sargon-transaction-models = { path = "../sargon-transaction-models" } -sargon-profile-gateway = { path = "../sargon-profile-gateway" } -sargon-profile-security-structures = { path = "../sargon-profile-security-structures" } - -# === RADIX DEPENDENCIES === -# None - -# === EXTERNAL DEPENDENCIES === -derive_more = { workspace = true } -serde = { workspace = true } -serde_json = { workspace = true } \ No newline at end of file diff --git a/crates/sargon-profile-gateway/Cargo.toml b/crates/sargon-profile-gateway/Cargo.toml deleted file mode 100644 index 617ff06cf..000000000 --- a/crates/sargon-profile-gateway/Cargo.toml +++ /dev/null @@ -1,22 +0,0 @@ -[package] -name = "sargon-profile-gateway" -version = "1.1.99" -edition = "2021" - -[dependencies] -# === INTERNAL DEPENDENCIES === -sargon-core = { path = "../sargon-core" } -identified-vec-of = { path = "../identified-vec-of" } -sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } -sargon-factors = { path = "../sargon-factors" } -sargon-keys-collector = { path = "../sargon-keys-collector" } -sargon-addresses = { path = "../sargon-addresses" } -sargon-transaction-models = { path = "../sargon-transaction-models" } - -# === RADIX DEPENDENCIES === -# None - -# === EXTERNAL DEPENDENCIES === -derive_more = { workspace = true } -serde = { workspace = true } -serde_json = { workspace = true } diff --git a/crates/sargon-profile-gateway/src/lib.rs b/crates/sargon-profile-gateway/src/lib.rs deleted file mode 100644 index 7740fdc76..000000000 --- a/crates/sargon-profile-gateway/src/lib.rs +++ /dev/null @@ -1,13 +0,0 @@ -mod gateway; -mod network_definition; -mod saved_gateways; - -pub mod prelude { - pub use crate::gateway::*; - pub use crate::network_definition::*; - pub use crate::saved_gateways::*; - - pub(crate) use sargon_core::prelude::*; -} - -pub use prelude::*; diff --git a/crates/sargon-profile-logic/Cargo.toml b/crates/sargon-profile-logic/Cargo.toml deleted file mode 100644 index 06e35773b..000000000 --- a/crates/sargon-profile-logic/Cargo.toml +++ /dev/null @@ -1,24 +0,0 @@ -[package] -name = "sargon-profile-logic" -version = "1.1.99" -edition = "2021" - -[dependencies] -# === SARGON CRATES === -sargon-core = { path = "../sargon-core" } -identified-vec-of = { path = "../identified-vec-of" } -sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } -sargon-factors = { path = "../sargon-factors" } -sargon-addresses = { path = "../sargon-addresses" } -sargon-profile = { path = "../sargon-profile" } -sargon-profile-supporting-types = { path = "../sargon-profile-supporting-types" } - -# === RADIX DEPENDENCIES === -# None - -# === EXTERNAL DEPENDENCIES === -derive_more = { workspace = true } -itertools = { workspace = true } -pretty_assertions = { workspace = true } -serde = { workspace = true } -serde_json = { workspace = true } diff --git a/crates/sargon-profile-logic/src/lib.rs b/crates/sargon-profile-logic/src/lib.rs deleted file mode 100644 index fd9201baf..000000000 --- a/crates/sargon-profile-logic/src/lib.rs +++ /dev/null @@ -1,13 +0,0 @@ -mod logic; -mod tests; - -pub mod prelude { - pub use crate::logic::*; - - pub use sargon_profile::prelude::*; - pub use sargon_profile_supporting_types::prelude::*; - - pub use itertools::*; -} - -pub use prelude::*; diff --git a/crates/sargon-profile-security-structures/Cargo.toml b/crates/sargon-profile-security-structures/Cargo.toml deleted file mode 100644 index bd4c86664..000000000 --- a/crates/sargon-profile-security-structures/Cargo.toml +++ /dev/null @@ -1,23 +0,0 @@ -[package] -name = "sargon-profile-security-structures" -version = "1.1.99" -edition = "2021" - -[dependencies] -# === INTERNAL DEPENDENCIES === -sargon-core = { path = "../sargon-core" } -identified-vec-of = { path = "../identified-vec-of" } -sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } -sargon-factors = { path = "../sargon-factors" } -sargon-addresses = { path = "../sargon-addresses" } -next-derivation-index-ephemeral = { path = "../next-derivation-index-ephemeral" } - -# === RADIX DEPENDENCIES === -radix-engine-interface = { workspace = true } - -# === EXTERNAL DEPENDENCIES === -derive_more = { workspace = true } -enum-as-inner = { workspace = true } -pretty_assertions = { workspace = true } -serde = { workspace = true } -thiserror = { workspace = true } \ No newline at end of file diff --git a/crates/sargon-profile-supporting-types/Cargo.toml b/crates/sargon-profile-supporting-types/Cargo.toml deleted file mode 100644 index d5b31c4f5..000000000 --- a/crates/sargon-profile-supporting-types/Cargo.toml +++ /dev/null @@ -1,23 +0,0 @@ -[package] -name = "sargon-profile-supporting-types" -version = "1.1.99" -edition = "2021" - -[dependencies] -# === SARGON CRATES === -sargon-core = { path = "../sargon-core" } -identified-vec-of = { path = "../identified-vec-of" } -sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } -sargon-factors = { path = "../sargon-factors" } -sargon-addresses = { path = "../sargon-addresses" } -sargon-profile = { path = "../sargon-profile" } - -# === RADIX DEPENDENCIES === -# None - -# === EXTERNAL DEPENDENCIES === -derive_more = { workspace = true } -itertools = { workspace = true } -pretty_assertions = { workspace = true } -serde = { workspace = true } -serde_json = { workspace = true } diff --git a/crates/sargon-profile/Cargo.toml b/crates/sargon-profile/Cargo.toml deleted file mode 100644 index 3a3efb1b9..000000000 --- a/crates/sargon-profile/Cargo.toml +++ /dev/null @@ -1,35 +0,0 @@ -[package] -name = "sargon-profile" -version = "1.1.99" -edition = "2021" -build = "build.rs" - -[dependencies] -# === INTERNAL DEPENDENCIES === -sargon-core = { path = "../sargon-core" } -identified-vec-of = { path = "../identified-vec-of" } -sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } -sargon-factors = { path = "../sargon-factors" } -sargon-keys-collector = { path = "../sargon-keys-collector" } -sargon-addresses = { path = "../sargon-addresses" } -sargon-transaction-models = { path = "../sargon-transaction-models" } -sargon-profile-app-preferences = { path = "../sargon-profile-app-preferences" } -sargon-profile-security-structures = { path = "../sargon-profile-security-structures" } - -# === RADIX DEPENDENCIES === -# None - -# === EXTERNAL DEPENDENCIES === -derive_more = { workspace = true } -enum-iterator = { workspace = true } -hkdf = { workspace = true } -k256 = { workspace = true } -once_cell = { workspace = true } -pretty_assertions = { workspace = true } -serde = { workspace = true } -serde_json = { workspace = true } -serde_repr = { workspace = true } -strum = { workspace = true } - -[build-dependencies] -cargo_toml = { workspace = true } diff --git a/crates/sargon-profile/src/encrypted/mod.rs b/crates/sargon-profile/src/encrypted/mod.rs deleted file mode 100644 index 544e43b22..000000000 --- a/crates/sargon-profile/src/encrypted/mod.rs +++ /dev/null @@ -1,9 +0,0 @@ -mod encrypted_profile; -mod key_derivation; -mod pb_hkdf_sha256; -mod versioned_algorithm; - -pub use encrypted_profile::*; -pub use key_derivation::*; -pub use pb_hkdf_sha256::*; -pub use versioned_algorithm::*; diff --git a/crates/sargon-profile/src/lib.rs b/crates/sargon-profile/src/lib.rs deleted file mode 100644 index acad24e95..000000000 --- a/crates/sargon-profile/src/lib.rs +++ /dev/null @@ -1,28 +0,0 @@ -#![allow(trivial_bounds)] -#![allow(incomplete_features)] -#![feature(trivial_bounds)] -#![feature(let_chains)] -#![feature(generic_const_exprs)] - -mod encrypted; -mod profilesnapshot_version; -mod samples; -mod supporting_types; -mod v100; - -pub mod prelude { - - pub use identified_vec_of::prelude::*; - pub use sargon_addresses::prelude::*; - pub use sargon_core::prelude::*; - pub use sargon_factors::prelude::*; - pub use sargon_hierarchical_deterministic::prelude::*; - pub use sargon_profile_app_preferences::prelude::*; - pub use sargon_transaction_models::prelude::*; - - pub use crate::encrypted::*; - pub use crate::profilesnapshot_version::*; - pub use crate::samples::*; - pub use crate::supporting_types::*; - pub use crate::v100::*; -} diff --git a/crates/sargon-transaction-models/Cargo.toml b/crates/sargon-transaction-models/Cargo.toml deleted file mode 100644 index 0aa7d7c93..000000000 --- a/crates/sargon-transaction-models/Cargo.toml +++ /dev/null @@ -1,36 +0,0 @@ -[package] -name = "sargon-transaction-models" -version = "1.1.99" -edition = "2021" -build = "build.rs" - -[dependencies] -# === SARGON CRATES === -sargon-core = { path = "../sargon-core" } -identified-vec-of = { path = "../identified-vec-of" } -sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } -sargon-factors = { path = "../sargon-factors" } -sargon-addresses = { path = "../sargon-addresses" } - -# === RADIX DEPENDENCIES === -radix-common = { workspace = true } -radix-common-derive = { workspace = true } -radix-engine = { workspace = true } -radix-engine-interface = { workspace = true } -radix-engine-toolkit = { workspace = true } -radix-engine-toolkit-common = { workspace = true } -radix-rust = { workspace = true } -radix-transactions = { workspace = true } -sbor = { workspace = true } - -# === EXTERNAL DEPENDENCIES === -derive_more = { workspace = true } -enum-iterator = { workspace = true } -pretty_assertions = { workspace = true } -serde = { workspace = true } -serde_json = { workspace = true } -serde_with = { workspace = true } - - -[build-dependencies] -cargo_toml = { workspace = true } diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/.DS_Store b/crates/sargon-uniffi/src/hierarchical_deterministic/.DS_Store deleted file mode 100644 index c0b35c89d0681b1f3ace6d65f7544039ccdb11b5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKI|>3Z5S{S@f{mqRt{`}TAbJ8XAR>q$DuUKqc`lFUn@_VWc3LQJVDgg5yo9`B zXGcVIaof#ACL%I|8_L6muGzkM$9fr2ARK4R@9XR7cs}hrx$gqT9m-Y?a*=t9Z#y(9 zKn17(6`%rC;L{3Zg&mDQeK60X0#xAV6|nC^fg9GuCeS|}7`z1l4iI+3+i0p zHi3x1G^oI!YPJ{}bi_;M)x;(+=%U$tXx^;Zp{U=E^NXj8)5qCO}KLe%, since Box is not UniFFI compatible. -pub enum OwnedOrThirdPartyAccountAddress { - OwnedAccount { value: AccountAddress }, - ThirdPartyAccount { value: AccountAddress }, -} - -#[uniffi::export] -pub fn new_account_or_address_of_sample() -> OwnedOrThirdPartyAccountAddress { - InternalOwnedOrThirdPartyAccountAddress::sample().into() -} - -#[uniffi::export] -pub fn new_account_or_address_of_sample_other( -) -> OwnedOrThirdPartyAccountAddress { - InternalOwnedOrThirdPartyAccountAddress::sample_other().into() -} - -#[uniffi::export] -pub fn account_or_address_of_account_address( - recipient: &OwnedOrThirdPartyAccountAddress, -) -> AccountAddress { - (*recipient.into_internal().account_address()).into() -} diff --git a/crates/sargon/.DS_Store b/crates/sargon/.DS_Store deleted file mode 100644 index 91a7914c43115676172e50edb6eca094365f09c9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKI|>3p3{6x-u(7n9D|mxJ^aNhOFE)bUr{BtRc{E=>2(sD;Hu3_=o5|$Ovai@| zL`0|8?L=fGA_KUg+$^-s&dpoa$&3QwxML@m?Rj%pACHGt_4|Zz`*M+$oMit6|NX7Z zQUNMJ1*iZOpaP#1u-*$B3z>WZy# WUK5)@rz7ulAb$o-7aA4#wE_?MTosrA diff --git a/crates/sargon/src/needs_a_new_home_dumping_ground/mod.rs b/crates/sargon/src/needs_a_new_home_dumping_ground/mod.rs deleted file mode 100644 index 23196acfc..000000000 --- a/crates/sargon/src/needs_a_new_home_dumping_ground/mod.rs +++ /dev/null @@ -1 +0,0 @@ -mod diagnose_instance_duplicates; diff --git a/crates/sargon/target/.DS_Store b/crates/sargon/target/.DS_Store deleted file mode 100644 index 3de12f59c6aa4c63e89ce67909b463ea522b1d09..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeH~JqiLr422W55Nx)zoW=uqgF*BJUO?1RQBeCix-UO0xLS+I3nXtQo3QLx>`X*N zSC8XTq!W=T+*B482Bz4L6{B2P4ZM@V^S+P^5+DH*AOR8}fuA8@ z=QeCQ3uPn$5+H$|fc+l|+_a{)Q2%ux_y_=+O1lkIJ+4?ei?Z%dD*%9O~r=FP8vp>?oeY-SE8F0$NjBC^9f!1RMhc34E2n6IKQh Ad;kCd diff --git a/crates/sargon/Cargo.toml b/crates/sargon_SPLIT_ME/Cargo.toml similarity index 57% rename from crates/sargon/Cargo.toml rename to crates/sargon_SPLIT_ME/Cargo.toml index 5619052f7..48acf9e70 100644 --- a/crates/sargon/Cargo.toml +++ b/crates/sargon_SPLIT_ME/Cargo.toml @@ -12,22 +12,25 @@ crate-type = ["staticlib", "cdylib", "lib"] [dependencies] # === SARGON CRATES === -sargon-core = { path = "../sargon-core" } -identified-vec-of = { path = "../identified-vec-of" } -sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } -sargon-factors = { path = "../sargon-factors" } -sargon-keys-collector = { path = "../sargon-keys-collector" } -sargon-addresses = { path = "../sargon-addresses" } -sargon-transaction-models = { path = "../sargon-transaction-models" } -sargon-manifests = { path = "../sargon-manifests" } -sargon-profile = { path = "../sargon-profile" } -sargon-profile-logic = { path = "../sargon-profile-logic" } -sargon-profile-security-structures = { path = "../sargon-profile-security-structures" } -sargon-factor-instances-provider = { path = "../sargon-factor-instances-provider" } -gateway-models = { path = "../gateway-models" } -sargon-clients = { path = "../sargon-clients" } -sargon-drivers = { path = "../sargon-drivers" } -gateway-client-and-api = { path = "../gateway-client-and-api" } +identified-vec-of = { path = "../common/identified-vec-of" } +hierarchical-deterministic = { path = "../crypto/hd" } +factors = { path = "../factors/factors" } +core-misc = { path = "../core/misc" } +transaction-foundation = { path = "../transaction/foundation" } +keys-collector = { path = "../factors/keys-collector" } +encryption = { path = "../crypto/encryption" } +addresses = { path = "../crypto/addresses" } +transaction-models = { path = "../transaction/models" } +manifests = { path = "../transaction/manifests" } +profile = { path = "../profile/models/profile_SPLIT_ME" } +profile-gateway = { path = "../profile/models/gateway" } +profile-logic = { path = "../profile/logic/logic_SPLIT_ME" } +profile-security-structures = { path = "../profile/models/security-structures" } +factor-instances-provider = { path = "../factors/instances-provider" } +gateway-models = { path = "../gateway/models" } +clients = { path = "../system/clients/clients" } +drivers = { path = "../system/drivers" } +gateway-client-and-api = { path = "../gateway/client-and-api" } # === RADIX DEPENDENCIES === radix-common = { workspace = true } @@ -40,6 +43,7 @@ async-std = { workspace = true } async-trait = { workspace = true } base64 = { workspace = true } derive_more = { workspace = true } +enum-as-inner = { workspace = true } enum-iterator = { workspace = true } futures = { workspace = true } hex = { workspace = true } diff --git a/crates/sargon/build.rs b/crates/sargon_SPLIT_ME/build.rs similarity index 100% rename from crates/sargon/build.rs rename to crates/sargon_SPLIT_ME/build.rs diff --git a/crates/sargon-uniffi/src/Package.swift b/crates/sargon_SPLIT_ME/fixtures/Package.swift similarity index 100% rename from crates/sargon-uniffi/src/Package.swift rename to crates/sargon_SPLIT_ME/fixtures/Package.swift diff --git a/crates/sargon/fixtures/models/well_known.json b/crates/sargon_SPLIT_ME/fixtures/models/well_known.json similarity index 100% rename from crates/sargon/fixtures/models/well_known.json rename to crates/sargon_SPLIT_ME/fixtures/models/well_known.json diff --git a/crates/sargon/fixtures/vector/big_profile_100_accounts.json b/crates/sargon_SPLIT_ME/fixtures/vector/big_profile_100_accounts.json similarity index 100% rename from crates/sargon/fixtures/vector/big_profile_100_accounts.json rename to crates/sargon_SPLIT_ME/fixtures/vector/big_profile_100_accounts.json diff --git a/crates/sargon/fixtures/vector/bip44_secp256k1.json b/crates/sargon_SPLIT_ME/fixtures/vector/bip44_secp256k1.json similarity index 100% rename from crates/sargon/fixtures/vector/bip44_secp256k1.json rename to crates/sargon_SPLIT_ME/fixtures/vector/bip44_secp256k1.json diff --git a/crates/sargon/fixtures/vector/cap26_curve25519.json b/crates/sargon_SPLIT_ME/fixtures/vector/cap26_curve25519.json similarity index 100% rename from crates/sargon/fixtures/vector/cap26_curve25519.json rename to crates/sargon_SPLIT_ME/fixtures/vector/cap26_curve25519.json diff --git a/crates/sargon/fixtures/vector/cap26_secp256k1.json b/crates/sargon_SPLIT_ME/fixtures/vector/cap26_secp256k1.json similarity index 100% rename from crates/sargon/fixtures/vector/cap26_secp256k1.json rename to crates/sargon_SPLIT_ME/fixtures/vector/cap26_secp256k1.json diff --git a/crates/sargon/fixtures/vector/deep_link_request_params.json b/crates/sargon_SPLIT_ME/fixtures/vector/deep_link_request_params.json similarity index 100% rename from crates/sargon/fixtures/vector/deep_link_request_params.json rename to crates/sargon_SPLIT_ME/fixtures/vector/deep_link_request_params.json diff --git a/crates/sargon/fixtures/vector/multi_profile_snapshots_test_version_100_patch_after_app_version_120.json b/crates/sargon_SPLIT_ME/fixtures/vector/multi_profile_snapshots_test_version_100_patch_after_app_version_120.json similarity index 100% rename from crates/sargon/fixtures/vector/multi_profile_snapshots_test_version_100_patch_after_app_version_120.json rename to crates/sargon_SPLIT_ME/fixtures/vector/multi_profile_snapshots_test_version_100_patch_after_app_version_120.json diff --git a/crates/sargon/fixtures/vector/only_plaintext_profile_snapshot_version_100.json b/crates/sargon_SPLIT_ME/fixtures/vector/only_plaintext_profile_snapshot_version_100.json similarity index 100% rename from crates/sargon/fixtures/vector/only_plaintext_profile_snapshot_version_100.json rename to crates/sargon_SPLIT_ME/fixtures/vector/only_plaintext_profile_snapshot_version_100.json diff --git a/crates/sargon/fixtures/vector/rola_challenge_payload_hash_vectors.json b/crates/sargon_SPLIT_ME/fixtures/vector/rola_challenge_payload_hash_vectors.json similarity index 100% rename from crates/sargon/fixtures/vector/rola_challenge_payload_hash_vectors.json rename to crates/sargon_SPLIT_ME/fixtures/vector/rola_challenge_payload_hash_vectors.json diff --git a/crates/sargon/fixtures/vector/slip10_tests_#10.json b/crates/sargon_SPLIT_ME/fixtures/vector/slip10_tests_#10.json similarity index 100% rename from crates/sargon/fixtures/vector/slip10_tests_#10.json rename to crates/sargon_SPLIT_ME/fixtures/vector/slip10_tests_#10.json diff --git a/crates/sargon/fixtures/vector/slip10_tests_#1000.json b/crates/sargon_SPLIT_ME/fixtures/vector/slip10_tests_#1000.json similarity index 100% rename from crates/sargon/fixtures/vector/slip10_tests_#1000.json rename to crates/sargon_SPLIT_ME/fixtures/vector/slip10_tests_#1000.json diff --git a/crates/sargon/fixtures/vector/wallet_interactions_dapp_to_wallet.json b/crates/sargon_SPLIT_ME/fixtures/vector/wallet_interactions_dapp_to_wallet.json similarity index 100% rename from crates/sargon/fixtures/vector/wallet_interactions_dapp_to_wallet.json rename to crates/sargon_SPLIT_ME/fixtures/vector/wallet_interactions_dapp_to_wallet.json diff --git a/crates/sargon/fixtures/vector/wallet_interactions_wallet_to_dapp.json b/crates/sargon_SPLIT_ME/fixtures/vector/wallet_interactions_wallet_to_dapp.json similarity index 100% rename from crates/sargon/fixtures/vector/wallet_interactions_wallet_to_dapp.json rename to crates/sargon_SPLIT_ME/fixtures/vector/wallet_interactions_wallet_to_dapp.json diff --git a/crates/sargon-uniffi/tests/Package.swift b/crates/sargon_SPLIT_ME/src/Package.swift similarity index 100% rename from crates/sargon-uniffi/tests/Package.swift rename to crates/sargon_SPLIT_ME/src/Package.swift diff --git a/crates/sargon/src/home_cards/deferred_deep_link/deferred_deep_link_method.rs b/crates/sargon_SPLIT_ME/src/home_cards/deferred_deep_link/deferred_deep_link_method.rs similarity index 100% rename from crates/sargon/src/home_cards/deferred_deep_link/deferred_deep_link_method.rs rename to crates/sargon_SPLIT_ME/src/home_cards/deferred_deep_link/deferred_deep_link_method.rs diff --git a/crates/sargon/src/home_cards/deferred_deep_link/deferred_deep_link_special_dapp.rs b/crates/sargon_SPLIT_ME/src/home_cards/deferred_deep_link/deferred_deep_link_special_dapp.rs similarity index 100% rename from crates/sargon/src/home_cards/deferred_deep_link/deferred_deep_link_special_dapp.rs rename to crates/sargon_SPLIT_ME/src/home_cards/deferred_deep_link/deferred_deep_link_special_dapp.rs diff --git a/crates/sargon/src/home_cards/deferred_deep_link/mod.rs b/crates/sargon_SPLIT_ME/src/home_cards/deferred_deep_link/mod.rs similarity index 100% rename from crates/sargon/src/home_cards/deferred_deep_link/mod.rs rename to crates/sargon_SPLIT_ME/src/home_cards/deferred_deep_link/mod.rs diff --git a/crates/sargon/src/home_cards/deferred_deep_link/onboarding_deep_link_value.rs b/crates/sargon_SPLIT_ME/src/home_cards/deferred_deep_link/onboarding_deep_link_value.rs similarity index 100% rename from crates/sargon/src/home_cards/deferred_deep_link/onboarding_deep_link_value.rs rename to crates/sargon_SPLIT_ME/src/home_cards/deferred_deep_link/onboarding_deep_link_value.rs diff --git a/crates/sargon/src/home_cards/deferred_deep_link/parser.rs b/crates/sargon_SPLIT_ME/src/home_cards/deferred_deep_link/parser.rs similarity index 100% rename from crates/sargon/src/home_cards/deferred_deep_link/parser.rs rename to crates/sargon_SPLIT_ME/src/home_cards/deferred_deep_link/parser.rs diff --git a/crates/sargon/src/home_cards/home_card.rs b/crates/sargon_SPLIT_ME/src/home_cards/home_card.rs similarity index 100% rename from crates/sargon/src/home_cards/home_card.rs rename to crates/sargon_SPLIT_ME/src/home_cards/home_card.rs diff --git a/crates/sargon/src/home_cards/home_cards.rs b/crates/sargon_SPLIT_ME/src/home_cards/home_cards.rs similarity index 100% rename from crates/sargon/src/home_cards/home_cards.rs rename to crates/sargon_SPLIT_ME/src/home_cards/home_cards.rs diff --git a/crates/sargon/src/home_cards/manager.rs b/crates/sargon_SPLIT_ME/src/home_cards/manager.rs similarity index 100% rename from crates/sargon/src/home_cards/manager.rs rename to crates/sargon_SPLIT_ME/src/home_cards/manager.rs diff --git a/crates/sargon/src/home_cards/mod.rs b/crates/sargon_SPLIT_ME/src/home_cards/mod.rs similarity index 100% rename from crates/sargon/src/home_cards/mod.rs rename to crates/sargon_SPLIT_ME/src/home_cards/mod.rs diff --git a/crates/sargon/src/home_cards/observer.rs b/crates/sargon_SPLIT_ME/src/home_cards/observer.rs similarity index 100% rename from crates/sargon/src/home_cards/observer.rs rename to crates/sargon_SPLIT_ME/src/home_cards/observer.rs diff --git a/crates/sargon/src/home_cards/storage.rs b/crates/sargon_SPLIT_ME/src/home_cards/storage.rs similarity index 100% rename from crates/sargon/src/home_cards/storage.rs rename to crates/sargon_SPLIT_ME/src/home_cards/storage.rs diff --git a/crates/sargon/src/lib.rs b/crates/sargon_SPLIT_ME/src/lib.rs similarity index 78% rename from crates/sargon/src/lib.rs rename to crates/sargon_SPLIT_ME/src/lib.rs index 31dca3b1e..919b13862 100644 --- a/crates/sargon/src/lib.rs +++ b/crates/sargon_SPLIT_ME/src/lib.rs @@ -12,7 +12,6 @@ #![allow(trivial_bounds)] mod home_cards; -mod needs_a_new_home_dumping_ground; mod radix_connect; mod security_center; mod signing; @@ -20,12 +19,12 @@ mod system; mod types; pub mod prelude { - pub use gateway_client_and_api::prelude::*; - pub use sargon_clients::prelude::*; - pub use sargon_factor_instances_provider::prelude::*; - pub use sargon_keys_collector::prelude::*; - pub use sargon_manifests::prelude::*; - pub use sargon_profile_logic::prelude::*; + pub use clients::prelude::*; + + pub use factor_instances_provider::prelude::*; + pub use keys_collector::prelude::*; + pub use manifests::prelude::*; + pub use profile_logic::prelude::*; pub use crate::home_cards::*; pub use crate::radix_connect::*; @@ -36,8 +35,21 @@ pub mod prelude { pub(crate) use radix_engine_interface::prelude::MetadataValue as ScryptoMetadataValue; + pub(crate) use serde::{ + de, ser::SerializeStruct, Deserializer, Serializer, + }; + + pub(crate) use enum_as_inner::EnumAsInner; + pub(crate) use serde_with::{serde_as, DisplayFromStr}; + pub(crate) use std::collections::HashSet; + #[cfg(test)] pub(crate) use radix_common::math::Decimal as ScryptoDecimal192; + #[cfg(test)] + pub(crate) use std::collections::BTreeSet; + + #[cfg(test)] + pub(crate) use serde_json::json; } pub use prelude::*; diff --git a/crates/sargon/src/radix_connect/interaction_id.rs b/crates/sargon_SPLIT_ME/src/radix_connect/interaction_id.rs similarity index 100% rename from crates/sargon/src/radix_connect/interaction_id.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/interaction_id.rs diff --git a/crates/sargon/src/radix_connect/interaction_version.rs b/crates/sargon_SPLIT_ME/src/radix_connect/interaction_version.rs similarity index 100% rename from crates/sargon/src/radix_connect/interaction_version.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/interaction_version.rs diff --git a/crates/sargon/src/radix_connect/mobile/client.rs b/crates/sargon_SPLIT_ME/src/radix_connect/mobile/client.rs similarity index 99% rename from crates/sargon/src/radix_connect/mobile/client.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/mobile/client.rs index 794135cc2..12d8baf46 100644 --- a/crates/sargon/src/radix_connect/mobile/client.rs +++ b/crates/sargon_SPLIT_ME/src/radix_connect/mobile/client.rs @@ -1,3 +1,5 @@ +use encryption::PbHkdfSha256; + use super::deep_link_parsing::*; use super::relay_service::Service as RelayService; use super::relay_service::WalletInteractionTransport; diff --git a/crates/sargon/src/radix_connect/mobile/deep_link_parsing/mod.rs b/crates/sargon_SPLIT_ME/src/radix_connect/mobile/deep_link_parsing/mod.rs similarity index 100% rename from crates/sargon/src/radix_connect/mobile/deep_link_parsing/mod.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/mobile/deep_link_parsing/mod.rs diff --git a/crates/sargon/src/radix_connect/mobile/deep_link_parsing/parser.rs b/crates/sargon_SPLIT_ME/src/radix_connect/mobile/deep_link_parsing/parser.rs similarity index 99% rename from crates/sargon/src/radix_connect/mobile/deep_link_parsing/parser.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/mobile/deep_link_parsing/parser.rs index 3febd6168..ba04e8124 100644 --- a/crates/sargon/src/radix_connect/mobile/deep_link_parsing/parser.rs +++ b/crates/sargon_SPLIT_ME/src/radix_connect/mobile/deep_link_parsing/parser.rs @@ -1,7 +1,7 @@ use super::request::RadixConnectMobileDappRequest; use crate::prelude::*; -use sargon_core::parse_url; +use core_misc::parse_url; const CONNECT_URL_PARAM_SESSION_ID: &str = "sessionId"; const CONNECT_URL_PARAM_ORIGIN: &str = "origin"; @@ -212,7 +212,6 @@ impl SampleRequestParams { #[cfg(test)] mod tests { - use sargon_core::parse_url; use super::*; diff --git a/crates/sargon/src/radix_connect/mobile/deep_link_parsing/request.rs b/crates/sargon_SPLIT_ME/src/radix_connect/mobile/deep_link_parsing/request.rs similarity index 100% rename from crates/sargon/src/radix_connect/mobile/deep_link_parsing/request.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/mobile/deep_link_parsing/request.rs diff --git a/crates/sargon/src/radix_connect/mobile/mod.rs b/crates/sargon_SPLIT_ME/src/radix_connect/mobile/mod.rs similarity index 100% rename from crates/sargon/src/radix_connect/mobile/mod.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/mobile/mod.rs diff --git a/crates/sargon/src/radix_connect/mobile/relay_service/mod.rs b/crates/sargon_SPLIT_ME/src/radix_connect/mobile/relay_service/mod.rs similarity index 100% rename from crates/sargon/src/radix_connect/mobile/relay_service/mod.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/mobile/relay_service/mod.rs diff --git a/crates/sargon/src/radix_connect/mobile/relay_service/service.rs b/crates/sargon_SPLIT_ME/src/radix_connect/mobile/relay_service/service.rs similarity index 98% rename from crates/sargon/src/radix_connect/mobile/relay_service/service.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/mobile/relay_service/service.rs index a472eab16..54def6081 100644 --- a/crates/sargon/src/radix_connect/mobile/relay_service/service.rs +++ b/crates/sargon_SPLIT_ME/src/radix_connect/mobile/relay_service/service.rs @@ -1,3 +1,5 @@ +use encryption::{EncryptionScheme, VersionedEncryption}; + use super::super::session::*; use super::success_response::SuccessResponse; use crate::prelude::*; @@ -98,6 +100,7 @@ impl Service { mod tests { use super::*; use actix_rt::time::timeout; + use encryption::{EncryptionScheme, VersionedEncryption}; use std::time::Duration; const MAX: Duration = Duration::from_millis(10); diff --git a/crates/sargon/src/radix_connect/mobile/relay_service/success_response.rs b/crates/sargon_SPLIT_ME/src/radix_connect/mobile/relay_service/success_response.rs similarity index 100% rename from crates/sargon/src/radix_connect/mobile/relay_service/success_response.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/mobile/relay_service/success_response.rs diff --git a/crates/sargon/src/radix_connect/mobile/session/mod.rs b/crates/sargon_SPLIT_ME/src/radix_connect/mobile/session/mod.rs similarity index 100% rename from crates/sargon/src/radix_connect/mobile/session/mod.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/mobile/session/mod.rs diff --git a/crates/sargon/src/radix_connect/mobile/session/session.rs b/crates/sargon_SPLIT_ME/src/radix_connect/mobile/session/session.rs similarity index 99% rename from crates/sargon/src/radix_connect/mobile/session/session.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/mobile/session/session.rs index 9fe198c15..8252ed2ef 100644 --- a/crates/sargon/src/radix_connect/mobile/session/session.rs +++ b/crates/sargon_SPLIT_ME/src/radix_connect/mobile/session/session.rs @@ -1,3 +1,5 @@ +use encryption::EncryptionKey; + use super::session_id::SessionID; use super::session_origin::SessionOrigin; use crate::prelude::*; diff --git a/crates/sargon/src/radix_connect/mobile/session/session_id.rs b/crates/sargon_SPLIT_ME/src/radix_connect/mobile/session/session_id.rs similarity index 100% rename from crates/sargon/src/radix_connect/mobile/session/session_id.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/mobile/session/session_id.rs diff --git a/crates/sargon/src/radix_connect/mobile/session/session_origin.rs b/crates/sargon_SPLIT_ME/src/radix_connect/mobile/session/session_origin.rs similarity index 100% rename from crates/sargon/src/radix_connect/mobile/session/session_origin.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/mobile/session/session_origin.rs diff --git a/crates/sargon/src/radix_connect/mobile/session_dapp_request.rs b/crates/sargon_SPLIT_ME/src/radix_connect/mobile/session_dapp_request.rs similarity index 100% rename from crates/sargon/src/radix_connect/mobile/session_dapp_request.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/mobile/session_dapp_request.rs diff --git a/crates/sargon/src/radix_connect/mobile/session_storage.rs b/crates/sargon_SPLIT_ME/src/radix_connect/mobile/session_storage.rs similarity index 100% rename from crates/sargon/src/radix_connect/mobile/session_storage.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/mobile/session_storage.rs diff --git a/crates/sargon/src/radix_connect/mobile/session_wallet_response.rs b/crates/sargon_SPLIT_ME/src/radix_connect/mobile/session_wallet_response.rs similarity index 100% rename from crates/sargon/src/radix_connect/mobile/session_wallet_response.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/mobile/session_wallet_response.rs diff --git a/crates/sargon/src/radix_connect/mod.rs b/crates/sargon_SPLIT_ME/src/radix_connect/mod.rs similarity index 100% rename from crates/sargon/src/radix_connect/mod.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/mod.rs diff --git a/crates/sargon/src/radix_connect/p2p_links/link_connection_qr_data.rs b/crates/sargon_SPLIT_ME/src/radix_connect/p2p_links/link_connection_qr_data.rs similarity index 100% rename from crates/sargon/src/radix_connect/p2p_links/link_connection_qr_data.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/p2p_links/link_connection_qr_data.rs diff --git a/crates/sargon-uniffi/src/radix_connect/p2p_links/mod.rs b/crates/sargon_SPLIT_ME/src/radix_connect/p2p_links/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/p2p_links/mod.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/p2p_links/mod.rs diff --git a/crates/sargon/src/radix_connect/p2p_links/p2p_link.rs b/crates/sargon_SPLIT_ME/src/radix_connect/p2p_links/p2p_link.rs similarity index 95% rename from crates/sargon/src/radix_connect/p2p_links/p2p_link.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/p2p_links/p2p_link.rs index 71f472ac5..1b61263cd 100644 --- a/crates/sargon/src/radix_connect/p2p_links/p2p_link.rs +++ b/crates/sargon_SPLIT_ME/src/radix_connect/p2p_links/p2p_link.rs @@ -41,12 +41,6 @@ pub struct P2PLink { pub display_name: String, } -impl SafeToLog for P2PLink { - fn non_sensitive(&self) -> impl std::fmt::Debug { - self.to_obfuscated_string() - } -} - impl P2PLink { pub fn new( connection_password: RadixConnectPassword, @@ -209,13 +203,4 @@ mod tests { "P2PLink( name: 'Chrome on Macbook', password: )" ); } - - #[test] - fn safe_to_log() { - let sut = P2PLink::sample(); - assert_eq!( - format!("{:?}", sut.to_string()), - format!("{:?}", sut.non_sensitive()) - ); - } } diff --git a/crates/sargon/src/radix_connect/p2p_links/p2p_links.rs b/crates/sargon_SPLIT_ME/src/radix_connect/p2p_links/p2p_links.rs similarity index 100% rename from crates/sargon/src/radix_connect/p2p_links/p2p_links.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/p2p_links/p2p_links.rs diff --git a/crates/sargon/src/radix_connect/p2p_links/radix_connect_password.rs b/crates/sargon_SPLIT_ME/src/radix_connect/p2p_links/radix_connect_password.rs similarity index 100% rename from crates/sargon/src/radix_connect/p2p_links/radix_connect_password.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/p2p_links/radix_connect_password.rs diff --git a/crates/sargon/src/radix_connect/p2p_links/radix_connect_purpose.rs b/crates/sargon_SPLIT_ME/src/radix_connect/p2p_links/radix_connect_purpose.rs similarity index 100% rename from crates/sargon/src/radix_connect/p2p_links/radix_connect_purpose.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/p2p_links/radix_connect_purpose.rs diff --git a/crates/sargon/src/radix_connect/wallet_account.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_account.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_account.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_account.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/auth_challenge_nonce.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/auth_challenge_nonce.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/auth_challenge_nonce.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/auth_challenge_nonce.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/interaction_metadata.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/interaction_metadata.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/interaction_metadata.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/interaction_metadata.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/interaction_metadata_unvalidated.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/interaction_metadata_unvalidated.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/interaction_metadata_unvalidated.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/interaction_metadata_unvalidated.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/mod.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/mod.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/mod.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/origin.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/origin.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/origin.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/origin.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/items.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/items.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/items.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/items.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/mod.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/mod.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/mod.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/after_delay.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/after_delay.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/after_delay.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/after_delay.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/at_time.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/at_time.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/at_time.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/at_time.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/expiration.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/expiration.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/expiration.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/expiration.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/mod.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/mod.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/mod.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/status.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/status.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/status.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/status.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/mod.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/mod.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/mod.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/mod.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/pre_authorization.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/pre_authorization.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/pre_authorization.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/pre_authorization.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/subintent.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/subintent.rs similarity index 98% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/subintent.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/subintent.rs index b3b2e2c94..045963d13 100644 --- a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/subintent.rs +++ b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/subintent.rs @@ -1,4 +1,4 @@ -use sargon_core::decl_version_type; +use transaction_foundation::decl_version_type; use crate::prelude::*; diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/unvalidated_subintent_manifest.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/unvalidated_subintent_manifest.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/unvalidated_subintent_manifest.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/unvalidated_subintent_manifest.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/auth.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/auth.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/auth.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/auth.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/login_with_challenge.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/login_with_challenge.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/login_with_challenge.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/login_with_challenge.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/mod.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/mod.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/mod.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/use_persona.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/use_persona.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/use_persona.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/use_persona.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/authorized_request.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/authorized_request.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/authorized_request.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/authorized_request.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/accounts.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/accounts.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/accounts.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/accounts.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/mod.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/mod.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/mod.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/persona_data.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/persona_data.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/persona_data.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/persona_data.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/proof_of_ownership.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/proof_of_ownership.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/proof_of_ownership.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/proof_of_ownership.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/reset.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/reset.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/reset.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/reset.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/mod.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/mod.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/mod.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/unauthorized_request.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/unauthorized_request.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/unauthorized_request.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/unauthorized_request.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/mod.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/mod.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/mod.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/transaction.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/transaction.rs similarity index 99% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/transaction.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/transaction.rs index b090c0847..85192a692 100644 --- a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/transaction.rs +++ b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/transaction.rs @@ -1,5 +1,5 @@ use crate::prelude::*; -use sargon_core::decl_version_type; +use transaction_foundation::decl_version_type; #[derive(Debug, Clone, Deserialize, Serialize, PartialEq)] pub struct DappToWalletInteractionTransactionItems { diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_unvalidated.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_unvalidated.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_unvalidated.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_unvalidated.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/mod.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/mod.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/mod.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/mod.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/mod.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/mod.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/error_type.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/error_type.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/error_type.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/error_type.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/failure.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/failure.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/failure.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/failure.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/mod.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/mod.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/mod.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/mod.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/mod.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/mod.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/response.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/response.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/response.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/response.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/account_proof.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/account_proof.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/account_proof.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/account_proof.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/accounts.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/accounts.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/accounts.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/accounts.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/mod.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/mod.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/mod.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_login_with_challenge.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_login_with_challenge.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_login_with_challenge.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_login_with_challenge.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_login_without_challenge.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_login_without_challenge.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_login_without_challenge.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_login_without_challenge.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_proof.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_proof.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_proof.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_proof.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_use_persona.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_use_persona.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_use_persona.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_use_persona.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/mod.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/mod.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/mod.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/authorized_request.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/authorized_request.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/authorized_request.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/authorized_request.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/items.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/items.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/items.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/items.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/mod.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/mod.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/mod.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona/mod.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona/mod.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona/mod.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona/persona_proof.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona/persona_proof.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona/persona_proof.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona/persona_proof.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona_data/mod.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona_data/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona_data/mod.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona_data/mod.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona_data/persona_data.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona_data/persona_data.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona_data/persona_data.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona_data/persona_data.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/mod.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/mod.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/mod.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/mod.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/pre_authorization.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/pre_authorization.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/pre_authorization.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/pre_authorization.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/subintent_response.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/subintent_response.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/subintent_response.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/subintent_response.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/mod.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/mod.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/mod.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/proof.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/proof.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/proof.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/proof.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/proof_of_ownership.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/proof_of_ownership.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/proof_of_ownership.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/proof_of_ownership.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/success.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/success.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/success.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/success.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/mod.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/mod.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/mod.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/mod.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/transaction.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/transaction.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/transaction.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/transaction.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/unauthorized_request.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/unauthorized_request.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/unauthorized_request.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/unauthorized_request.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/mod.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/mod.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/mod.rs diff --git a/crates/sargon/src/radix_connect/wallet_persona.rs b/crates/sargon_SPLIT_ME/src/radix_connect/wallet_persona.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_persona.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/wallet_persona.rs diff --git a/crates/sargon/src/radix_connect/well_known_client/client.rs b/crates/sargon_SPLIT_ME/src/radix_connect/well_known_client/client.rs similarity index 100% rename from crates/sargon/src/radix_connect/well_known_client/client.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/well_known_client/client.rs diff --git a/crates/sargon/src/radix_connect/well_known_client/mod.rs b/crates/sargon_SPLIT_ME/src/radix_connect/well_known_client/mod.rs similarity index 100% rename from crates/sargon/src/radix_connect/well_known_client/mod.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/well_known_client/mod.rs diff --git a/crates/sargon/src/radix_connect/well_known_client/models/dapp_definition.rs b/crates/sargon_SPLIT_ME/src/radix_connect/well_known_client/models/dapp_definition.rs similarity index 100% rename from crates/sargon/src/radix_connect/well_known_client/models/dapp_definition.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/well_known_client/models/dapp_definition.rs diff --git a/crates/sargon/src/radix_connect/well_known_client/models/dapp_well_known_data.rs b/crates/sargon_SPLIT_ME/src/radix_connect/well_known_client/models/dapp_well_known_data.rs similarity index 100% rename from crates/sargon/src/radix_connect/well_known_client/models/dapp_well_known_data.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/well_known_client/models/dapp_well_known_data.rs diff --git a/crates/sargon/src/radix_connect/well_known_client/models/mod.rs b/crates/sargon_SPLIT_ME/src/radix_connect/well_known_client/models/mod.rs similarity index 100% rename from crates/sargon/src/radix_connect/well_known_client/models/mod.rs rename to crates/sargon_SPLIT_ME/src/radix_connect/well_known_client/models/mod.rs diff --git a/crates/sargon/src/security_center/client.rs b/crates/sargon_SPLIT_ME/src/security_center/client.rs similarity index 100% rename from crates/sargon/src/security_center/client.rs rename to crates/sargon_SPLIT_ME/src/security_center/client.rs diff --git a/crates/sargon/src/security_center/mod.rs b/crates/sargon_SPLIT_ME/src/security_center/mod.rs similarity index 100% rename from crates/sargon/src/security_center/mod.rs rename to crates/sargon_SPLIT_ME/src/security_center/mod.rs diff --git a/crates/sargon/src/security_center/security_problem.rs b/crates/sargon_SPLIT_ME/src/security_center/security_problem.rs similarity index 100% rename from crates/sargon/src/security_center/security_problem.rs rename to crates/sargon_SPLIT_ME/src/security_center/security_problem.rs diff --git a/crates/sargon/src/security_center/security_problem_kind.rs b/crates/sargon_SPLIT_ME/src/security_center/security_problem_kind.rs similarity index 100% rename from crates/sargon/src/security_center/security_problem_kind.rs rename to crates/sargon_SPLIT_ME/src/security_center/security_problem_kind.rs diff --git a/crates/sargon/src/security_center/support/addresses_entities_bad_state.rs b/crates/sargon_SPLIT_ME/src/security_center/support/addresses_entities_bad_state.rs similarity index 100% rename from crates/sargon/src/security_center/support/addresses_entities_bad_state.rs rename to crates/sargon_SPLIT_ME/src/security_center/support/addresses_entities_bad_state.rs diff --git a/crates/sargon/src/security_center/support/backup_result.rs b/crates/sargon_SPLIT_ME/src/security_center/support/backup_result.rs similarity index 97% rename from crates/sargon/src/security_center/support/backup_result.rs rename to crates/sargon_SPLIT_ME/src/security_center/support/backup_result.rs index 856cf902c..a9182f6fe 100644 --- a/crates/sargon/src/security_center/support/backup_result.rs +++ b/crates/sargon_SPLIT_ME/src/security_center/support/backup_result.rs @@ -1,4 +1,4 @@ -use sargon_core::decl_bool_type; +use core_misc::decl_bool_type; use crate::prelude::*; diff --git a/crates/sargon/src/security_center/support/input.rs b/crates/sargon_SPLIT_ME/src/security_center/support/input.rs similarity index 100% rename from crates/sargon/src/security_center/support/input.rs rename to crates/sargon_SPLIT_ME/src/security_center/support/input.rs diff --git a/crates/sargon-uniffi/src/security_center/support/mod.rs b/crates/sargon_SPLIT_ME/src/security_center/support/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/security_center/support/mod.rs rename to crates/sargon_SPLIT_ME/src/security_center/support/mod.rs diff --git a/crates/sargon/src/signing/authentication/auth_intent.rs b/crates/sargon_SPLIT_ME/src/signing/authentication/auth_intent.rs similarity index 100% rename from crates/sargon/src/signing/authentication/auth_intent.rs rename to crates/sargon_SPLIT_ME/src/signing/authentication/auth_intent.rs diff --git a/crates/sargon/src/signing/authentication/auth_intent_hash.rs b/crates/sargon_SPLIT_ME/src/signing/authentication/auth_intent_hash.rs similarity index 100% rename from crates/sargon/src/signing/authentication/auth_intent_hash.rs rename to crates/sargon_SPLIT_ME/src/signing/authentication/auth_intent_hash.rs diff --git a/crates/sargon-uniffi/src/signing/authentication/mod.rs b/crates/sargon_SPLIT_ME/src/signing/authentication/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/signing/authentication/mod.rs rename to crates/sargon_SPLIT_ME/src/signing/authentication/mod.rs diff --git a/crates/sargon/src/signing/authentication/signed_auth_intent.rs b/crates/sargon_SPLIT_ME/src/signing/authentication/signed_auth_intent.rs similarity index 82% rename from crates/sargon/src/signing/authentication/signed_auth_intent.rs rename to crates/sargon_SPLIT_ME/src/signing/authentication/signed_auth_intent.rs index 8420a1155..27b17c586 100644 --- a/crates/sargon/src/signing/authentication/signed_auth_intent.rs +++ b/crates/sargon_SPLIT_ME/src/signing/authentication/signed_auth_intent.rs @@ -40,8 +40,9 @@ impl HasSampleValues for SignedAuthIntent { let signature = mnemonic_with_passphrase .sign(&intent.auth_intent_hash().hash(), &DerivationPath::sample()); - let intent_signatures = indexmap!( - AddressOfAccountOrPersona::sample() => IntentSignature(signature) + let intent_signatures = IndexMap::kv( + AddressOfAccountOrPersona::sample(), + IntentSignature(signature), ); SignedAuthIntent::new(intent, intent_signatures).unwrap() @@ -53,8 +54,9 @@ impl HasSampleValues for SignedAuthIntent { let signature = mnemonic_with_passphrase .sign(&intent.auth_intent_hash().hash(), &DerivationPath::sample()); - let intent_signatures = indexmap!( - AddressOfAccountOrPersona::sample() => IntentSignature(signature) + let intent_signatures = IndexMap::kv( + AddressOfAccountOrPersona::sample(), + IntentSignature(signature), ); SignedAuthIntent::new(intent, intent_signatures).unwrap() @@ -86,16 +88,18 @@ mod tests { let signature = mnemonic_with_passphrase .sign(&intent.auth_intent_hash().hash(), &DerivationPath::sample()); - let intent_signatures = indexmap!( - AddressOfAccountOrPersona::sample() => IntentSignature(signature) + let intent_signatures = IndexMap::kv( + AddressOfAccountOrPersona::sample(), + IntentSignature(signature), ); assert!(SignedAuthIntent::new(intent, intent_signatures).is_ok()) } #[test] fn test_invalid_signatures() { - let intent_signatures = indexmap!( - AddressOfAccountOrPersona::sample() => IntentSignature::sample() + let intent_signatures = IndexMap::kv( + AddressOfAccountOrPersona::sample(), + IntentSignature::sample(), ); assert_eq!( SUT::new(AuthIntent::sample(), intent_signatures), @@ -110,8 +114,9 @@ mod tests { let signature = mnemonic_with_passphrase .sign(&intent.auth_intent_hash().hash(), &DerivationPath::sample()); - let intent_signatures = indexmap!( - AddressOfAccountOrPersona::sample() => IntentSignature(signature) + let intent_signatures = IndexMap::kv( + AddressOfAccountOrPersona::sample(), + IntentSignature(signature), ); assert_eq!( diff --git a/crates/sargon/src/signing/collector/extractor_of_instances_required_to_sign_transactions.rs b/crates/sargon_SPLIT_ME/src/signing/collector/extractor_of_instances_required_to_sign_transactions.rs similarity index 100% rename from crates/sargon/src/signing/collector/extractor_of_instances_required_to_sign_transactions.rs rename to crates/sargon_SPLIT_ME/src/signing/collector/extractor_of_instances_required_to_sign_transactions.rs diff --git a/crates/sargon/src/signing/collector/mod.rs b/crates/sargon_SPLIT_ME/src/signing/collector/mod.rs similarity index 100% rename from crates/sargon/src/signing/collector/mod.rs rename to crates/sargon_SPLIT_ME/src/signing/collector/mod.rs diff --git a/crates/sargon/src/signing/collector/signatures_collecting_continuation.rs b/crates/sargon_SPLIT_ME/src/signing/collector/signatures_collecting_continuation.rs similarity index 100% rename from crates/sargon/src/signing/collector/signatures_collecting_continuation.rs rename to crates/sargon_SPLIT_ME/src/signing/collector/signatures_collecting_continuation.rs diff --git a/crates/sargon/src/signing/collector/signatures_collector.rs b/crates/sargon_SPLIT_ME/src/signing/collector/signatures_collector.rs similarity index 99% rename from crates/sargon/src/signing/collector/signatures_collector.rs rename to crates/sargon_SPLIT_ME/src/signing/collector/signatures_collector.rs index 1d0e9c056..86ca6ea0e 100644 --- a/crates/sargon/src/signing/collector/signatures_collector.rs +++ b/crates/sargon_SPLIT_ME/src/signing/collector/signatures_collector.rs @@ -1092,7 +1092,7 @@ mod tests { } mod with_failure { - use std::rc::Rc; + use std::{cell::RefCell, rc::Rc}; use super::*; diff --git a/crates/sargon/src/signing/collector/signatures_collector_dependencies.rs b/crates/sargon_SPLIT_ME/src/signing/collector/signatures_collector_dependencies.rs similarity index 100% rename from crates/sargon/src/signing/collector/signatures_collector_dependencies.rs rename to crates/sargon_SPLIT_ME/src/signing/collector/signatures_collector_dependencies.rs diff --git a/crates/sargon/src/signing/collector/signatures_collector_preprocessor.rs b/crates/sargon_SPLIT_ME/src/signing/collector/signatures_collector_preprocessor.rs similarity index 100% rename from crates/sargon/src/signing/collector/signatures_collector_preprocessor.rs rename to crates/sargon_SPLIT_ME/src/signing/collector/signatures_collector_preprocessor.rs diff --git a/crates/sargon/src/signing/collector/signatures_collector_state.rs b/crates/sargon_SPLIT_ME/src/signing/collector/signatures_collector_state.rs similarity index 100% rename from crates/sargon/src/signing/collector/signatures_collector_state.rs rename to crates/sargon_SPLIT_ME/src/signing/collector/signatures_collector_state.rs diff --git a/crates/sargon/src/signing/collector/signing_finish_early_strategy.rs b/crates/sargon_SPLIT_ME/src/signing/collector/signing_finish_early_strategy.rs similarity index 100% rename from crates/sargon/src/signing/collector/signing_finish_early_strategy.rs rename to crates/sargon_SPLIT_ME/src/signing/collector/signing_finish_early_strategy.rs diff --git a/crates/sargon/src/signing/extractor_of_entities_requiring_auth.rs b/crates/sargon_SPLIT_ME/src/signing/extractor_of_entities_requiring_auth.rs similarity index 99% rename from crates/sargon/src/signing/extractor_of_entities_requiring_auth.rs rename to crates/sargon_SPLIT_ME/src/signing/extractor_of_entities_requiring_auth.rs index c439f2c9f..0912c0a8e 100644 --- a/crates/sargon/src/signing/extractor_of_entities_requiring_auth.rs +++ b/crates/sargon_SPLIT_ME/src/signing/extractor_of_entities_requiring_auth.rs @@ -46,7 +46,6 @@ impl ExtractorOfEntitiesRequiringAuth { #[cfg(test)] mod tests { use super::*; - use indexmap::IndexSet; use radix_transactions::prelude::ManifestBuilder; #[test] diff --git a/crates/sargon/src/signing/host_interaction/mod.rs b/crates/sargon_SPLIT_ME/src/signing/host_interaction/mod.rs similarity index 100% rename from crates/sargon/src/signing/host_interaction/mod.rs rename to crates/sargon_SPLIT_ME/src/signing/host_interaction/mod.rs diff --git a/crates/sargon/src/signing/host_interaction/sign_interactor.rs b/crates/sargon_SPLIT_ME/src/signing/host_interaction/sign_interactor.rs similarity index 100% rename from crates/sargon/src/signing/host_interaction/sign_interactor.rs rename to crates/sargon_SPLIT_ME/src/signing/host_interaction/sign_interactor.rs diff --git a/crates/sargon/src/signing/host_interaction/sign_request.rs b/crates/sargon_SPLIT_ME/src/signing/host_interaction/sign_request.rs similarity index 100% rename from crates/sargon/src/signing/host_interaction/sign_request.rs rename to crates/sargon_SPLIT_ME/src/signing/host_interaction/sign_request.rs diff --git a/crates/sargon/src/signing/host_interaction/sign_response.rs b/crates/sargon_SPLIT_ME/src/signing/host_interaction/sign_response.rs similarity index 100% rename from crates/sargon/src/signing/host_interaction/sign_response.rs rename to crates/sargon_SPLIT_ME/src/signing/host_interaction/sign_response.rs diff --git a/crates/sargon/src/signing/host_interaction/transaction_sign_request_input.rs b/crates/sargon_SPLIT_ME/src/signing/host_interaction/transaction_sign_request_input.rs similarity index 100% rename from crates/sargon/src/signing/host_interaction/transaction_sign_request_input.rs rename to crates/sargon_SPLIT_ME/src/signing/host_interaction/transaction_sign_request_input.rs diff --git a/crates/sargon/src/signing/mod.rs b/crates/sargon_SPLIT_ME/src/signing/mod.rs similarity index 100% rename from crates/sargon/src/signing/mod.rs rename to crates/sargon_SPLIT_ME/src/signing/mod.rs diff --git a/crates/sargon/src/signing/petition_types/mod.rs b/crates/sargon_SPLIT_ME/src/signing/petition_types/mod.rs similarity index 100% rename from crates/sargon/src/signing/petition_types/mod.rs rename to crates/sargon_SPLIT_ME/src/signing/petition_types/mod.rs diff --git a/crates/sargon/src/signing/petition_types/petition_for_entity.rs b/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_entity.rs similarity index 100% rename from crates/sargon/src/signing/petition_types/petition_for_entity.rs rename to crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_entity.rs diff --git a/crates/sargon/src/signing/petition_types/petition_for_factors_types/factor_source_referencing.rs b/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/factor_source_referencing.rs similarity index 100% rename from crates/sargon/src/signing/petition_types/petition_for_factors_types/factor_source_referencing.rs rename to crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/factor_source_referencing.rs diff --git a/crates/sargon/src/signing/petition_types/petition_for_factors_types/mod.rs b/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/mod.rs similarity index 100% rename from crates/sargon/src/signing/petition_types/petition_for_factors_types/mod.rs rename to crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/mod.rs diff --git a/crates/sargon/src/signing/petition_types/petition_for_factors_types/neglected_factor_instance.rs b/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/neglected_factor_instance.rs similarity index 99% rename from crates/sargon/src/signing/petition_types/petition_for_factors_types/neglected_factor_instance.rs rename to crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/neglected_factor_instance.rs index a60274864..bd18f497b 100644 --- a/crates/sargon/src/signing/petition_types/petition_for_factors_types/neglected_factor_instance.rs +++ b/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/neglected_factor_instance.rs @@ -1,3 +1,5 @@ +use std::fmt::Formatter; + use crate::prelude::*; /// A neglected factor, with a reason. diff --git a/crates/sargon/src/signing/petition_types/petition_for_factors_types/petition_for_factors/mod.rs b/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/petition_for_factors/mod.rs similarity index 100% rename from crates/sargon/src/signing/petition_types/petition_for_factors_types/petition_for_factors/mod.rs rename to crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/petition_for_factors/mod.rs diff --git a/crates/sargon/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors.rs b/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors.rs similarity index 99% rename from crates/sargon/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors.rs rename to crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors.rs index 8914c95a1..ed608de20 100644 --- a/crates/sargon/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors.rs +++ b/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors.rs @@ -1,3 +1,5 @@ +use std::ops::Deref; + use super::*; use crate::prelude::*; diff --git a/crates/sargon/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_input.rs b/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_input.rs similarity index 100% rename from crates/sargon/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_input.rs rename to crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_input.rs diff --git a/crates/sargon/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state.rs b/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state.rs similarity index 100% rename from crates/sargon/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state.rs rename to crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state.rs diff --git a/crates/sargon/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state_snapshot.rs b/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state_snapshot.rs similarity index 100% rename from crates/sargon/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state_snapshot.rs rename to crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state_snapshot.rs diff --git a/crates/sargon/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_status.rs b/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_status.rs similarity index 100% rename from crates/sargon/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_status.rs rename to crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_status.rs diff --git a/crates/sargon/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_sub_state.rs b/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_sub_state.rs similarity index 100% rename from crates/sargon/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_sub_state.rs rename to crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_sub_state.rs diff --git a/crates/sargon/src/signing/petition_types/petition_for_transaction.rs b/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_transaction.rs similarity index 99% rename from crates/sargon/src/signing/petition_types/petition_for_transaction.rs rename to crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_transaction.rs index c445aa31e..ecd51d1d2 100644 --- a/crates/sargon/src/signing/petition_types/petition_for_transaction.rs +++ b/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_transaction.rs @@ -1,3 +1,5 @@ +use std::ops::Deref; + use crate::prelude::*; /// Petition of signatures for a transaction. diff --git a/crates/sargon/src/signing/petition_types/petition_status.rs b/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_status.rs similarity index 100% rename from crates/sargon/src/signing/petition_types/petition_status.rs rename to crates/sargon_SPLIT_ME/src/signing/petition_types/petition_status.rs diff --git a/crates/sargon/src/signing/petition_types/petitions.rs b/crates/sargon_SPLIT_ME/src/signing/petition_types/petitions.rs similarity index 99% rename from crates/sargon/src/signing/petition_types/petitions.rs rename to crates/sargon_SPLIT_ME/src/signing/petition_types/petitions.rs index a443ac10d..b0d0757ac 100644 --- a/crates/sargon/src/signing/petition_types/petitions.rs +++ b/crates/sargon_SPLIT_ME/src/signing/petition_types/petitions.rs @@ -1,5 +1,7 @@ #![allow(clippy::non_canonical_partial_ord_impl)] +use std::ops::Deref; + use crate::prelude::*; #[derive(derive_more::Debug)] diff --git a/crates/sargon/src/signing/petition_types/signing_purpose.rs b/crates/sargon_SPLIT_ME/src/signing/petition_types/signing_purpose.rs similarity index 100% rename from crates/sargon/src/signing/petition_types/signing_purpose.rs rename to crates/sargon_SPLIT_ME/src/signing/petition_types/signing_purpose.rs diff --git a/crates/sargon/src/signing/signable_with_entities.rs b/crates/sargon_SPLIT_ME/src/signing/signable_with_entities.rs similarity index 100% rename from crates/sargon/src/signing/signable_with_entities.rs rename to crates/sargon_SPLIT_ME/src/signing/signable_with_entities.rs diff --git a/crates/sargon/src/signing/signables/mod.rs b/crates/sargon_SPLIT_ME/src/signing/signables/mod.rs similarity index 100% rename from crates/sargon/src/signing/signables/mod.rs rename to crates/sargon_SPLIT_ME/src/signing/signables/mod.rs diff --git a/crates/sargon/src/signing/signables/signable.rs b/crates/sargon_SPLIT_ME/src/signing/signables/signable.rs similarity index 100% rename from crates/sargon/src/signing/signables/signable.rs rename to crates/sargon_SPLIT_ME/src/signing/signables/signable.rs diff --git a/crates/sargon/src/signing/signables/signable_auth_intent.rs b/crates/sargon_SPLIT_ME/src/signing/signables/signable_auth_intent.rs similarity index 94% rename from crates/sargon/src/signing/signables/signable_auth_intent.rs rename to crates/sargon_SPLIT_ME/src/signing/signables/signable_auth_intent.rs index c0ec8f4ee..3cebcb814 100644 --- a/crates/sargon/src/signing/signables/signable_auth_intent.rs +++ b/crates/sargon_SPLIT_ME/src/signing/signables/signable_auth_intent.rs @@ -133,8 +133,9 @@ mod tests { let mnemonic_with_passphrase = MnemonicWithPassphrase::sample(); let signature = mnemonic_with_passphrase .sign(&sut.auth_intent_hash().hash(), &DerivationPath::sample()); - let intent_signatures = indexmap!( - AddressOfAccountOrPersona::sample() => IntentSignature(signature) + let intent_signatures = IndexMap::kv( + AddressOfAccountOrPersona::sample(), + IntentSignature(signature), ); let signed = sut.signed(intent_signatures.clone()).unwrap(); @@ -152,8 +153,9 @@ mod tests { let mnemonic_with_passphrase = MnemonicWithPassphrase::sample(); let signature = mnemonic_with_passphrase .sign(&sut.auth_intent_hash().hash(), &DerivationPath::sample()); - let intent_signatures = indexmap!( - AddressOfAccountOrPersona::sample() => IntentSignature(signature) + let intent_signatures = IndexMap::kv( + AddressOfAccountOrPersona::sample(), + IntentSignature(signature), ); let signed = sut.signed(intent_signatures.clone()).unwrap(); diff --git a/crates/sargon/src/signing/signables/signable_subintent.rs b/crates/sargon_SPLIT_ME/src/signing/signables/signable_subintent.rs similarity index 100% rename from crates/sargon/src/signing/signables/signable_subintent.rs rename to crates/sargon_SPLIT_ME/src/signing/signables/signable_subintent.rs diff --git a/crates/sargon/src/signing/signables/signable_transaction_intent.rs b/crates/sargon_SPLIT_ME/src/signing/signables/signable_transaction_intent.rs similarity index 100% rename from crates/sargon/src/signing/signables/signable_transaction_intent.rs rename to crates/sargon_SPLIT_ME/src/signing/signables/signable_transaction_intent.rs diff --git a/crates/sargon/src/signing/signatures_outecome_types/maybe_signed_transactions.rs b/crates/sargon_SPLIT_ME/src/signing/signatures_outecome_types/maybe_signed_transactions.rs similarity index 100% rename from crates/sargon/src/signing/signatures_outecome_types/maybe_signed_transactions.rs rename to crates/sargon_SPLIT_ME/src/signing/signatures_outecome_types/maybe_signed_transactions.rs diff --git a/crates/sargon/src/signing/signatures_outecome_types/mod.rs b/crates/sargon_SPLIT_ME/src/signing/signatures_outecome_types/mod.rs similarity index 100% rename from crates/sargon/src/signing/signatures_outecome_types/mod.rs rename to crates/sargon_SPLIT_ME/src/signing/signatures_outecome_types/mod.rs diff --git a/crates/sargon/src/signing/signatures_outecome_types/petition_transaction_outcome.rs b/crates/sargon_SPLIT_ME/src/signing/signatures_outecome_types/petition_transaction_outcome.rs similarity index 100% rename from crates/sargon/src/signing/signatures_outecome_types/petition_transaction_outcome.rs rename to crates/sargon_SPLIT_ME/src/signing/signatures_outecome_types/petition_transaction_outcome.rs diff --git a/crates/sargon/src/signing/signatures_outecome_types/sign_with_factors_outcome.rs b/crates/sargon_SPLIT_ME/src/signing/signatures_outecome_types/sign_with_factors_outcome.rs similarity index 100% rename from crates/sargon/src/signing/signatures_outecome_types/sign_with_factors_outcome.rs rename to crates/sargon_SPLIT_ME/src/signing/signatures_outecome_types/sign_with_factors_outcome.rs diff --git a/crates/sargon/src/signing/signatures_outecome_types/signatures_outcome.rs b/crates/sargon_SPLIT_ME/src/signing/signatures_outecome_types/signatures_outcome.rs similarity index 100% rename from crates/sargon/src/signing/signatures_outecome_types/signatures_outcome.rs rename to crates/sargon_SPLIT_ME/src/signing/signatures_outecome_types/signatures_outcome.rs diff --git a/crates/sargon/src/signing/testing/interactors/mod.rs b/crates/sargon_SPLIT_ME/src/signing/testing/interactors/mod.rs similarity index 100% rename from crates/sargon/src/signing/testing/interactors/mod.rs rename to crates/sargon_SPLIT_ME/src/signing/testing/interactors/mod.rs diff --git a/crates/sargon/src/signing/testing/interactors/test_interactor.rs b/crates/sargon_SPLIT_ME/src/signing/testing/interactors/test_interactor.rs similarity index 100% rename from crates/sargon/src/signing/testing/interactors/test_interactor.rs rename to crates/sargon_SPLIT_ME/src/signing/testing/interactors/test_interactor.rs diff --git a/crates/sargon/src/signing/testing/interactors/test_sign_interactor.rs b/crates/sargon_SPLIT_ME/src/signing/testing/interactors/test_sign_interactor.rs similarity index 100% rename from crates/sargon/src/signing/testing/interactors/test_sign_interactor.rs rename to crates/sargon_SPLIT_ME/src/signing/testing/interactors/test_sign_interactor.rs diff --git a/crates/sargon/src/signing/testing/mod.rs b/crates/sargon_SPLIT_ME/src/signing/testing/mod.rs similarity index 100% rename from crates/sargon/src/signing/testing/mod.rs rename to crates/sargon_SPLIT_ME/src/signing/testing/mod.rs diff --git a/crates/sargon/src/signing/testing/simulated_user.rs b/crates/sargon_SPLIT_ME/src/signing/testing/simulated_user.rs similarity index 100% rename from crates/sargon/src/signing/testing/simulated_user.rs rename to crates/sargon_SPLIT_ME/src/signing/testing/simulated_user.rs diff --git a/crates/sargon/src/signing/testing/test_signatures_collector.rs b/crates/sargon_SPLIT_ME/src/signing/testing/test_signatures_collector.rs similarity index 100% rename from crates/sargon/src/signing/testing/test_signatures_collector.rs rename to crates/sargon_SPLIT_ME/src/signing/testing/test_signatures_collector.rs diff --git a/crates/sargon/src/system/bios/bios.rs b/crates/sargon_SPLIT_ME/src/system/bios/bios.rs similarity index 100% rename from crates/sargon/src/system/bios/bios.rs rename to crates/sargon_SPLIT_ME/src/system/bios/bios.rs diff --git a/crates/sargon-uniffi/src/system/bios/mod.rs b/crates/sargon_SPLIT_ME/src/system/bios/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/system/bios/mod.rs rename to crates/sargon_SPLIT_ME/src/system/bios/mod.rs diff --git a/crates/sargon/src/system/interactors/interactors.rs b/crates/sargon_SPLIT_ME/src/system/interactors/interactors.rs similarity index 100% rename from crates/sargon/src/system/interactors/interactors.rs rename to crates/sargon_SPLIT_ME/src/system/interactors/interactors.rs diff --git a/crates/sargon/src/system/interactors/mod.rs b/crates/sargon_SPLIT_ME/src/system/interactors/mod.rs similarity index 100% rename from crates/sargon/src/system/interactors/mod.rs rename to crates/sargon_SPLIT_ME/src/system/interactors/mod.rs diff --git a/crates/sargon/src/system/interactors/testing/mod.rs b/crates/sargon_SPLIT_ME/src/system/interactors/testing/mod.rs similarity index 100% rename from crates/sargon/src/system/interactors/testing/mod.rs rename to crates/sargon_SPLIT_ME/src/system/interactors/testing/mod.rs diff --git a/crates/sargon/src/system/interactors/testing/test_use_factor_sources_interactors.rs b/crates/sargon_SPLIT_ME/src/system/interactors/testing/test_use_factor_sources_interactors.rs similarity index 100% rename from crates/sargon/src/system/interactors/testing/test_use_factor_sources_interactors.rs rename to crates/sargon_SPLIT_ME/src/system/interactors/testing/test_use_factor_sources_interactors.rs diff --git a/crates/sargon/src/system/interactors/use_factor_sources_interactor.rs b/crates/sargon_SPLIT_ME/src/system/interactors/use_factor_sources_interactor.rs similarity index 100% rename from crates/sargon/src/system/interactors/use_factor_sources_interactor.rs rename to crates/sargon_SPLIT_ME/src/system/interactors/use_factor_sources_interactor.rs diff --git a/crates/sargon/src/system/mod.rs b/crates/sargon_SPLIT_ME/src/system/mod.rs similarity index 78% rename from crates/sargon/src/system/mod.rs rename to crates/sargon_SPLIT_ME/src/system/mod.rs index c92f0dc03..fc1d06dea 100644 --- a/crates/sargon/src/system/mod.rs +++ b/crates/sargon_SPLIT_ME/src/system/mod.rs @@ -2,6 +2,7 @@ mod bios; mod interactors; mod sargon_os; mod subsystems; +mod test_diagnose_instance_duplicates; pub use bios::*; pub use interactors::*; diff --git a/crates/sargon/src/system/sargon_os/delete_account/mod.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/delete_account/mod.rs similarity index 100% rename from crates/sargon/src/system/sargon_os/delete_account/mod.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/delete_account/mod.rs diff --git a/crates/sargon/src/system/sargon_os/delete_account/sargon_os_delete_account.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/delete_account/sargon_os_delete_account.rs similarity index 100% rename from crates/sargon/src/system/sargon_os/delete_account/sargon_os_delete_account.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/delete_account/sargon_os_delete_account.rs diff --git a/crates/sargon-clients/src/clients/client/factor_instances_cache_client/models/mod.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/delete_account/support/mod.rs similarity index 100% rename from crates/sargon-clients/src/clients/client/factor_instances_cache_client/models/mod.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/delete_account/support/mod.rs diff --git a/crates/sargon/src/system/sargon_os/delete_account/support/outcome.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/delete_account/support/outcome.rs similarity index 100% rename from crates/sargon/src/system/sargon_os/delete_account/support/outcome.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/delete_account/support/outcome.rs diff --git a/crates/sargon/src/system/sargon_os/entity_creating_with_factor_source_and_derivation_outcome.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/entity_creating_with_factor_source_and_derivation_outcome.rs similarity index 100% rename from crates/sargon/src/system/sargon_os/entity_creating_with_factor_source_and_derivation_outcome.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/entity_creating_with_factor_source_and_derivation_outcome.rs diff --git a/crates/sargon/src/system/sargon_os/factor_instances_provider_unit_tests.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/factor_instances_provider_unit_tests.rs similarity index 100% rename from crates/sargon/src/system/sargon_os/factor_instances_provider_unit_tests.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/factor_instances_provider_unit_tests.rs diff --git a/crates/sargon/src/system/sargon_os/mod.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/mod.rs similarity index 100% rename from crates/sargon/src/system/sargon_os/mod.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/mod.rs diff --git a/crates/sargon/src/system/sargon_os/pre_authorization/mod.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/pre_authorization/mod.rs similarity index 100% rename from crates/sargon/src/system/sargon_os/pre_authorization/mod.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/pre_authorization/mod.rs diff --git a/crates/sargon/src/system/sargon_os/pre_authorization/sargon_os_create_subintent.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/pre_authorization/sargon_os_create_subintent.rs similarity index 100% rename from crates/sargon/src/system/sargon_os/pre_authorization/sargon_os_create_subintent.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/pre_authorization/sargon_os_create_subintent.rs diff --git a/crates/sargon/src/system/sargon_os/pre_authorization/sargon_os_pre_authorization_status.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/pre_authorization/sargon_os_pre_authorization_status.rs similarity index 100% rename from crates/sargon/src/system/sargon_os/pre_authorization/sargon_os_pre_authorization_status.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/pre_authorization/sargon_os_pre_authorization_status.rs diff --git a/crates/sargon-uniffi/src/system/sargon_os/pre_authorization/support/mod.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/pre_authorization/support/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/system/sargon_os/pre_authorization/support/mod.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/pre_authorization/support/mod.rs diff --git a/crates/sargon/src/system/sargon_os/pre_authorization/support/pre_authorization_status.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/pre_authorization/support/pre_authorization_status.rs similarity index 100% rename from crates/sargon/src/system/sargon_os/pre_authorization/support/pre_authorization_status.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/pre_authorization/support/pre_authorization_status.rs diff --git a/crates/sargon/src/system/sargon_os/profile_state_holder.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/profile_state_holder.rs similarity index 100% rename from crates/sargon/src/system/sargon_os/profile_state_holder.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/profile_state_holder.rs diff --git a/crates/sargon/src/system/sargon_os/sargon_os.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os.rs similarity index 99% rename from crates/sargon/src/system/sargon_os/sargon_os.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os.rs index 0a1a72b70..d80779481 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os.rs +++ b/crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os.rs @@ -24,7 +24,7 @@ impl WithBios for Clients { /// So that we do not have to go through `self.clients`, /// but can use e.g. `self.secure_storage` directly. -impl Deref for SargonOS { +impl std::ops::Deref for SargonOS { type Target = Clients; fn deref(&self) -> &Self::Target { diff --git a/crates/sargon/src/system/sargon_os/sargon_os_accounts.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_accounts.rs similarity index 99% rename from crates/sargon/src/system/sargon_os/sargon_os_accounts.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_accounts.rs index 04d3a8aab..fd402dba6 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os_accounts.rs +++ b/crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_accounts.rs @@ -1222,7 +1222,7 @@ mod tests { // ASSERT assert_eq!(accounts.len(), n); assert_eq!( - HashSet::from_iter( + HashSet::::from_iter( accounts.clone().into_iter().map(|a| a.address()) ) .len(), diff --git a/crates/sargon/src/system/sargon_os/sargon_os_entities_linked_to_factor_source.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_entities_linked_to_factor_source.rs similarity index 100% rename from crates/sargon/src/system/sargon_os/sargon_os_entities_linked_to_factor_source.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_entities_linked_to_factor_source.rs diff --git a/crates/sargon/src/system/sargon_os/sargon_os_factors.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_factors.rs similarity index 99% rename from crates/sargon/src/system/sargon_os/sargon_os_factors.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_factors.rs index 2848c523e..230cc98cb 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os_factors.rs +++ b/crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_factors.rs @@ -430,9 +430,9 @@ impl SargonOS { device_factor_source.clone(), ) }) - .log_info( - "Successfully loaded Private DeviceFactorSource from SecureStorage", - ) + // .log_info( + // "Successfully loaded Private DeviceFactorSource from SecureStorage", + // ) } /// Tries to load a `MnemonicWithPassphrase` from secure storage diff --git a/crates/sargon/src/system/sargon_os/sargon_os_gateway.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_gateway.rs similarity index 100% rename from crates/sargon/src/system/sargon_os/sargon_os_gateway.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_gateway.rs diff --git a/crates/sargon/src/system/sargon_os/sargon_os_personas.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_personas.rs similarity index 100% rename from crates/sargon/src/system/sargon_os/sargon_os_personas.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_personas.rs diff --git a/crates/sargon/src/system/sargon_os/sargon_os_profile.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_profile.rs similarity index 100% rename from crates/sargon/src/system/sargon_os/sargon_os_profile.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_profile.rs diff --git a/crates/sargon/src/system/sargon_os/sargon_os_security_center.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_security_center.rs similarity index 100% rename from crates/sargon/src/system/sargon_os/sargon_os_security_center.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_security_center.rs diff --git a/crates/sargon/src/system/sargon_os/sargon_os_security_structures.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_security_structures.rs similarity index 100% rename from crates/sargon/src/system/sargon_os/sargon_os_security_structures.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_security_structures.rs diff --git a/crates/sargon/src/system/sargon_os/sargon_os_signing.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_signing.rs similarity index 100% rename from crates/sargon/src/system/sargon_os/sargon_os_signing.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_signing.rs diff --git a/crates/sargon/src/system/sargon_os/sargon_os_sync_accounts.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_sync_accounts.rs similarity index 97% rename from crates/sargon/src/system/sargon_os/sargon_os_sync_accounts.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_sync_accounts.rs index 42b103757..c131f92a9 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os_sync_accounts.rs +++ b/crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_sync_accounts.rs @@ -153,10 +153,10 @@ mod tests { // ASSERT assert_eq!( accounts_status, - indexmap!( - account_address_deleted => true, - account_address_not_deleted => false, - ) + IndexMap::::from_iter([ + (account_address_deleted, true), + (account_address_not_deleted, false), + ]) ) } diff --git a/crates/sargon/src/system/sargon_os/transactions/mod.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/mod.rs similarity index 100% rename from crates/sargon/src/system/sargon_os/transactions/mod.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/mod.rs diff --git a/crates/sargon/src/system/sargon_os/transactions/sargon_os_transaction_analysis.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/sargon_os_transaction_analysis.rs similarity index 100% rename from crates/sargon/src/system/sargon_os/transactions/sargon_os_transaction_analysis.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/sargon_os_transaction_analysis.rs diff --git a/crates/sargon/src/system/sargon_os/transactions/sargon_os_transaction_status.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/sargon_os_transaction_status.rs similarity index 100% rename from crates/sargon/src/system/sargon_os/transactions/sargon_os_transaction_status.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/sargon_os_transaction_status.rs diff --git a/crates/sargon/src/system/sargon_os/transactions/sargon_os_transaction_submit.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/sargon_os_transaction_submit.rs similarity index 100% rename from crates/sargon/src/system/sargon_os/transactions/sargon_os_transaction_submit.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/sargon_os_transaction_submit.rs diff --git a/crates/sargon/src/system/sargon_os/transactions/support/mod.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/support/mod.rs similarity index 100% rename from crates/sargon/src/system/sargon_os/transactions/support/mod.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/support/mod.rs diff --git a/crates/sargon/src/system/sargon_os/transactions/support/pre_auth_to_review.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/support/pre_auth_to_review.rs similarity index 100% rename from crates/sargon/src/system/sargon_os/transactions/support/pre_auth_to_review.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/support/pre_auth_to_review.rs diff --git a/crates/sargon/src/system/sargon_os/transactions/support/signable_manifest_summary.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/support/signable_manifest_summary.rs similarity index 100% rename from crates/sargon/src/system/sargon_os/transactions/support/signable_manifest_summary.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/support/signable_manifest_summary.rs diff --git a/crates/sargon/src/system/sargon_os/transactions/support/transaction_to_review.rs b/crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/support/transaction_to_review.rs similarity index 100% rename from crates/sargon/src/system/sargon_os/transactions/support/transaction_to_review.rs rename to crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/support/transaction_to_review.rs diff --git a/crates/sargon-uniffi/src/system/subsystems/README.md b/crates/sargon_SPLIT_ME/src/system/subsystems/README.md similarity index 100% rename from crates/sargon-uniffi/src/system/subsystems/README.md rename to crates/sargon_SPLIT_ME/src/system/subsystems/README.md diff --git a/crates/sargon/src/system/subsystems/log_system/log_system.rs b/crates/sargon_SPLIT_ME/src/system/subsystems/log_system/log_system.rs similarity index 100% rename from crates/sargon/src/system/subsystems/log_system/log_system.rs rename to crates/sargon_SPLIT_ME/src/system/subsystems/log_system/log_system.rs diff --git a/crates/sargon-uniffi/src/system/subsystems/log_system/mod.rs b/crates/sargon_SPLIT_ME/src/system/subsystems/log_system/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/system/subsystems/log_system/mod.rs rename to crates/sargon_SPLIT_ME/src/system/subsystems/log_system/mod.rs diff --git a/crates/sargon-uniffi/src/system/subsystems/mod.rs b/crates/sargon_SPLIT_ME/src/system/subsystems/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/system/subsystems/mod.rs rename to crates/sargon_SPLIT_ME/src/system/subsystems/mod.rs diff --git a/crates/sargon/src/needs_a_new_home_dumping_ground/diagnose_instance_duplicates.rs b/crates/sargon_SPLIT_ME/src/system/test_diagnose_instance_duplicates.rs similarity index 100% rename from crates/sargon/src/needs_a_new_home_dumping_ground/diagnose_instance_duplicates.rs rename to crates/sargon_SPLIT_ME/src/system/test_diagnose_instance_duplicates.rs diff --git a/crates/sargon/src/types/hd_signature.rs b/crates/sargon_SPLIT_ME/src/types/hd_signature.rs similarity index 100% rename from crates/sargon/src/types/hd_signature.rs rename to crates/sargon_SPLIT_ME/src/types/hd_signature.rs diff --git a/crates/sargon/src/types/hd_signature_input.rs b/crates/sargon_SPLIT_ME/src/types/hd_signature_input.rs similarity index 100% rename from crates/sargon/src/types/hd_signature_input.rs rename to crates/sargon_SPLIT_ME/src/types/hd_signature_input.rs diff --git a/crates/sargon/src/types/invalid_transaction_if_neglected.rs b/crates/sargon_SPLIT_ME/src/types/invalid_transaction_if_neglected.rs similarity index 100% rename from crates/sargon/src/types/invalid_transaction_if_neglected.rs rename to crates/sargon_SPLIT_ME/src/types/invalid_transaction_if_neglected.rs diff --git a/crates/sargon/src/types/mod.rs b/crates/sargon_SPLIT_ME/src/types/mod.rs similarity index 100% rename from crates/sargon/src/types/mod.rs rename to crates/sargon_SPLIT_ME/src/types/mod.rs diff --git a/crates/sargon/src/types/owned_types/mod.rs b/crates/sargon_SPLIT_ME/src/types/owned_types/mod.rs similarity index 100% rename from crates/sargon/src/types/owned_types/mod.rs rename to crates/sargon_SPLIT_ME/src/types/owned_types/mod.rs diff --git a/crates/sargon/src/types/owned_types/owned.rs b/crates/sargon_SPLIT_ME/src/types/owned_types/owned.rs similarity index 100% rename from crates/sargon/src/types/owned_types/owned.rs rename to crates/sargon_SPLIT_ME/src/types/owned_types/owned.rs diff --git a/crates/sargon/src/types/owned_types/owned_factor_instance.rs b/crates/sargon_SPLIT_ME/src/types/owned_types/owned_factor_instance.rs similarity index 100% rename from crates/sargon/src/types/owned_types/owned_factor_instance.rs rename to crates/sargon_SPLIT_ME/src/types/owned_types/owned_factor_instance.rs diff --git a/crates/sargon/fixtures/Package.swift b/crates/sargon_SPLIT_ME/tests/Package.swift similarity index 100% rename from crates/sargon/fixtures/Package.swift rename to crates/sargon_SPLIT_ME/tests/Package.swift diff --git a/crates/sargon/tests/integration/main.rs b/crates/sargon_SPLIT_ME/tests/integration/main.rs similarity index 99% rename from crates/sargon/tests/integration/main.rs rename to crates/sargon_SPLIT_ME/tests/integration/main.rs index ad3de081c..9eb73b96e 100644 --- a/crates/sargon/tests/integration/main.rs +++ b/crates/sargon_SPLIT_ME/tests/integration/main.rs @@ -91,9 +91,7 @@ mod integration_tests { let transfers = PerRecipientAssetTransfers::new( from, [PerRecipientAssetTransfer::new( - OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { - value: to, - }, + AccountOrAddressOf::AddressOfExternalAccount { value: to }, [PerRecipientFungibleTransfer::new( resource, amount, true, None, )], diff --git a/crates/sargon/tests/vectors/main.rs b/crates/sargon_SPLIT_ME/tests/vectors/main.rs similarity index 100% rename from crates/sargon/tests/vectors/main.rs rename to crates/sargon_SPLIT_ME/tests/vectors/main.rs diff --git a/crates/system/clients/clients/Cargo.toml b/crates/system/clients/clients/Cargo.toml new file mode 100644 index 000000000..e00323051 --- /dev/null +++ b/crates/system/clients/clients/Cargo.toml @@ -0,0 +1,31 @@ +[package] +name = "clients" +version = "1.1.99" +edition = "2021" +build = "build.rs" + +[dependencies] +# === SARGON CRATES === +core-collections = { path = "../../../core/collections" } +profile = { path = "../../../profile/models/profile_SPLIT_ME" } +factors-supporting-types = { path = "../../../factors/supporting-types" } +profile-supporting-types = { path = "../../../profile/models/supporting-types" } +drivers = { path = "../../../system/drivers" } +http-client = { path = "../../../system/clients/http" } +gateway-client-and-api = { path = "../../../gateway/client-and-api" } +hierarchical-deterministic = { path = "../../../crypto/hd" } + +# === RADIX DEPENDENCIES === +# None + +# === EXTERNAL DEPENDENCIES === +async-trait = { workspace = true } +derive_more = { workspace = true } +enum-as-inner = { workspace = true } +pretty_assertions = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +serde_with = { workspace = true } + +[dev-dependencies] +actix-rt = { workspace = true } diff --git a/crates/system/clients/clients/build.rs b/crates/system/clients/clients/build.rs new file mode 100644 index 000000000..b1b5aed46 --- /dev/null +++ b/crates/system/clients/clients/build.rs @@ -0,0 +1,11 @@ +use std::env; +use std::path::Path; + +pub fn main() { + // Paths for reading fixtures used by tests + let cargo = Path::new(env!("CARGO_MANIFEST_DIR")); + let target = cargo.join("../../../../target"); + println!("cargo:rustc-env=TARGET_PATH={}/", target.display()); + let tmp = target.join("tmp"); + println!("cargo:rustc-env=TMP_PATH={}/", tmp.display()); +} diff --git a/crates/sargon-clients/src/clients/README.md b/crates/system/clients/clients/src/clients/README.md similarity index 100% rename from crates/sargon-clients/src/clients/README.md rename to crates/system/clients/clients/src/clients/README.md diff --git a/crates/sargon-clients/src/clients/client/entropy_client/entropy_client.rs b/crates/system/clients/clients/src/clients/client/entropy_client/entropy_client.rs similarity index 100% rename from crates/sargon-clients/src/clients/client/entropy_client/entropy_client.rs rename to crates/system/clients/clients/src/clients/client/entropy_client/entropy_client.rs diff --git a/crates/sargon-clients/src/clients/client/entropy_client/mod.rs b/crates/system/clients/clients/src/clients/client/entropy_client/mod.rs similarity index 100% rename from crates/sargon-clients/src/clients/client/entropy_client/mod.rs rename to crates/system/clients/clients/src/clients/client/entropy_client/mod.rs diff --git a/crates/sargon-clients/src/clients/client/event_bus_client/event_bus_client.rs b/crates/system/clients/clients/src/clients/client/event_bus_client/event_bus_client.rs similarity index 100% rename from crates/sargon-clients/src/clients/client/event_bus_client/event_bus_client.rs rename to crates/system/clients/clients/src/clients/client/event_bus_client/event_bus_client.rs diff --git a/crates/sargon-clients/src/clients/client/event_bus_client/mod.rs b/crates/system/clients/clients/src/clients/client/event_bus_client/mod.rs similarity index 100% rename from crates/sargon-clients/src/clients/client/event_bus_client/mod.rs rename to crates/system/clients/clients/src/clients/client/event_bus_client/mod.rs diff --git a/crates/sargon-clients/src/clients/client/factor_instances_cache_client/cache/factor_instances_cache.rs b/crates/system/clients/clients/src/clients/client/factor_instances_cache_client/cache/factor_instances_cache.rs similarity index 100% rename from crates/sargon-clients/src/clients/client/factor_instances_cache_client/cache/factor_instances_cache.rs rename to crates/system/clients/clients/src/clients/client/factor_instances_cache_client/cache/factor_instances_cache.rs diff --git a/crates/sargon-clients/src/clients/client/factor_instances_cache_client/cache/keyed_instances.rs b/crates/system/clients/clients/src/clients/client/factor_instances_cache_client/cache/keyed_instances.rs similarity index 100% rename from crates/sargon-clients/src/clients/client/factor_instances_cache_client/cache/keyed_instances.rs rename to crates/system/clients/clients/src/clients/client/factor_instances_cache_client/cache/keyed_instances.rs diff --git a/crates/sargon-clients/src/clients/client/factor_instances_cache_client/cache/mod.rs b/crates/system/clients/clients/src/clients/client/factor_instances_cache_client/cache/mod.rs similarity index 100% rename from crates/sargon-clients/src/clients/client/factor_instances_cache_client/cache/mod.rs rename to crates/system/clients/clients/src/clients/client/factor_instances_cache_client/cache/mod.rs diff --git a/crates/sargon-clients/src/clients/client/factor_instances_cache_client/cache/serializable_cache/factor_instances_cache_snapshot.rs b/crates/system/clients/clients/src/clients/client/factor_instances_cache_client/cache/serializable_cache/factor_instances_cache_snapshot.rs similarity index 100% rename from crates/sargon-clients/src/clients/client/factor_instances_cache_client/cache/serializable_cache/factor_instances_cache_snapshot.rs rename to crates/system/clients/clients/src/clients/client/factor_instances_cache_client/cache/serializable_cache/factor_instances_cache_snapshot.rs diff --git a/crates/sargon-clients/src/clients/client/factor_instances_cache_client/cache/serializable_cache/factor_source_id_from_hash_dense_key.rs b/crates/system/clients/clients/src/clients/client/factor_instances_cache_client/cache/serializable_cache/factor_source_id_from_hash_dense_key.rs similarity index 100% rename from crates/sargon-clients/src/clients/client/factor_instances_cache_client/cache/serializable_cache/factor_source_id_from_hash_dense_key.rs rename to crates/system/clients/clients/src/clients/client/factor_instances_cache_client/cache/serializable_cache/factor_source_id_from_hash_dense_key.rs diff --git a/crates/sargon-clients/src/clients/client/factor_instances_cache_client/cache/serializable_cache/mod.rs b/crates/system/clients/clients/src/clients/client/factor_instances_cache_client/cache/serializable_cache/mod.rs similarity index 100% rename from crates/sargon-clients/src/clients/client/factor_instances_cache_client/cache/serializable_cache/mod.rs rename to crates/system/clients/clients/src/clients/client/factor_instances_cache_client/cache/serializable_cache/mod.rs diff --git a/crates/sargon-clients/src/clients/client/factor_instances_cache_client/client.rs b/crates/system/clients/clients/src/clients/client/factor_instances_cache_client/client.rs similarity index 100% rename from crates/sargon-clients/src/clients/client/factor_instances_cache_client/client.rs rename to crates/system/clients/clients/src/clients/client/factor_instances_cache_client/client.rs diff --git a/crates/sargon-clients/src/clients/client/factor_instances_cache_client/mod.rs b/crates/system/clients/clients/src/clients/client/factor_instances_cache_client/mod.rs similarity index 100% rename from crates/sargon-clients/src/clients/client/factor_instances_cache_client/mod.rs rename to crates/system/clients/clients/src/clients/client/factor_instances_cache_client/mod.rs diff --git a/crates/sargon-uniffi/src/system/sargon_os/delete_account/support/mod.rs b/crates/system/clients/clients/src/clients/client/factor_instances_cache_client/models/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/system/sargon_os/delete_account/support/mod.rs rename to crates/system/clients/clients/src/clients/client/factor_instances_cache_client/models/mod.rs diff --git a/crates/sargon-clients/src/clients/client/factor_instances_cache_client/models/outcome.rs b/crates/system/clients/clients/src/clients/client/factor_instances_cache_client/models/outcome.rs similarity index 100% rename from crates/sargon-clients/src/clients/client/factor_instances_cache_client/models/outcome.rs rename to crates/system/clients/clients/src/clients/client/factor_instances_cache_client/models/outcome.rs diff --git a/crates/sargon-clients/src/clients/client/file_system_client/file_system_client.rs b/crates/system/clients/clients/src/clients/client/file_system_client/file_system_client.rs similarity index 95% rename from crates/sargon-clients/src/clients/client/file_system_client/file_system_client.rs rename to crates/system/clients/clients/src/clients/client/file_system_client/file_system_client.rs index 153fd423f..8be706132 100644 --- a/crates/sargon-clients/src/clients/client/file_system_client/file_system_client.rs +++ b/crates/system/clients/clients/src/clients/client/file_system_client/file_system_client.rs @@ -1,5 +1,5 @@ use crate::prelude::*; -use std::path::Path; +use std::{fs, path::Path}; #[derive(Debug)] pub struct FileSystemClient { @@ -120,13 +120,13 @@ mod tests { let dir_path = dir_path.as_ref(); assert!(std::fs::create_dir_all(dir_path).is_ok()); - let file_name = format!("delete-this--generated-by-test-{}.txt", id()); + let file_name = + format!("delete-this--generated-by-test-{}.txt", Uuid::new_v4()); dir_path.join(file_name) } fn file_in_tmp() -> PathBuf { - let dir_path = - Path::new(env!("CARGO_MANIFEST_DIR")).join("../../target/tmp"); + let dir_path = Path::new(env!("TMP_PATH")); file_in_dir(dir_path) } @@ -252,11 +252,8 @@ mod tests { #[actix_rt::test] async fn test_delete_dir_does_not_work() { - let path = String::from( - Path::new(env!("CARGO_MANIFEST_DIR")) - .join("../../target/") - .to_string_lossy(), - ); + let path = + String::from(Path::new(env!("TARGET_PATH")).to_string_lossy()); let sut = SUT::test(); let res = sut.delete_file(path.clone()).await; assert_eq!(res, Err(CommonError::FailedToDeleteFile { path })); diff --git a/crates/sargon-clients/src/clients/client/file_system_client/mod.rs b/crates/system/clients/clients/src/clients/client/file_system_client/mod.rs similarity index 100% rename from crates/sargon-clients/src/clients/client/file_system_client/mod.rs rename to crates/system/clients/clients/src/clients/client/file_system_client/mod.rs diff --git a/crates/sargon-clients/src/clients/client/host_info_client/host_info_client.rs b/crates/system/clients/clients/src/clients/client/host_info_client/host_info_client.rs similarity index 100% rename from crates/sargon-clients/src/clients/client/host_info_client/host_info_client.rs rename to crates/system/clients/clients/src/clients/client/host_info_client/host_info_client.rs diff --git a/crates/sargon-clients/src/clients/client/host_info_client/mod.rs b/crates/system/clients/clients/src/clients/client/host_info_client/mod.rs similarity index 100% rename from crates/sargon-clients/src/clients/client/host_info_client/mod.rs rename to crates/system/clients/clients/src/clients/client/host_info_client/mod.rs diff --git a/crates/sargon-clients/src/clients/client/mod.rs b/crates/system/clients/clients/src/clients/client/mod.rs similarity index 100% rename from crates/sargon-clients/src/clients/client/mod.rs rename to crates/system/clients/clients/src/clients/client/mod.rs diff --git a/crates/sargon-clients/src/clients/client/profile_change_client/mod.rs b/crates/system/clients/clients/src/clients/client/profile_change_client/mod.rs similarity index 100% rename from crates/sargon-clients/src/clients/client/profile_change_client/mod.rs rename to crates/system/clients/clients/src/clients/client/profile_change_client/mod.rs diff --git a/crates/sargon-clients/src/clients/client/profile_change_client/profile_change_client.rs b/crates/system/clients/clients/src/clients/client/profile_change_client/profile_change_client.rs similarity index 100% rename from crates/sargon-clients/src/clients/client/profile_change_client/profile_change_client.rs rename to crates/system/clients/clients/src/clients/client/profile_change_client/profile_change_client.rs diff --git a/crates/sargon-clients/src/clients/client/secure_storage_client/mod.rs b/crates/system/clients/clients/src/clients/client/secure_storage_client/mod.rs similarity index 100% rename from crates/sargon-clients/src/clients/client/secure_storage_client/mod.rs rename to crates/system/clients/clients/src/clients/client/secure_storage_client/mod.rs diff --git a/crates/sargon-clients/src/clients/client/secure_storage_client/secure_storage_client.rs b/crates/system/clients/clients/src/clients/client/secure_storage_client/secure_storage_client.rs similarity index 100% rename from crates/sargon-clients/src/clients/client/secure_storage_client/secure_storage_client.rs rename to crates/system/clients/clients/src/clients/client/secure_storage_client/secure_storage_client.rs diff --git a/crates/sargon-clients/src/clients/client/unsafe_storage_client/mod.rs b/crates/system/clients/clients/src/clients/client/unsafe_storage_client/mod.rs similarity index 100% rename from crates/sargon-clients/src/clients/client/unsafe_storage_client/mod.rs rename to crates/system/clients/clients/src/clients/client/unsafe_storage_client/mod.rs diff --git a/crates/sargon-clients/src/clients/client/unsafe_storage_client/unsafe_storage_client.rs b/crates/system/clients/clients/src/clients/client/unsafe_storage_client/unsafe_storage_client.rs similarity index 100% rename from crates/sargon-clients/src/clients/client/unsafe_storage_client/unsafe_storage_client.rs rename to crates/system/clients/clients/src/clients/client/unsafe_storage_client/unsafe_storage_client.rs diff --git a/crates/sargon-clients/src/clients/clients.rs b/crates/system/clients/clients/src/clients/clients.rs similarity index 100% rename from crates/sargon-clients/src/clients/clients.rs rename to crates/system/clients/clients/src/clients/clients.rs diff --git a/crates/sargon-clients/src/clients/mod.rs b/crates/system/clients/clients/src/clients/mod.rs similarity index 100% rename from crates/sargon-clients/src/clients/mod.rs rename to crates/system/clients/clients/src/clients/mod.rs diff --git a/crates/system/clients/clients/src/lib.rs b/crates/system/clients/clients/src/lib.rs new file mode 100644 index 000000000..39a6d3b69 --- /dev/null +++ b/crates/system/clients/clients/src/lib.rs @@ -0,0 +1,20 @@ +mod clients; + +pub mod prelude { + pub use core_collections::prelude::*; + pub use factors_supporting_types::prelude::*; + pub use gateway_client_and_api::prelude::*; + pub use profile::prelude::*; + pub use profile_supporting_types::prelude::*; + + pub use crate::clients::*; + + #[cfg(test)] + pub(crate) use serde::Serializer; + + #[cfg(test)] + pub(crate) use serde_json::json; + pub use std::sync::{Arc, RwLock}; +} + +pub use prelude::*; diff --git a/crates/http-client/Cargo.toml b/crates/system/clients/http/Cargo.toml similarity index 63% rename from crates/http-client/Cargo.toml rename to crates/system/clients/http/Cargo.toml index 2bcb66169..838823267 100644 --- a/crates/http-client/Cargo.toml +++ b/crates/system/clients/http/Cargo.toml @@ -5,8 +5,10 @@ edition = "2021" [dependencies] # === SARGON CRATES === -sargon-core = { path = "../sargon-core" } -sargon-drivers = { path = "../sargon-drivers" } +drivers = { path = "../../../system/drivers" } +bytes = { path = "../../../common/bytes" } +error = { path = "../../../core/error" } +sargon-core-utils = { path = "../../../core/utils" } # === RADIX DEPENDENCIES === diff --git a/crates/http-client/src/http_client.rs b/crates/system/clients/http/src/http_client.rs similarity index 100% rename from crates/http-client/src/http_client.rs rename to crates/system/clients/http/src/http_client.rs diff --git a/crates/system/clients/http/src/lib.rs b/crates/system/clients/http/src/lib.rs new file mode 100644 index 000000000..dad49b0ed --- /dev/null +++ b/crates/system/clients/http/src/lib.rs @@ -0,0 +1,15 @@ +mod http_client; + +pub mod prelude { + pub use crate::http_client::*; + + pub(crate) use bytes::prelude::*; + pub(crate) use drivers::prelude::*; + pub(crate) use sargon_core_utils::prelude::*; + + pub(crate) use serde::Deserialize; + + pub(crate) use std::sync::Arc; +} + +pub use prelude::*; diff --git a/crates/sargon-drivers/Cargo.toml b/crates/system/drivers/Cargo.toml similarity index 56% rename from crates/sargon-drivers/Cargo.toml rename to crates/system/drivers/Cargo.toml index 3d0e04d7c..8150be461 100644 --- a/crates/sargon-drivers/Cargo.toml +++ b/crates/system/drivers/Cargo.toml @@ -1,15 +1,16 @@ [package] -name = "sargon-drivers" +name = "drivers" version = "1.1.99" edition = "2021" +build = "build.rs" [dependencies] # === SARGON CRATES === -sargon-core = { path = "../sargon-core" } -sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } -sargon-addresses = { path = "../sargon-addresses" } -sargon-profile = { path = "../sargon-profile" } -sargon-profile-supporting-types = { path = "../sargon-profile-supporting-types" } +hierarchical-deterministic = { path = "../../crypto/hd" } +addresses = { path = "../../crypto/addresses" } +profile = { path = "../../profile/models/profile_SPLIT_ME" } +profile-supporting-types = { path = "../../profile/models/supporting-types" } +time-utils = { path = "../../core/time-utils" } # === RADIX DEPENDENCIES === # None @@ -18,6 +19,8 @@ sargon-profile-supporting-types = { path = "../sargon-profile-supporting-types" async-trait = { workspace = true } derive_more = { workspace = true } enum-iterator = { workspace = true } +indexmap = { workspace = true } +itertools = { workspace = true } log = { workspace = true } pretty_env_logger = { workspace = true } reqwest = { workspace = true } diff --git a/crates/system/drivers/build.rs b/crates/system/drivers/build.rs new file mode 100644 index 000000000..a59ddbd99 --- /dev/null +++ b/crates/system/drivers/build.rs @@ -0,0 +1,11 @@ +use std::env; +use std::path::Path; + +pub fn main() { + // Paths for reading fixtures used by tests + let cargo = Path::new(env!("CARGO_MANIFEST_DIR")); + let target = cargo.join("../../../target"); + println!("cargo:rustc-env=TARGET_PATH={}/", target.display()); + let tmp = target.join("tmp"); + println!("cargo:rustc-env=TMP_PATH={}/", tmp.display()); +} diff --git a/crates/sargon-drivers/src/drivers/README.md b/crates/system/drivers/src/drivers/README.md similarity index 100% rename from crates/sargon-drivers/src/drivers/README.md rename to crates/system/drivers/src/drivers/README.md diff --git a/crates/sargon-drivers/src/drivers/drivers.rs b/crates/system/drivers/src/drivers/drivers.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/drivers.rs rename to crates/system/drivers/src/drivers/drivers.rs diff --git a/crates/sargon-drivers/src/drivers/entropy_provider_driver/entropy_provider_driver.rs b/crates/system/drivers/src/drivers/entropy_provider_driver/entropy_provider_driver.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/entropy_provider_driver/entropy_provider_driver.rs rename to crates/system/drivers/src/drivers/entropy_provider_driver/entropy_provider_driver.rs diff --git a/crates/sargon-drivers/src/drivers/entropy_provider_driver/mod.rs b/crates/system/drivers/src/drivers/entropy_provider_driver/mod.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/entropy_provider_driver/mod.rs rename to crates/system/drivers/src/drivers/entropy_provider_driver/mod.rs diff --git a/crates/sargon-drivers/src/drivers/entropy_provider_driver/support/mod.rs b/crates/system/drivers/src/drivers/entropy_provider_driver/support/mod.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/entropy_provider_driver/support/mod.rs rename to crates/system/drivers/src/drivers/entropy_provider_driver/support/mod.rs diff --git a/crates/sargon-drivers/src/drivers/entropy_provider_driver/support/test/mod.rs b/crates/system/drivers/src/drivers/entropy_provider_driver/support/test/mod.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/entropy_provider_driver/support/test/mod.rs rename to crates/system/drivers/src/drivers/entropy_provider_driver/support/test/mod.rs diff --git a/crates/sargon-drivers/src/drivers/entropy_provider_driver/support/test/rust_entropy_driver.rs b/crates/system/drivers/src/drivers/entropy_provider_driver/support/test/rust_entropy_driver.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/entropy_provider_driver/support/test/rust_entropy_driver.rs rename to crates/system/drivers/src/drivers/entropy_provider_driver/support/test/rust_entropy_driver.rs diff --git a/crates/sargon-drivers/src/drivers/event_bus_driver/event_bus_driver.rs b/crates/system/drivers/src/drivers/event_bus_driver/event_bus_driver.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/event_bus_driver/event_bus_driver.rs rename to crates/system/drivers/src/drivers/event_bus_driver/event_bus_driver.rs diff --git a/crates/sargon-drivers/src/drivers/event_bus_driver/mod.rs b/crates/system/drivers/src/drivers/event_bus_driver/mod.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/event_bus_driver/mod.rs rename to crates/system/drivers/src/drivers/event_bus_driver/mod.rs diff --git a/crates/sargon-drivers/src/drivers/event_bus_driver/support/event.rs b/crates/system/drivers/src/drivers/event_bus_driver/support/event.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/event_bus_driver/support/event.rs rename to crates/system/drivers/src/drivers/event_bus_driver/support/event.rs diff --git a/crates/sargon-drivers/src/drivers/event_bus_driver/support/event_kind.rs b/crates/system/drivers/src/drivers/event_bus_driver/support/event_kind.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/event_bus_driver/support/event_kind.rs rename to crates/system/drivers/src/drivers/event_bus_driver/support/event_kind.rs diff --git a/crates/sargon-drivers/src/drivers/event_bus_driver/support/event_notification.rs b/crates/system/drivers/src/drivers/event_bus_driver/support/event_notification.rs similarity index 96% rename from crates/sargon-drivers/src/drivers/event_bus_driver/support/event_notification.rs rename to crates/system/drivers/src/drivers/event_bus_driver/support/event_notification.rs index 332405df6..589dc2140 100644 --- a/crates/sargon-drivers/src/drivers/event_bus_driver/support/event_notification.rs +++ b/crates/system/drivers/src/drivers/event_bus_driver/support/event_notification.rs @@ -1,3 +1,5 @@ +use time_utils::now; + use crate::prelude::*; /// A notification containing a timestamped and unique `event`, host client @@ -12,7 +14,7 @@ pub struct EventNotification { impl EventNotification { pub fn new(event: Event) -> Self { Self { - id: id(), + id: Uuid::new_v4(), event, timestamp: now(), } diff --git a/crates/sargon-drivers/src/drivers/event_bus_driver/support/event_profile_modified.rs b/crates/system/drivers/src/drivers/event_bus_driver/support/event_profile_modified.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/event_bus_driver/support/event_profile_modified.rs rename to crates/system/drivers/src/drivers/event_bus_driver/support/event_profile_modified.rs diff --git a/crates/sargon-drivers/src/drivers/event_bus_driver/support/has_event_kind.rs b/crates/system/drivers/src/drivers/event_bus_driver/support/has_event_kind.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/event_bus_driver/support/has_event_kind.rs rename to crates/system/drivers/src/drivers/event_bus_driver/support/has_event_kind.rs diff --git a/crates/sargon-drivers/src/drivers/event_bus_driver/support/mod.rs b/crates/system/drivers/src/drivers/event_bus_driver/support/mod.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/event_bus_driver/support/mod.rs rename to crates/system/drivers/src/drivers/event_bus_driver/support/mod.rs diff --git a/crates/sargon-drivers/src/drivers/event_bus_driver/support/test/mod.rs b/crates/system/drivers/src/drivers/event_bus_driver/support/test/mod.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/event_bus_driver/support/test/mod.rs rename to crates/system/drivers/src/drivers/event_bus_driver/support/test/mod.rs diff --git a/crates/sargon-drivers/src/drivers/event_bus_driver/support/test/rust_event_bus_driver.rs b/crates/system/drivers/src/drivers/event_bus_driver/support/test/rust_event_bus_driver.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/event_bus_driver/support/test/rust_event_bus_driver.rs rename to crates/system/drivers/src/drivers/event_bus_driver/support/test/rust_event_bus_driver.rs diff --git a/crates/sargon-drivers/src/drivers/file_system_driver/file_system_driver.rs b/crates/system/drivers/src/drivers/file_system_driver/file_system_driver.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/file_system_driver/file_system_driver.rs rename to crates/system/drivers/src/drivers/file_system_driver/file_system_driver.rs diff --git a/crates/sargon-drivers/src/drivers/file_system_driver/mod.rs b/crates/system/drivers/src/drivers/file_system_driver/mod.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/file_system_driver/mod.rs rename to crates/system/drivers/src/drivers/file_system_driver/mod.rs diff --git a/crates/sargon-drivers/src/drivers/file_system_driver/support/mod.rs b/crates/system/drivers/src/drivers/file_system_driver/support/mod.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/file_system_driver/support/mod.rs rename to crates/system/drivers/src/drivers/file_system_driver/support/mod.rs diff --git a/crates/sargon-drivers/src/drivers/file_system_driver/support/test/in_memory_file_system_driver.rs b/crates/system/drivers/src/drivers/file_system_driver/support/test/in_memory_file_system_driver.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/file_system_driver/support/test/in_memory_file_system_driver.rs rename to crates/system/drivers/src/drivers/file_system_driver/support/test/in_memory_file_system_driver.rs diff --git a/crates/sargon-drivers/src/drivers/file_system_driver/support/test/mod.rs b/crates/system/drivers/src/drivers/file_system_driver/support/test/mod.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/file_system_driver/support/test/mod.rs rename to crates/system/drivers/src/drivers/file_system_driver/support/test/mod.rs diff --git a/crates/sargon-drivers/src/drivers/file_system_driver/support/test/rust_file_system_driver.rs b/crates/system/drivers/src/drivers/file_system_driver/support/test/rust_file_system_driver.rs similarity index 92% rename from crates/sargon-drivers/src/drivers/file_system_driver/support/test/rust_file_system_driver.rs rename to crates/system/drivers/src/drivers/file_system_driver/support/test/rust_file_system_driver.rs index d6175ea23..35e1936ba 100644 --- a/crates/sargon-drivers/src/drivers/file_system_driver/support/test/rust_file_system_driver.rs +++ b/crates/system/drivers/src/drivers/file_system_driver/support/test/rust_file_system_driver.rs @@ -1,4 +1,7 @@ -use std::path::{Path, PathBuf}; +use std::{ + fs, + path::{Path, PathBuf}, +}; use crate::prelude::*; @@ -22,10 +25,7 @@ pub(crate) fn path_from_str(str: String, require: bool) -> Result { impl RustFileSystemDriver { pub(crate) fn tmp_dir() -> PathBuf { - fs::canonicalize( - Path::new(env!("CARGO_MANIFEST_DIR")).join("../../target/tmp"), - ) - .unwrap() + fs::canonicalize(Path::new(env!("TMP_PATH"))).unwrap() } } @@ -87,7 +87,8 @@ mod tests { let dir_path = dir_path.as_ref(); assert!(std::fs::create_dir_all(dir_path).is_ok()); - let file_name = format!("delete-me--generated-by-test-{}.txt", id()); + let file_name = + format!("delete-me--generated-by-test-{}.txt", Uuid::new_v4()); let file_path_buf = dir_path.join(file_name); let file = String::from(file_path_buf.to_string_lossy()); file @@ -167,11 +168,8 @@ mod tests { #[actix_rt::test] async fn test_delete_dir_does_not_work() { let sut = SUT::new(); - let path = String::from( - Path::new(env!("CARGO_MANIFEST_DIR")) - .join("../../target/") - .to_string_lossy(), - ); + let path = + String::from(Path::new(env!("TARGET_PATH")).to_string_lossy()); let res = sut.delete_file(path.clone()).await; assert_eq!(res, Err(CommonError::FailedToDeleteFile { path })); } diff --git a/crates/sargon-drivers/src/drivers/host_info_driver/host_info_driver.rs b/crates/system/drivers/src/drivers/host_info_driver/host_info_driver.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/host_info_driver/host_info_driver.rs rename to crates/system/drivers/src/drivers/host_info_driver/host_info_driver.rs diff --git a/crates/sargon-drivers/src/drivers/host_info_driver/mod.rs b/crates/system/drivers/src/drivers/host_info_driver/mod.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/host_info_driver/mod.rs rename to crates/system/drivers/src/drivers/host_info_driver/mod.rs diff --git a/crates/sargon-drivers/src/drivers/host_info_driver/support/mod.rs b/crates/system/drivers/src/drivers/host_info_driver/support/mod.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/host_info_driver/support/mod.rs rename to crates/system/drivers/src/drivers/host_info_driver/support/mod.rs diff --git a/crates/sargon-drivers/src/drivers/host_info_driver/support/test/mod.rs b/crates/system/drivers/src/drivers/host_info_driver/support/test/mod.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/host_info_driver/support/test/mod.rs rename to crates/system/drivers/src/drivers/host_info_driver/support/test/mod.rs diff --git a/crates/sargon-drivers/src/drivers/host_info_driver/support/test/rust_host_info_driver.rs b/crates/system/drivers/src/drivers/host_info_driver/support/test/rust_host_info_driver.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/host_info_driver/support/test/rust_host_info_driver.rs rename to crates/system/drivers/src/drivers/host_info_driver/support/test/rust_host_info_driver.rs diff --git a/crates/sargon-drivers/src/drivers/logging_driver/logging_driver.rs b/crates/system/drivers/src/drivers/logging_driver/logging_driver.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/logging_driver/logging_driver.rs rename to crates/system/drivers/src/drivers/logging_driver/logging_driver.rs diff --git a/crates/sargon-drivers/src/drivers/logging_driver/mod.rs b/crates/system/drivers/src/drivers/logging_driver/mod.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/logging_driver/mod.rs rename to crates/system/drivers/src/drivers/logging_driver/mod.rs diff --git a/crates/sargon-drivers/src/drivers/logging_driver/support/log_level.rs b/crates/system/drivers/src/drivers/logging_driver/support/log_level.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/logging_driver/support/log_level.rs rename to crates/system/drivers/src/drivers/logging_driver/support/log_level.rs diff --git a/crates/sargon-drivers/src/drivers/logging_driver/support/mod.rs b/crates/system/drivers/src/drivers/logging_driver/support/mod.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/logging_driver/support/mod.rs rename to crates/system/drivers/src/drivers/logging_driver/support/mod.rs diff --git a/crates/sargon-drivers/src/drivers/logging_driver/support/test/mod.rs b/crates/system/drivers/src/drivers/logging_driver/support/test/mod.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/logging_driver/support/test/mod.rs rename to crates/system/drivers/src/drivers/logging_driver/support/test/mod.rs diff --git a/crates/sargon-drivers/src/drivers/logging_driver/support/test/rust_logging_driver.rs b/crates/system/drivers/src/drivers/logging_driver/support/test/rust_logging_driver.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/logging_driver/support/test/rust_logging_driver.rs rename to crates/system/drivers/src/drivers/logging_driver/support/test/rust_logging_driver.rs diff --git a/crates/sargon-drivers/src/drivers/mod.rs b/crates/system/drivers/src/drivers/mod.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/mod.rs rename to crates/system/drivers/src/drivers/mod.rs diff --git a/crates/sargon-drivers/src/drivers/networking_driver/mod.rs b/crates/system/drivers/src/drivers/networking_driver/mod.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/networking_driver/mod.rs rename to crates/system/drivers/src/drivers/networking_driver/mod.rs diff --git a/crates/sargon-drivers/src/drivers/networking_driver/networking_driver.rs b/crates/system/drivers/src/drivers/networking_driver/networking_driver.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/networking_driver/networking_driver.rs rename to crates/system/drivers/src/drivers/networking_driver/networking_driver.rs diff --git a/crates/sargon-drivers/src/drivers/networking_driver/support/mod.rs b/crates/system/drivers/src/drivers/networking_driver/support/mod.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/networking_driver/support/mod.rs rename to crates/system/drivers/src/drivers/networking_driver/support/mod.rs diff --git a/crates/sargon-drivers/src/drivers/networking_driver/support/network_method.rs b/crates/system/drivers/src/drivers/networking_driver/support/network_method.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/networking_driver/support/network_method.rs rename to crates/system/drivers/src/drivers/networking_driver/support/network_method.rs diff --git a/crates/sargon-drivers/src/drivers/networking_driver/support/network_request.rs b/crates/system/drivers/src/drivers/networking_driver/support/network_request.rs similarity index 99% rename from crates/sargon-drivers/src/drivers/networking_driver/support/network_request.rs rename to crates/system/drivers/src/drivers/networking_driver/support/network_request.rs index 4e250166b..e073e0b63 100644 --- a/crates/sargon-drivers/src/drivers/networking_driver/support/network_request.rs +++ b/crates/system/drivers/src/drivers/networking_driver/support/network_request.rs @@ -1,3 +1,5 @@ +use serde::Serialize; + use crate::prelude::*; #[derive(Clone, Debug, PartialEq, Eq)] diff --git a/crates/sargon-drivers/src/drivers/networking_driver/support/network_response.rs b/crates/system/drivers/src/drivers/networking_driver/support/network_response.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/networking_driver/support/network_response.rs rename to crates/system/drivers/src/drivers/networking_driver/support/network_response.rs diff --git a/crates/sargon-drivers/src/drivers/networking_driver/support/test/mock_networking_driver.rs b/crates/system/drivers/src/drivers/networking_driver/support/test/mock_networking_driver.rs similarity index 99% rename from crates/sargon-drivers/src/drivers/networking_driver/support/test/mock_networking_driver.rs rename to crates/system/drivers/src/drivers/networking_driver/support/test/mock_networking_driver.rs index 34dedcc4c..9af196a03 100644 --- a/crates/sargon-drivers/src/drivers/networking_driver/support/test/mock_networking_driver.rs +++ b/crates/system/drivers/src/drivers/networking_driver/support/test/mock_networking_driver.rs @@ -1,3 +1,5 @@ +use serde::Serialize; + use crate::prelude::*; use std::sync::Mutex; diff --git a/crates/sargon-drivers/src/drivers/networking_driver/support/test/mod.rs b/crates/system/drivers/src/drivers/networking_driver/support/test/mod.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/networking_driver/support/test/mod.rs rename to crates/system/drivers/src/drivers/networking_driver/support/test/mod.rs diff --git a/crates/sargon-drivers/src/drivers/networking_driver/support/test/rust_networking_driver.rs b/crates/system/drivers/src/drivers/networking_driver/support/test/rust_networking_driver.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/networking_driver/support/test/rust_networking_driver.rs rename to crates/system/drivers/src/drivers/networking_driver/support/test/rust_networking_driver.rs diff --git a/crates/sargon-drivers/src/drivers/profile_change_driver/mod.rs b/crates/system/drivers/src/drivers/profile_change_driver/mod.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/profile_change_driver/mod.rs rename to crates/system/drivers/src/drivers/profile_change_driver/mod.rs diff --git a/crates/sargon-drivers/src/drivers/profile_change_driver/profile_change_driver.rs b/crates/system/drivers/src/drivers/profile_change_driver/profile_change_driver.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/profile_change_driver/profile_change_driver.rs rename to crates/system/drivers/src/drivers/profile_change_driver/profile_change_driver.rs diff --git a/crates/sargon-drivers/src/drivers/profile_change_driver/support/mod.rs b/crates/system/drivers/src/drivers/profile_change_driver/support/mod.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/profile_change_driver/support/mod.rs rename to crates/system/drivers/src/drivers/profile_change_driver/support/mod.rs diff --git a/crates/sargon-drivers/src/drivers/profile_change_driver/support/test/mod.rs b/crates/system/drivers/src/drivers/profile_change_driver/support/test/mod.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/profile_change_driver/support/test/mod.rs rename to crates/system/drivers/src/drivers/profile_change_driver/support/test/mod.rs diff --git a/crates/sargon-drivers/src/drivers/profile_change_driver/support/test/rust_profile_change_driver.rs b/crates/system/drivers/src/drivers/profile_change_driver/support/test/rust_profile_change_driver.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/profile_change_driver/support/test/rust_profile_change_driver.rs rename to crates/system/drivers/src/drivers/profile_change_driver/support/test/rust_profile_change_driver.rs diff --git a/crates/sargon-drivers/src/drivers/secure_storage_driver/mod.rs b/crates/system/drivers/src/drivers/secure_storage_driver/mod.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/secure_storage_driver/mod.rs rename to crates/system/drivers/src/drivers/secure_storage_driver/mod.rs diff --git a/crates/sargon-drivers/src/drivers/secure_storage_driver/secure_storage_driver.rs b/crates/system/drivers/src/drivers/secure_storage_driver/secure_storage_driver.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/secure_storage_driver/secure_storage_driver.rs rename to crates/system/drivers/src/drivers/secure_storage_driver/secure_storage_driver.rs diff --git a/crates/sargon-drivers/src/drivers/secure_storage_driver/support/mod.rs b/crates/system/drivers/src/drivers/secure_storage_driver/support/mod.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/secure_storage_driver/support/mod.rs rename to crates/system/drivers/src/drivers/secure_storage_driver/support/mod.rs diff --git a/crates/sargon-drivers/src/drivers/secure_storage_driver/support/secure_storage_access_error_kind.rs b/crates/system/drivers/src/drivers/secure_storage_driver/support/secure_storage_access_error_kind.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/secure_storage_driver/support/secure_storage_access_error_kind.rs rename to crates/system/drivers/src/drivers/secure_storage_driver/support/secure_storage_access_error_kind.rs diff --git a/crates/sargon-drivers/src/drivers/secure_storage_driver/support/secure_storage_key.rs b/crates/system/drivers/src/drivers/secure_storage_driver/support/secure_storage_key.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/secure_storage_driver/support/secure_storage_key.rs rename to crates/system/drivers/src/drivers/secure_storage_driver/support/secure_storage_key.rs diff --git a/crates/sargon-drivers/src/drivers/secure_storage_driver/support/test/ephemeral_secure_storage.rs b/crates/system/drivers/src/drivers/secure_storage_driver/support/test/ephemeral_secure_storage.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/secure_storage_driver/support/test/ephemeral_secure_storage.rs rename to crates/system/drivers/src/drivers/secure_storage_driver/support/test/ephemeral_secure_storage.rs diff --git a/crates/sargon-drivers/src/drivers/secure_storage_driver/support/test/fail_secure_storage.rs b/crates/system/drivers/src/drivers/secure_storage_driver/support/test/fail_secure_storage.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/secure_storage_driver/support/test/fail_secure_storage.rs rename to crates/system/drivers/src/drivers/secure_storage_driver/support/test/fail_secure_storage.rs diff --git a/crates/sargon-drivers/src/drivers/secure_storage_driver/support/test/mod.rs b/crates/system/drivers/src/drivers/secure_storage_driver/support/test/mod.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/secure_storage_driver/support/test/mod.rs rename to crates/system/drivers/src/drivers/secure_storage_driver/support/test/mod.rs diff --git a/crates/sargon-drivers/src/drivers/unsafe_storage_driver/mod.rs b/crates/system/drivers/src/drivers/unsafe_storage_driver/mod.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/unsafe_storage_driver/mod.rs rename to crates/system/drivers/src/drivers/unsafe_storage_driver/mod.rs diff --git a/crates/sargon-drivers/src/drivers/unsafe_storage_driver/support/ephemeral_unsafe_storage.rs b/crates/system/drivers/src/drivers/unsafe_storage_driver/support/ephemeral_unsafe_storage.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/unsafe_storage_driver/support/ephemeral_unsafe_storage.rs rename to crates/system/drivers/src/drivers/unsafe_storage_driver/support/ephemeral_unsafe_storage.rs diff --git a/crates/sargon-drivers/src/drivers/unsafe_storage_driver/support/mod.rs b/crates/system/drivers/src/drivers/unsafe_storage_driver/support/mod.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/unsafe_storage_driver/support/mod.rs rename to crates/system/drivers/src/drivers/unsafe_storage_driver/support/mod.rs diff --git a/crates/sargon-drivers/src/drivers/unsafe_storage_driver/support/unsafe_storage_key.rs b/crates/system/drivers/src/drivers/unsafe_storage_driver/support/unsafe_storage_key.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/unsafe_storage_driver/support/unsafe_storage_key.rs rename to crates/system/drivers/src/drivers/unsafe_storage_driver/support/unsafe_storage_key.rs diff --git a/crates/sargon-drivers/src/drivers/unsafe_storage_driver/unsafe_storage_driver.rs b/crates/system/drivers/src/drivers/unsafe_storage_driver/unsafe_storage_driver.rs similarity index 100% rename from crates/sargon-drivers/src/drivers/unsafe_storage_driver/unsafe_storage_driver.rs rename to crates/system/drivers/src/drivers/unsafe_storage_driver/unsafe_storage_driver.rs diff --git a/crates/system/drivers/src/lib.rs b/crates/system/drivers/src/lib.rs new file mode 100644 index 000000000..6b6a752ae --- /dev/null +++ b/crates/system/drivers/src/lib.rs @@ -0,0 +1,23 @@ +#![feature(let_chains)] + +mod drivers; + +pub mod prelude { + pub(crate) use addresses::prelude::*; + + pub(crate) use hierarchical_deterministic::prelude::*; + pub(crate) use profile::prelude::*; + pub(crate) use profile_supporting_types::prelude::*; + + pub use crate::drivers::*; + + pub(crate) use enum_iterator::*; + pub(crate) use std::sync::{Arc, RwLock}; + + pub(crate) use indexmap::{IndexMap, IndexSet}; + pub(crate) use itertools::Itertools; + pub(crate) use std::collections::HashMap; + pub(crate) use std::str::FromStr; +} + +pub use prelude::*; diff --git a/crates/transaction/foundation/Cargo.toml b/crates/transaction/foundation/Cargo.toml new file mode 100644 index 000000000..951d89ee9 --- /dev/null +++ b/crates/transaction/foundation/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "transaction-foundation" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +assert-json = { path = "../../core/assert-json" } +has-sample-values = { path = "../../core/has-sample-values" } +bytes = { path = "../../common/bytes" } + +# === RADIX DEPENDENCIES === +radix-engine-interface = { workspace = true } + +# === EXTERNAL DEPENDENCIES === +derive_more = { workspace = true } +paste = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } diff --git a/crates/sargon-core/src/types/epoch.rs b/crates/transaction/foundation/src/epoch.rs similarity index 100% rename from crates/sargon-core/src/types/epoch.rs rename to crates/transaction/foundation/src/epoch.rs diff --git a/crates/sargon-core/src/types/intent_discriminator.rs b/crates/transaction/foundation/src/intent_discriminator.rs similarity index 100% rename from crates/sargon-core/src/types/intent_discriminator.rs rename to crates/transaction/foundation/src/intent_discriminator.rs diff --git a/crates/transaction/foundation/src/lib.rs b/crates/transaction/foundation/src/lib.rs new file mode 100644 index 000000000..02b9944a0 --- /dev/null +++ b/crates/transaction/foundation/src/lib.rs @@ -0,0 +1,18 @@ +mod epoch; +mod intent_discriminator; +mod nonce; +mod version_type; + +pub mod prelude { + pub use crate::epoch::*; + pub use crate::intent_discriminator::*; + pub use crate::nonce::*; + + pub(crate) use bytes::prelude::*; + pub(crate) use radix_engine_interface::prelude::Epoch as ScryptoEpoch; + + pub(crate) use serde::{Deserialize, Serialize}; + + #[cfg(test)] + pub(crate) use std::collections::HashSet; +} diff --git a/crates/sargon-core/src/types/nonce.rs b/crates/transaction/foundation/src/nonce.rs similarity index 100% rename from crates/sargon-core/src/types/nonce.rs rename to crates/transaction/foundation/src/nonce.rs diff --git a/crates/sargon-core/src/types/version_type.rs b/crates/transaction/foundation/src/version_type.rs similarity index 95% rename from crates/sargon-core/src/types/version_type.rs rename to crates/transaction/foundation/src/version_type.rs index 0928164be..af7111df0 100644 --- a/crates/sargon-core/src/types/version_type.rs +++ b/crates/transaction/foundation/src/version_type.rs @@ -1,5 +1,3 @@ -use crate::prelude::*; - /// A macro that generates a XYZVersion type, which is a typed version of `u64`. #[macro_export] macro_rules! decl_version_type { @@ -25,7 +23,7 @@ macro_rules! decl_version_type { } } - impl Deref for [<$name Version>] { + impl std::ops::Deref for [<$name Version>] { type Target = u64; fn deref(&self) -> &Self::Target { @@ -36,8 +34,6 @@ macro_rules! decl_version_type { }; } -pub(crate) use decl_version_type; - #[cfg(test)] mod tests { decl_version_type!(Example); diff --git a/crates/transaction/manifests/Cargo.toml b/crates/transaction/manifests/Cargo.toml new file mode 100644 index 000000000..c30ae6d1c --- /dev/null +++ b/crates/transaction/manifests/Cargo.toml @@ -0,0 +1,39 @@ +[package] +name = "manifests" +version = "1.1.99" +edition = "2021" +build = "build.rs" + +[dependencies] +# === SARGON CRATES === +sargon-core-utils = { path = "../../core/utils" } +identified-vec-of = { path = "../../common/identified-vec-of" } +hierarchical-deterministic = { path = "../../crypto/hd" } +factors = { path = "../../factors/factors" } +addresses = { path = "../../crypto/addresses" } +metadata = { path = "../../common/metadata" } +transaction-models = { path = "../../transaction/models" } +gateway-models = { path = "../../gateway/models" } +profile = { path = "../../profile/models/profile_SPLIT_ME" } +account-for-display = { path = "../../profile/models/account-for-display" } + +# === RADIX DEPENDENCIES === +radix-common = { workspace = true } +radix-engine = { workspace = true } +radix-engine-interface = { workspace = true } +radix-engine-toolkit = { workspace = true } +radix-rust = { workspace = true } +radix-transactions = { workspace = true } +sbor = { workspace = true } + +# === EXTERNAL DEPENDENCIES === +derive_more = { workspace = true } +enum-as-inner = { workspace = true } +itertools = { workspace = true } +paste = { workspace = true } +pretty_assertions = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } + +[build-dependencies] +cargo_toml = { workspace = true } diff --git a/crates/sargon-manifests/build.rs b/crates/transaction/manifests/build.rs similarity index 100% rename from crates/sargon-manifests/build.rs rename to crates/transaction/manifests/build.rs diff --git a/crates/sargon-manifests/fixtures/transaction/account_locker_claim.rtm b/crates/transaction/manifests/fixtures/transaction/account_locker_claim.rtm similarity index 100% rename from crates/sargon-manifests/fixtures/transaction/account_locker_claim.rtm rename to crates/transaction/manifests/fixtures/transaction/account_locker_claim.rtm diff --git a/crates/sargon-manifests/fixtures/transaction/account_locker_claim_max_nft_items.rtm b/crates/transaction/manifests/fixtures/transaction/account_locker_claim_max_nft_items.rtm similarity index 100% rename from crates/sargon-manifests/fixtures/transaction/account_locker_claim_max_nft_items.rtm rename to crates/transaction/manifests/fixtures/transaction/account_locker_claim_max_nft_items.rtm diff --git a/crates/sargon-manifests/fixtures/transaction/create_3_nft_collections.rtm b/crates/transaction/manifests/fixtures/transaction/create_3_nft_collections.rtm similarity index 100% rename from crates/sargon-manifests/fixtures/transaction/create_3_nft_collections.rtm rename to crates/transaction/manifests/fixtures/transaction/create_3_nft_collections.rtm diff --git a/crates/sargon-manifests/fixtures/transaction/create_access_controller_for_account.rtm b/crates/transaction/manifests/fixtures/transaction/create_access_controller_for_account.rtm similarity index 100% rename from crates/sargon-manifests/fixtures/transaction/create_access_controller_for_account.rtm rename to crates/transaction/manifests/fixtures/transaction/create_access_controller_for_account.rtm diff --git a/crates/sargon-manifests/fixtures/transaction/create_access_controller_for_persona.rtm b/crates/transaction/manifests/fixtures/transaction/create_access_controller_for_persona.rtm similarity index 100% rename from crates/sargon-manifests/fixtures/transaction/create_access_controller_for_persona.rtm rename to crates/transaction/manifests/fixtures/transaction/create_access_controller_for_persona.rtm diff --git a/crates/sargon-manifests/src/bucket.rs b/crates/transaction/manifests/src/bucket.rs similarity index 100% rename from crates/sargon-manifests/src/bucket.rs rename to crates/transaction/manifests/src/bucket.rs diff --git a/crates/sargon-manifests/src/bucket_factory.rs b/crates/transaction/manifests/src/bucket_factory.rs similarity index 100% rename from crates/sargon-manifests/src/bucket_factory.rs rename to crates/transaction/manifests/src/bucket_factory.rs diff --git a/crates/sargon-manifests/src/delete_account/delete_account_transfer.rs b/crates/transaction/manifests/src/delete_account/delete_account_transfer.rs similarity index 100% rename from crates/sargon-manifests/src/delete_account/delete_account_transfer.rs rename to crates/transaction/manifests/src/delete_account/delete_account_transfer.rs diff --git a/crates/sargon-manifests/src/delete_account/delete_account_transfers.rs b/crates/transaction/manifests/src/delete_account/delete_account_transfers.rs similarity index 100% rename from crates/sargon-manifests/src/delete_account/delete_account_transfers.rs rename to crates/transaction/manifests/src/delete_account/delete_account_transfers.rs diff --git a/crates/sargon-manifests/src/delete_account/manifest_delete_account.rs b/crates/transaction/manifests/src/delete_account/manifest_delete_account.rs similarity index 100% rename from crates/sargon-manifests/src/delete_account/manifest_delete_account.rs rename to crates/transaction/manifests/src/delete_account/manifest_delete_account.rs diff --git a/crates/sargon-manifests/src/delete_account/mod.rs b/crates/transaction/manifests/src/delete_account/mod.rs similarity index 100% rename from crates/sargon-manifests/src/delete_account/mod.rs rename to crates/transaction/manifests/src/delete_account/mod.rs diff --git a/crates/sargon-manifests/src/high_level/mod.rs b/crates/transaction/manifests/src/high_level/mod.rs similarity index 100% rename from crates/sargon-manifests/src/high_level/mod.rs rename to crates/transaction/manifests/src/high_level/mod.rs diff --git a/crates/sargon-manifests/src/high_level/sargon_specific_types/account_locker/account_locker_claimable_resource.rs b/crates/transaction/manifests/src/high_level/sargon_specific_types/account_locker/account_locker_claimable_resource.rs similarity index 100% rename from crates/sargon-manifests/src/high_level/sargon_specific_types/account_locker/account_locker_claimable_resource.rs rename to crates/transaction/manifests/src/high_level/sargon_specific_types/account_locker/account_locker_claimable_resource.rs diff --git a/crates/sargon-manifests/src/high_level/sargon_specific_types/account_locker/mod.rs b/crates/transaction/manifests/src/high_level/sargon_specific_types/account_locker/mod.rs similarity index 100% rename from crates/sargon-manifests/src/high_level/sargon_specific_types/account_locker/mod.rs rename to crates/transaction/manifests/src/high_level/sargon_specific_types/account_locker/mod.rs diff --git a/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/owned_or_third_party_account_address.rs b/crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/account_or_address_of.rs similarity index 64% rename from crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/owned_or_third_party_account_address.rs rename to crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/account_or_address_of.rs index 15678cec7..f670a8768 100644 --- a/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/owned_or_third_party_account_address.rs +++ b/crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/account_or_address_of.rs @@ -1,55 +1,50 @@ use crate::prelude::*; #[derive(Clone, Debug, PartialEq, Eq, Hash)] -pub enum OwnedOrThirdPartyAccountAddress { - OwnedAccount { value: AccountAddress }, - ThirdPartyAccount { value: AccountAddress }, +#[allow(clippy::large_enum_variant)] +pub enum AccountOrAddressOf { + ProfileAccount { value: AccountForDisplay }, + AddressOfExternalAccount { value: AccountAddress }, } -// impl From for OwnedOrThirdPartyAccountAddress { -// fn from(value: AccountAddress) -> Self { -// Self::ThirdPartyAccount { value } -// } -// } - -impl OwnedOrThirdPartyAccountAddress { +impl AccountOrAddressOf { pub fn account_address(&self) -> &AccountAddress { match self { - OwnedOrThirdPartyAccountAddress::OwnedAccount { value } => value, - OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { value } => { - value - } + AccountOrAddressOf::ProfileAccount { value } => &value.address, + AccountOrAddressOf::AddressOfExternalAccount { value } => value, } } } -impl OwnedOrThirdPartyAccountAddress { +impl AccountOrAddressOf { pub(crate) fn sample_mainnet() -> Self { - Self::OwnedAccount { - value: AccountAddress::from_str("account_rdx12y02nen8zjrq0k0nku98shjq7n05kvl3j9m5d3a6cpduqwzgmenjq7").unwrap(), + Self::ProfileAccount { + value: AccountForDisplay::new(AccountAddress::from_str("account_rdx12y02nen8zjrq0k0nku98shjq7n05kvl3j9m5d3a6cpduqwzgmenjq7").unwrap(), + DisplayName::sample(), AppearanceID::sample() + ), } } pub(crate) fn sample_mainnet_other() -> Self { - Self::ThirdPartyAccount { + Self::AddressOfExternalAccount { value: AccountAddress::sample_mainnet_other(), } } pub(crate) fn sample_stokenet() -> Self { - Self::OwnedAccount { - value: AccountAddress::from_str("account_tdx_2_128jx5fmru80v38a7hun8tdhajf2exef756c92tfg4atwl3y4pqn48m").unwrap(), + Self::ProfileAccount { + value: AccountForDisplay::new(AccountAddress::from_str("account_tdx_2_128jx5fmru80v38a7hun8tdhajf2exef756c92tfg4atwl3y4pqn48m").unwrap(), DisplayName::sample(), AppearanceID::sample()) } } pub(crate) fn sample_stokenet_other() -> Self { - Self::ThirdPartyAccount { + Self::AddressOfExternalAccount { value: AccountAddress::sample_stokenet_other(), } } } -impl HasSampleValues for OwnedOrThirdPartyAccountAddress { +impl HasSampleValues for AccountOrAddressOf { fn sample() -> Self { Self::sample_mainnet() } @@ -64,7 +59,7 @@ mod tests { use super::*; #[allow(clippy::upper_case_acronyms)] - type SUT = OwnedOrThirdPartyAccountAddress; + type SUT = AccountOrAddressOf; #[test] fn equality() { diff --git a/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/mod.rs b/crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/mod.rs similarity index 58% rename from crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/mod.rs rename to crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/mod.rs index 1abd5ac33..2235168c5 100644 --- a/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/mod.rs +++ b/crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/mod.rs @@ -1,9 +1,9 @@ -mod owned_or_third_party_account_address; +mod account_or_address_of; mod per_asset; mod per_recipient; mod transfer_types; -pub use owned_or_third_party_account_address::*; +pub use account_or_address_of::*; pub use per_asset::*; pub use per_recipient::*; pub use transfer_types::*; diff --git a/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/mod.rs b/crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/mod.rs similarity index 100% rename from crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/mod.rs rename to crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/mod.rs diff --git a/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_fungible_resource.rs b/crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_fungible_resource.rs similarity index 100% rename from crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_fungible_resource.rs rename to crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_fungible_resource.rs diff --git a/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_fungible_transfer.rs b/crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_fungible_transfer.rs similarity index 76% rename from crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_fungible_transfer.rs rename to crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_fungible_transfer.rs index eb3e415af..73dca79fd 100644 --- a/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_fungible_transfer.rs +++ b/crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_fungible_transfer.rs @@ -2,7 +2,7 @@ use crate::prelude::*; impl PerAssetFungibleTransfer { pub fn new( - recipient: impl Into, + recipient: impl Into, use_try_deposit_or_abort: bool, amount: impl Into, ) -> Self { @@ -21,17 +21,11 @@ impl PerAssetFungibleTransfer { } } -impl - From<( - &OwnedOrThirdPartyAccountAddress, - PerRecipientFungibleTransfer, - )> for PerAssetFungibleTransfer +impl From<(&AccountOrAddressOf, PerRecipientFungibleTransfer)> + for PerAssetFungibleTransfer { fn from( - value: ( - &OwnedOrThirdPartyAccountAddress, - PerRecipientFungibleTransfer, - ), + value: (&AccountOrAddressOf, PerRecipientFungibleTransfer), ) -> Self { let (recipient, transfer) = value; Self::new( @@ -55,14 +49,14 @@ impl HasSampleValues for PerAssetFungibleTransfer { impl PerAssetFungibleTransfer { pub(crate) fn sample_mainnet() -> Self { Self::new( - OwnedOrThirdPartyAccountAddress::OwnedAccount { value: AccountAddress::from_str("account_rdx129akrrsd9ctuphe99lesa8cf6auc5vqwdd2lu0ej6csncnuw9eedgv").unwrap() }, + AccountOrAddressOf::ProfileAccount { value: AccountForDisplay::new(AccountAddress::from_str("account_rdx129akrrsd9ctuphe99lesa8cf6auc5vqwdd2lu0ej6csncnuw9eedgv").unwrap(), DisplayName::sample(), AppearanceID::sample()) }, true, Decimal192::from_str("237.13372718281828").unwrap(), ) } pub(crate) fn sample_mainnet_other() -> Self { - Self::new(OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { + Self::new(AccountOrAddressOf::AddressOfExternalAccount { value: AccountAddress::from_str("account_rdx12y02nen8zjrq0k0nku98shjq7n05kvl3j9m5d3a6cpduqwzgmenjq7").unwrap() }, true, @@ -71,8 +65,8 @@ impl PerAssetFungibleTransfer { pub(crate) fn sample_stokenet() -> Self { Self::new( - OwnedOrThirdPartyAccountAddress::OwnedAccount { - value: AccountAddress::from_str("account_tdx_2_12xvlee7xtg7dx599yv69tzkpeqzn4wr2nlnn3gpsm0zu0v9luqdpnp").unwrap(), + AccountOrAddressOf::ProfileAccount { + value: AccountForDisplay::new(AccountAddress::from_str("account_tdx_2_12xvlee7xtg7dx599yv69tzkpeqzn4wr2nlnn3gpsm0zu0v9luqdpnp").unwrap(), DisplayName::sample(), AppearanceID::sample()) }, true, Decimal192::from_str("42.311415").unwrap(), @@ -80,7 +74,7 @@ impl PerAssetFungibleTransfer { } pub(crate) fn sample_stokenet_other() -> Self { - Self::new(OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { + Self::new(AccountOrAddressOf::AddressOfExternalAccount { value: AccountAddress::from_str("account_tdx_2_1288efhmjt8kzce77par4ex997x2zgnlv5qqv9ltpxqg7ur0xpqm6gk").unwrap() }, true, diff --git a/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_non_fungible_transfer.rs b/crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_non_fungible_transfer.rs similarity index 78% rename from crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_non_fungible_transfer.rs rename to crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_non_fungible_transfer.rs index 68ea7c53a..8649e7102 100644 --- a/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_non_fungible_transfer.rs +++ b/crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_non_fungible_transfer.rs @@ -2,7 +2,7 @@ use crate::prelude::*; impl PerAssetNonFungibleTransfer { pub fn new( - recipient: impl Into, + recipient: impl Into, use_try_deposit_or_abort: bool, non_fungible_local_ids: impl IntoIterator, ) -> Self { @@ -24,17 +24,11 @@ impl PerAssetNonFungibleTransfer { } } -impl - From<( - &OwnedOrThirdPartyAccountAddress, - PerRecipientNonFungibleTransfer, - )> for PerAssetNonFungibleTransfer +impl From<(&AccountOrAddressOf, PerRecipientNonFungibleTransfer)> + for PerAssetNonFungibleTransfer { fn from( - value: ( - &OwnedOrThirdPartyAccountAddress, - PerRecipientNonFungibleTransfer, - ), + value: (&AccountOrAddressOf, PerRecipientNonFungibleTransfer), ) -> Self { let (recipient, non_fungibles) = value; Self::new( @@ -48,8 +42,8 @@ impl impl PerAssetNonFungibleTransfer { pub(crate) fn sample_mainnet() -> Self { Self::new( - OwnedOrThirdPartyAccountAddress::OwnedAccount { - value: AccountAddress::from_str("account_rdx129akrrsd9ctuphe99lesa8cf6auc5vqwdd2lu0ej6csncnuw9eedgv").unwrap(), + AccountOrAddressOf::ProfileAccount { + value: AccountForDisplay::new(AccountAddress::from_str("account_rdx129akrrsd9ctuphe99lesa8cf6auc5vqwdd2lu0ej6csncnuw9eedgv").unwrap(), DisplayName::sample(), AppearanceID::sample()) }, true, [ @@ -61,7 +55,7 @@ impl PerAssetNonFungibleTransfer { pub(crate) fn sample_mainnet_other() -> Self { Self::new( - OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { + AccountOrAddressOf::AddressOfExternalAccount { value: AccountAddress::from_str("account_rdx12y02nen8zjrq0k0nku98shjq7n05kvl3j9m5d3a6cpduqwzgmenjq7").unwrap() }, true, @@ -71,8 +65,8 @@ impl PerAssetNonFungibleTransfer { pub(crate) fn sample_stokenet() -> Self { Self::new( - OwnedOrThirdPartyAccountAddress::OwnedAccount { - value: AccountAddress::from_str("account_tdx_2_128jx5fmru80v38a7hun8tdhajf2exef756c92tfg4atwl3y4pqn48m").unwrap(), + AccountOrAddressOf::ProfileAccount { + value: AccountForDisplay::new(AccountAddress::from_str("account_tdx_2_128jx5fmru80v38a7hun8tdhajf2exef756c92tfg4atwl3y4pqn48m").unwrap(), DisplayName::sample(), AppearanceID::sample()) }, true, [ @@ -84,7 +78,7 @@ impl PerAssetNonFungibleTransfer { pub(crate) fn sample_stokenet_other() -> Self { Self::new( - OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { + AccountOrAddressOf::AddressOfExternalAccount { value: AccountAddress::from_str("account_tdx_2_1288efhmjt8kzce77par4ex997x2zgnlv5qqv9ltpxqg7ur0xpqm6gk").unwrap() }, true, diff --git a/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers.rs b/crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers.rs similarity index 100% rename from crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers.rs rename to crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers.rs diff --git a/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers_of_fungible_resource.rs b/crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers_of_fungible_resource.rs similarity index 100% rename from crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers_of_fungible_resource.rs rename to crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers_of_fungible_resource.rs diff --git a/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers_of_non_fungible_resource.rs b/crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers_of_non_fungible_resource.rs similarity index 100% rename from crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers_of_non_fungible_resource.rs rename to crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers_of_non_fungible_resource.rs diff --git a/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/mod.rs b/crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/mod.rs similarity index 100% rename from crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/mod.rs rename to crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/mod.rs diff --git a/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfer.rs b/crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfer.rs similarity index 89% rename from crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfer.rs rename to crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfer.rs index ec11e10b8..399415c46 100644 --- a/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfer.rs +++ b/crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfer.rs @@ -2,14 +2,14 @@ use crate::prelude::*; #[derive(Clone, Debug, PartialEq, Eq, Hash)] pub struct PerRecipientAssetTransfer { - pub recipient: OwnedOrThirdPartyAccountAddress, + pub recipient: AccountOrAddressOf, pub fungibles: Vec, pub non_fungibles: Vec, } impl PerRecipientAssetTransfer { pub fn new( - recipient: impl Into, + recipient: impl Into, fungibles: impl IntoIterator, non_fungibles: impl IntoIterator, ) -> Self { @@ -25,7 +25,7 @@ impl PerRecipientAssetTransfer { impl PerRecipientAssetTransfer { pub(crate) fn sample_mainnet() -> Self { Self::new( - OwnedOrThirdPartyAccountAddress::sample_mainnet(), + AccountOrAddressOf::sample_mainnet(), [ PerRecipientFungibleTransfer::sample_mainnet(), PerRecipientFungibleTransfer::sample_mainnet_other(), @@ -39,7 +39,7 @@ impl PerRecipientAssetTransfer { pub(crate) fn sample_mainnet_other() -> Self { Self::new( - OwnedOrThirdPartyAccountAddress::sample_mainnet_other(), + AccountOrAddressOf::sample_mainnet_other(), [PerRecipientFungibleTransfer::sample_mainnet_other()], [PerRecipientNonFungibleTransfer::sample_mainnet_other()], ) @@ -47,7 +47,7 @@ impl PerRecipientAssetTransfer { pub(crate) fn sample_stokenet() -> Self { Self::new( - OwnedOrThirdPartyAccountAddress::sample_stokenet(), + AccountOrAddressOf::sample_stokenet(), [ PerRecipientFungibleTransfer::sample_stokenet(), PerRecipientFungibleTransfer::sample_stokenet_other(), @@ -61,7 +61,7 @@ impl PerRecipientAssetTransfer { pub(crate) fn sample_stokenet_other() -> Self { Self::new( - OwnedOrThirdPartyAccountAddress::sample_stokenet_other(), + AccountOrAddressOf::sample_stokenet_other(), [PerRecipientFungibleTransfer::sample_stokenet_other()], [PerRecipientNonFungibleTransfer::sample_stokenet_other()], ) diff --git a/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfers.rs b/crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfers.rs similarity index 84% rename from crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfers.rs rename to crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfers.rs index c8a3dcb14..8f7a92502 100644 --- a/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfers.rs +++ b/crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfers.rs @@ -60,7 +60,7 @@ impl HasSampleValues for PerRecipientAssetTransfers { Self::new( AccountAddress::sample_mainnet(), [PerRecipientAssetTransfer::new( - OwnedOrThirdPartyAccountAddress::OwnedAccount { value: AccountAddress::from_str("account_rdx129akrrsd9ctuphe99lesa8cf6auc5vqwdd2lu0ej6csncnuw9eedgv").unwrap() }, + AccountOrAddressOf::ProfileAccount { value: AccountForDisplay::new(AccountAddress::from_str("account_rdx129akrrsd9ctuphe99lesa8cf6auc5vqwdd2lu0ej6csncnuw9eedgv").unwrap(), DisplayName::sample(), AppearanceID::sample()) }, [PerRecipientFungibleTransfer::new( ResourceAddress::sample_mainnet_xrd(), Decimal192::from_str("237.13372718281828").unwrap(), @@ -75,7 +75,7 @@ impl HasSampleValues for PerRecipientAssetTransfers { ], ), PerRecipientAssetTransfer::new( - OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { value: AccountAddress::from_str("account_rdx12y02nen8zjrq0k0nku98shjq7n05kvl3j9m5d3a6cpduqwzgmenjq7").unwrap() } + AccountOrAddressOf::AddressOfExternalAccount { value: AccountAddress::from_str("account_rdx12y02nen8zjrq0k0nku98shjq7n05kvl3j9m5d3a6cpduqwzgmenjq7").unwrap() } , [PerRecipientFungibleTransfer::new( ResourceAddress::sample_mainnet_xrd(), @@ -115,7 +115,7 @@ impl HasSampleValues for PerRecipientAssetTransfers { sender, [ PerRecipientAssetTransfer::new( - OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { + AccountOrAddressOf::AddressOfExternalAccount { value: recip0, }, [ @@ -142,7 +142,7 @@ impl HasSampleValues for PerRecipientAssetTransfers { ], ), PerRecipientAssetTransfer::new( - OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { + AccountOrAddressOf::AddressOfExternalAccount { value: recip1, }, [ @@ -305,19 +305,39 @@ mod tests { PerAssetTransfersOfFungibleResource::new( PerAssetFungibleResource::new(fung_0, 18), [ - PerAssetFungibleTransfer::new(OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { - value: recip0 }, true, 30), - PerAssetFungibleTransfer::new(OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { - value: recip1 }, true, 50), + PerAssetFungibleTransfer::new( + AccountOrAddressOf::AddressOfExternalAccount { + value: recip0, + }, + true, + 30, + ), + PerAssetFungibleTransfer::new( + AccountOrAddressOf::AddressOfExternalAccount { + value: recip1, + }, + true, + 50, + ), ], ), PerAssetTransfersOfFungibleResource::new( PerAssetFungibleResource::new(fung_1, 18), [ - PerAssetFungibleTransfer::new(OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { - value: recip0 }, true, 3), - PerAssetFungibleTransfer::new(OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { - value: recip1 }, true, 5), + PerAssetFungibleTransfer::new( + AccountOrAddressOf::AddressOfExternalAccount { + value: recip0, + }, + true, + 3, + ), + PerAssetFungibleTransfer::new( + AccountOrAddressOf::AddressOfExternalAccount { + value: recip1, + }, + true, + 5, + ), ], ), ], @@ -326,8 +346,9 @@ mod tests { nft_c0, [ PerAssetNonFungibleTransfer::new( - OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { - value: recip0 }, + AccountOrAddressOf::AddressOfExternalAccount { + value: recip0, + }, true, [ NonFungibleLocalId::integer(40), @@ -335,8 +356,9 @@ mod tests { ], ), PerAssetNonFungibleTransfer::new( - OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { - value: recip1}, + AccountOrAddressOf::AddressOfExternalAccount { + value: recip1, + }, true, [ NonFungibleLocalId::integer(34), @@ -349,8 +371,9 @@ mod tests { nft_c1, [ PerAssetNonFungibleTransfer::new( - OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { - value: recip0}, + AccountOrAddressOf::AddressOfExternalAccount { + value: recip0, + }, true, [ NonFungibleLocalId::integer(21), @@ -358,8 +381,9 @@ mod tests { ], ), PerAssetNonFungibleTransfer::new( - OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { - value: recip1}, + AccountOrAddressOf::AddressOfExternalAccount { + value: recip1, + }, true, [ NonFungibleLocalId::integer(15), diff --git a/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_fungible_transfer.rs b/crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_fungible_transfer.rs similarity index 100% rename from crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_fungible_transfer.rs rename to crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_fungible_transfer.rs diff --git a/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_non_fungibles_transfer.rs b/crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_non_fungibles_transfer.rs similarity index 100% rename from crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_non_fungibles_transfer.rs rename to crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_non_fungibles_transfer.rs diff --git a/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/transfer_types.rs b/crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/transfer_types.rs similarity index 94% rename from crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/transfer_types.rs rename to crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/transfer_types.rs index 5d3f2f995..397dcd913 100644 --- a/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/transfer_types.rs +++ b/crates/transaction/manifests/src/high_level/sargon_specific_types/assets_transfers/transfer_types.rs @@ -9,7 +9,7 @@ macro_rules! decl_transfer_of { $struct_name: ident, $($fields:tt)* ) => { - paste! { + paste::paste! { $( #[doc = $expr] )* @@ -18,7 +18,7 @@ macro_rules! decl_transfer_of { /// If `true` the `try_deposit_batch_or_abort` method will be used instead of `deposit`, /// typically wallets sets this to try if and only if the recipient is a self-owned account - /// (`OwnedOrThirdPartyAccountAddress::OwnedAccount`) controlled by a DeviceFactorSource thy have + /// (`AccountOrAddressOf::ProfileAccount`) controlled by a DeviceFactorSource thy have /// access to and which third party deposit setting's `DepositRule` is `AcceptKnown` and /// which resource is known (`resource_address` is owned or has been owned before). pub use_try_deposit_or_abort: bool, @@ -47,10 +47,10 @@ macro_rules! decl_per_asset_transfer_of { $struct_name, $($fields)* /// The account or account address to send the tokens to. - pub recipient: OwnedOrThirdPartyAccountAddress, + pub recipient: AccountOrAddressOf, ); - paste! { + paste::paste! { impl [< PerAsset $struct_name Transfer>] { pub(crate) fn deposit_instruction(&self, builder: ScryptoTransactionManifestBuilder, bucket: &crate::bucket::Bucket) -> ScryptoTransactionManifestBuilder { diff --git a/crates/sargon-manifests/src/high_level/sargon_specific_types/build_information/dependency_information.rs b/crates/transaction/manifests/src/high_level/sargon_specific_types/build_information/dependency_information.rs similarity index 100% rename from crates/sargon-manifests/src/high_level/sargon_specific_types/build_information/dependency_information.rs rename to crates/transaction/manifests/src/high_level/sargon_specific_types/build_information/dependency_information.rs diff --git a/crates/sargon-manifests/src/high_level/sargon_specific_types/build_information/mod.rs b/crates/transaction/manifests/src/high_level/sargon_specific_types/build_information/mod.rs similarity index 100% rename from crates/sargon-manifests/src/high_level/sargon_specific_types/build_information/mod.rs rename to crates/transaction/manifests/src/high_level/sargon_specific_types/build_information/mod.rs diff --git a/crates/sargon-manifests/src/high_level/sargon_specific_types/build_information/sargon_build_information.rs b/crates/transaction/manifests/src/high_level/sargon_specific_types/build_information/sargon_build_information.rs similarity index 100% rename from crates/sargon-manifests/src/high_level/sargon_specific_types/build_information/sargon_build_information.rs rename to crates/transaction/manifests/src/high_level/sargon_specific_types/build_information/sargon_build_information.rs diff --git a/crates/sargon-manifests/src/high_level/sargon_specific_types/build_information/sargon_dependencies.rs b/crates/transaction/manifests/src/high_level/sargon_specific_types/build_information/sargon_dependencies.rs similarity index 100% rename from crates/sargon-manifests/src/high_level/sargon_specific_types/build_information/sargon_dependencies.rs rename to crates/transaction/manifests/src/high_level/sargon_specific_types/build_information/sargon_dependencies.rs diff --git a/crates/sargon-manifests/src/high_level/sargon_specific_types/mod.rs b/crates/transaction/manifests/src/high_level/sargon_specific_types/mod.rs similarity index 100% rename from crates/sargon-manifests/src/high_level/sargon_specific_types/mod.rs rename to crates/transaction/manifests/src/high_level/sargon_specific_types/mod.rs diff --git a/crates/sargon-manifests/src/high_level/sargon_specific_types/stake_claim.rs b/crates/transaction/manifests/src/high_level/sargon_specific_types/stake_claim.rs similarity index 100% rename from crates/sargon-manifests/src/high_level/sargon_specific_types/stake_claim.rs rename to crates/transaction/manifests/src/high_level/sargon_specific_types/stake_claim.rs diff --git a/crates/sargon-manifests/src/high_level/sargon_specific_types/transaction/mod.rs b/crates/transaction/manifests/src/high_level/sargon_specific_types/transaction/mod.rs similarity index 100% rename from crates/sargon-manifests/src/high_level/sargon_specific_types/transaction/mod.rs rename to crates/transaction/manifests/src/high_level/sargon_specific_types/transaction/mod.rs diff --git a/crates/sargon-manifests/src/high_level/sargon_specific_types/transaction/transaction_status.rs b/crates/transaction/manifests/src/high_level/sargon_specific_types/transaction/transaction_status.rs similarity index 100% rename from crates/sargon-manifests/src/high_level/sargon_specific_types/transaction/transaction_status.rs rename to crates/transaction/manifests/src/high_level/sargon_specific_types/transaction/transaction_status.rs diff --git a/crates/sargon-manifests/src/high_level/sargon_specific_types/transaction/transaction_status_reason.rs b/crates/transaction/manifests/src/high_level/sargon_specific_types/transaction/transaction_status_reason.rs similarity index 100% rename from crates/sargon-manifests/src/high_level/sargon_specific_types/transaction/transaction_status_reason.rs rename to crates/transaction/manifests/src/high_level/sargon_specific_types/transaction/transaction_status_reason.rs diff --git a/crates/sargon-manifests/src/high_level/sargon_specific_types/transaction_guarantee.rs b/crates/transaction/manifests/src/high_level/sargon_specific_types/transaction_guarantee.rs similarity index 100% rename from crates/sargon-manifests/src/high_level/sargon_specific_types/transaction_guarantee.rs rename to crates/transaction/manifests/src/high_level/sargon_specific_types/transaction_guarantee.rs diff --git a/crates/sargon-manifests/src/high_level/token_definition_metadata.rs b/crates/transaction/manifests/src/high_level/token_definition_metadata.rs similarity index 100% rename from crates/sargon-manifests/src/high_level/token_definition_metadata.rs rename to crates/transaction/manifests/src/high_level/token_definition_metadata.rs diff --git a/crates/sargon-manifests/src/lib.rs b/crates/transaction/manifests/src/lib.rs similarity index 94% rename from crates/sargon-manifests/src/lib.rs rename to crates/transaction/manifests/src/lib.rs index 9957c6700..4f5401a86 100644 --- a/crates/sargon-manifests/src/lib.rs +++ b/crates/transaction/manifests/src/lib.rs @@ -11,10 +11,11 @@ mod modify_manifest; mod third_party_deposit_update; pub mod prelude { + pub use factors::prelude::*; pub use gateway_models::prelude::*; - pub use sargon_factors::prelude::*; - pub use sargon_hierarchical_deterministic::prelude::*; - pub use sargon_profile::prelude::*; + pub use hierarchical_deterministic::prelude::*; + pub use metadata::prelude::*; + pub use profile::prelude::*; pub(crate) use crate::bucket_factory; @@ -150,6 +151,14 @@ pub mod prelude { Update as RetUpdate, }, }; + + pub(crate) use enum_as_inner::EnumAsInner; + pub(crate) use serde::{Deserialize, Serialize}; + + pub(crate) use std::collections::BTreeMap; + + #[cfg(test)] + pub(crate) use std::collections::HashSet; } pub use prelude::*; diff --git a/crates/sargon-manifests/src/manifest_account_locker.rs b/crates/transaction/manifests/src/manifest_account_locker.rs similarity index 99% rename from crates/sargon-manifests/src/manifest_account_locker.rs rename to crates/transaction/manifests/src/manifest_account_locker.rs index 422ca3dd4..5c4128f0a 100644 --- a/crates/sargon-manifests/src/manifest_account_locker.rs +++ b/crates/transaction/manifests/src/manifest_account_locker.rs @@ -91,7 +91,7 @@ impl ManifestForAccountLockerClaim for TransactionManifest { #[cfg(test)] mod tests { use super::*; - use sargon_addresses::ResourceAddress; + use addresses::ResourceAddress; #[allow(clippy::upper_case_acronyms)] type SUT = TransactionManifest; diff --git a/crates/sargon-manifests/src/manifest_assets_transfers.rs b/crates/transaction/manifests/src/manifest_assets_transfers.rs similarity index 99% rename from crates/sargon-manifests/src/manifest_assets_transfers.rs rename to crates/transaction/manifests/src/manifest_assets_transfers.rs index a31048cf8..20262c912 100644 --- a/crates/sargon-manifests/src/manifest_assets_transfers.rs +++ b/crates/transaction/manifests/src/manifest_assets_transfers.rs @@ -96,7 +96,7 @@ mod tests { let transfers = PerRecipientAssetTransfers::new( AccountAddress::sample_mainnet(), [PerRecipientAssetTransfer::new( - OwnedOrThirdPartyAccountAddress::ThirdPartyAccount { + AccountOrAddressOf::AddressOfExternalAccount { value: AccountAddress::sample_mainnet_other(), }, [PerRecipientFungibleTransfer::new( diff --git a/crates/sargon-manifests/src/manifests.rs b/crates/transaction/manifests/src/manifests.rs similarity index 100% rename from crates/sargon-manifests/src/manifests.rs rename to crates/transaction/manifests/src/manifests.rs diff --git a/crates/sargon-manifests/src/manifests_access_controller.rs b/crates/transaction/manifests/src/manifests_access_controller.rs similarity index 100% rename from crates/sargon-manifests/src/manifests_access_controller.rs rename to crates/transaction/manifests/src/manifests_access_controller.rs diff --git a/crates/sargon-manifests/src/manifests_create_tokens.rs b/crates/transaction/manifests/src/manifests_create_tokens.rs similarity index 100% rename from crates/sargon-manifests/src/manifests_create_tokens.rs rename to crates/transaction/manifests/src/manifests_create_tokens.rs diff --git a/crates/sargon-manifests/src/modify_manifest.rs b/crates/transaction/manifests/src/modify_manifest.rs similarity index 100% rename from crates/sargon-manifests/src/modify_manifest.rs rename to crates/transaction/manifests/src/modify_manifest.rs diff --git a/crates/sargon-manifests/src/sample_resource_definition_metadata.json b/crates/transaction/manifests/src/sample_resource_definition_metadata.json similarity index 100% rename from crates/sargon-manifests/src/sample_resource_definition_metadata.json rename to crates/transaction/manifests/src/sample_resource_definition_metadata.json diff --git a/crates/sargon-manifests/src/third_party_deposit_update/manifest_third_party_deposit_update.rs b/crates/transaction/manifests/src/third_party_deposit_update/manifest_third_party_deposit_update.rs similarity index 100% rename from crates/sargon-manifests/src/third_party_deposit_update/manifest_third_party_deposit_update.rs rename to crates/transaction/manifests/src/third_party_deposit_update/manifest_third_party_deposit_update.rs diff --git a/crates/sargon-manifests/src/third_party_deposit_update/mod.rs b/crates/transaction/manifests/src/third_party_deposit_update/mod.rs similarity index 100% rename from crates/sargon-manifests/src/third_party_deposit_update/mod.rs rename to crates/transaction/manifests/src/third_party_deposit_update/mod.rs diff --git a/crates/sargon-manifests/src/third_party_deposit_update/third_party_deposits_delta.rs b/crates/transaction/manifests/src/third_party_deposit_update/third_party_deposits_delta.rs similarity index 100% rename from crates/sargon-manifests/src/third_party_deposit_update/third_party_deposits_delta.rs rename to crates/transaction/manifests/src/third_party_deposit_update/third_party_deposits_delta.rs diff --git a/crates/transaction/models/Cargo.toml b/crates/transaction/models/Cargo.toml new file mode 100644 index 000000000..5d0cfedd2 --- /dev/null +++ b/crates/transaction/models/Cargo.toml @@ -0,0 +1,49 @@ +[package] +name = "transaction-models" +version = "1.1.99" +edition = "2021" +build = "build.rs" + +[dependencies] +# === SARGON CRATES === +identified-vec-of = { path = "../../common/identified-vec-of" } +hierarchical-deterministic = { path = "../../crypto/hd" } +factors = { path = "../../factors/factors" } +addresses = { path = "../../crypto/addresses" } +hash = { path = "../../crypto/hash" } +bytes = { path = "../../common/bytes" } +ecc = { path = "../../crypto/ecc" } +numeric = { path = "../../common/numeric" } +has-sample-values = { path = "../../core/has-sample-values" } +metadata = { path = "../../common/metadata" } +network = { path = "../../common/network" } +sargon-core-utils = { path = "../../core/utils" } +transaction-foundation = { path = "../../transaction/foundation" } +core-collections = { path = "../../core/collections" } +core-misc = { path = "../../core/misc" } # Instant + +# === RADIX DEPENDENCIES === +radix-common = { workspace = true } +radix-common-derive = { workspace = true } +radix-engine = { workspace = true } +radix-engine-interface = { workspace = true } +radix-engine-toolkit = { workspace = true } +radix-engine-toolkit-common = { workspace = true } +radix-rust = { workspace = true } +radix-transactions = { workspace = true } +sbor = { workspace = true } + +# === EXTERNAL DEPENDENCIES === +derive_more = { workspace = true } +enum-iterator = { workspace = true } +enum-as-inner = { workspace = true } +log = { workspace = true } +paste = { workspace = true } +pretty_assertions = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +serde_with = { workspace = true } +strum = { workspace = true } + +[build-dependencies] +cargo_toml = { workspace = true } diff --git a/crates/sargon-transaction-models/build.rs b/crates/transaction/models/build.rs similarity index 100% rename from crates/sargon-transaction-models/build.rs rename to crates/transaction/models/build.rs diff --git a/crates/sargon-transaction-models/fixtures/transaction/account_delete.dat b/crates/transaction/models/fixtures/transaction/account_delete.dat similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/account_delete.dat rename to crates/transaction/models/fixtures/transaction/account_delete.dat diff --git a/crates/sargon-transaction-models/fixtures/transaction/account_delete.rtm b/crates/transaction/models/fixtures/transaction/account_delete.rtm similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/account_delete.rtm rename to crates/transaction/models/fixtures/transaction/account_delete.rtm diff --git a/crates/sargon-transaction-models/fixtures/transaction/account_locker_claim_fungibles_and_non_fungibles.dat b/crates/transaction/models/fixtures/transaction/account_locker_claim_fungibles_and_non_fungibles.dat similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/account_locker_claim_fungibles_and_non_fungibles.dat rename to crates/transaction/models/fixtures/transaction/account_locker_claim_fungibles_and_non_fungibles.dat diff --git a/crates/sargon-transaction-models/fixtures/transaction/account_locker_claim_fungibles_and_non_fungibles.rtm b/crates/transaction/models/fixtures/transaction/account_locker_claim_fungibles_and_non_fungibles.rtm similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/account_locker_claim_fungibles_and_non_fungibles.rtm rename to crates/transaction/models/fixtures/transaction/account_locker_claim_fungibles_and_non_fungibles.rtm diff --git a/crates/sargon-transaction-models/fixtures/transaction/claim_two_stakes_from_one_validator.dat b/crates/transaction/models/fixtures/transaction/claim_two_stakes_from_one_validator.dat similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/claim_two_stakes_from_one_validator.dat rename to crates/transaction/models/fixtures/transaction/claim_two_stakes_from_one_validator.dat diff --git a/crates/sargon-transaction-models/fixtures/transaction/claim_two_stakes_from_one_validator.rtm b/crates/transaction/models/fixtures/transaction/claim_two_stakes_from_one_validator.rtm similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/claim_two_stakes_from_one_validator.rtm rename to crates/transaction/models/fixtures/transaction/claim_two_stakes_from_one_validator.rtm diff --git a/crates/sargon-transaction-models/fixtures/transaction/contribute_to_bi_pool.dat b/crates/transaction/models/fixtures/transaction/contribute_to_bi_pool.dat similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/contribute_to_bi_pool.dat rename to crates/transaction/models/fixtures/transaction/contribute_to_bi_pool.dat diff --git a/crates/sargon-transaction-models/fixtures/transaction/contribute_to_bi_pool.rtm b/crates/transaction/models/fixtures/transaction/contribute_to_bi_pool.rtm similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/contribute_to_bi_pool.rtm rename to crates/transaction/models/fixtures/transaction/contribute_to_bi_pool.rtm diff --git a/crates/sargon-transaction-models/fixtures/transaction/create_3_nft_collections.rtm b/crates/transaction/models/fixtures/transaction/create_3_nft_collections.rtm similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/create_3_nft_collections.rtm rename to crates/transaction/models/fixtures/transaction/create_3_nft_collections.rtm diff --git a/crates/sargon-transaction-models/fixtures/transaction/create_access_controller_for_account.rtm b/crates/transaction/models/fixtures/transaction/create_access_controller_for_account.rtm similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/create_access_controller_for_account.rtm rename to crates/transaction/models/fixtures/transaction/create_access_controller_for_account.rtm diff --git a/crates/sargon-transaction-models/fixtures/transaction/create_access_controller_for_persona.rtm b/crates/transaction/models/fixtures/transaction/create_access_controller_for_persona.rtm similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/create_access_controller_for_persona.rtm rename to crates/transaction/models/fixtures/transaction/create_access_controller_for_persona.rtm diff --git a/crates/sargon-transaction-models/fixtures/transaction/create_nft_collection.dat b/crates/transaction/models/fixtures/transaction/create_nft_collection.dat similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/create_nft_collection.dat rename to crates/transaction/models/fixtures/transaction/create_nft_collection.dat diff --git a/crates/sargon-transaction-models/fixtures/transaction/create_nft_collection.rtm b/crates/transaction/models/fixtures/transaction/create_nft_collection.rtm similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/create_nft_collection.rtm rename to crates/transaction/models/fixtures/transaction/create_nft_collection.rtm diff --git a/crates/sargon-transaction-models/fixtures/transaction/create_pool.dat b/crates/transaction/models/fixtures/transaction/create_pool.dat similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/create_pool.dat rename to crates/transaction/models/fixtures/transaction/create_pool.dat diff --git a/crates/sargon-transaction-models/fixtures/transaction/create_pool.rtm b/crates/transaction/models/fixtures/transaction/create_pool.rtm similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/create_pool.rtm rename to crates/transaction/models/fixtures/transaction/create_pool.rtm diff --git a/crates/sargon-transaction-models/fixtures/transaction/create_single_fungible.dat b/crates/transaction/models/fixtures/transaction/create_single_fungible.dat similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/create_single_fungible.dat rename to crates/transaction/models/fixtures/transaction/create_single_fungible.dat diff --git a/crates/sargon-transaction-models/fixtures/transaction/create_single_fungible.rtm b/crates/transaction/models/fixtures/transaction/create_single_fungible.rtm similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/create_single_fungible.rtm rename to crates/transaction/models/fixtures/transaction/create_single_fungible.rtm diff --git a/crates/sargon-transaction-models/fixtures/transaction/mint_nft_gumball_card.dat b/crates/transaction/models/fixtures/transaction/mint_nft_gumball_card.dat similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/mint_nft_gumball_card.dat rename to crates/transaction/models/fixtures/transaction/mint_nft_gumball_card.dat diff --git a/crates/sargon-transaction-models/fixtures/transaction/mint_nft_gumball_card.rtm b/crates/transaction/models/fixtures/transaction/mint_nft_gumball_card.rtm similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/mint_nft_gumball_card.rtm rename to crates/transaction/models/fixtures/transaction/mint_nft_gumball_card.rtm diff --git a/crates/sargon-transaction-models/fixtures/transaction/multi_account_resource_transfer.rtm b/crates/transaction/models/fixtures/transaction/multi_account_resource_transfer.rtm similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/multi_account_resource_transfer.rtm rename to crates/transaction/models/fixtures/transaction/multi_account_resource_transfer.rtm diff --git a/crates/sargon-transaction-models/fixtures/transaction/multi_account_resource_transfer_subintent.rtm b/crates/transaction/models/fixtures/transaction/multi_account_resource_transfer_subintent.rtm similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/multi_account_resource_transfer_subintent.rtm rename to crates/transaction/models/fixtures/transaction/multi_account_resource_transfer_subintent.rtm diff --git a/crates/sargon-transaction-models/fixtures/transaction/open_subintent_fungibles.rtm b/crates/transaction/models/fixtures/transaction/open_subintent_fungibles.rtm similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/open_subintent_fungibles.rtm rename to crates/transaction/models/fixtures/transaction/open_subintent_fungibles.rtm diff --git a/crates/sargon-transaction-models/fixtures/transaction/open_subintent_mix_multiple_deposits.rtm b/crates/transaction/models/fixtures/transaction/open_subintent_mix_multiple_deposits.rtm similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/open_subintent_mix_multiple_deposits.rtm rename to crates/transaction/models/fixtures/transaction/open_subintent_mix_multiple_deposits.rtm diff --git a/crates/sargon-transaction-models/fixtures/transaction/open_subintent_non_fungibles_no_certain_ids.rtm b/crates/transaction/models/fixtures/transaction/open_subintent_non_fungibles_no_certain_ids.rtm similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/open_subintent_non_fungibles_no_certain_ids.rtm rename to crates/transaction/models/fixtures/transaction/open_subintent_non_fungibles_no_certain_ids.rtm diff --git a/crates/sargon-transaction-models/fixtures/transaction/open_subintent_non_fungibles_with_certain_ids.rtm b/crates/transaction/models/fixtures/transaction/open_subintent_non_fungibles_with_certain_ids.rtm similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/open_subintent_non_fungibles_with_certain_ids.rtm rename to crates/transaction/models/fixtures/transaction/open_subintent_non_fungibles_with_certain_ids.rtm diff --git a/crates/sargon-transaction-models/fixtures/transaction/open_subintent_pool_stakes_stake_claim.rtm b/crates/transaction/models/fixtures/transaction/open_subintent_pool_stakes_stake_claim.rtm similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/open_subintent_pool_stakes_stake_claim.rtm rename to crates/transaction/models/fixtures/transaction/open_subintent_pool_stakes_stake_claim.rtm diff --git a/crates/sargon-transaction-models/fixtures/transaction/present_proof_swap_candy.dat b/crates/transaction/models/fixtures/transaction/present_proof_swap_candy.dat similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/present_proof_swap_candy.dat rename to crates/transaction/models/fixtures/transaction/present_proof_swap_candy.dat diff --git a/crates/sargon-transaction-models/fixtures/transaction/present_proof_swap_candy.rtm b/crates/transaction/models/fixtures/transaction/present_proof_swap_candy.rtm similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/present_proof_swap_candy.rtm rename to crates/transaction/models/fixtures/transaction/present_proof_swap_candy.rtm diff --git a/crates/sargon-transaction-models/fixtures/transaction/redeem_from_bi_pool.dat b/crates/transaction/models/fixtures/transaction/redeem_from_bi_pool.dat similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/redeem_from_bi_pool.dat rename to crates/transaction/models/fixtures/transaction/redeem_from_bi_pool.dat diff --git a/crates/sargon-transaction-models/fixtures/transaction/redeem_from_bi_pool.rtm b/crates/transaction/models/fixtures/transaction/redeem_from_bi_pool.rtm similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/redeem_from_bi_pool.rtm rename to crates/transaction/models/fixtures/transaction/redeem_from_bi_pool.rtm diff --git a/crates/sargon-transaction-models/fixtures/transaction/resource_transfer.rtm b/crates/transaction/models/fixtures/transaction/resource_transfer.rtm similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/resource_transfer.rtm rename to crates/transaction/models/fixtures/transaction/resource_transfer.rtm diff --git a/crates/sargon-transaction-models/fixtures/transaction/resource_transfer_subintent.rtm b/crates/transaction/models/fixtures/transaction/resource_transfer_subintent.rtm similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/resource_transfer_subintent.rtm rename to crates/transaction/models/fixtures/transaction/resource_transfer_subintent.rtm diff --git a/crates/sargon-transaction-models/fixtures/transaction/stake_to_three_validators.dat b/crates/transaction/models/fixtures/transaction/stake_to_three_validators.dat similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/stake_to_three_validators.dat rename to crates/transaction/models/fixtures/transaction/stake_to_three_validators.dat diff --git a/crates/sargon-transaction-models/fixtures/transaction/stake_to_three_validators.rtm b/crates/transaction/models/fixtures/transaction/stake_to_three_validators.rtm similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/stake_to_three_validators.rtm rename to crates/transaction/models/fixtures/transaction/stake_to_three_validators.rtm diff --git a/crates/sargon-transaction-models/fixtures/transaction/third_party_deposits_update.dat b/crates/transaction/models/fixtures/transaction/third_party_deposits_update.dat similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/third_party_deposits_update.dat rename to crates/transaction/models/fixtures/transaction/third_party_deposits_update.dat diff --git a/crates/sargon-transaction-models/fixtures/transaction/third_party_deposits_update.rtm b/crates/transaction/models/fixtures/transaction/third_party_deposits_update.rtm similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/third_party_deposits_update.rtm rename to crates/transaction/models/fixtures/transaction/third_party_deposits_update.rtm diff --git a/crates/sargon-transaction-models/fixtures/transaction/transfer_1to2_multiple_nf_and_f_tokens.dat b/crates/transaction/models/fixtures/transaction/transfer_1to2_multiple_nf_and_f_tokens.dat similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/transfer_1to2_multiple_nf_and_f_tokens.dat rename to crates/transaction/models/fixtures/transaction/transfer_1to2_multiple_nf_and_f_tokens.dat diff --git a/crates/sargon-transaction-models/fixtures/transaction/transfer_1to2_multiple_nf_and_f_tokens.rtm b/crates/transaction/models/fixtures/transaction/transfer_1to2_multiple_nf_and_f_tokens.rtm similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/transfer_1to2_multiple_nf_and_f_tokens.rtm rename to crates/transaction/models/fixtures/transaction/transfer_1to2_multiple_nf_and_f_tokens.rtm diff --git a/crates/sargon-transaction-models/fixtures/transaction/unstake_partially_from_one_validator.dat b/crates/transaction/models/fixtures/transaction/unstake_partially_from_one_validator.dat similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/unstake_partially_from_one_validator.dat rename to crates/transaction/models/fixtures/transaction/unstake_partially_from_one_validator.dat diff --git a/crates/sargon-transaction-models/fixtures/transaction/unstake_partially_from_one_validator.rtm b/crates/transaction/models/fixtures/transaction/unstake_partially_from_one_validator.rtm similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/unstake_partially_from_one_validator.rtm rename to crates/transaction/models/fixtures/transaction/unstake_partially_from_one_validator.rtm diff --git a/crates/sargon-transaction-models/src/assert_manifest.rs b/crates/transaction/models/src/assert_manifest.rs similarity index 100% rename from crates/sargon-transaction-models/src/assert_manifest.rs rename to crates/transaction/models/src/assert_manifest.rs diff --git a/crates/sargon-transaction-models/src/error_from.rs b/crates/transaction/models/src/error_from.rs similarity index 100% rename from crates/sargon-transaction-models/src/error_from.rs rename to crates/transaction/models/src/error_from.rs diff --git a/crates/sargon-transaction-models/src/is_intent_signing.rs b/crates/transaction/models/src/is_intent_signing.rs similarity index 100% rename from crates/sargon-transaction-models/src/is_intent_signing.rs rename to crates/transaction/models/src/is_intent_signing.rs diff --git a/crates/sargon-transaction-models/src/lib.rs b/crates/transaction/models/src/lib.rs similarity index 93% rename from crates/sargon-transaction-models/src/lib.rs rename to crates/transaction/models/src/lib.rs index 97c08441a..e74aca824 100644 --- a/crates/sargon-transaction-models/src/lib.rs +++ b/crates/transaction/models/src/lib.rs @@ -6,11 +6,18 @@ mod profile_models; mod unvalidated_transaction_manifest; pub mod prelude { + pub use addresses::prelude::*; + pub use bytes::prelude::*; + pub use core_collections::prelude::Just; + pub use core_misc::prelude::Instant; + pub use ecc::prelude::*; + pub use factors::prelude::*; + pub use hash::prelude::*; + pub use hierarchical_deterministic::prelude::*; pub use identified_vec_of::prelude::*; - pub use sargon_addresses::prelude::*; - pub use sargon_core::prelude::*; - pub use sargon_factors::prelude::*; - pub use sargon_hierarchical_deterministic::prelude::*; + pub use network::prelude::*; + pub use numeric::prelude::*; + pub use transaction_foundation::prelude::*; pub use crate::assert_manifest::*; pub use crate::error_from::*; @@ -195,6 +202,17 @@ pub mod prelude { TransactionManifestV2Builder as ScryptoTransactionManifestV2Builder, }, }; + + pub(crate) use enum_as_inner::EnumAsInner; + pub(crate) use log::*; + pub(crate) use serde::{Deserialize, Serialize}; + pub(crate) use std::collections::HashMap; + + #[cfg(test)] + pub(crate) use serde_json::json; + + #[cfg(test)] + pub(crate) use std::collections::HashSet; } pub use prelude::*; diff --git a/crates/sargon-transaction-models/src/low_level/compiled_notarized_intent.rs b/crates/transaction/models/src/low_level/compiled_notarized_intent.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/compiled_notarized_intent.rs rename to crates/transaction/models/src/low_level/compiled_notarized_intent.rs diff --git a/crates/sargon-transaction-models/src/low_level/compiled_transaction_intent.rs b/crates/transaction/models/src/low_level/compiled_transaction_intent.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/compiled_transaction_intent.rs rename to crates/transaction/models/src/low_level/compiled_transaction_intent.rs diff --git a/crates/sargon-transaction-models/src/low_level/dynamically_analyzable_manifest.rs b/crates/transaction/models/src/low_level/dynamically_analyzable_manifest.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/dynamically_analyzable_manifest.rs rename to crates/transaction/models/src/low_level/dynamically_analyzable_manifest.rs diff --git a/crates/sargon-transaction-models/src/low_level/execution_summary/execution_summary.rs b/crates/transaction/models/src/low_level/execution_summary/execution_summary.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/execution_summary/execution_summary.rs rename to crates/transaction/models/src/low_level/execution_summary/execution_summary.rs diff --git a/crates/sargon-transaction-models/src/low_level/execution_summary/fee_locks.rs b/crates/transaction/models/src/low_level/execution_summary/fee_locks.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/execution_summary/fee_locks.rs rename to crates/transaction/models/src/low_level/execution_summary/fee_locks.rs diff --git a/crates/sargon-transaction-models/src/low_level/execution_summary/fee_summary.rs b/crates/transaction/models/src/low_level/execution_summary/fee_summary.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/execution_summary/fee_summary.rs rename to crates/transaction/models/src/low_level/execution_summary/fee_summary.rs diff --git a/crates/sargon-transaction-models/src/low_level/execution_summary/mod.rs b/crates/transaction/models/src/low_level/execution_summary/mod.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/execution_summary/mod.rs rename to crates/transaction/models/src/low_level/execution_summary/mod.rs diff --git a/crates/sargon-transaction-models/src/low_level/execution_summary/new_entities.rs b/crates/transaction/models/src/low_level/execution_summary/new_entities.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/execution_summary/new_entities.rs rename to crates/transaction/models/src/low_level/execution_summary/new_entities.rs diff --git a/crates/sargon-transaction-models/src/low_level/execution_summary/newly_created_resource.rs b/crates/transaction/models/src/low_level/execution_summary/newly_created_resource.rs similarity index 98% rename from crates/sargon-transaction-models/src/low_level/execution_summary/newly_created_resource.rs rename to crates/transaction/models/src/low_level/execution_summary/newly_created_resource.rs index 85919e9a7..0bb262222 100644 --- a/crates/sargon-transaction-models/src/low_level/execution_summary/newly_created_resource.rs +++ b/crates/transaction/models/src/low_level/execution_summary/newly_created_resource.rs @@ -1,3 +1,4 @@ +use metadata::prelude::MetadataKey; use radix_rust::prelude::IndexMap; use crate::prelude::*; @@ -41,7 +42,7 @@ impl From>> _ => None, }; - use MetadataKey::*; + use metadata::prelude::MetadataKey::*; Self::new( get_str(Name), diff --git a/crates/sargon-transaction-models/src/low_level/execution_summary/reserved_instruction.rs b/crates/transaction/models/src/low_level/execution_summary/reserved_instruction.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/execution_summary/reserved_instruction.rs rename to crates/transaction/models/src/low_level/execution_summary/reserved_instruction.rs diff --git a/crates/sargon-transaction-models/src/low_level/execution_summary/resource_indicator/fungible_resource_indicator.rs b/crates/transaction/models/src/low_level/execution_summary/resource_indicator/fungible_resource_indicator.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/execution_summary/resource_indicator/fungible_resource_indicator.rs rename to crates/transaction/models/src/low_level/execution_summary/resource_indicator/fungible_resource_indicator.rs diff --git a/crates/sargon-transaction-models/src/low_level/execution_summary/resource_indicator/mod.rs b/crates/transaction/models/src/low_level/execution_summary/resource_indicator/mod.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/execution_summary/resource_indicator/mod.rs rename to crates/transaction/models/src/low_level/execution_summary/resource_indicator/mod.rs diff --git a/crates/sargon-transaction-models/src/low_level/execution_summary/resource_indicator/non_fungible_resource_indicator.rs b/crates/transaction/models/src/low_level/execution_summary/resource_indicator/non_fungible_resource_indicator.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/execution_summary/resource_indicator/non_fungible_resource_indicator.rs rename to crates/transaction/models/src/low_level/execution_summary/resource_indicator/non_fungible_resource_indicator.rs diff --git a/crates/sargon-transaction-models/src/low_level/execution_summary/resource_indicator/predicted.rs b/crates/transaction/models/src/low_level/execution_summary/resource_indicator/predicted.rs similarity index 99% rename from crates/sargon-transaction-models/src/low_level/execution_summary/resource_indicator/predicted.rs rename to crates/transaction/models/src/low_level/execution_summary/resource_indicator/predicted.rs index a5f607e2b..a2ad23ec5 100644 --- a/crates/sargon-transaction-models/src/low_level/execution_summary/resource_indicator/predicted.rs +++ b/crates/transaction/models/src/low_level/execution_summary/resource_indicator/predicted.rs @@ -64,7 +64,7 @@ macro_rules! decl_predicted { )* $wrapped_type:ty ) => { - paste! { + paste::paste! { decl_predicted!( $( #[doc = $expr] diff --git a/crates/sargon-transaction-models/src/low_level/execution_summary/resource_indicator/resource_indicator.rs b/crates/transaction/models/src/low_level/execution_summary/resource_indicator/resource_indicator.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/execution_summary/resource_indicator/resource_indicator.rs rename to crates/transaction/models/src/low_level/execution_summary/resource_indicator/resource_indicator.rs diff --git a/crates/sargon-transaction-models/src/low_level/execution_summary/resource_specifier/mod.rs b/crates/transaction/models/src/low_level/execution_summary/resource_specifier/mod.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/execution_summary/resource_specifier/mod.rs rename to crates/transaction/models/src/low_level/execution_summary/resource_specifier/mod.rs diff --git a/crates/sargon-transaction-models/src/low_level/execution_summary/resource_specifier/resource_specifier.rs b/crates/transaction/models/src/low_level/execution_summary/resource_specifier/resource_specifier.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/execution_summary/resource_specifier/resource_specifier.rs rename to crates/transaction/models/src/low_level/execution_summary/resource_specifier/resource_specifier.rs diff --git a/crates/sargon-transaction-models/src/low_level/intent_signature.rs b/crates/transaction/models/src/low_level/intent_signature.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/intent_signature.rs rename to crates/transaction/models/src/low_level/intent_signature.rs diff --git a/crates/sargon-transaction-models/src/low_level/manifest_encountered_component_address.rs b/crates/transaction/models/src/low_level/manifest_encountered_component_address.rs similarity index 98% rename from crates/sargon-transaction-models/src/low_level/manifest_encountered_component_address.rs rename to crates/transaction/models/src/low_level/manifest_encountered_component_address.rs index fd2bcb83d..96ff43cb6 100644 --- a/crates/sargon-transaction-models/src/low_level/manifest_encountered_component_address.rs +++ b/crates/transaction/models/src/low_level/manifest_encountered_component_address.rs @@ -1,4 +1,4 @@ -use sargon_addresses::address_union; +use addresses::address_union; use crate::prelude::*; diff --git a/crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/account_deposits.rs b/crates/transaction/models/src/low_level/manifest_summary/account_deposit/account_deposits.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/account_deposits.rs rename to crates/transaction/models/src/low_level/manifest_summary/account_deposit/account_deposits.rs diff --git a/crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/change_source.rs b/crates/transaction/models/src/low_level/manifest_summary/account_deposit/change_source.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/change_source.rs rename to crates/transaction/models/src/low_level/manifest_summary/account_deposit/change_source.rs diff --git a/crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/mod.rs b/crates/transaction/models/src/low_level/manifest_summary/account_deposit/mod.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/mod.rs rename to crates/transaction/models/src/low_level/manifest_summary/account_deposit/mod.rs diff --git a/crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/simple_counted_resource_bounds.rs b/crates/transaction/models/src/low_level/manifest_summary/account_deposit/simple_counted_resource_bounds.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/simple_counted_resource_bounds.rs rename to crates/transaction/models/src/low_level/manifest_summary/account_deposit/simple_counted_resource_bounds.rs diff --git a/crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/simple_non_fungible_resource_bounds.rs b/crates/transaction/models/src/low_level/manifest_summary/account_deposit/simple_non_fungible_resource_bounds.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/simple_non_fungible_resource_bounds.rs rename to crates/transaction/models/src/low_level/manifest_summary/account_deposit/simple_non_fungible_resource_bounds.rs diff --git a/crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/simple_resource_bounds.rs b/crates/transaction/models/src/low_level/manifest_summary/account_deposit/simple_resource_bounds.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/simple_resource_bounds.rs rename to crates/transaction/models/src/low_level/manifest_summary/account_deposit/simple_resource_bounds.rs diff --git a/crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/unspecified_resources.rs b/crates/transaction/models/src/low_level/manifest_summary/account_deposit/unspecified_resources.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/unspecified_resources.rs rename to crates/transaction/models/src/low_level/manifest_summary/account_deposit/unspecified_resources.rs diff --git a/crates/sargon-transaction-models/src/low_level/manifest_summary/account_withdraw/account_withdraw.rs b/crates/transaction/models/src/low_level/manifest_summary/account_withdraw/account_withdraw.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/manifest_summary/account_withdraw/account_withdraw.rs rename to crates/transaction/models/src/low_level/manifest_summary/account_withdraw/account_withdraw.rs diff --git a/crates/sargon-transaction-models/src/low_level/manifest_summary/account_withdraw/mod.rs b/crates/transaction/models/src/low_level/manifest_summary/account_withdraw/mod.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/manifest_summary/account_withdraw/mod.rs rename to crates/transaction/models/src/low_level/manifest_summary/account_withdraw/mod.rs diff --git a/crates/sargon-transaction-models/src/low_level/manifest_summary/manifest_summary.rs b/crates/transaction/models/src/low_level/manifest_summary/manifest_summary.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/manifest_summary/manifest_summary.rs rename to crates/transaction/models/src/low_level/manifest_summary/manifest_summary.rs diff --git a/crates/sargon-transaction-models/src/low_level/manifest_summary/mod.rs b/crates/transaction/models/src/low_level/manifest_summary/mod.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/manifest_summary/mod.rs rename to crates/transaction/models/src/low_level/manifest_summary/mod.rs diff --git a/crates/sargon-transaction-models/src/low_level/mod.rs b/crates/transaction/models/src/low_level/mod.rs similarity index 90% rename from crates/sargon-transaction-models/src/low_level/mod.rs rename to crates/transaction/models/src/low_level/mod.rs index 38a75e552..7c0c5f7dd 100644 --- a/crates/sargon-transaction-models/src/low_level/mod.rs +++ b/crates/transaction/models/src/low_level/mod.rs @@ -1,3 +1,5 @@ +use crate::prelude::*; + mod compiled_notarized_intent; mod compiled_transaction_intent; mod dynamically_analyzable_manifest; @@ -34,12 +36,12 @@ pub use v2::*; pub(crate) fn map_static_analysis_error( error: radix_transactions::manifest::static_resource_movements::StaticResourceMovementsError, -) -> crate::prelude::CommonError { - crate::prelude::error!( +) -> CommonError { + error!( "Failed to get execution summary from RET, error: {:?}", error ); - crate::prelude::CommonError::FailedToGenerateManifestSummary { + CommonError::FailedToGenerateManifestSummary { underlying: format!("{:?}", error), } } diff --git a/crates/sargon-transaction-models/src/low_level/notarized_transaction.rs b/crates/transaction/models/src/low_level/notarized_transaction.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/notarized_transaction.rs rename to crates/transaction/models/src/low_level/notarized_transaction.rs diff --git a/crates/sargon-transaction-models/src/low_level/notary_signature.rs b/crates/transaction/models/src/low_level/notary_signature.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/notary_signature.rs rename to crates/transaction/models/src/low_level/notary_signature.rs diff --git a/crates/sargon-transaction-models/src/low_level/sbor_depth_validation.rs b/crates/transaction/models/src/low_level/sbor_depth_validation.rs similarity index 97% rename from crates/sargon-transaction-models/src/low_level/sbor_depth_validation.rs rename to crates/transaction/models/src/low_level/sbor_depth_validation.rs index 1f02659f3..3b35327b0 100644 --- a/crates/sargon-transaction-models/src/low_level/sbor_depth_validation.rs +++ b/crates/transaction/models/src/low_level/sbor_depth_validation.rs @@ -44,7 +44,7 @@ pub(crate) fn manifest_value_with_sbor_depth( #[cfg(test)] mod sbor_depth_validation_tests { - use sargon_addresses::Scrypto_scrypto_encode; + use addresses::Scrypto_scrypto_encode; use super::*; diff --git a/crates/sargon-transaction-models/src/low_level/signed_intent.rs b/crates/transaction/models/src/low_level/signed_intent.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/signed_intent.rs rename to crates/transaction/models/src/low_level/signed_intent.rs diff --git a/crates/sargon-transaction-models/src/low_level/statically_analyzable_manifest.rs b/crates/transaction/models/src/low_level/statically_analyzable_manifest.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/statically_analyzable_manifest.rs rename to crates/transaction/models/src/low_level/statically_analyzable_manifest.rs diff --git a/crates/sargon-transaction-models/src/low_level/transaction_classes/detailed_manifest_class.rs b/crates/transaction/models/src/low_level/transaction_classes/detailed_manifest_class.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/transaction_classes/detailed_manifest_class.rs rename to crates/transaction/models/src/low_level/transaction_classes/detailed_manifest_class.rs diff --git a/crates/sargon-transaction-models/src/low_level/transaction_classes/detailed_manifest_class_kind.rs b/crates/transaction/models/src/low_level/transaction_classes/detailed_manifest_class_kind.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/transaction_classes/detailed_manifest_class_kind.rs rename to crates/transaction/models/src/low_level/transaction_classes/detailed_manifest_class_kind.rs diff --git a/crates/sargon-transaction-models/src/low_level/transaction_classes/mod.rs b/crates/transaction/models/src/low_level/transaction_classes/mod.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/transaction_classes/mod.rs rename to crates/transaction/models/src/low_level/transaction_classes/mod.rs diff --git a/crates/sargon-transaction-models/src/low_level/transaction_classes/types/mod.rs b/crates/transaction/models/src/low_level/transaction_classes/types/mod.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/transaction_classes/types/mod.rs rename to crates/transaction/models/src/low_level/transaction_classes/types/mod.rs diff --git a/crates/sargon-transaction-models/src/low_level/transaction_classes/types/resource_preference_update.rs b/crates/transaction/models/src/low_level/transaction_classes/types/resource_preference_update.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/transaction_classes/types/resource_preference_update.rs rename to crates/transaction/models/src/low_level/transaction_classes/types/resource_preference_update.rs diff --git a/crates/sargon-transaction-models/src/low_level/transaction_classes/types/tracked_pool_contribution.rs b/crates/transaction/models/src/low_level/transaction_classes/types/tracked_pool_contribution.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/transaction_classes/types/tracked_pool_contribution.rs rename to crates/transaction/models/src/low_level/transaction_classes/types/tracked_pool_contribution.rs diff --git a/crates/sargon-transaction-models/src/low_level/transaction_classes/types/tracked_pool_redemption.rs b/crates/transaction/models/src/low_level/transaction_classes/types/tracked_pool_redemption.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/transaction_classes/types/tracked_pool_redemption.rs rename to crates/transaction/models/src/low_level/transaction_classes/types/tracked_pool_redemption.rs diff --git a/crates/sargon-transaction-models/src/low_level/transaction_classes/types/tracked_validator_claim.rs b/crates/transaction/models/src/low_level/transaction_classes/types/tracked_validator_claim.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/transaction_classes/types/tracked_validator_claim.rs rename to crates/transaction/models/src/low_level/transaction_classes/types/tracked_validator_claim.rs diff --git a/crates/sargon-transaction-models/src/low_level/transaction_classes/types/tracked_validator_stake.rs b/crates/transaction/models/src/low_level/transaction_classes/types/tracked_validator_stake.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/transaction_classes/types/tracked_validator_stake.rs rename to crates/transaction/models/src/low_level/transaction_classes/types/tracked_validator_stake.rs diff --git a/crates/sargon-transaction-models/src/low_level/transaction_classes/types/unstake_data.rs b/crates/transaction/models/src/low_level/transaction_classes/types/unstake_data.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/transaction_classes/types/unstake_data.rs rename to crates/transaction/models/src/low_level/transaction_classes/types/unstake_data.rs diff --git a/crates/sargon-transaction-models/src/low_level/transaction_hashes/intent_hash.rs b/crates/transaction/models/src/low_level/transaction_hashes/intent_hash.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/transaction_hashes/intent_hash.rs rename to crates/transaction/models/src/low_level/transaction_hashes/intent_hash.rs diff --git a/crates/sargon-transaction-models/src/low_level/transaction_hashes/mod.rs b/crates/transaction/models/src/low_level/transaction_hashes/mod.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/transaction_hashes/mod.rs rename to crates/transaction/models/src/low_level/transaction_hashes/mod.rs diff --git a/crates/sargon-transaction-models/src/low_level/transaction_hashes/signed_intent_hash.rs b/crates/transaction/models/src/low_level/transaction_hashes/signed_intent_hash.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/transaction_hashes/signed_intent_hash.rs rename to crates/transaction/models/src/low_level/transaction_hashes/signed_intent_hash.rs diff --git a/crates/sargon-transaction-models/src/low_level/transaction_hashes/subintent_hash.rs b/crates/transaction/models/src/low_level/transaction_hashes/subintent_hash.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/transaction_hashes/subintent_hash.rs rename to crates/transaction/models/src/low_level/transaction_hashes/subintent_hash.rs diff --git a/crates/sargon-transaction-models/src/low_level/transaction_hashes/transaction_hashes.rs b/crates/transaction/models/src/low_level/transaction_hashes/transaction_hashes.rs similarity index 98% rename from crates/sargon-transaction-models/src/low_level/transaction_hashes/transaction_hashes.rs rename to crates/transaction/models/src/low_level/transaction_hashes/transaction_hashes.rs index d4c076a1d..5d711416e 100644 --- a/crates/sargon-transaction-models/src/low_level/transaction_hashes/transaction_hashes.rs +++ b/crates/transaction/models/src/low_level/transaction_hashes/transaction_hashes.rs @@ -1,6 +1,8 @@ use crate::prelude::*; use crate::low_level::transaction_hashes::validate_and_decode_hash::validate_and_decode_hash; +use radix_common::crypto::IsHash; +use sargon_core_utils::prelude::format_string; macro_rules! decl_tx_hash { ( @@ -31,6 +33,7 @@ macro_rules! decl_tx_hash { pub bech32_encoded_tx_id: String, } + impl $struct_name { pub(crate) fn from_scrypto( scrypto: $scrypto_struct_name, @@ -128,7 +131,7 @@ macro_rules! decl_tx_hash { $expected_sample_str: literal, $expected_sample_str_formatted: literal, ) => { - paste! { + paste::paste! { decl_tx_hash!( $( #[doc = $expr] diff --git a/crates/sargon-transaction-models/src/low_level/transaction_hashes/validate_and_decode_hash.rs b/crates/transaction/models/src/low_level/transaction_hashes/validate_and_decode_hash.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/transaction_hashes/validate_and_decode_hash.rs rename to crates/transaction/models/src/low_level/transaction_hashes/validate_and_decode_hash.rs diff --git a/crates/sargon-transaction-models/src/low_level/v1/intent_signatures.rs b/crates/transaction/models/src/low_level/v1/intent_signatures.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v1/intent_signatures.rs rename to crates/transaction/models/src/low_level/v1/intent_signatures.rs diff --git a/crates/sargon-transaction-models/src/low_level/v1/message/message.rs b/crates/transaction/models/src/low_level/v1/message/message.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v1/message/message.rs rename to crates/transaction/models/src/low_level/v1/message/message.rs diff --git a/crates/sargon-transaction-models/src/low_level/v1/message/mod.rs b/crates/transaction/models/src/low_level/v1/message/mod.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v1/message/mod.rs rename to crates/transaction/models/src/low_level/v1/message/mod.rs diff --git a/crates/sargon-transaction-models/src/low_level/v1/message/plaintext_message/mod.rs b/crates/transaction/models/src/low_level/v1/message/plaintext_message/mod.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v1/message/plaintext_message/mod.rs rename to crates/transaction/models/src/low_level/v1/message/plaintext_message/mod.rs diff --git a/crates/sargon-transaction-models/src/low_level/v1/message/plaintext_message/plaintext_message.rs b/crates/transaction/models/src/low_level/v1/message/plaintext_message/plaintext_message.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v1/message/plaintext_message/plaintext_message.rs rename to crates/transaction/models/src/low_level/v1/message/plaintext_message/plaintext_message.rs diff --git a/crates/sargon-transaction-models/src/low_level/v1/message/plaintext_message/plaintext_message_contents.rs b/crates/transaction/models/src/low_level/v1/message/plaintext_message/plaintext_message_contents.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v1/message/plaintext_message/plaintext_message_contents.rs rename to crates/transaction/models/src/low_level/v1/message/plaintext_message/plaintext_message_contents.rs diff --git a/crates/sargon-transaction-models/src/low_level/v1/mod.rs b/crates/transaction/models/src/low_level/v1/mod.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v1/mod.rs rename to crates/transaction/models/src/low_level/v1/mod.rs diff --git a/crates/sargon-transaction-models/src/low_level/v1/transaction_header.rs b/crates/transaction/models/src/low_level/v1/transaction_header.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v1/transaction_header.rs rename to crates/transaction/models/src/low_level/v1/transaction_header.rs diff --git a/crates/sargon-transaction-models/src/low_level/v1/transaction_intent.rs b/crates/transaction/models/src/low_level/v1/transaction_intent.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v1/transaction_intent.rs rename to crates/transaction/models/src/low_level/v1/transaction_intent.rs diff --git a/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/blobs/blob.rs b/crates/transaction/models/src/low_level/v1/transaction_manifest/blobs/blob.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/blobs/blob.rs rename to crates/transaction/models/src/low_level/v1/transaction_manifest/blobs/blob.rs diff --git a/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/blobs/blobs.rs b/crates/transaction/models/src/low_level/v1/transaction_manifest/blobs/blobs.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/blobs/blobs.rs rename to crates/transaction/models/src/low_level/v1/transaction_manifest/blobs/blobs.rs diff --git a/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/blobs/mod.rs b/crates/transaction/models/src/low_level/v1/transaction_manifest/blobs/mod.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/blobs/mod.rs rename to crates/transaction/models/src/low_level/v1/transaction_manifest/blobs/mod.rs diff --git a/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/execution_summary/mod.rs b/crates/transaction/models/src/low_level/v1/transaction_manifest/execution_summary/mod.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/execution_summary/mod.rs rename to crates/transaction/models/src/low_level/v1/transaction_manifest/execution_summary/mod.rs diff --git a/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/execution_summary/transaction_manifest_execution_summary.rs b/crates/transaction/models/src/low_level/v1/transaction_manifest/execution_summary/transaction_manifest_execution_summary.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/execution_summary/transaction_manifest_execution_summary.rs rename to crates/transaction/models/src/low_level/v1/transaction_manifest/execution_summary/transaction_manifest_execution_summary.rs diff --git a/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/instructions/instructions.rs b/crates/transaction/models/src/low_level/v1/transaction_manifest/instructions/instructions.rs similarity index 99% rename from crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/instructions/instructions.rs rename to crates/transaction/models/src/low_level/v1/transaction_manifest/instructions/instructions.rs index 95efa062e..c517f1c6c 100644 --- a/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/instructions/instructions.rs +++ b/crates/transaction/models/src/low_level/v1/transaction_manifest/instructions/instructions.rs @@ -1,3 +1,5 @@ +use std::ops::Deref; + use crate::prelude::*; #[cfg(test)] diff --git a/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/instructions/mod.rs b/crates/transaction/models/src/low_level/v1/transaction_manifest/instructions/mod.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/instructions/mod.rs rename to crates/transaction/models/src/low_level/v1/transaction_manifest/instructions/mod.rs diff --git a/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/mod.rs b/crates/transaction/models/src/low_level/v1/transaction_manifest/mod.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/mod.rs rename to crates/transaction/models/src/low_level/v1/transaction_manifest/mod.rs diff --git a/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/transaction_manifest.rs b/crates/transaction/models/src/low_level/v1/transaction_manifest/transaction_manifest.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/transaction_manifest.rs rename to crates/transaction/models/src/low_level/v1/transaction_manifest/transaction_manifest.rs diff --git a/crates/sargon-transaction-models/src/low_level/v2/compiled_subintent.rs b/crates/transaction/models/src/low_level/v2/compiled_subintent.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v2/compiled_subintent.rs rename to crates/transaction/models/src/low_level/v2/compiled_subintent.rs diff --git a/crates/sargon-transaction-models/src/low_level/v2/intent_header_v2.rs b/crates/transaction/models/src/low_level/v2/intent_header_v2.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v2/intent_header_v2.rs rename to crates/transaction/models/src/low_level/v2/intent_header_v2.rs diff --git a/crates/sargon-transaction-models/src/low_level/v2/message_v2/message_v2.rs b/crates/transaction/models/src/low_level/v2/message_v2/message_v2.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v2/message_v2/message_v2.rs rename to crates/transaction/models/src/low_level/v2/message_v2/message_v2.rs diff --git a/crates/sargon-transaction-models/src/low_level/v2/message_v2/mod.rs b/crates/transaction/models/src/low_level/v2/message_v2/mod.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v2/message_v2/mod.rs rename to crates/transaction/models/src/low_level/v2/message_v2/mod.rs diff --git a/crates/sargon-transaction-models/src/low_level/v2/mod.rs b/crates/transaction/models/src/low_level/v2/mod.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v2/mod.rs rename to crates/transaction/models/src/low_level/v2/mod.rs diff --git a/crates/sargon-transaction-models/src/low_level/v2/signed_partial_transaction.rs b/crates/transaction/models/src/low_level/v2/signed_partial_transaction.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v2/signed_partial_transaction.rs rename to crates/transaction/models/src/low_level/v2/signed_partial_transaction.rs diff --git a/crates/sargon-transaction-models/src/low_level/v2/signed_subintent.rs b/crates/transaction/models/src/low_level/v2/signed_subintent.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v2/signed_subintent.rs rename to crates/transaction/models/src/low_level/v2/signed_subintent.rs diff --git a/crates/sargon-transaction-models/src/low_level/v2/subintent.rs b/crates/transaction/models/src/low_level/v2/subintent.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v2/subintent.rs rename to crates/transaction/models/src/low_level/v2/subintent.rs diff --git a/crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/child_subintent_specifier.rs b/crates/transaction/models/src/low_level/v2/transaction_manifest_v2/child_subintent_specifier.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/child_subintent_specifier.rs rename to crates/transaction/models/src/low_level/v2/transaction_manifest_v2/child_subintent_specifier.rs diff --git a/crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/child_subintent_specifiers.rs b/crates/transaction/models/src/low_level/v2/transaction_manifest_v2/child_subintent_specifiers.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/child_subintent_specifiers.rs rename to crates/transaction/models/src/low_level/v2/transaction_manifest_v2/child_subintent_specifiers.rs diff --git a/crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/execution_summary_v2/mod.rs b/crates/transaction/models/src/low_level/v2/transaction_manifest_v2/execution_summary_v2/mod.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/execution_summary_v2/mod.rs rename to crates/transaction/models/src/low_level/v2/transaction_manifest_v2/execution_summary_v2/mod.rs diff --git a/crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/execution_summary_v2/transaction_manifest_execution_summary_v2.rs b/crates/transaction/models/src/low_level/v2/transaction_manifest_v2/execution_summary_v2/transaction_manifest_execution_summary_v2.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/execution_summary_v2/transaction_manifest_execution_summary_v2.rs rename to crates/transaction/models/src/low_level/v2/transaction_manifest_v2/execution_summary_v2/transaction_manifest_execution_summary_v2.rs diff --git a/crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/instructions_v2/instructions_v2.rs b/crates/transaction/models/src/low_level/v2/transaction_manifest_v2/instructions_v2/instructions_v2.rs similarity index 99% rename from crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/instructions_v2/instructions_v2.rs rename to crates/transaction/models/src/low_level/v2/transaction_manifest_v2/instructions_v2/instructions_v2.rs index 839b030ba..4123019fd 100644 --- a/crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/instructions_v2/instructions_v2.rs +++ b/crates/transaction/models/src/low_level/v2/transaction_manifest_v2/instructions_v2/instructions_v2.rs @@ -1,3 +1,5 @@ +use std::ops::Deref; + use crate::prelude::*; #[cfg(test)] diff --git a/crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/instructions_v2/mod.rs b/crates/transaction/models/src/low_level/v2/transaction_manifest_v2/instructions_v2/mod.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/instructions_v2/mod.rs rename to crates/transaction/models/src/low_level/v2/transaction_manifest_v2/instructions_v2/mod.rs diff --git a/crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/mod.rs b/crates/transaction/models/src/low_level/v2/transaction_manifest_v2/mod.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/mod.rs rename to crates/transaction/models/src/low_level/v2/transaction_manifest_v2/mod.rs diff --git a/crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/subintent_manifest.rs b/crates/transaction/models/src/low_level/v2/transaction_manifest_v2/subintent_manifest.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/subintent_manifest.rs rename to crates/transaction/models/src/low_level/v2/transaction_manifest_v2/subintent_manifest.rs diff --git a/crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/transaction_manifest_v2.rs b/crates/transaction/models/src/low_level/v2/transaction_manifest_v2/transaction_manifest_v2.rs similarity index 100% rename from crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/transaction_manifest_v2.rs rename to crates/transaction/models/src/low_level/v2/transaction_manifest_v2/transaction_manifest_v2.rs diff --git a/crates/sargon-transaction-models/src/profile_models/deposit_rule.rs b/crates/transaction/models/src/profile_models/deposit_rule.rs similarity index 98% rename from crates/sargon-transaction-models/src/profile_models/deposit_rule.rs rename to crates/transaction/models/src/profile_models/deposit_rule.rs index 7ac47c70b..fabf65037 100644 --- a/crates/sargon-transaction-models/src/profile_models/deposit_rule.rs +++ b/crates/transaction/models/src/profile_models/deposit_rule.rs @@ -67,6 +67,8 @@ impl From for DepositRule { #[cfg(test)] mod tests { + use sargon_core_utils::prelude::DeserializeStr; + use super::*; #[allow(clippy::upper_case_acronyms)] diff --git a/crates/sargon-transaction-models/src/profile_models/mod.rs b/crates/transaction/models/src/profile_models/mod.rs similarity index 100% rename from crates/sargon-transaction-models/src/profile_models/mod.rs rename to crates/transaction/models/src/profile_models/mod.rs diff --git a/crates/sargon-transaction-models/src/profile_models/third_party_deposits/asset_exception.rs b/crates/transaction/models/src/profile_models/third_party_deposits/asset_exception.rs similarity index 100% rename from crates/sargon-transaction-models/src/profile_models/third_party_deposits/asset_exception.rs rename to crates/transaction/models/src/profile_models/third_party_deposits/asset_exception.rs diff --git a/crates/sargon-transaction-models/src/profile_models/third_party_deposits/assets_exception_list.rs b/crates/transaction/models/src/profile_models/third_party_deposits/assets_exception_list.rs similarity index 100% rename from crates/sargon-transaction-models/src/profile_models/third_party_deposits/assets_exception_list.rs rename to crates/transaction/models/src/profile_models/third_party_deposits/assets_exception_list.rs diff --git a/crates/sargon-transaction-models/src/profile_models/third_party_deposits/deposit_address_exception_rule.rs b/crates/transaction/models/src/profile_models/third_party_deposits/deposit_address_exception_rule.rs similarity index 100% rename from crates/sargon-transaction-models/src/profile_models/third_party_deposits/deposit_address_exception_rule.rs rename to crates/transaction/models/src/profile_models/third_party_deposits/deposit_address_exception_rule.rs diff --git a/crates/sargon-transaction-models/src/profile_models/third_party_deposits/depositors_allow_list.rs b/crates/transaction/models/src/profile_models/third_party_deposits/depositors_allow_list.rs similarity index 100% rename from crates/sargon-transaction-models/src/profile_models/third_party_deposits/depositors_allow_list.rs rename to crates/transaction/models/src/profile_models/third_party_deposits/depositors_allow_list.rs diff --git a/crates/sargon-transaction-models/src/profile_models/third_party_deposits/mod.rs b/crates/transaction/models/src/profile_models/third_party_deposits/mod.rs similarity index 100% rename from crates/sargon-transaction-models/src/profile_models/third_party_deposits/mod.rs rename to crates/transaction/models/src/profile_models/third_party_deposits/mod.rs diff --git a/crates/sargon-transaction-models/src/profile_models/third_party_deposits/third_party_deposits.rs b/crates/transaction/models/src/profile_models/third_party_deposits/third_party_deposits.rs similarity index 100% rename from crates/sargon-transaction-models/src/profile_models/third_party_deposits/third_party_deposits.rs rename to crates/transaction/models/src/profile_models/third_party_deposits/third_party_deposits.rs diff --git a/crates/sargon-transaction-models/src/unvalidated_transaction_manifest.rs b/crates/transaction/models/src/unvalidated_transaction_manifest.rs similarity index 100% rename from crates/sargon-transaction-models/src/unvalidated_transaction_manifest.rs rename to crates/transaction/models/src/unvalidated_transaction_manifest.rs diff --git a/crates/sargon-uniffi-conversion-macros/Cargo.toml b/crates/uniffi/conversion-macros/Cargo.toml similarity index 100% rename from crates/sargon-uniffi-conversion-macros/Cargo.toml rename to crates/uniffi/conversion-macros/Cargo.toml diff --git a/crates/sargon-uniffi-conversion-macros/src/common.rs b/crates/uniffi/conversion-macros/src/common.rs similarity index 100% rename from crates/sargon-uniffi-conversion-macros/src/common.rs rename to crates/uniffi/conversion-macros/src/common.rs diff --git a/crates/sargon-uniffi-conversion-macros/src/enum_conversion.rs b/crates/uniffi/conversion-macros/src/enum_conversion.rs similarity index 100% rename from crates/sargon-uniffi-conversion-macros/src/enum_conversion.rs rename to crates/uniffi/conversion-macros/src/enum_conversion.rs diff --git a/crates/sargon-uniffi-conversion-macros/src/lib.rs b/crates/uniffi/conversion-macros/src/lib.rs similarity index 100% rename from crates/sargon-uniffi-conversion-macros/src/lib.rs rename to crates/uniffi/conversion-macros/src/lib.rs diff --git a/crates/sargon-uniffi-conversion-macros/src/struct_conversion.rs b/crates/uniffi/conversion-macros/src/struct_conversion.rs similarity index 100% rename from crates/sargon-uniffi-conversion-macros/src/struct_conversion.rs rename to crates/uniffi/conversion-macros/src/struct_conversion.rs diff --git a/crates/sargon-uniffi/Cargo.toml b/crates/uniffi/uniffi_SPLIT_ME/Cargo.toml similarity index 55% rename from crates/sargon-uniffi/Cargo.toml rename to crates/uniffi/uniffi_SPLIT_ME/Cargo.toml index 44b061d18..541f59898 100644 --- a/crates/sargon-uniffi/Cargo.toml +++ b/crates/uniffi/uniffi_SPLIT_ME/Cargo.toml @@ -1,6 +1,5 @@ [package] name = "sargon-uniffi" -# Don't forget to update version in crates/sargon/Cargo.toml version = "1.1.99" edition = "2021" build = "build.rs" @@ -14,29 +13,29 @@ crate-type = ["staticlib", "cdylib", "lib"] [[bin]] name = "sargon-bindgen" path = "src/bindgen/bin.rs" -# required-features = ["build-binary"] [dependencies] # === SARGON CRATES === -sargon-core = { path = "../sargon-core" } -identified-vec-of = { path = "../identified-vec-of" } -sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-deterministic" } -sargon-factors = { path = "../sargon-factors" } -sargon-keys-collector = { path = "../sargon-keys-collector" } -sargon-addresses = { path = "../sargon-addresses" } -sargon-transaction-models = { path = "../sargon-transaction-models" } -sargon-manifests = { path = "../sargon-manifests" } -sargon-profile = { path = "../sargon-profile" } -sargon-profile-logic = { path = "../sargon-profile-logic" } -sargon-profile-security-structures = { path = "../sargon-profile-security-structures" } -sargon-factor-instances-provider = { path = "../sargon-factor-instances-provider" } -gateway-models = { path = "../gateway-models" } -sargon-clients = { path = "../sargon-clients" } -sargon-drivers = { path = "../sargon-drivers" } -gateway-client-and-api = { path = "../gateway-client-and-api" } +identified-vec-of = { path = "../../common/identified-vec-of" } +hierarchical-deterministic = { path = "../../crypto/hd" } +encryption = { path = "../../crypto/encryption" } +factors = { path = "../../factors/factors" } +keys-collector = { path = "../../factors/keys-collector" } +addresses = { path = "../../crypto/addresses" } +transaction-models = { path = "../../transaction/models" } +manifests = { path = "../../transaction/manifests" } +profile = { path = "../../profile/models/profile_SPLIT_ME" } +profile-logic = { path = "../../profile/logic/logic_SPLIT_ME" } +profile-security-structures = { path = "../../profile/models/security-structures" } +factor-instances-provider = { path = "../../factors/instances-provider" } +gateway-models = { path = "../../gateway/models" } +core-misc = { path = "../../core/misc" } +clients = { path = "../../system/clients/clients" } +drivers = { path = "../../system/drivers" } +gateway-client-and-api = { path = "../../gateway/client-and-api" } -sargon = { path = "../sargon" } -sargon-uniffi-conversion-macros = { path = "../sargon-uniffi-conversion-macros" } +sargon = { path = "../../sargon_SPLIT_ME" } +sargon-uniffi-conversion-macros = { path = "../../uniffi/conversion-macros" } # === RADIX DEPENDENCIES === radix-engine-toolkit = { workspace = true } @@ -52,6 +51,7 @@ derive_more = { workspace = true } enum-as-inner = { workspace = true } enum-iterator = { workspace = true } hex = { workspace = true } +indexmap = { workspace = true } iso8601-timestamp = { workspace = true } itertools = { workspace = true } log = { workspace = true } diff --git a/crates/sargon-uniffi/build.rs b/crates/uniffi/uniffi_SPLIT_ME/build.rs similarity index 100% rename from crates/sargon-uniffi/build.rs rename to crates/uniffi/uniffi_SPLIT_ME/build.rs diff --git a/crates/sargon/src/Package.swift b/crates/uniffi/uniffi_SPLIT_ME/src/Package.swift similarity index 100% rename from crates/sargon/src/Package.swift rename to crates/uniffi/uniffi_SPLIT_ME/src/Package.swift diff --git a/crates/sargon-uniffi/src/bindgen/args.rs b/crates/uniffi/uniffi_SPLIT_ME/src/bindgen/args.rs similarity index 100% rename from crates/sargon-uniffi/src/bindgen/args.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/bindgen/args.rs diff --git a/crates/sargon-uniffi/src/bindgen/bin.rs b/crates/uniffi/uniffi_SPLIT_ME/src/bindgen/bin.rs similarity index 100% rename from crates/sargon-uniffi/src/bindgen/bin.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/bindgen/bin.rs diff --git a/crates/sargon-uniffi/src/bindgen/bindgen_error.rs b/crates/uniffi/uniffi_SPLIT_ME/src/bindgen/bindgen_error.rs similarity index 100% rename from crates/sargon-uniffi/src/bindgen/bindgen_error.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/bindgen/bindgen_error.rs diff --git a/crates/sargon-uniffi/src/bindgen/post_process.rs b/crates/uniffi/uniffi_SPLIT_ME/src/bindgen/post_process.rs similarity index 100% rename from crates/sargon-uniffi/src/bindgen/post_process.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/bindgen/post_process.rs diff --git a/crates/sargon-uniffi/src/bindgen/post_process_kotlin.rs b/crates/uniffi/uniffi_SPLIT_ME/src/bindgen/post_process_kotlin.rs similarity index 100% rename from crates/sargon-uniffi/src/bindgen/post_process_kotlin.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/bindgen/post_process_kotlin.rs diff --git a/crates/sargon-uniffi/src/bindgen/post_process_swift.rs b/crates/uniffi/uniffi_SPLIT_ME/src/bindgen/post_process_swift.rs similarity index 100% rename from crates/sargon-uniffi/src/bindgen/post_process_swift.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/bindgen/post_process_swift.rs diff --git a/crates/sargon-uniffi/src/core/error/common_error.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/error/common_error.rs similarity index 100% rename from crates/sargon-uniffi/src/core/error/common_error.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/error/common_error.rs diff --git a/crates/sargon-uniffi/src/core/error/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/error/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/core/error/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/error/mod.rs diff --git a/crates/sargon-uniffi/src/core/hash.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/hash.rs similarity index 100% rename from crates/sargon-uniffi/src/core/hash.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/hash.rs diff --git a/crates/sargon-uniffi/src/core/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/core/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/mod.rs diff --git a/crates/sargon-uniffi/src/core/result/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/result/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/core/result/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/result/mod.rs diff --git a/crates/sargon-uniffi/src/core/result/result.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/result/result.rs similarity index 100% rename from crates/sargon-uniffi/src/core/result/result.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/result/result.rs diff --git a/crates/sargon-uniffi/src/core/types/appearance_id.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/appearance_id.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/appearance_id.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/appearance_id.rs diff --git a/crates/sargon-uniffi/src/core/types/bag_of_bytes.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/bag_of_bytes.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/bag_of_bytes.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/bag_of_bytes.rs diff --git a/crates/sargon-uniffi/src/core/types/collections/internal_mapping.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/collections/internal_mapping.rs similarity index 99% rename from crates/sargon-uniffi/src/core/types/collections/internal_mapping.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/collections/internal_mapping.rs index 10d54c22f..cbca35a3d 100644 --- a/crates/sargon-uniffi/src/core/types/collections/internal_mapping.rs +++ b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/collections/internal_mapping.rs @@ -1,6 +1,6 @@ use crate::prelude::*; -use sargon::{IdentifiedVecOf, IndexSet}; +use identified_vec_of::IdentifiedVecOf; // ========================== // === From InternalType ==== diff --git a/crates/sargon-uniffi/src/core/types/collections/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/collections/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/collections/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/collections/mod.rs diff --git a/crates/sargon-uniffi/src/core/types/decimal192.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/decimal192.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/decimal192.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/decimal192.rs diff --git a/crates/sargon-uniffi/src/core/types/entity_kind.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/entity_kind.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/entity_kind.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/entity_kind.rs diff --git a/crates/sargon-uniffi/src/core/types/epoch.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/epoch.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/epoch.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/epoch.rs diff --git a/crates/sargon-uniffi/src/core/types/exactly_n_bytes.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/exactly_n_bytes.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/exactly_n_bytes.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/exactly_n_bytes.rs diff --git a/crates/sargon-uniffi/src/core/types/instant.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/instant.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/instant.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/instant.rs diff --git a/crates/sargon-uniffi/src/core/types/intent_discriminator.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/intent_discriminator.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/intent_discriminator.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/intent_discriminator.rs diff --git a/crates/sargon-uniffi/src/core/types/keys/ed25519/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/keys/ed25519/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/keys/ed25519/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/keys/ed25519/mod.rs diff --git a/crates/sargon-uniffi/src/core/types/keys/ed25519/public_key.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/keys/ed25519/public_key.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/keys/ed25519/public_key.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/keys/ed25519/public_key.rs diff --git a/crates/sargon-uniffi/src/core/types/keys/key_agreement/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/keys/key_agreement/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/keys/key_agreement/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/keys/key_agreement/mod.rs diff --git a/crates/sargon-uniffi/src/core/types/keys/key_agreement/public_key.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/keys/key_agreement/public_key.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/keys/key_agreement/public_key.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/keys/key_agreement/public_key.rs diff --git a/crates/sargon-uniffi/src/core/types/keys/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/keys/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/keys/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/keys/mod.rs diff --git a/crates/sargon-uniffi/src/core/types/keys/public_key.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/keys/public_key.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/keys/public_key.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/keys/public_key.rs diff --git a/crates/sargon-uniffi/src/core/types/keys/secp256k1/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/keys/secp256k1/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/keys/secp256k1/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/keys/secp256k1/mod.rs diff --git a/crates/sargon-uniffi/src/core/types/keys/secp256k1/public_key.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/keys/secp256k1/public_key.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/keys/secp256k1/public_key.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/keys/secp256k1/public_key.rs diff --git a/crates/sargon-uniffi/src/core/types/keys/slip10_curve.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/keys/slip10_curve.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/keys/slip10_curve.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/keys/slip10_curve.rs diff --git a/crates/sargon-uniffi/src/core/types/locale_config.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/locale_config.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/locale_config.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/locale_config.rs diff --git a/crates/sargon-uniffi/src/core/types/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/mod.rs diff --git a/crates/sargon-uniffi/src/core/types/non_empty_max_n_bytes.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/non_empty_max_n_bytes.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/non_empty_max_n_bytes.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/non_empty_max_n_bytes.rs diff --git a/crates/sargon-uniffi/src/core/types/nonce.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/nonce.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/nonce.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/nonce.rs diff --git a/crates/sargon-uniffi/src/core/types/requested_number_quantifier.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/requested_number_quantifier.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/requested_number_quantifier.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/requested_number_quantifier.rs diff --git a/crates/sargon-uniffi/src/core/types/requested_quantity.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/requested_quantity.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/requested_quantity.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/requested_quantity.rs diff --git a/crates/sargon-uniffi/src/core/types/rounding_mode.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/rounding_mode.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/rounding_mode.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/rounding_mode.rs diff --git a/crates/sargon-uniffi/src/core/types/secret_bytes.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/secret_bytes.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/secret_bytes.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/secret_bytes.rs diff --git a/crates/sargon-uniffi/src/core/types/signatures/ed25519_signature.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/signatures/ed25519_signature.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/signatures/ed25519_signature.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/signatures/ed25519_signature.rs diff --git a/crates/sargon-uniffi/src/core/types/signatures/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/signatures/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/signatures/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/signatures/mod.rs diff --git a/crates/sargon-uniffi/src/core/types/signatures/secp256k1_signature.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/signatures/secp256k1_signature.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/signatures/secp256k1_signature.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/signatures/secp256k1_signature.rs diff --git a/crates/sargon-uniffi/src/core/types/signatures/signature.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/signatures/signature.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/signatures/signature.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/signatures/signature.rs diff --git a/crates/sargon-uniffi/src/core/types/signatures/signature_with_public_key.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/signatures/signature_with_public_key.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/signatures/signature_with_public_key.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/signatures/signature_with_public_key.rs diff --git a/crates/sargon-uniffi/src/core/types/version_type.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/types/version_type.rs similarity index 100% rename from crates/sargon-uniffi/src/core/types/version_type.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/types/version_type.rs diff --git a/crates/sargon-uniffi/src/core/utils/builder_arc_map.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/utils/builder_arc_map.rs similarity index 100% rename from crates/sargon-uniffi/src/core/utils/builder_arc_map.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/utils/builder_arc_map.rs diff --git a/crates/sargon-uniffi/src/core/utils/constants.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/utils/constants.rs similarity index 100% rename from crates/sargon-uniffi/src/core/utils/constants.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/utils/constants.rs diff --git a/crates/sargon-uniffi/src/core/utils/conversion_tests_macro.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/utils/conversion_tests_macro.rs similarity index 100% rename from crates/sargon-uniffi/src/core/utils/conversion_tests_macro.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/utils/conversion_tests_macro.rs diff --git a/crates/sargon-uniffi/src/core/utils/delegate_debug_display_impl.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/utils/delegate_debug_display_impl.rs similarity index 100% rename from crates/sargon-uniffi/src/core/utils/delegate_debug_display_impl.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/utils/delegate_debug_display_impl.rs diff --git a/crates/sargon-uniffi/src/core/utils/image_url_utils_uniffi_fn.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/utils/image_url_utils_uniffi_fn.rs similarity index 64% rename from crates/sargon-uniffi/src/core/utils/image_url_utils_uniffi_fn.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/utils/image_url_utils_uniffi_fn.rs index eddf59d74..c3ade4e2c 100644 --- a/crates/sargon-uniffi/src/core/utils/image_url_utils_uniffi_fn.rs +++ b/crates/uniffi/uniffi_SPLIT_ME/src/core/utils/image_url_utils_uniffi_fn.rs @@ -1,3 +1,5 @@ +use core_misc::{is_vector_image, make_image_url}; + use crate::prelude::*; use crate::types::*; @@ -6,7 +8,7 @@ pub fn image_url_utils_is_vector_image( url: &str, image_type: VectorImageType, ) -> bool { - sargon::is_vector_image(url, image_type.into_internal()) + is_vector_image(url, image_type.into_internal()) } #[uniffi::export] @@ -16,5 +18,5 @@ pub fn image_url_utils_make_image_url( width: u32, height: u32, ) -> Result { - sargon::make_image_url(url, image_service_url, width, height).into_result() + make_image_url(url, image_service_url, width, height).into_result() } diff --git a/crates/sargon-uniffi/src/core/utils/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/core/utils/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/core/utils/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/core/utils/mod.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/hardened.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip32/hardened.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/bip32/hardened.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip32/hardened.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/hd_path.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip32/hd_path.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/bip32/hd_path.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip32/hd_path.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/hd_path_component.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip32/hd_path_component.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/bip32/hd_path_component.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip32/hd_path_component.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/key_space.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip32/key_space.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/bip32/key_space.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip32/key_space.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip32/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/bip32/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip32/mod.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/securified.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip32/securified.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/bip32/securified.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip32/securified.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/u30.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip32/u30.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/bip32/u30.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip32/u30.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/u31.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip32/u31.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/bip32/u31.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip32/u31.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/unhardened.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip32/unhardened.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/bip32/unhardened.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip32/unhardened.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/unsecurified.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip32/unsecurified.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/bip32/unsecurified.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip32/unsecurified.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/bip32/unsecurified_hardened.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip32/unsecurified_hardened.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/bip32/unsecurified_hardened.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip32/unsecurified_hardened.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/bip39/bip39_entropy.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip39/bip39_entropy.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/bip39/bip39_entropy.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip39/bip39_entropy.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/bip39/bip39_passphrase.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip39/bip39_passphrase.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/bip39/bip39_passphrase.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip39/bip39_passphrase.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/bip39/bip39_seed.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip39/bip39_seed.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/bip39/bip39_seed.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip39/bip39_seed.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/bip39/bip39_word/bip39_language.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip39/bip39_word/bip39_language.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/bip39/bip39_word/bip39_language.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip39/bip39_word/bip39_language.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/bip39/bip39_word/bip39_word.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip39/bip39_word/bip39_word.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/bip39/bip39_word/bip39_word.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip39/bip39_word/bip39_word.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/bip39/bip39_word/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip39/bip39_word/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/bip39/bip39_word/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip39/bip39_word/mod.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/bip39/bip39_word/u11.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip39/bip39_word/u11.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/bip39/bip39_word/u11.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip39/bip39_word/u11.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/bip39/bip39_word_count.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip39/bip39_word_count.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/bip39/bip39_word_count.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip39/bip39_word_count.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/bip39/mnemonic.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip39/mnemonic.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/bip39/mnemonic.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip39/mnemonic.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/bip39/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip39/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/bip39/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip39/mod.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/bip44/bip44_like_path.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip44/bip44_like_path.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/bip44/bip44_like_path.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip44/bip44_like_path.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/bip44/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip44/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/bip44/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/bip44/mod.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/cap26/cap26_entity_kind.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/cap26/cap26_entity_kind.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/cap26/cap26_entity_kind.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/cap26/cap26_entity_kind.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/cap26/cap26_key_kind.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/cap26/cap26_key_kind.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/cap26/cap26_key_kind.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/cap26/cap26_key_kind.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/cap26/cap26_path/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/cap26/cap26_path/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/cap26/cap26_path/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/cap26/cap26_path/mod.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/cap26/cap26_path/paths/account_path.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/cap26/cap26_path/paths/account_path.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/cap26/cap26_path/paths/account_path.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/cap26/cap26_path/paths/account_path.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/cap26/cap26_path/paths/identity_path.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/cap26/cap26_path/paths/identity_path.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/cap26/cap26_path/paths/identity_path.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/cap26/cap26_path/paths/identity_path.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/cap26/cap26_path/paths/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/cap26/cap26_path/paths/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/cap26/cap26_path/paths/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/cap26/cap26_path/paths/mod.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/cap26/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/cap26/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/cap26/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/cap26/mod.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/derivation/derivation_path.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/derivation/derivation_path.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/derivation/derivation_path.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/derivation/derivation_path.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/derivation/derivation_path_scheme.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/derivation/derivation_path_scheme.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/derivation/derivation_path_scheme.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/derivation/derivation_path_scheme.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/derivation/hierarchical_deterministic_public_key.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/derivation/hierarchical_deterministic_public_key.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/derivation/hierarchical_deterministic_public_key.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/derivation/hierarchical_deterministic_public_key.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/derivation/mnemonic_with_passphrase.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/derivation/mnemonic_with_passphrase.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/derivation/mnemonic_with_passphrase.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/derivation/mnemonic_with_passphrase.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/derivation/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/derivation/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/derivation/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/derivation/mod.rs diff --git a/crates/sargon-uniffi/src/hierarchical_deterministic/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/hierarchical_deterministic/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/hierarchical_deterministic/mod.rs diff --git a/crates/sargon-uniffi/src/home_cards/home_card.rs b/crates/uniffi/uniffi_SPLIT_ME/src/home_cards/home_card.rs similarity index 100% rename from crates/sargon-uniffi/src/home_cards/home_card.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/home_cards/home_card.rs diff --git a/crates/sargon-uniffi/src/home_cards/manager.rs b/crates/uniffi/uniffi_SPLIT_ME/src/home_cards/manager.rs similarity index 100% rename from crates/sargon-uniffi/src/home_cards/manager.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/home_cards/manager.rs diff --git a/crates/sargon-uniffi/src/home_cards/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/home_cards/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/home_cards/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/home_cards/mod.rs diff --git a/crates/sargon-uniffi/src/home_cards/observer.rs b/crates/uniffi/uniffi_SPLIT_ME/src/home_cards/observer.rs similarity index 100% rename from crates/sargon-uniffi/src/home_cards/observer.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/home_cards/observer.rs diff --git a/crates/sargon-uniffi/src/home_cards/storage.rs b/crates/uniffi/uniffi_SPLIT_ME/src/home_cards/storage.rs similarity index 100% rename from crates/sargon-uniffi/src/home_cards/storage.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/home_cards/storage.rs diff --git a/crates/sargon-uniffi/src/keys_collector/derivation_purpose.rs b/crates/uniffi/uniffi_SPLIT_ME/src/keys_collector/derivation_purpose.rs similarity index 100% rename from crates/sargon-uniffi/src/keys_collector/derivation_purpose.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/keys_collector/derivation_purpose.rs diff --git a/crates/sargon-uniffi/src/keys_collector/key_derivation_request.rs b/crates/uniffi/uniffi_SPLIT_ME/src/keys_collector/key_derivation_request.rs similarity index 99% rename from crates/sargon-uniffi/src/keys_collector/key_derivation_request.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/keys_collector/key_derivation_request.rs index 958ffa711..91eb03981 100644 --- a/crates/sargon-uniffi/src/keys_collector/key_derivation_request.rs +++ b/crates/uniffi/uniffi_SPLIT_ME/src/keys_collector/key_derivation_request.rs @@ -1,5 +1,4 @@ use crate::prelude::*; -use sargon::IndexMap; use sargon::KeyDerivationRequest as InternalKeyDerivationRequest; /// A collection of derivation paths, on a per-factor-source basis. diff --git a/crates/sargon-uniffi/src/keys_collector/key_derivation_response.rs b/crates/uniffi/uniffi_SPLIT_ME/src/keys_collector/key_derivation_response.rs similarity index 98% rename from crates/sargon-uniffi/src/keys_collector/key_derivation_response.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/keys_collector/key_derivation_response.rs index 6e51c3f5d..7c3019154 100644 --- a/crates/sargon-uniffi/src/keys_collector/key_derivation_response.rs +++ b/crates/uniffi/uniffi_SPLIT_ME/src/keys_collector/key_derivation_response.rs @@ -1,5 +1,4 @@ use crate::prelude::*; -use sargon::IndexMap; use sargon::KeyDerivationResponse as InternalKeyDerivationResponse; /// A collection of `HierarchicalDeterministicFactorInstance`s, on a diff --git a/crates/sargon-uniffi/src/keys_collector/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/keys_collector/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/keys_collector/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/keys_collector/mod.rs diff --git a/crates/sargon-uniffi/src/lib.rs b/crates/uniffi/uniffi_SPLIT_ME/src/lib.rs similarity index 98% rename from crates/sargon-uniffi/src/lib.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/lib.rs index 0bcfecbe1..77444dd20 100644 --- a/crates/sargon-uniffi/src/lib.rs +++ b/crates/uniffi/uniffi_SPLIT_ME/src/lib.rs @@ -47,12 +47,11 @@ pub mod prelude { }, }; - pub(crate) use sargon_uniffi_conversion_macros::*; - // pub(crate) use sargon_manifests::prelude::*; pub(crate) use sargon::prelude::{ DeserializeBytes, DeserializeStr, HasSampleValues, HashMap, SerializeToBytes, SerializeToString, }; + pub(crate) use sargon_uniffi_conversion_macros::*; pub(crate) use iso8601_timestamp::Timestamp; pub(crate) use itertools::Itertools; @@ -67,6 +66,8 @@ pub mod prelude { pub(crate) use uuid::Uuid; pub(crate) use paste::*; + + pub(crate) use indexmap::{IndexMap, IndexSet}; } pub use prelude::*; diff --git a/crates/sargon-uniffi/src/profile/encrypted/encryption/aes_gcm_256.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/encrypted/encryption/aes_gcm_256.rs similarity index 75% rename from crates/sargon-uniffi/src/profile/encrypted/encryption/aes_gcm_256.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/encrypted/encryption/aes_gcm_256.rs index 12827ced6..e3cd4c2a2 100644 --- a/crates/sargon-uniffi/src/profile/encrypted/encryption/aes_gcm_256.rs +++ b/crates/uniffi/uniffi_SPLIT_ME/src/profile/encrypted/encryption/aes_gcm_256.rs @@ -1,5 +1,5 @@ use crate::prelude::*; -use sargon::AesGcm256 as InternalAesGcm256; +use encryption::AesGcm256 as InternalAesGcm256; /// AES GCM 256 encryption #[derive(Clone, PartialEq, Eq, Hash, InternalConversion, uniffi::Record)] diff --git a/crates/sargon-uniffi/src/profile/encrypted/encryption/encryption_scheme.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/encrypted/encryption/encryption_scheme.rs similarity index 74% rename from crates/sargon-uniffi/src/profile/encrypted/encryption/encryption_scheme.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/encrypted/encryption/encryption_scheme.rs index c01737935..2aabcbfde 100644 --- a/crates/sargon-uniffi/src/profile/encrypted/encryption/encryption_scheme.rs +++ b/crates/uniffi/uniffi_SPLIT_ME/src/profile/encrypted/encryption/encryption_scheme.rs @@ -1,5 +1,5 @@ use crate::prelude::*; -use sargon::EncryptionScheme as InternalEncryptionScheme; +use encryption::EncryptionScheme as InternalEncryptionScheme; #[derive(Clone, PartialEq, Eq, Hash, InternalConversion, uniffi::Enum)] pub enum EncryptionScheme { diff --git a/crates/sargon-uniffi/src/profile/encrypted/encryption/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/encrypted/encryption/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/encrypted/encryption/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/encrypted/encryption/mod.rs diff --git a/crates/sargon-uniffi/src/profile/encrypted/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/encrypted/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/encrypted/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/encrypted/mod.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/arculus_card_factor_source/arculus_card_factor_source.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/arculus_card_factor_source/arculus_card_factor_source.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/arculus_card_factor_source/arculus_card_factor_source.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/arculus_card_factor_source/arculus_card_factor_source.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/arculus_card_factor_source/arculus_card_hint.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/arculus_card_factor_source/arculus_card_hint.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/arculus_card_factor_source/arculus_card_hint.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/arculus_card_factor_source/arculus_card_hint.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/arculus_card_factor_source/arculus_card_model.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/arculus_card_factor_source/arculus_card_model.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/arculus_card_factor_source/arculus_card_model.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/arculus_card_factor_source/arculus_card_model.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/arculus_card_factor_source/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/arculus_card_factor_source/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/arculus_card_factor_source/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/arculus_card_factor_source/mod.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/mod.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/off_device_mnemonic_factor_source/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/off_device_mnemonic_factor_source/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/off_device_mnemonic_factor_source/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/off_device_mnemonic_factor_source/mod.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_factor_source_hint.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_factor_source_hint.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_factor_source_hint.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_factor_source_hint.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_mnemonic_factor_source.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_mnemonic_factor_source.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_mnemonic_factor_source.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/off_device_mnemonic_factor_source/off_device_mnemonic_factor_source.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/password_factor_source/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/password_factor_source/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/password_factor_source/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/password_factor_source/mod.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/password_factor_source/password_factor_source.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/password_factor_source/password_factor_source.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/password_factor_source/password_factor_source.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/password_factor_source/password_factor_source.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/password_factor_source/password_factor_source_hint.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/password_factor_source/password_factor_source_hint.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/password_factor_source/password_factor_source_hint.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/password_factor_source/password_factor_source_hint.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/answer/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/answer/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/answer/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/answer/mod.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/answer/security_question_and_answer.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/answer/security_question_and_answer.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/answer/security_question_and_answer.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/answer/security_question_and_answer.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/mod.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/security_questions_keys_from_questions_and_answer_scheme.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/security_questions_keys_from_questions_and_answer_scheme.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/security_questions_keys_from_questions_and_answer_scheme.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/security_questions_keys_from_questions_and_answer_scheme.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/keys_by_diffie_hellman_fold.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/keys_by_diffie_hellman_fold.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/keys_by_diffie_hellman_fold.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/keys_by_diffie_hellman_fold.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/encryption_keys_from_key_exchange_keys/mod.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/keys_from_questions_and_answers_lower_trim_utf8.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/keys_from_questions_and_answers_lower_trim_utf8.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/keys_from_questions_and_answers_lower_trim_utf8.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/keys_from_questions_and_answers_lower_trim_utf8.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/mod.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/security_question_and_answer_as_bytes.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/security_question_and_answer_as_bytes.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/security_question_and_answer_as_bytes.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/security_question_and_answer_as_bytes.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/security_question_answer_as_bytes.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/security_question_answer_as_bytes.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/security_question_answer_as_bytes.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/key_exchange_keys_from_questions_and_answer/security_question_answer_as_bytes.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/kdf/sub_kdf/mod.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/mod.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/mod.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/security_question.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/security_question.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/security_question.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/security_question.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/security_question_kind.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/security_question_kind.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/security_question_kind.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/security_question_kind.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/security_questions.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/security_questions.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/security_questions.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/question/security_questions.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/security_questions_factor_source.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/security_questions_factor_source.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/security_questions_factor_source.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/security_questions_factor_source.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/security_questions_sealed_mnemonic.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/security_questions_sealed_mnemonic.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/security_questions_sealed_mnemonic.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/security_questions_factor_source/security_questions_sealed_mnemonic.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/trusted_contact_factor_source/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/trusted_contact_factor_source/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/trusted_contact_factor_source/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/trusted_contact_factor_source/mod.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source_contact.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source_contact.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source_contact.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mfa_factor_sources/trusted_contact_factor_source/trusted_contact_factor_source_contact.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/mod.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/secured_entity_control/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/secured_entity_control/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/secured_entity_control/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/secured_entity_control/mod.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/secured_entity_control/secured_entity_control.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/secured_entity_control/secured_entity_control.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/secured_entity_control/secured_entity_control.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/secured_entity_control/secured_entity_control.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/security_structures/matrices/decl_matrix_macro.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/matrices/decl_matrix_macro.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/security_structures/matrices/decl_matrix_macro.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/matrices/decl_matrix_macro.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/security_structures/matrices/matrix_of_factor_instances.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/matrices/matrix_of_factor_instances.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/security_structures/matrices/matrix_of_factor_instances.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/matrices/matrix_of_factor_instances.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/security_structures/matrices/matrix_of_factor_source_ids.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/matrices/matrix_of_factor_source_ids.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/security_structures/matrices/matrix_of_factor_source_ids.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/matrices/matrix_of_factor_source_ids.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/security_structures/matrices/matrix_of_factor_sources.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/matrices/matrix_of_factor_sources.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/security_structures/matrices/matrix_of_factor_sources.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/matrices/matrix_of_factor_sources.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/security_structures/matrices/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/matrices/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/security_structures/matrices/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/matrices/mod.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/security_structures/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/security_structures/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/mod.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/security_structures/models/factor_source_in_role_builder_validation_status.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/models/factor_source_in_role_builder_validation_status.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/security_structures/models/factor_source_in_role_builder_validation_status.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/models/factor_source_in_role_builder_validation_status.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/security_structures/models/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/models/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/security_structures/models/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/models/mod.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/security_structures/models/role_kind.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/models/role_kind.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/security_structures/models/role_kind.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/models/role_kind.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/security_structures/roles/decl_role_macro.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/roles/decl_role_macro.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/security_structures/roles/decl_role_macro.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/roles/decl_role_macro.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/security_structures/roles/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/roles/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/security_structures/roles/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/roles/mod.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/security_structures/roles/roles_factor_instances.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/roles/roles_factor_instances.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/security_structures/roles/roles_factor_instances.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/roles/roles_factor_instances.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/security_structures/roles/roles_factor_source_ids.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/roles/roles_factor_source_ids.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/security_structures/roles/roles_factor_source_ids.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/roles/roles_factor_source_ids.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/security_structures/roles/roles_factor_sources.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/roles/roles_factor_sources.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/security_structures/roles/roles_factor_sources.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/roles/roles_factor_sources.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/security_structures/security_shield_builder.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/security_shield_builder.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/security_structures/security_shield_builder.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/security_shield_builder.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/security_structures/security_shield_builder_invalid_reason.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/security_shield_builder_invalid_reason.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/security_structures/security_shield_builder_invalid_reason.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/security_shield_builder_invalid_reason.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/security_structures/security_shield_prerequisites_status.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/security_shield_prerequisites_status.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/security_structures/security_shield_prerequisites_status.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/security_shield_prerequisites_status.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/security_structures/security_structure_id.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/security_structure_id.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/security_structures/security_structure_id.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/security_structure_id.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/security_structures/security_structure_metadata.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/security_structure_metadata.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/security_structures/security_structure_metadata.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/security_structure_metadata.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/security_structures/security_structures/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/security_structures/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/security_structures/security_structures/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/security_structures/mod.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/security_structures/security_structures/security_structure_of_factor_instances.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/security_structures/security_structure_of_factor_instances.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/security_structures/security_structures/security_structure_of_factor_instances.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/security_structures/security_structure_of_factor_instances.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/security_structures/security_structures/security_structure_of_factor_source_ids.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/security_structures/security_structure_of_factor_source_ids.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/security_structures/security_structures/security_structure_of_factor_source_ids.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/security_structures/security_structure_of_factor_source_ids.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/security_structures/security_structures/security_structure_of_factor_sources.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/security_structures/security_structure_of_factor_sources.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/security_structures/security_structures/security_structure_of_factor_sources.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/security_structures/security_structure_of_factor_sources.rs diff --git a/crates/sargon-uniffi/src/profile/mfa/security_structures/selected_factor_sources_status.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/selected_factor_sources_status.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mfa/security_structures/selected_factor_sources_status.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mfa/security_structures/selected_factor_sources_status.rs diff --git a/crates/sargon-uniffi/src/profile/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/mod.rs diff --git a/crates/sargon-uniffi/src/profile/profilesnapshot_version.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/profilesnapshot_version.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/profilesnapshot_version.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/profilesnapshot_version.rs diff --git a/crates/sargon-uniffi/src/profile/supporting_types/account_for_display.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/supporting_types/account_for_display.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/supporting_types/account_for_display.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/supporting_types/account_for_display.rs diff --git a/crates/sargon-uniffi/src/profile/supporting_types/account_or_persona.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/supporting_types/account_or_persona.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/supporting_types/account_or_persona.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/supporting_types/account_or_persona.rs diff --git a/crates/sargon-uniffi/src/profile/supporting_types/authorized_dapp_detailed.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/supporting_types/authorized_dapp_detailed.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/supporting_types/authorized_dapp_detailed.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/supporting_types/authorized_dapp_detailed.rs diff --git a/crates/sargon-uniffi/src/profile/supporting_types/authorized_persona_detailed.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/supporting_types/authorized_persona_detailed.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/supporting_types/authorized_persona_detailed.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/supporting_types/authorized_persona_detailed.rs diff --git a/crates/sargon-uniffi/src/profile/supporting_types/decl_vec_samples_for.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/supporting_types/decl_vec_samples_for.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/supporting_types/decl_vec_samples_for.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/supporting_types/decl_vec_samples_for.rs diff --git a/crates/sargon-uniffi/src/profile/supporting_types/email_address.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/supporting_types/email_address.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/supporting_types/email_address.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/supporting_types/email_address.rs diff --git a/crates/sargon-uniffi/src/profile/supporting_types/host_id.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/supporting_types/host_id.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/supporting_types/host_id.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/supporting_types/host_id.rs diff --git a/crates/sargon-uniffi/src/profile/supporting_types/host_info.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/supporting_types/host_info.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/supporting_types/host_info.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/supporting_types/host_info.rs diff --git a/crates/sargon-uniffi/src/profile/supporting_types/host_os.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/supporting_types/host_os.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/supporting_types/host_os.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/supporting_types/host_os.rs diff --git a/crates/sargon-uniffi/src/profile/supporting_types/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/supporting_types/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/supporting_types/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/supporting_types/mod.rs diff --git a/crates/sargon-uniffi/src/profile/v100/address/access_controller_address.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/access_controller_address.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/address/access_controller_address.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/access_controller_address.rs diff --git a/crates/sargon-uniffi/src/profile/v100/address/account_address.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/account_address.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/address/account_address.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/account_address.rs diff --git a/crates/sargon-uniffi/src/profile/v100/address/address.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/address.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/address/address.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/address.rs diff --git a/crates/sargon-uniffi/src/profile/v100/address/address_format.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/address_format.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/address/address_format.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/address_format.rs diff --git a/crates/sargon-uniffi/src/profile/v100/address/component_address.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/component_address.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/address/component_address.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/component_address.rs diff --git a/crates/sargon-uniffi/src/profile/v100/address/identity_address.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/identity_address.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/address/identity_address.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/identity_address.rs diff --git a/crates/sargon-uniffi/src/profile/v100/address/legacy_olympia_account_address.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/legacy_olympia_account_address.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/address/legacy_olympia_account_address.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/legacy_olympia_account_address.rs diff --git a/crates/sargon-uniffi/src/profile/v100/address/locker_address.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/locker_address.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/address/locker_address.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/locker_address.rs diff --git a/crates/sargon-uniffi/src/profile/v100/address/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/address/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/mod.rs diff --git a/crates/sargon-uniffi/src/profile/v100/address/non_fungible_global_id.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/non_fungible_global_id.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/address/non_fungible_global_id.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/non_fungible_global_id.rs diff --git a/crates/sargon-uniffi/src/profile/v100/address/non_fungible_local_id.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/non_fungible_local_id.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/address/non_fungible_local_id.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/non_fungible_local_id.rs diff --git a/crates/sargon-uniffi/src/profile/v100/address/non_fungible_local_id_string.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/non_fungible_local_id_string.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/address/non_fungible_local_id_string.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/non_fungible_local_id_string.rs diff --git a/crates/sargon-uniffi/src/profile/v100/address/non_fungible_resource_address.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/non_fungible_resource_address.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/address/non_fungible_resource_address.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/non_fungible_resource_address.rs diff --git a/crates/sargon-uniffi/src/profile/v100/address/package_address.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/package_address.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/address/package_address.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/package_address.rs diff --git a/crates/sargon-uniffi/src/profile/v100/address/pool_address.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/pool_address.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/address/pool_address.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/pool_address.rs diff --git a/crates/sargon-uniffi/src/profile/v100/address/resource_address.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/resource_address.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/address/resource_address.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/resource_address.rs diff --git a/crates/sargon-uniffi/src/profile/v100/address/validator_address.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/validator_address.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/address/validator_address.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/validator_address.rs diff --git a/crates/sargon-uniffi/src/profile/v100/address/vault_address.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/vault_address.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/address/vault_address.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/vault_address.rs diff --git a/crates/sargon-uniffi/src/profile/v100/address/wrap_ret_address.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/wrap_ret_address.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/address/wrap_ret_address.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/address/wrap_ret_address.rs diff --git a/crates/sargon-uniffi/src/profile/v100/app_preferences/app_display_settings/app_display_settings.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/app_preferences/app_display_settings/app_display_settings.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/app_preferences/app_display_settings/app_display_settings.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/app_preferences/app_display_settings/app_display_settings.rs diff --git a/crates/sargon-uniffi/src/profile/v100/app_preferences/app_display_settings/fiat_currency.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/app_preferences/app_display_settings/fiat_currency.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/app_preferences/app_display_settings/fiat_currency.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/app_preferences/app_display_settings/fiat_currency.rs diff --git a/crates/sargon-uniffi/src/profile/v100/app_preferences/app_display_settings/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/app_preferences/app_display_settings/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/app_preferences/app_display_settings/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/app_preferences/app_display_settings/mod.rs diff --git a/crates/sargon-uniffi/src/profile/v100/app_preferences/app_preferences.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/app_preferences/app_preferences.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/app_preferences/app_preferences.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/app_preferences/app_preferences.rs diff --git a/crates/sargon-uniffi/src/profile/v100/app_preferences/gateways/gateway.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/app_preferences/gateways/gateway.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/app_preferences/gateways/gateway.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/app_preferences/gateways/gateway.rs diff --git a/crates/sargon-uniffi/src/profile/v100/app_preferences/gateways/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/app_preferences/gateways/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/app_preferences/gateways/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/app_preferences/gateways/mod.rs diff --git a/crates/sargon-uniffi/src/profile/v100/app_preferences/gateways/network_definition.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/app_preferences/gateways/network_definition.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/app_preferences/gateways/network_definition.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/app_preferences/gateways/network_definition.rs diff --git a/crates/sargon-uniffi/src/profile/v100/app_preferences/gateways/saved_gateways.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/app_preferences/gateways/saved_gateways.rs similarity index 96% rename from crates/sargon-uniffi/src/profile/v100/app_preferences/gateways/saved_gateways.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/app_preferences/gateways/saved_gateways.rs index 708682288..90f64a39b 100644 --- a/crates/sargon-uniffi/src/profile/v100/app_preferences/gateways/saved_gateways.rs +++ b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/app_preferences/gateways/saved_gateways.rs @@ -1,6 +1,6 @@ use crate::prelude::*; +use profile_logic::prelude::SavedGatewaysChangeCurrent as _; use sargon::SavedGateways as InternalSavedGateways; -use sargon_profile_logic::prelude::SavedGatewaysChangeCurrent as _; decl_vec_samples_for!(Gateways, Gateway); diff --git a/crates/sargon-uniffi/src/profile/v100/app_preferences/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/app_preferences/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/app_preferences/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/app_preferences/mod.rs diff --git a/crates/sargon-uniffi/src/profile/v100/app_preferences/security.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/app_preferences/security.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/app_preferences/security.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/app_preferences/security.rs diff --git a/crates/sargon-uniffi/src/profile/v100/app_preferences/transaction_preferences.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/app_preferences/transaction_preferences.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/app_preferences/transaction_preferences.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/app_preferences/transaction_preferences.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entities_linked_to_factor_source/entities_linked_to_factor_source.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entities_linked_to_factor_source/entities_linked_to_factor_source.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entities_linked_to_factor_source/entities_linked_to_factor_source.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entities_linked_to_factor_source/entities_linked_to_factor_source.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entities_linked_to_factor_source/integrity/device.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entities_linked_to_factor_source/integrity/device.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entities_linked_to_factor_source/integrity/device.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entities_linked_to_factor_source/integrity/device.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entities_linked_to_factor_source/integrity/integrity.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entities_linked_to_factor_source/integrity/integrity.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entities_linked_to_factor_source/integrity/integrity.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entities_linked_to_factor_source/integrity/integrity.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entities_linked_to_factor_source/integrity/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entities_linked_to_factor_source/integrity/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entities_linked_to_factor_source/integrity/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entities_linked_to_factor_source/integrity/mod.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entities_linked_to_factor_source/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entities_linked_to_factor_source/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entities_linked_to_factor_source/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entities_linked_to_factor_source/mod.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entities_linked_to_factor_source/profile_to_check.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entities_linked_to_factor_source/profile_to_check.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entities_linked_to_factor_source/profile_to_check.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entities_linked_to_factor_source/profile_to_check.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entity/account/account.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/account/account.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entity/account/account.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/account/account.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entity/account/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/account/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entity/account/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/account/mod.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entity/account/on_ledger_settings/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/account/on_ledger_settings/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entity/account/on_ledger_settings/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/account/on_ledger_settings/mod.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entity/account/on_ledger_settings/on_ledger_settings.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/account/on_ledger_settings/on_ledger_settings.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entity/account/on_ledger_settings/on_ledger_settings.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/account/on_ledger_settings/on_ledger_settings.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/asset_exception.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/asset_exception.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/asset_exception.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/asset_exception.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/deposit_address_exception_rule.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/deposit_address_exception_rule.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/deposit_address_exception_rule.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/deposit_address_exception_rule.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/deposit_rule.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/deposit_rule.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/deposit_rule.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/deposit_rule.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/mod.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/resource_or_non_fungible.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/resource_or_non_fungible.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/resource_or_non_fungible.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/resource_or_non_fungible.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/third_party_deposits.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/third_party_deposits.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/third_party_deposits.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/account/on_ledger_settings/third_party_deposits/third_party_deposits.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entity/display_name.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/display_name.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entity/display_name.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/display_name.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entity/entity_flag.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/entity_flag.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entity/entity_flag.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/entity_flag.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entity/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entity/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/mod.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entity/persona/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/persona/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entity/persona/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/persona/mod.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entity/persona/persona.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/persona/persona.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entity/persona/persona.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/persona/persona.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entity/persona/persona_data/collection_of_email_addresses.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/persona/persona_data/collection_of_email_addresses.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entity/persona/persona_data/collection_of_email_addresses.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/persona/persona_data/collection_of_email_addresses.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entity/persona/persona_data/collection_of_phone_numbers.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/persona/persona_data/collection_of_phone_numbers.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entity/persona/persona_data/collection_of_phone_numbers.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/persona/persona_data/collection_of_phone_numbers.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entity/persona/persona_data/entry_kinds/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/persona/persona_data/entry_kinds/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entity/persona/persona_data/entry_kinds/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/persona/persona_data/entry_kinds/mod.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_email_address.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_email_address.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_email_address.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_email_address.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_name.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_name.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_name.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_name.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_phone_number.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_phone_number.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_phone_number.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_phone_number.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entity/persona/persona_data/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/persona/persona_data/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entity/persona/persona_data/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/persona/persona_data/mod.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entity/persona/persona_data/persona_data.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/persona/persona_data/persona_data.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entity/persona/persona_data/persona_data.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/persona/persona_data/persona_data.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entity/persona/persona_data/persona_data_entry_id.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/persona/persona_data/persona_data_entry_id.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entity/persona/persona_data/persona_data_entry_id.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/persona/persona_data/persona_data_entry_id.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entity/persona/persona_data/persona_data_identified_collection_types.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/persona/persona_data/persona_data_identified_collection_types.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entity/persona/persona_data/persona_data_identified_collection_types.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/persona/persona_data/persona_data_identified_collection_types.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entity/persona/persona_data/persona_data_identified_entry_types.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/persona/persona_data/persona_data_identified_entry_types.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entity/persona/persona_data/persona_data_identified_entry_types.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/persona/persona_data/persona_data_identified_entry_types.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entity_security_state/entity_security_state.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity_security_state/entity_security_state.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entity_security_state/entity_security_state.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity_security_state/entity_security_state.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entity_security_state/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity_security_state/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entity_security_state/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity_security_state/mod.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entity_security_state/provisional_securified_config.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity_security_state/provisional_securified_config.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entity_security_state/provisional_securified_config.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity_security_state/provisional_securified_config.rs diff --git a/crates/sargon-uniffi/src/profile/v100/entity_security_state/unsecured_entity_control.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity_security_state/unsecured_entity_control.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/entity_security_state/unsecured_entity_control.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity_security_state/unsecured_entity_control.rs diff --git a/crates/sargon-uniffi/src/profile/v100/factors/factor_instance/badge_virtual_source.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_instance/badge_virtual_source.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/factors/factor_instance/badge_virtual_source.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_instance/badge_virtual_source.rs diff --git a/crates/sargon-uniffi/src/profile/v100/factors/factor_instance/factor_instance.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_instance/factor_instance.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/factors/factor_instance/factor_instance.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_instance/factor_instance.rs diff --git a/crates/sargon-uniffi/src/profile/v100/factors/factor_instance/factor_instance_badge.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_instance/factor_instance_badge.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/factors/factor_instance/factor_instance_badge.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_instance/factor_instance_badge.rs diff --git a/crates/sargon-uniffi/src/profile/v100/factors/factor_instance/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_instance/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/factors/factor_instance/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_instance/mod.rs diff --git a/crates/sargon-uniffi/src/profile/v100/factors/factor_source.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_source.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/factors/factor_source.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_source.rs diff --git a/crates/sargon-uniffi/src/profile/v100/factors/factor_source_common.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_source_common.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/factors/factor_source_common.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_source_common.rs diff --git a/crates/sargon-uniffi/src/profile/v100/factors/factor_source_crypto_parameters.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_source_crypto_parameters.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/factors/factor_source_crypto_parameters.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_source_crypto_parameters.rs diff --git a/crates/sargon-uniffi/src/profile/v100/factors/factor_source_flag.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_source_flag.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/factors/factor_source_flag.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_source_flag.rs diff --git a/crates/sargon-uniffi/src/profile/v100/factors/factor_source_id.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_source_id.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/factors/factor_source_id.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_source_id.rs diff --git a/crates/sargon-uniffi/src/profile/v100/factors/factor_source_id_from_address.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_source_id_from_address.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/factors/factor_source_id_from_address.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_source_id_from_address.rs diff --git a/crates/sargon-uniffi/src/profile/v100/factors/factor_source_id_from_hash.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_source_id_from_hash.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/factors/factor_source_id_from_hash.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_source_id_from_hash.rs diff --git a/crates/sargon-uniffi/src/profile/v100/factors/factor_source_kind.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_source_kind.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/factors/factor_source_kind.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_source_kind.rs diff --git a/crates/sargon-uniffi/src/profile/v100/factors/factor_sources/device_factor_source/device_factor_source.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_sources/device_factor_source/device_factor_source.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/factors/factor_sources/device_factor_source/device_factor_source.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_sources/device_factor_source/device_factor_source.rs diff --git a/crates/sargon-uniffi/src/profile/v100/factors/factor_sources/device_factor_source/device_factor_source_hint.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_sources/device_factor_source/device_factor_source_hint.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/factors/factor_sources/device_factor_source/device_factor_source_hint.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_sources/device_factor_source/device_factor_source_hint.rs diff --git a/crates/sargon-uniffi/src/profile/v100/factors/factor_sources/device_factor_source/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_sources/device_factor_source/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/factors/factor_sources/device_factor_source/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_sources/device_factor_source/mod.rs diff --git a/crates/sargon-uniffi/src/profile/v100/factors/factor_sources/factor_sources.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_sources/factor_sources.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/factors/factor_sources/factor_sources.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_sources/factor_sources.rs diff --git a/crates/sargon-uniffi/src/profile/v100/factors/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_factor_source.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_factor_source.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/factors/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_factor_source.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_factor_source.rs diff --git a/crates/sargon-uniffi/src/profile/v100/factors/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_hint.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_hint.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/factors/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_hint.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_hint.rs diff --git a/crates/sargon-uniffi/src/profile/v100/factors/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_model.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_model.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/factors/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_model.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_model.rs diff --git a/crates/sargon-uniffi/src/profile/v100/factors/factor_sources/ledger_hardware_wallet_factor_source/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_sources/ledger_hardware_wallet_factor_source/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/factors/factor_sources/ledger_hardware_wallet_factor_source/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_sources/ledger_hardware_wallet_factor_source/mod.rs diff --git a/crates/sargon-uniffi/src/profile/v100/factors/factor_sources/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_sources/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/factors/factor_sources/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_sources/mod.rs diff --git a/crates/sargon-uniffi/src/profile/v100/factors/factor_sources/private_hierarchical_deterministic_factor_source.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_sources/private_hierarchical_deterministic_factor_source.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/factors/factor_sources/private_hierarchical_deterministic_factor_source.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/factor_sources/private_hierarchical_deterministic_factor_source.rs diff --git a/crates/sargon-uniffi/src/profile/v100/factors/hierarchical_deterministic_factor_instance.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/hierarchical_deterministic_factor_instance.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/factors/hierarchical_deterministic_factor_instance.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/hierarchical_deterministic_factor_instance.rs diff --git a/crates/sargon-uniffi/src/profile/v100/factors/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/factors/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/factors/mod.rs diff --git a/crates/sargon-uniffi/src/profile/v100/header/content_hint.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/header/content_hint.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/header/content_hint.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/header/content_hint.rs diff --git a/crates/sargon-uniffi/src/profile/v100/header/device_id.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/header/device_id.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/header/device_id.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/header/device_id.rs diff --git a/crates/sargon-uniffi/src/profile/v100/header/device_info.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/header/device_info.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/header/device_info.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/header/device_info.rs diff --git a/crates/sargon-uniffi/src/profile/v100/header/device_info_description.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/header/device_info_description.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/header/device_info_description.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/header/device_info_description.rs diff --git a/crates/sargon-uniffi/src/profile/v100/header/header.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/header/header.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/header/header.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/header/header.rs diff --git a/crates/sargon-uniffi/src/profile/v100/header/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/header/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/header/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/header/mod.rs diff --git a/crates/sargon-uniffi/src/profile/v100/header/profile_id.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/header/profile_id.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/header/profile_id.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/header/profile_id.rs diff --git a/crates/sargon-uniffi/src/profile/v100/json_data_convertible.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/json_data_convertible.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/json_data_convertible.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/json_data_convertible.rs diff --git a/crates/sargon-uniffi/src/profile/v100/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/mod.rs diff --git a/crates/sargon-uniffi/src/profile/v100/networks/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/networks/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/mod.rs diff --git a/crates/sargon-uniffi/src/profile/v100/networks/network/authorized_dapp/authorized_dapp.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/authorized_dapp/authorized_dapp.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/networks/network/authorized_dapp/authorized_dapp.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/authorized_dapp/authorized_dapp.rs diff --git a/crates/sargon-uniffi/src/profile/v100/networks/network/authorized_dapp/authorized_persona_simple.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/authorized_dapp/authorized_persona_simple.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/networks/network/authorized_dapp/authorized_persona_simple.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/authorized_dapp/authorized_persona_simple.rs diff --git a/crates/sargon-uniffi/src/profile/v100/networks/network/authorized_dapp/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/authorized_dapp/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/networks/network/authorized_dapp/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/authorized_dapp/mod.rs diff --git a/crates/sargon-uniffi/src/profile/v100/networks/network/authorized_dapp/preferences/authorized_dapp_preference_deposits.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/authorized_dapp/preferences/authorized_dapp_preference_deposits.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/networks/network/authorized_dapp/preferences/authorized_dapp_preference_deposits.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/authorized_dapp/preferences/authorized_dapp_preference_deposits.rs diff --git a/crates/sargon-uniffi/src/profile/v100/networks/network/authorized_dapp/preferences/authorized_dapp_preferences.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/authorized_dapp/preferences/authorized_dapp_preferences.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/networks/network/authorized_dapp/preferences/authorized_dapp_preferences.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/authorized_dapp/preferences/authorized_dapp_preferences.rs diff --git a/crates/sargon-uniffi/src/profile/v100/networks/network/authorized_dapp/preferences/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/authorized_dapp/preferences/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/networks/network/authorized_dapp/preferences/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/authorized_dapp/preferences/mod.rs diff --git a/crates/sargon-uniffi/src/profile/v100/networks/network/authorized_dapp/shared_persona_data.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/authorized_dapp/shared_persona_data.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/networks/network/authorized_dapp/shared_persona_data.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/authorized_dapp/shared_persona_data.rs diff --git a/crates/sargon-uniffi/src/profile/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_account_addresses.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_account_addresses.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_account_addresses.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_account_addresses.rs diff --git a/crates/sargon-uniffi/src/profile/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_ids_of_persona_data_entries.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_ids_of_persona_data_entries.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_ids_of_persona_data_entries.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_ids_of_persona_data_entries.rs diff --git a/crates/sargon-uniffi/src/profile/v100/networks/network/authorized_dapp/shared_with_dapp.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/authorized_dapp/shared_with_dapp.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/networks/network/authorized_dapp/shared_with_dapp.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/authorized_dapp/shared_with_dapp.rs diff --git a/crates/sargon-uniffi/src/profile/v100/networks/network/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/networks/network/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/mod.rs diff --git a/crates/sargon-uniffi/src/profile/v100/networks/network/network_id.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/network_id.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/networks/network/network_id.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/network_id.rs diff --git a/crates/sargon-uniffi/src/profile/v100/networks/network/profile_network.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/profile_network.rs similarity index 95% rename from crates/sargon-uniffi/src/profile/v100/networks/network/profile_network.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/profile_network.rs index 26874b88c..ed20b9015 100644 --- a/crates/sargon-uniffi/src/profile/v100/networks/network/profile_network.rs +++ b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/profile_network.rs @@ -1,6 +1,6 @@ use crate::prelude::*; +use profile_logic::prelude::ProfileNetworkDetailsForAuthorizedDapp as _; use sargon::ProfileNetwork as InternalProfileNetwork; -use sargon_profile_logic::prelude::ProfileNetworkDetailsForAuthorizedDapp as _; decl_vec_samples_for!(ProfileNetworks, ProfileNetwork); diff --git a/crates/sargon-uniffi/src/profile/v100/networks/network/resource_preferences/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/resource_preferences/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/networks/network/resource_preferences/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/resource_preferences/mod.rs diff --git a/crates/sargon-uniffi/src/profile/v100/networks/network/resource_preferences/resource_app_preference.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/resource_preferences/resource_app_preference.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/networks/network/resource_preferences/resource_app_preference.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/resource_preferences/resource_app_preference.rs diff --git a/crates/sargon-uniffi/src/profile/v100/networks/network/resource_preferences/resource_identifier.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/resource_preferences/resource_identifier.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/networks/network/resource_preferences/resource_identifier.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/resource_preferences/resource_identifier.rs diff --git a/crates/sargon-uniffi/src/profile/v100/networks/network/resource_preferences/resource_preferences.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/resource_preferences/resource_preferences.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/networks/network/resource_preferences/resource_preferences.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/resource_preferences/resource_preferences.rs diff --git a/crates/sargon-uniffi/src/profile/v100/networks/network/resource_preferences/resource_visibility.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/resource_preferences/resource_visibility.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/networks/network/resource_preferences/resource_visibility.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/networks/network/resource_preferences/resource_visibility.rs diff --git a/crates/sargon-uniffi/src/profile/v100/profile.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/profile.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/profile.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/profile.rs diff --git a/crates/sargon-uniffi/src/profile/v100/profile_file_contents.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/profile_file_contents.rs similarity index 100% rename from crates/sargon-uniffi/src/profile/v100/profile_file_contents.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/profile_file_contents.rs diff --git a/crates/sargon-uniffi/src/radix_connect/interaction_id.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/interaction_id.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/interaction_id.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/interaction_id.rs diff --git a/crates/sargon-uniffi/src/radix_connect/interaction_version.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/interaction_version.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/interaction_version.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/interaction_version.rs diff --git a/crates/sargon-uniffi/src/radix_connect/mobile/client.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/mobile/client.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/mobile/client.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/mobile/client.rs diff --git a/crates/sargon-uniffi/src/radix_connect/mobile/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/mobile/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/mobile/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/mobile/mod.rs diff --git a/crates/sargon-uniffi/src/radix_connect/mobile/session/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/mobile/session/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/mobile/session/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/mobile/session/mod.rs diff --git a/crates/sargon-uniffi/src/radix_connect/mobile/session/session_id.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/mobile/session/session_id.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/mobile/session/session_id.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/mobile/session/session_id.rs diff --git a/crates/sargon-uniffi/src/radix_connect/mobile/session_dapp_request.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/mobile/session_dapp_request.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/mobile/session_dapp_request.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/mobile/session_dapp_request.rs diff --git a/crates/sargon-uniffi/src/radix_connect/mobile/session_storage.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/mobile/session_storage.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/mobile/session_storage.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/mobile/session_storage.rs diff --git a/crates/sargon-uniffi/src/radix_connect/mobile/session_wallet_response.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/mobile/session_wallet_response.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/mobile/session_wallet_response.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/mobile/session_wallet_response.rs diff --git a/crates/sargon-uniffi/src/radix_connect/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/mod.rs diff --git a/crates/sargon-uniffi/src/radix_connect/p2p_links/link_connection_qr_data.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/p2p_links/link_connection_qr_data.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/p2p_links/link_connection_qr_data.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/p2p_links/link_connection_qr_data.rs diff --git a/crates/sargon/src/radix_connect/p2p_links/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/p2p_links/mod.rs similarity index 100% rename from crates/sargon/src/radix_connect/p2p_links/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/p2p_links/mod.rs diff --git a/crates/sargon-uniffi/src/radix_connect/p2p_links/p2p_link.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/p2p_links/p2p_link.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/p2p_links/p2p_link.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/p2p_links/p2p_link.rs diff --git a/crates/sargon-uniffi/src/radix_connect/p2p_links/p2p_links.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/p2p_links/p2p_links.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/p2p_links/p2p_links.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/p2p_links/p2p_links.rs diff --git a/crates/sargon-uniffi/src/radix_connect/p2p_links/radix_connect_password.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/p2p_links/radix_connect_password.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/p2p_links/radix_connect_password.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/p2p_links/radix_connect_password.rs diff --git a/crates/sargon-uniffi/src/radix_connect/p2p_links/radix_connect_purpose.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/p2p_links/radix_connect_purpose.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/p2p_links/radix_connect_purpose.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/p2p_links/radix_connect_purpose.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_account.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_account.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_account.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_account.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/auth_challenge_nonce.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/auth_challenge_nonce.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/auth_challenge_nonce.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/auth_challenge_nonce.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/interaction_metadata.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/interaction_metadata.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/interaction_metadata.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/interaction_metadata.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/interaction_metadata_unvalidated.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/interaction_metadata_unvalidated.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/interaction_metadata_unvalidated.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/interaction_metadata_unvalidated.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/mod.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/mod.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/origin.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/origin.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/origin.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/origin.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/items.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/items.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/items.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/items.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/mod.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/mod.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/after_delay.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/after_delay.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/after_delay.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/after_delay.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/at_time.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/at_time.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/at_time.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/at_time.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/expiration.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/expiration.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/expiration.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/expiration.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/mod.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/mod.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/status.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/status.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/status.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/status.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/mod.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/pre_authorization.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/pre_authorization.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/pre_authorization.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/pre_authorization.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/subintent.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/subintent.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/subintent.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/subintent.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/unvalidated_subintent_manifest.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/unvalidated_subintent_manifest.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/unvalidated_subintent_manifest.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/unvalidated_subintent_manifest.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/auth.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/auth.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/auth.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/auth.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/login_with_challenge.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/login_with_challenge.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/login_with_challenge.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/login_with_challenge.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/mod.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/mod.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/use_persona.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/use_persona.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/use_persona.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/use_persona.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/authorized_request.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/authorized_request.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/authorized_request.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/authorized_request.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/accounts.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/accounts.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/accounts.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/accounts.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/mod.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/mod.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/persona_data.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/persona_data.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/persona_data.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/persona_data.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/proof_of_ownership.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/proof_of_ownership.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/proof_of_ownership.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/proof_of_ownership.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/reset.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/reset.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/reset.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/reset.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/mod.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/mod.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/unauthorized_request.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/unauthorized_request.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/unauthorized_request.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/unauthorized_request.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/mod.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/transaction.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/transaction.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/transaction.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/transaction.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/transaction_version.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/transaction_version.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/transaction_version.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/transaction_version.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/unvalidated_transaction_manifest.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/unvalidated_transaction_manifest.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/unvalidated_transaction_manifest.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/unvalidated_transaction_manifest.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_unvalidated.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_unvalidated.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_unvalidated.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_unvalidated.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/mod.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/mod.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/mod.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/mod.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/error_type.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/error_type.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/error_type.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/error_type.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/failure.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/failure.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/failure.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/failure.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/mod.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/mod.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/mod.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/mod.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/response.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/response.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/response.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/response.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/account_proof.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/account_proof.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/account_proof.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/account_proof.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/accounts.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/accounts.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/accounts.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/accounts.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/mod.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/mod.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_login_with_challenge.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_login_with_challenge.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_login_with_challenge.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_login_with_challenge.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_login_without_challenge.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_login_without_challenge.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_login_without_challenge.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_login_without_challenge.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_proof.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_proof.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_proof.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_proof.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_use_persona.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_use_persona.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_use_persona.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_use_persona.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/mod.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/mod.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/authorized_request.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/authorized_request.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/authorized_request.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/authorized_request.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/items.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/items.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/items.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/items.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/mod.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/mod.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona/mod.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona/mod.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona/persona_proof.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona/persona_proof.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona/persona_proof.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona/persona_proof.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona_data/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona_data/mod.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona_data/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona_data/mod.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona_data/persona_data.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona_data/persona_data.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona_data/persona_data.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona_data/persona_data.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/mod.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/pre_authorization.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/pre_authorization.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/pre_authorization.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/pre_authorization.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/mod.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/mod.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/proof.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/proof.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/proof.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/proof.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/proof_of_ownership.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/proof_of_ownership.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/proof_of_ownership.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/proof_of_ownership.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/success.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/success.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/success.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/success.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/mod.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/mod.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/transaction.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/transaction.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/transaction.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/transaction.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/unauthorized_request.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/unauthorized_request.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/unauthorized_request.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/unauthorized_request.rs diff --git a/crates/sargon/src/radix_connect/wallet_interaction/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/mod.rs similarity index 100% rename from crates/sargon/src/radix_connect/wallet_interaction/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_interaction/mod.rs diff --git a/crates/sargon-uniffi/src/radix_connect/wallet_persona.rs b/crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_persona.rs similarity index 100% rename from crates/sargon-uniffi/src/radix_connect/wallet_persona.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/radix_connect/wallet_persona.rs diff --git a/crates/sargon-uniffi/src/sargon.udl b/crates/uniffi/uniffi_SPLIT_ME/src/sargon.udl similarity index 100% rename from crates/sargon-uniffi/src/sargon.udl rename to crates/uniffi/uniffi_SPLIT_ME/src/sargon.udl diff --git a/crates/sargon-uniffi/src/security_center/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/security_center/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/security_center/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/security_center/mod.rs diff --git a/crates/sargon-uniffi/src/security_center/security_problem.rs b/crates/uniffi/uniffi_SPLIT_ME/src/security_center/security_problem.rs similarity index 100% rename from crates/sargon-uniffi/src/security_center/security_problem.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/security_center/security_problem.rs diff --git a/crates/sargon-uniffi/src/security_center/security_problem_kind.rs b/crates/uniffi/uniffi_SPLIT_ME/src/security_center/security_problem_kind.rs similarity index 100% rename from crates/sargon-uniffi/src/security_center/security_problem_kind.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/security_center/security_problem_kind.rs diff --git a/crates/sargon-uniffi/src/security_center/support/addresses_entities_bad_state.rs b/crates/uniffi/uniffi_SPLIT_ME/src/security_center/support/addresses_entities_bad_state.rs similarity index 100% rename from crates/sargon-uniffi/src/security_center/support/addresses_entities_bad_state.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/security_center/support/addresses_entities_bad_state.rs diff --git a/crates/sargon-uniffi/src/security_center/support/backup_result.rs b/crates/uniffi/uniffi_SPLIT_ME/src/security_center/support/backup_result.rs similarity index 100% rename from crates/sargon-uniffi/src/security_center/support/backup_result.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/security_center/support/backup_result.rs diff --git a/crates/sargon-uniffi/src/security_center/support/input.rs b/crates/uniffi/uniffi_SPLIT_ME/src/security_center/support/input.rs similarity index 100% rename from crates/sargon-uniffi/src/security_center/support/input.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/security_center/support/input.rs diff --git a/crates/sargon/src/security_center/support/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/security_center/support/mod.rs similarity index 100% rename from crates/sargon/src/security_center/support/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/security_center/support/mod.rs diff --git a/crates/sargon-uniffi/src/signing/authentication/auth_intent.rs b/crates/uniffi/uniffi_SPLIT_ME/src/signing/authentication/auth_intent.rs similarity index 100% rename from crates/sargon-uniffi/src/signing/authentication/auth_intent.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/signing/authentication/auth_intent.rs diff --git a/crates/sargon-uniffi/src/signing/authentication/auth_intent_hash.rs b/crates/uniffi/uniffi_SPLIT_ME/src/signing/authentication/auth_intent_hash.rs similarity index 100% rename from crates/sargon-uniffi/src/signing/authentication/auth_intent_hash.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/signing/authentication/auth_intent_hash.rs diff --git a/crates/sargon/src/signing/authentication/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/signing/authentication/mod.rs similarity index 100% rename from crates/sargon/src/signing/authentication/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/signing/authentication/mod.rs diff --git a/crates/sargon-uniffi/src/signing/authentication/signed_auth_intent.rs b/crates/uniffi/uniffi_SPLIT_ME/src/signing/authentication/signed_auth_intent.rs similarity index 97% rename from crates/sargon-uniffi/src/signing/authentication/signed_auth_intent.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/signing/authentication/signed_auth_intent.rs index 0c3174de4..51f35354a 100644 --- a/crates/sargon-uniffi/src/signing/authentication/signed_auth_intent.rs +++ b/crates/uniffi/uniffi_SPLIT_ME/src/signing/authentication/signed_auth_intent.rs @@ -56,7 +56,7 @@ impl From for InternalSignedAuthIntent { item.intent_signature.into_internal(), ) }) - .collect::>(), diff --git a/crates/sargon-uniffi/src/signing/hd_signature.rs b/crates/uniffi/uniffi_SPLIT_ME/src/signing/hd_signature.rs similarity index 100% rename from crates/sargon-uniffi/src/signing/hd_signature.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/signing/hd_signature.rs diff --git a/crates/sargon-uniffi/src/signing/hd_signature_input.rs b/crates/uniffi/uniffi_SPLIT_ME/src/signing/hd_signature_input.rs similarity index 100% rename from crates/sargon-uniffi/src/signing/hd_signature_input.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/signing/hd_signature_input.rs diff --git a/crates/sargon-uniffi/src/signing/intent_signature_of_owner.rs b/crates/uniffi/uniffi_SPLIT_ME/src/signing/intent_signature_of_owner.rs similarity index 100% rename from crates/sargon-uniffi/src/signing/intent_signature_of_owner.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/signing/intent_signature_of_owner.rs diff --git a/crates/sargon-uniffi/src/signing/invalid_transaction_if_neglected.rs b/crates/uniffi/uniffi_SPLIT_ME/src/signing/invalid_transaction_if_neglected.rs similarity index 100% rename from crates/sargon-uniffi/src/signing/invalid_transaction_if_neglected.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/signing/invalid_transaction_if_neglected.rs diff --git a/crates/sargon-uniffi/src/signing/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/signing/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/signing/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/signing/mod.rs diff --git a/crates/sargon-uniffi/src/signing/neglected_factors.rs b/crates/uniffi/uniffi_SPLIT_ME/src/signing/neglected_factors.rs similarity index 93% rename from crates/sargon-uniffi/src/signing/neglected_factors.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/signing/neglected_factors.rs index c545e2152..03e0f2c24 100644 --- a/crates/sargon-uniffi/src/signing/neglected_factors.rs +++ b/crates/uniffi/uniffi_SPLIT_ME/src/signing/neglected_factors.rs @@ -1,9 +1,8 @@ use crate::prelude::*; use sargon::FactorSourceIDFromHash as InternalFactorSourceIDFromHash; use sargon::NeglectFactorReason as InternalNeglectFactorReason; -type InternalNeglectedFactors = sargon::AbstractNeglectedFactor< - sargon::IndexSet, ->; +type InternalNeglectedFactors = + sargon::AbstractNeglectedFactor>; #[derive(Clone, PartialEq, Eq, uniffi::Record)] pub struct NeglectedFactors { diff --git a/crates/sargon-uniffi/src/signing/sign_request.rs b/crates/uniffi/uniffi_SPLIT_ME/src/signing/sign_request.rs similarity index 100% rename from crates/sargon-uniffi/src/signing/sign_request.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/signing/sign_request.rs diff --git a/crates/sargon-uniffi/src/signing/sign_response.rs b/crates/uniffi/uniffi_SPLIT_ME/src/signing/sign_response.rs similarity index 96% rename from crates/sargon-uniffi/src/signing/sign_response.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/signing/sign_response.rs index 904d72088..7ae89d899 100644 --- a/crates/sargon-uniffi/src/signing/sign_response.rs +++ b/crates/uniffi/uniffi_SPLIT_ME/src/signing/sign_response.rs @@ -41,7 +41,7 @@ macro_rules! decl_sign_response { impl From<$struct_name> for $internal_struct_name { fn from(value: $struct_name) -> Self { Self::new( - sargon::IndexMap::from_iter(value.per_factor_source.into_iter().map( + IndexMap::from_iter(value.per_factor_source.into_iter().map( |item| { ( item.factor_source_id.into_internal(), diff --git a/crates/sargon-uniffi/src/signing/sign_with_factors_outcome.rs b/crates/uniffi/uniffi_SPLIT_ME/src/signing/sign_with_factors_outcome.rs similarity index 100% rename from crates/sargon-uniffi/src/signing/sign_with_factors_outcome.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/signing/sign_with_factors_outcome.rs diff --git a/crates/sargon-uniffi/src/signing/signatures_per_fractor_source.rs b/crates/uniffi/uniffi_SPLIT_ME/src/signing/signatures_per_fractor_source.rs similarity index 100% rename from crates/sargon-uniffi/src/signing/signatures_per_fractor_source.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/signing/signatures_per_fractor_source.rs diff --git a/crates/sargon-uniffi/src/signing/transaction_sign_request_input.rs b/crates/uniffi/uniffi_SPLIT_ME/src/signing/transaction_sign_request_input.rs similarity index 100% rename from crates/sargon-uniffi/src/signing/transaction_sign_request_input.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/signing/transaction_sign_request_input.rs diff --git a/crates/sargon-uniffi/src/signing/transactions_to_sign_per_factor_source.rs b/crates/uniffi/uniffi_SPLIT_ME/src/signing/transactions_to_sign_per_factor_source.rs similarity index 100% rename from crates/sargon-uniffi/src/signing/transactions_to_sign_per_factor_source.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/signing/transactions_to_sign_per_factor_source.rs diff --git a/crates/sargon-uniffi/src/system/bios/bios.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/bios/bios.rs similarity index 100% rename from crates/sargon-uniffi/src/system/bios/bios.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/bios/bios.rs diff --git a/crates/sargon/src/system/bios/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/bios/mod.rs similarity index 100% rename from crates/sargon/src/system/bios/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/bios/mod.rs diff --git a/crates/sargon-uniffi/src/system/drivers/README.md b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/README.md similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/README.md rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/README.md diff --git a/crates/sargon-uniffi/src/system/drivers/drivers.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/drivers.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/drivers.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/drivers.rs diff --git a/crates/sargon-uniffi/src/system/drivers/entropy_provider_driver/entropy_provider_driver.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/entropy_provider_driver/entropy_provider_driver.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/entropy_provider_driver/entropy_provider_driver.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/entropy_provider_driver/entropy_provider_driver.rs diff --git a/crates/sargon-uniffi/src/system/drivers/entropy_provider_driver/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/entropy_provider_driver/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/entropy_provider_driver/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/entropy_provider_driver/mod.rs diff --git a/crates/sargon-uniffi/src/system/drivers/event_bus_driver/event_bus_driver.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/event_bus_driver/event_bus_driver.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/event_bus_driver/event_bus_driver.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/event_bus_driver/event_bus_driver.rs diff --git a/crates/sargon-uniffi/src/system/drivers/event_bus_driver/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/event_bus_driver/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/event_bus_driver/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/event_bus_driver/mod.rs diff --git a/crates/sargon-uniffi/src/system/drivers/event_bus_driver/support/event.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/event_bus_driver/support/event.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/event_bus_driver/support/event.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/event_bus_driver/support/event.rs diff --git a/crates/sargon-uniffi/src/system/drivers/event_bus_driver/support/event_kind.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/event_bus_driver/support/event_kind.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/event_bus_driver/support/event_kind.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/event_bus_driver/support/event_kind.rs diff --git a/crates/sargon-uniffi/src/system/drivers/event_bus_driver/support/event_notification.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/event_bus_driver/support/event_notification.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/event_bus_driver/support/event_notification.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/event_bus_driver/support/event_notification.rs diff --git a/crates/sargon-uniffi/src/system/drivers/event_bus_driver/support/event_profile_modified.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/event_bus_driver/support/event_profile_modified.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/event_bus_driver/support/event_profile_modified.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/event_bus_driver/support/event_profile_modified.rs diff --git a/crates/sargon-uniffi/src/system/drivers/event_bus_driver/support/has_event_kind.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/event_bus_driver/support/has_event_kind.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/event_bus_driver/support/has_event_kind.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/event_bus_driver/support/has_event_kind.rs diff --git a/crates/sargon-uniffi/src/system/drivers/event_bus_driver/support/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/event_bus_driver/support/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/event_bus_driver/support/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/event_bus_driver/support/mod.rs diff --git a/crates/sargon-uniffi/src/system/drivers/file_system_driver/file_system_driver.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/file_system_driver/file_system_driver.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/file_system_driver/file_system_driver.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/file_system_driver/file_system_driver.rs diff --git a/crates/sargon-uniffi/src/system/drivers/file_system_driver/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/file_system_driver/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/file_system_driver/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/file_system_driver/mod.rs diff --git a/crates/sargon-uniffi/src/system/drivers/host_info_driver/host_info_driver.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/host_info_driver/host_info_driver.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/host_info_driver/host_info_driver.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/host_info_driver/host_info_driver.rs diff --git a/crates/sargon-uniffi/src/system/drivers/host_info_driver/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/host_info_driver/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/host_info_driver/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/host_info_driver/mod.rs diff --git a/crates/sargon-uniffi/src/system/drivers/logging_driver/logging_driver.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/logging_driver/logging_driver.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/logging_driver/logging_driver.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/logging_driver/logging_driver.rs diff --git a/crates/sargon-uniffi/src/system/drivers/logging_driver/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/logging_driver/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/logging_driver/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/logging_driver/mod.rs diff --git a/crates/sargon-uniffi/src/system/drivers/logging_driver/support/log_level.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/logging_driver/support/log_level.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/logging_driver/support/log_level.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/logging_driver/support/log_level.rs diff --git a/crates/sargon-uniffi/src/system/drivers/logging_driver/support/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/logging_driver/support/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/logging_driver/support/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/logging_driver/support/mod.rs diff --git a/crates/sargon-uniffi/src/system/drivers/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/mod.rs diff --git a/crates/sargon-uniffi/src/system/drivers/networking_driver/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/networking_driver/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/networking_driver/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/networking_driver/mod.rs diff --git a/crates/sargon-uniffi/src/system/drivers/networking_driver/networking_driver.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/networking_driver/networking_driver.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/networking_driver/networking_driver.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/networking_driver/networking_driver.rs diff --git a/crates/sargon-uniffi/src/system/drivers/networking_driver/support/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/networking_driver/support/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/networking_driver/support/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/networking_driver/support/mod.rs diff --git a/crates/sargon-uniffi/src/system/drivers/networking_driver/support/network_method.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/networking_driver/support/network_method.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/networking_driver/support/network_method.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/networking_driver/support/network_method.rs diff --git a/crates/sargon-uniffi/src/system/drivers/networking_driver/support/network_request.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/networking_driver/support/network_request.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/networking_driver/support/network_request.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/networking_driver/support/network_request.rs diff --git a/crates/sargon-uniffi/src/system/drivers/networking_driver/support/network_response.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/networking_driver/support/network_response.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/networking_driver/support/network_response.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/networking_driver/support/network_response.rs diff --git a/crates/sargon-uniffi/src/system/drivers/profile_change_driver/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/profile_change_driver/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/profile_change_driver/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/profile_change_driver/mod.rs diff --git a/crates/sargon-uniffi/src/system/drivers/profile_change_driver/profile_change_driver.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/profile_change_driver/profile_change_driver.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/profile_change_driver/profile_change_driver.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/profile_change_driver/profile_change_driver.rs diff --git a/crates/sargon-uniffi/src/system/drivers/secure_storage_driver/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/secure_storage_driver/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/secure_storage_driver/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/secure_storage_driver/mod.rs diff --git a/crates/sargon-uniffi/src/system/drivers/secure_storage_driver/secure_storage_driver.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/secure_storage_driver/secure_storage_driver.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/secure_storage_driver/secure_storage_driver.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/secure_storage_driver/secure_storage_driver.rs diff --git a/crates/sargon-uniffi/src/system/drivers/secure_storage_driver/support/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/secure_storage_driver/support/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/secure_storage_driver/support/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/secure_storage_driver/support/mod.rs diff --git a/crates/sargon-uniffi/src/system/drivers/secure_storage_driver/support/secure_storage_access_error_kind.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/secure_storage_driver/support/secure_storage_access_error_kind.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/secure_storage_driver/support/secure_storage_access_error_kind.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/secure_storage_driver/support/secure_storage_access_error_kind.rs diff --git a/crates/sargon-uniffi/src/system/drivers/secure_storage_driver/support/secure_storage_key.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/secure_storage_driver/support/secure_storage_key.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/secure_storage_driver/support/secure_storage_key.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/secure_storage_driver/support/secure_storage_key.rs diff --git a/crates/sargon-uniffi/src/system/drivers/unsafe_storage_driver/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/unsafe_storage_driver/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/unsafe_storage_driver/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/unsafe_storage_driver/mod.rs diff --git a/crates/sargon-uniffi/src/system/drivers/unsafe_storage_driver/support/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/unsafe_storage_driver/support/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/unsafe_storage_driver/support/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/unsafe_storage_driver/support/mod.rs diff --git a/crates/sargon-uniffi/src/system/drivers/unsafe_storage_driver/support/test/ephemeral_unsafe_storage.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/unsafe_storage_driver/support/test/ephemeral_unsafe_storage.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/unsafe_storage_driver/support/test/ephemeral_unsafe_storage.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/unsafe_storage_driver/support/test/ephemeral_unsafe_storage.rs diff --git a/crates/sargon-uniffi/src/system/drivers/unsafe_storage_driver/support/test/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/unsafe_storage_driver/support/test/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/unsafe_storage_driver/support/test/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/unsafe_storage_driver/support/test/mod.rs diff --git a/crates/sargon-uniffi/src/system/drivers/unsafe_storage_driver/support/unsafe_storage_key.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/unsafe_storage_driver/support/unsafe_storage_key.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/unsafe_storage_driver/support/unsafe_storage_key.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/unsafe_storage_driver/support/unsafe_storage_key.rs diff --git a/crates/sargon-uniffi/src/system/drivers/unsafe_storage_driver/unsafe_storage_driver.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/unsafe_storage_driver/unsafe_storage_driver.rs similarity index 100% rename from crates/sargon-uniffi/src/system/drivers/unsafe_storage_driver/unsafe_storage_driver.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/drivers/unsafe_storage_driver/unsafe_storage_driver.rs diff --git a/crates/sargon-uniffi/src/system/interactors/host_interactor.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/interactors/host_interactor.rs similarity index 100% rename from crates/sargon-uniffi/src/system/interactors/host_interactor.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/interactors/host_interactor.rs diff --git a/crates/sargon-uniffi/src/system/interactors/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/interactors/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/system/interactors/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/interactors/mod.rs diff --git a/crates/sargon-uniffi/src/system/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/system/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/mod.rs diff --git a/crates/sargon-uniffi/src/system/sargon_os/delete_account/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/delete_account/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/system/sargon_os/delete_account/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/delete_account/mod.rs diff --git a/crates/sargon-uniffi/src/system/sargon_os/delete_account/sargon_os_delete_account.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/delete_account/sargon_os_delete_account.rs similarity index 100% rename from crates/sargon-uniffi/src/system/sargon_os/delete_account/sargon_os_delete_account.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/delete_account/sargon_os_delete_account.rs diff --git a/crates/sargon/src/system/sargon_os/delete_account/support/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/delete_account/support/mod.rs similarity index 100% rename from crates/sargon/src/system/sargon_os/delete_account/support/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/delete_account/support/mod.rs diff --git a/crates/sargon-uniffi/src/system/sargon_os/delete_account/support/outcome.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/delete_account/support/outcome.rs similarity index 100% rename from crates/sargon-uniffi/src/system/sargon_os/delete_account/support/outcome.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/delete_account/support/outcome.rs diff --git a/crates/sargon-uniffi/src/system/sargon_os/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/system/sargon_os/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/mod.rs diff --git a/crates/sargon-uniffi/src/system/sargon_os/pre_authorization/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/pre_authorization/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/system/sargon_os/pre_authorization/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/pre_authorization/mod.rs diff --git a/crates/sargon-uniffi/src/system/sargon_os/pre_authorization/sargon_os_create_subintent.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/pre_authorization/sargon_os_create_subintent.rs similarity index 100% rename from crates/sargon-uniffi/src/system/sargon_os/pre_authorization/sargon_os_create_subintent.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/pre_authorization/sargon_os_create_subintent.rs diff --git a/crates/sargon-uniffi/src/system/sargon_os/pre_authorization/sargon_os_pre_authorization_status.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/pre_authorization/sargon_os_pre_authorization_status.rs similarity index 100% rename from crates/sargon-uniffi/src/system/sargon_os/pre_authorization/sargon_os_pre_authorization_status.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/pre_authorization/sargon_os_pre_authorization_status.rs diff --git a/crates/sargon/src/system/sargon_os/pre_authorization/support/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/pre_authorization/support/mod.rs similarity index 100% rename from crates/sargon/src/system/sargon_os/pre_authorization/support/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/pre_authorization/support/mod.rs diff --git a/crates/sargon-uniffi/src/system/sargon_os/pre_authorization/support/pre_authorization_status.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/pre_authorization/support/pre_authorization_status.rs similarity index 100% rename from crates/sargon-uniffi/src/system/sargon_os/pre_authorization/support/pre_authorization_status.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/pre_authorization/support/pre_authorization_status.rs diff --git a/crates/sargon-uniffi/src/system/sargon_os/profile_state_holder.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/profile_state_holder.rs similarity index 100% rename from crates/sargon-uniffi/src/system/sargon_os/profile_state_holder.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/profile_state_holder.rs diff --git a/crates/sargon-uniffi/src/system/sargon_os/sargon_os.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os.rs similarity index 100% rename from crates/sargon-uniffi/src/system/sargon_os/sargon_os.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os.rs diff --git a/crates/sargon-uniffi/src/system/sargon_os/sargon_os_accounts.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_accounts.rs similarity index 100% rename from crates/sargon-uniffi/src/system/sargon_os/sargon_os_accounts.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_accounts.rs diff --git a/crates/sargon-uniffi/src/system/sargon_os/sargon_os_entities_linked_to_factor_source.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_entities_linked_to_factor_source.rs similarity index 100% rename from crates/sargon-uniffi/src/system/sargon_os/sargon_os_entities_linked_to_factor_source.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_entities_linked_to_factor_source.rs diff --git a/crates/sargon-uniffi/src/system/sargon_os/sargon_os_factors.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_factors.rs similarity index 100% rename from crates/sargon-uniffi/src/system/sargon_os/sargon_os_factors.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_factors.rs diff --git a/crates/sargon-uniffi/src/system/sargon_os/sargon_os_gateway.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_gateway.rs similarity index 100% rename from crates/sargon-uniffi/src/system/sargon_os/sargon_os_gateway.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_gateway.rs diff --git a/crates/sargon-uniffi/src/system/sargon_os/sargon_os_profile.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_profile.rs similarity index 100% rename from crates/sargon-uniffi/src/system/sargon_os/sargon_os_profile.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_profile.rs diff --git a/crates/sargon-uniffi/src/system/sargon_os/sargon_os_security_center.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_security_center.rs similarity index 100% rename from crates/sargon-uniffi/src/system/sargon_os/sargon_os_security_center.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_security_center.rs diff --git a/crates/sargon-uniffi/src/system/sargon_os/sargon_os_security_structures.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_security_structures.rs similarity index 100% rename from crates/sargon-uniffi/src/system/sargon_os/sargon_os_security_structures.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_security_structures.rs diff --git a/crates/sargon-uniffi/src/system/sargon_os/sargon_os_signing.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_signing.rs similarity index 100% rename from crates/sargon-uniffi/src/system/sargon_os/sargon_os_signing.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_signing.rs diff --git a/crates/sargon-uniffi/src/system/sargon_os/sargon_os_sync_accounts.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_sync_accounts.rs similarity index 100% rename from crates/sargon-uniffi/src/system/sargon_os/sargon_os_sync_accounts.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_sync_accounts.rs diff --git a/crates/sargon-uniffi/src/system/sargon_os/transactions/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/transactions/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/system/sargon_os/transactions/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/transactions/mod.rs diff --git a/crates/sargon-uniffi/src/system/sargon_os/transactions/sargon_os_transaction_analysis.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/transactions/sargon_os_transaction_analysis.rs similarity index 100% rename from crates/sargon-uniffi/src/system/sargon_os/transactions/sargon_os_transaction_analysis.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/transactions/sargon_os_transaction_analysis.rs diff --git a/crates/sargon-uniffi/src/system/sargon_os/transactions/sargon_os_transaction_status.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/transactions/sargon_os_transaction_status.rs similarity index 100% rename from crates/sargon-uniffi/src/system/sargon_os/transactions/sargon_os_transaction_status.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/transactions/sargon_os_transaction_status.rs diff --git a/crates/sargon-uniffi/src/system/sargon_os/transactions/sargon_os_transaction_submit.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/transactions/sargon_os_transaction_submit.rs similarity index 100% rename from crates/sargon-uniffi/src/system/sargon_os/transactions/sargon_os_transaction_submit.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/transactions/sargon_os_transaction_submit.rs diff --git a/crates/sargon-uniffi/src/system/sargon_os/transactions/support/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/transactions/support/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/system/sargon_os/transactions/support/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/transactions/support/mod.rs diff --git a/crates/sargon-uniffi/src/system/sargon_os/transactions/support/pre_auth_to_review.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/transactions/support/pre_auth_to_review.rs similarity index 100% rename from crates/sargon-uniffi/src/system/sargon_os/transactions/support/pre_auth_to_review.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/transactions/support/pre_auth_to_review.rs diff --git a/crates/sargon-uniffi/src/system/sargon_os/transactions/support/transaction_to_review.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/transactions/support/transaction_to_review.rs similarity index 100% rename from crates/sargon-uniffi/src/system/sargon_os/transactions/support/transaction_to_review.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/transactions/support/transaction_to_review.rs diff --git a/crates/sargon/src/system/subsystems/README.md b/crates/uniffi/uniffi_SPLIT_ME/src/system/subsystems/README.md similarity index 100% rename from crates/sargon/src/system/subsystems/README.md rename to crates/uniffi/uniffi_SPLIT_ME/src/system/subsystems/README.md diff --git a/crates/sargon-uniffi/src/system/subsystems/log_system/log_system.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/subsystems/log_system/log_system.rs similarity index 100% rename from crates/sargon-uniffi/src/system/subsystems/log_system/log_system.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/subsystems/log_system/log_system.rs diff --git a/crates/sargon/src/system/subsystems/log_system/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/subsystems/log_system/mod.rs similarity index 100% rename from crates/sargon/src/system/subsystems/log_system/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/subsystems/log_system/mod.rs diff --git a/crates/sargon/src/system/subsystems/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/subsystems/mod.rs similarity index 100% rename from crates/sargon/src/system/subsystems/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/system/subsystems/mod.rs diff --git a/crates/sargon-uniffi/src/types/ffi_url.rs b/crates/uniffi/uniffi_SPLIT_ME/src/types/ffi_url.rs similarity index 97% rename from crates/sargon-uniffi/src/types/ffi_url.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/types/ffi_url.rs index 7b5ae7d54..b93e5e305 100644 --- a/crates/sargon-uniffi/src/types/ffi_url.rs +++ b/crates/uniffi/uniffi_SPLIT_ME/src/types/ffi_url.rs @@ -1,4 +1,4 @@ -use sargon_core::parse_url; +use core_misc::parse_url; use crate::prelude::*; diff --git a/crates/sargon-uniffi/src/types/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/types/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/types/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/types/mod.rs diff --git a/crates/sargon-uniffi/src/types/owned_factor_instance.rs b/crates/uniffi/uniffi_SPLIT_ME/src/types/owned_factor_instance.rs similarity index 100% rename from crates/sargon-uniffi/src/types/owned_factor_instance.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/types/owned_factor_instance.rs diff --git a/crates/sargon-uniffi/src/types/vector_image_type.rs b/crates/uniffi/uniffi_SPLIT_ME/src/types/vector_image_type.rs similarity index 100% rename from crates/sargon-uniffi/src/types/vector_image_type.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/types/vector_image_type.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/mod.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/ret_api.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/ret_api.rs similarity index 99% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/ret_api.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/ret_api.rs index 4785d1123..071751d58 100644 --- a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/ret_api.rs +++ b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/ret_api.rs @@ -4,7 +4,7 @@ use sargon::SargonBuildInformation as InternalSargonBuildInformation; use sargon::TransactionManifest as InternalTransactionManifest; use sargon::{ - // sargon_manifests crate + // manifests crate ManifestForAccountLockerClaim as _, TransactionManifestAssetTransfers as _, TransactionManifestFaucet as _, diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/account_locker/account_locker_claimable_resource.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/account_locker/account_locker_claimable_resource.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/account_locker/account_locker_claimable_resource.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/account_locker/account_locker_claimable_resource.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/account_locker/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/account_locker/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/account_locker/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/account_locker/mod.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/address_of_account_or_persona.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/address_of_account_or_persona.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/address_of_account_or_persona.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/address_of_account_or_persona.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/address_union.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/address_union.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/address_union.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/address_union.rs diff --git a/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/account_or_address_of.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/account_or_address_of.rs new file mode 100644 index 000000000..0afe9ed19 --- /dev/null +++ b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/account_or_address_of.rs @@ -0,0 +1,26 @@ +use crate::prelude::*; +use sargon::AccountOrAddressOf as InternalAccountOrAddressOf; + +#[derive(Clone, PartialEq, Eq, Hash, InternalConversion, uniffi::Enum)] +#[allow(clippy::large_enum_variant)] // we cannot Box, since Box is not UniFFI compatible. +pub enum AccountOrAddressOf { + ProfileAccount { value: AccountForDisplay }, + AddressOfExternalAccount { value: AccountAddress }, +} + +#[uniffi::export] +pub fn new_account_or_address_of_sample() -> AccountOrAddressOf { + InternalAccountOrAddressOf::sample().into() +} + +#[uniffi::export] +pub fn new_account_or_address_of_sample_other() -> AccountOrAddressOf { + InternalAccountOrAddressOf::sample_other().into() +} + +#[uniffi::export] +pub fn account_or_address_of_account_address( + recipient: &AccountOrAddressOf, +) -> AccountAddress { + (*recipient.into_internal().account_address()).into() +} diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/mod.rs similarity index 58% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/mod.rs index 1abd5ac33..2235168c5 100644 --- a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/mod.rs +++ b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/mod.rs @@ -1,9 +1,9 @@ -mod owned_or_third_party_account_address; +mod account_or_address_of; mod per_asset; mod per_recipient; mod transfer_types; -pub use owned_or_third_party_account_address::*; +pub use account_or_address_of::*; pub use per_asset::*; pub use per_recipient::*; pub use transfer_types::*; diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/mod.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_fungible_resource.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_fungible_resource.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_fungible_resource.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_fungible_resource.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers_of_fungible_resource.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers_of_fungible_resource.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers_of_fungible_resource.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers_of_fungible_resource.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers_of_non_fungible_resource.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers_of_non_fungible_resource.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers_of_non_fungible_resource.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_asset/per_asset_transfers_of_non_fungible_resource.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/mod.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfer.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfer.rs similarity index 86% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfer.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfer.rs index dbbe36419..eb0171daf 100644 --- a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfer.rs +++ b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfer.rs @@ -3,7 +3,7 @@ use sargon::PerRecipientAssetTransfer as InternalPerRecipientAssetTransfer; #[derive(Clone, PartialEq, Eq, Hash, InternalConversion, uniffi::Record)] pub struct PerRecipientAssetTransfer { - pub recipient: OwnedOrThirdPartyAccountAddress, + pub recipient: AccountOrAddressOf, pub fungibles: Vec, pub non_fungibles: Vec, } diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfers.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfers.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfers.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/per_recipient/per_recipient_asset_transfers.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/transfer_types.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/transfer_types.rs similarity index 94% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/transfer_types.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/transfer_types.rs index 7c410e086..33517b531 100644 --- a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/transfer_types.rs +++ b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/transfer_types.rs @@ -18,7 +18,7 @@ macro_rules! decl_transfer_of { /// If `true` the `try_deposit_batch_or_abort` method will be used instead of `deposit`, /// typically wallets sets this to try if and only if the recipient is a self-owned account - /// (`OwnedOrThirdPartyAccountAddress::OwnedAccount`) controlled by a DeviceFactorSource thy have + /// (`AccountOrAddressOf::ProfileAccount`) controlled by a DeviceFactorSource thy have /// access to and which third party deposit setting's `DepositRule` is `AcceptKnown` and /// which resource is known (`resource_address` is owned or has been owned before). pub(crate) use_try_deposit_or_abort: bool, @@ -47,7 +47,7 @@ macro_rules! decl_per_asset_transfer_of { $struct_name, $($fields)* /// The account or account address to send the tokens to. - pub recipient: OwnedOrThirdPartyAccountAddress, + pub recipient: AccountOrAddressOf, ); }; } diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/build_information/dependency_information.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/build_information/dependency_information.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/build_information/dependency_information.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/build_information/dependency_information.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/build_information/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/build_information/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/build_information/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/build_information/mod.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/build_information/sargon_build_information.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/build_information/sargon_build_information.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/build_information/sargon_build_information.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/build_information/sargon_build_information.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/build_information/sargon_dependencies.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/build_information/sargon_dependencies.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/build_information/sargon_dependencies.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/build_information/sargon_dependencies.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/manifest_encountered_component_address.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/manifest_encountered_component_address.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/manifest_encountered_component_address.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/manifest_encountered_component_address.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/mod.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/stake_claim.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/stake_claim.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/stake_claim.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/stake_claim.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction/mod.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction/transaction_status.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction/transaction_status.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction/transaction_status.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction/transaction_status.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction/transaction_status_reason.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction/transaction_status_reason.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction/transaction_status_reason.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction/transaction_status_reason.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction_guarantee.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction_guarantee.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction_guarantee.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/transaction_guarantee.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/token_definition_metadata.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/token_definition_metadata.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/token_definition_metadata.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/high_level/token_definition_metadata.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/compiled_notarized_intent.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/compiled_notarized_intent.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/compiled_notarized_intent.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/compiled_notarized_intent.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/compiled_transaction_intent.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/compiled_transaction_intent.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/compiled_transaction_intent.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/compiled_transaction_intent.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/execution_summary/execution_summary.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/execution_summary/execution_summary.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/execution_summary/execution_summary.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/execution_summary/execution_summary.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/execution_summary/fee_locks.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/execution_summary/fee_locks.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/execution_summary/fee_locks.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/execution_summary/fee_locks.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/execution_summary/fee_summary.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/execution_summary/fee_summary.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/execution_summary/fee_summary.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/execution_summary/fee_summary.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/execution_summary/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/execution_summary/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/execution_summary/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/execution_summary/mod.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/execution_summary/new_entities.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/execution_summary/new_entities.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/execution_summary/new_entities.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/execution_summary/new_entities.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/execution_summary/newly_created_resource.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/execution_summary/newly_created_resource.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/execution_summary/newly_created_resource.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/execution_summary/newly_created_resource.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/execution_summary/reserved_instruction.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/execution_summary/reserved_instruction.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/execution_summary/reserved_instruction.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/execution_summary/reserved_instruction.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/fungible_resource_indicator.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/fungible_resource_indicator.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/fungible_resource_indicator.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/fungible_resource_indicator.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/mod.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/non_fungible_resource_indicator.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/non_fungible_resource_indicator.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/non_fungible_resource_indicator.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/non_fungible_resource_indicator.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/predicted.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/predicted.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/predicted.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/predicted.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/resource_indicator.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/resource_indicator.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/resource_indicator.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_indicator/resource_indicator.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_specifier/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_specifier/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_specifier/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_specifier/mod.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_specifier/resource_specifier.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_specifier/resource_specifier.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_specifier/resource_specifier.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/execution_summary/resource_specifier/resource_specifier.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/intent_signature.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/intent_signature.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/intent_signature.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/intent_signature.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/account_deposit.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/account_deposit.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/account_deposit.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/account_deposit.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/change_source.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/change_source.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/change_source.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/change_source.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/mod.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/simple_fungible_resource_bounds.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/simple_fungible_resource_bounds.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/simple_fungible_resource_bounds.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/simple_fungible_resource_bounds.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/simple_non_fungible_resource_bounds.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/simple_non_fungible_resource_bounds.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/simple_non_fungible_resource_bounds.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/simple_non_fungible_resource_bounds.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/simple_resource_bounds.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/simple_resource_bounds.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/simple_resource_bounds.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/simple_resource_bounds.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/unspecified_resources.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/unspecified_resources.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/unspecified_resources.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_deposit/unspecified_resources.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_withdraw/account_withdraw.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_withdraw/account_withdraw.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_withdraw/account_withdraw.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_withdraw/account_withdraw.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_withdraw/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_withdraw/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_withdraw/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/account_withdraw/mod.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/manifest_summary.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/manifest_summary.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/manifest_summary.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/manifest_summary.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/manifest_summary/mod.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/mod.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/notarized_transaction.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/notarized_transaction.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/notarized_transaction.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/notarized_transaction.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/notary_signature.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/notary_signature.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/notary_signature.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/notary_signature.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/public_key_hash.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/public_key_hash.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/public_key_hash.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/public_key_hash.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/signed_intent.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/signed_intent.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/signed_intent.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/signed_intent.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/detailed_manifest_class.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/detailed_manifest_class.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/detailed_manifest_class.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/detailed_manifest_class.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/detailed_manifest_class_kind.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/detailed_manifest_class_kind.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/detailed_manifest_class_kind.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/detailed_manifest_class_kind.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/mod.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/mod.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/resource_preference_update.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/resource_preference_update.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/resource_preference_update.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/resource_preference_update.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/tracked_pool_contribution.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/tracked_pool_contribution.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/tracked_pool_contribution.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/tracked_pool_contribution.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/tracked_pool_redemption.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/tracked_pool_redemption.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/tracked_pool_redemption.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/tracked_pool_redemption.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/tracked_validator_claim.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/tracked_validator_claim.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/tracked_validator_claim.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/tracked_validator_claim.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/tracked_validator_stake.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/tracked_validator_stake.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/tracked_validator_stake.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/tracked_validator_stake.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/unstake_data.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/unstake_data.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/unstake_data.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/transaction_classes/types/unstake_data.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/intent_hash.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/intent_hash.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/intent_hash.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/intent_hash.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/mod.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/signed_intent_hash.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/signed_intent_hash.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/signed_intent_hash.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/signed_intent_hash.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/subintent_hash.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/subintent_hash.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/subintent_hash.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/subintent_hash.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/transaction_hashes.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/transaction_hashes.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/transaction_hashes.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/transaction_hashes/transaction_hashes.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/intent_signatures.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/intent_signatures.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/intent_signatures.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/intent_signatures.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/message/message.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/message/message.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/message/message.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/message/message.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/message/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/message/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/message/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/message/mod.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/message/plaintext_message/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/message/plaintext_message/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/message/plaintext_message/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/message/plaintext_message/mod.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/message/plaintext_message/plaintext_message.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/message/plaintext_message/plaintext_message.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/message/plaintext_message/plaintext_message.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/message/plaintext_message/plaintext_message.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/message/plaintext_message/plaintext_message_contents.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/message/plaintext_message/plaintext_message_contents.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/message/plaintext_message/plaintext_message_contents.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/message/plaintext_message/plaintext_message_contents.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/mod.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_header.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_header.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_header.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_header.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_intent.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_intent.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_intent.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_intent.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/blobs/blob.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/blobs/blob.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/blobs/blob.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/blobs/blob.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/blobs/blobs.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/blobs/blobs.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/blobs/blobs.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/blobs/blobs.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/blobs/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/blobs/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/blobs/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/blobs/mod.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/instructions/instructions.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/instructions/instructions.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/instructions/instructions.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/instructions/instructions.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/instructions/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/instructions/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/instructions/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/instructions/mod.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/mod.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/transaction_manifest.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/transaction_manifest.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/transaction_manifest.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/transaction_manifest.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v2/compiled_subintent.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v2/compiled_subintent.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v2/compiled_subintent.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v2/compiled_subintent.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v2/intent_header_v2.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v2/intent_header_v2.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v2/intent_header_v2.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v2/intent_header_v2.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v2/message_v2/message_v2.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v2/message_v2/message_v2.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v2/message_v2/message_v2.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v2/message_v2/message_v2.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v2/message_v2/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v2/message_v2/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v2/message_v2/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v2/message_v2/mod.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v2/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v2/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v2/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v2/mod.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v2/signed_subintent.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v2/signed_subintent.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v2/signed_subintent.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v2/signed_subintent.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v2/subintent.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v2/subintent.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v2/subintent.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v2/subintent.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/mod.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/subintent_manifest.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/subintent_manifest.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/subintent_manifest.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/subintent_manifest.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/transaction_manifest_v2.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/transaction_manifest_v2.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/transaction_manifest_v2.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/transaction_manifest_v2.rs diff --git a/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/mod.rs b/crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/mod.rs similarity index 100% rename from crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/mod.rs rename to crates/uniffi/uniffi_SPLIT_ME/src/wrapped_radix_engine_toolkit/mod.rs diff --git a/crates/sargon/tests/Package.swift b/crates/uniffi/uniffi_SPLIT_ME/tests/Package.swift similarity index 100% rename from crates/sargon/tests/Package.swift rename to crates/uniffi/uniffi_SPLIT_ME/tests/Package.swift diff --git a/crates/sargon-uniffi/tests/integration/main.rs b/crates/uniffi/uniffi_SPLIT_ME/tests/integration/main.rs similarity index 100% rename from crates/sargon-uniffi/tests/integration/main.rs rename to crates/uniffi/uniffi_SPLIT_ME/tests/integration/main.rs diff --git a/crates/sargon-uniffi/tests/vectors/main.rs b/crates/uniffi/uniffi_SPLIT_ME/tests/vectors/main.rs similarity index 100% rename from crates/sargon-uniffi/tests/vectors/main.rs rename to crates/uniffi/uniffi_SPLIT_ME/tests/vectors/main.rs diff --git a/crates/sargon-uniffi/uniffi.toml b/crates/uniffi/uniffi_SPLIT_ME/uniffi.toml similarity index 100% rename from crates/sargon-uniffi/uniffi.toml rename to crates/uniffi/uniffi_SPLIT_ME/uniffi.toml diff --git a/jvm/buildSrc/src/main/java/com/radixdlt/cargo/toml/SargonVersion.kt b/jvm/buildSrc/src/main/java/com/radixdlt/cargo/toml/SargonVersion.kt index 17b27639a..b36ce8f87 100644 --- a/jvm/buildSrc/src/main/java/com/radixdlt/cargo/toml/SargonVersion.kt +++ b/jvm/buildSrc/src/main/java/com/radixdlt/cargo/toml/SargonVersion.kt @@ -6,7 +6,7 @@ import java.io.ByteArrayOutputStream import java.io.File private fun Project.parseTomlVersion(): String { - val sargonCrate = File(projectDir.parentFile.parentFile, "crates/sargon") + val sargonCrate = File(projectDir.parentFile.parentFile, "crates/sargon_SPLIT_ME") val tomlFile = File(sargonCrate, "Cargo.toml").toPath() val toml = Toml.parse(tomlFile) diff --git a/jvm/sargon-android/src/test/java/com/radixdlt/sargon/ProfileTest.kt b/jvm/sargon-android/src/test/java/com/radixdlt/sargon/ProfileTest.kt index 5f08066e9..6557ec904 100644 --- a/jvm/sargon-android/src/test/java/com/radixdlt/sargon/ProfileTest.kt +++ b/jvm/sargon-android/src/test/java/com/radixdlt/sargon/ProfileTest.kt @@ -126,7 +126,7 @@ class ProfileTest : SampleTestable { @Test fun testCheckIfProfileJsonContainsLegacyP2PLinksWhenP2PLinksArePresent() { - val json = File("../../" + "crates/sargon/fixtures/vector/only_plaintext_profile_snapshot_version_100.json").readText() + val json = File("../../" + "crates/sargon_SPLIT_ME/fixtures/vector/only_plaintext_profile_snapshot_version_100.json").readText() assertEquals( true, Profile.checkIfProfileJsonContainsLegacyP2PLinks(json) @@ -143,7 +143,7 @@ class ProfileTest : SampleTestable { @Test fun testCheckIfEncryptedProfileJsonContainsLegacyP2PLinksWhenP2PLinksArePresent() { - val json = File("../../" + "crates/sargon-profile/fixtures/vector/profile_encrypted_by_password_of_babylon.json").readText() + val json = File("../../" + "crates/profile/models/profile_SPLIT_ME/fixtures/vector/profile_encrypted_by_password_of_babylon.json").readText() assertEquals( true, Profile.checkIfEncryptedProfileJsonContainsLegacyP2PLinks(json, "babylon") diff --git a/jvm/sargon-android/src/test/java/com/radixdlt/sargon/TransactionManifestTest.kt b/jvm/sargon-android/src/test/java/com/radixdlt/sargon/TransactionManifestTest.kt index f4f4021c8..710c534ab 100644 --- a/jvm/sargon-android/src/test/java/com/radixdlt/sargon/TransactionManifestTest.kt +++ b/jvm/sargon-android/src/test/java/com/radixdlt/sargon/TransactionManifestTest.kt @@ -342,17 +342,17 @@ class TransactionManifestTest : SampleTestable { ) perAssetTransfer.transfers.forEach { when (val recipient = it.recipient) { - is OwnedOrThirdPartyAccountAddress.ThirdPartyAccount -> + is AccountOrAddressOf.AddressOfExternalAccount -> assertTrue( contains( recipient.value .string ) ) - is OwnedOrThirdPartyAccountAddress.OwnedAccount -> + is AccountOrAddressOf.ProfileAccount -> assertTrue( contains( - recipient.value + recipient.value.address .string ) ) @@ -376,8 +376,8 @@ class TransactionManifestTest : SampleTestable { listOf( PerRecipientAssetTransfer( recipient = - OwnedOrThirdPartyAccountAddress - .ThirdPartyAccount( + AccountOrAddressOf + .AddressOfExternalAccount( value = AccountAddress( "account_rdx12xkzynhzgtpnnd02tudw2els2g9xl73yk54ppw8xekt2sdrlaer264" @@ -651,6 +651,6 @@ class TransactionManifestTest : SampleTestable { private fun openFileInCrate(crate: String, name: String, extension: String) = File("../../" + "crates/" + crate + "/fixtures/transaction/$name.$extension") - private fun openFileInTxModels(name: String, extension: String) = openFileInCrate("sargon-transaction-models", name, extension) - private fun openFileInManifests(name: String, extension: String) = openFileInCrate("sargon-manifests", name, extension) + private fun openFileInTxModels(name: String, extension: String) = openFileInCrate("transaction/models", name, extension) + private fun openFileInManifests(name: String, extension: String) = openFileInCrate("transaction/manifests", name, extension) } From f1c14a0d83dfdc9cacc97918d181ed389e3e2b0e Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Sat, 4 Jan 2025 15:24:11 +0100 Subject: [PATCH 11/13] fix ci --- .github/workflows/test.yml | 14 +++----------- crates/{sargon_SPLIT_ME/src => }/Package.swift | 0 2 files changed, 3 insertions(+), 11 deletions(-) rename crates/{sargon_SPLIT_ME/src => }/Package.swift (100%) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 45413dafd..f046c486b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -63,22 +63,14 @@ jobs: latest_tag_version=$latest_tag # Extract the version from both Cargo.toml in the PR branch - pr_version_sargon=$(grep '^version' crates/sargon/Cargo.toml | sed 's/version = "\(.*\)"/\1/') - pr_version_sargon_uniffi=$(grep '^version' crates/sargon-uniffi/Cargo.toml | sed 's/version = "\(.*\)"/\1/') + pr_version_sargon_uniffi=$(grep '^version' crates/uniffi/uniffi_SPLIT_ME/Cargo.toml | sed 's/version = "\(.*\)"/\1/') echo "Latest tag version: $latest_tag_version" - echo "PR version sargon: $pr_version_sargon" echo "PR version sargon-uniffi: $pr_version_sargon_uniffi" - - # Check if sargon and sargon-uniffi versions match - if [ "$pr_version_sargon" != "$pr_version_sargon_uniffi" ]; then - echo "Error: sargon version ($pr_version_sargon) does not match sargon-uniffi version ($pr_version_sargon_uniffi)." - exit 1 - fi - + # Split the versions into major, minor, and patch components IFS='.' read -r -a tag_version_parts <<< "$latest_tag_version" - IFS='.' read -r -a pr_version_parts <<< "$pr_version_sargon" + IFS='.' read -r -a pr_version_parts <<< "$pr_version_sargon_uniffi" major_diff=$((pr_version_parts[0] - tag_version_parts[0])) minor_diff=$((pr_version_parts[1] - tag_version_parts[1])) diff --git a/crates/sargon_SPLIT_ME/src/Package.swift b/crates/Package.swift similarity index 100% rename from crates/sargon_SPLIT_ME/src/Package.swift rename to crates/Package.swift From ed1ea7e713d8d561d0bdd3eeac446cc16887e292 Mon Sep 17 00:00:00 2001 From: Alexander Cyon <116169792+CyonAlexRDX@users.noreply.github.com> Date: Sun, 5 Jan 2025 21:39:38 +0100 Subject: [PATCH 12/13] Split `sargon` crate => `app/home-cards`, `radix-connect`, `security-center`, `signing` & account, persona (#330) --- Cargo.lock | 319 ++++- Cargo.toml | 32 +- crates/app/home-cards/Cargo.toml | 31 + .../deferred_deep_link_method.rs | 0 .../deferred_deep_link_special_dapp.rs | 0 .../home-cards/src}/deferred_deep_link/mod.rs | 0 .../onboarding_deep_link_value.rs | 0 .../src}/deferred_deep_link/parser.rs | 1 + .../home-cards/src}/home_card.rs | 0 .../home-cards/src}/home_cards.rs | 0 crates/app/home-cards/src/lib.rs | 34 + .../home-cards/src}/manager.rs | 5 +- .../home-cards/src}/observer.rs | 0 .../home-cards/src}/storage.rs | 0 crates/app/radix-connect-models/Cargo.toml | 20 + .../src}/auth_challenge_nonce.rs | 0 .../dapp_metadata/interaction_metadata.rs | 0 .../interaction_metadata_unvalidated.rs | 0 .../src}/dapp_metadata/mod.rs | 2 - .../src}/interaction_version.rs | 0 crates/app/radix-connect-models/src/lib.rs | 17 + .../radix-connect-models/src}/origin.rs | 0 crates/app/radix-connect/Cargo.toml | 41 + crates/app/radix-connect/build.rs | 20 + .../fixtures/models/well_known.json | 0 .../vector/deep_link_request_params.json | 0 .../radix-connect/src}/interaction_id.rs | 0 crates/app/radix-connect/src/lib.rs | 56 + .../radix-connect/src}/mobile/client.rs | 1 + .../src}/mobile/deep_link_parsing/mod.rs | 0 .../src}/mobile/deep_link_parsing/parser.rs | 0 .../src}/mobile/deep_link_parsing/request.rs | 0 .../radix-connect/src}/mobile/mod.rs | 0 .../src}/mobile/relay_service/mod.rs | 0 .../src}/mobile/relay_service/service.rs | 3 + .../mobile/relay_service/success_response.rs | 0 .../radix-connect/src}/mobile/session/mod.rs | 0 .../src}/mobile/session/session.rs | 0 .../src}/mobile/session/session_id.rs | 0 .../src}/mobile/session/session_origin.rs | 0 .../src}/mobile/session_dapp_request.rs | 0 .../src}/mobile/session_storage.rs | 0 .../src}/mobile/session_wallet_response.rs | 0 .../src}/p2p_links/link_connection_qr_data.rs | 0 .../radix-connect/src}/p2p_links/mod.rs | 0 .../radix-connect/src}/p2p_links/p2p_link.rs | 0 .../radix-connect/src}/p2p_links/p2p_links.rs | 0 .../src}/p2p_links/radix_connect_password.rs | 0 .../src}/p2p_links/radix_connect_purpose.rs | 0 .../radix-connect/src}/wallet_account.rs | 0 .../dapp_to_wallet/interaction.rs | 0 .../dapp_to_wallet/interaction_items/items.rs | 0 .../dapp_to_wallet/interaction_items/mod.rs | 0 .../expiration/after_delay.rs | 0 .../pre_authorization/expiration/at_time.rs | 0 .../expiration/expiration.rs | 0 .../pre_authorization/expiration/mod.rs | 0 .../pre_authorization/expiration/status.rs | 0 .../pre_authorization/mod.rs | 0 .../pre_authorization/pre_authorization.rs | 0 .../pre_authorization/subintent.rs | 0 .../unvalidated_subintent_manifest.rs | 0 .../interaction_items/request/auth/auth.rs | 0 .../request/auth/login_with_challenge.rs | 0 .../interaction_items/request/auth/mod.rs | 0 .../request/auth/use_persona.rs | 0 .../request/authorized_request.rs | 0 .../request/entity/accounts.rs | 0 .../interaction_items/request/entity/mod.rs | 0 .../request/entity/persona_data.rs | 0 .../request/entity/proof_of_ownership.rs | 0 .../interaction_items/request/entity/reset.rs | 0 .../interaction_items/request/mod.rs | 0 .../request/unauthorized_request.rs | 0 .../interaction_items/transaction/mod.rs | 0 .../transaction/transaction.rs | 0 .../dapp_to_wallet/interaction_unvalidated.rs | 0 .../dapp_to_wallet/mod.rs | 4 - .../dapp_wallet_interaction/mod.rs | 0 .../failure_response/error_type.rs | 0 .../failure_response/failure.rs | 0 .../wallet_to_dapp/failure_response/mod.rs | 0 .../wallet_to_dapp/mod.rs | 0 .../wallet_to_dapp/response.rs | 0 .../success_response/account/account_proof.rs | 0 .../success_response/account/accounts.rs | 0 .../success_response/account/mod.rs | 0 .../success_response/auth/auth.rs | 0 .../auth/auth_login_with_challenge.rs | 0 .../auth/auth_login_without_challenge.rs | 0 .../success_response/auth/auth_proof.rs | 0 .../success_response/auth/auth_use_persona.rs | 0 .../success_response/auth/mod.rs | 0 .../success_response/authorized_request.rs | 0 .../wallet_to_dapp/success_response/items.rs | 0 .../wallet_to_dapp/success_response/mod.rs | 0 .../success_response/persona/mod.rs | 0 .../success_response/persona/persona_proof.rs | 0 .../success_response/persona_data/mod.rs | 0 .../persona_data/persona_data.rs | 0 .../success_response/pre_authorization/mod.rs | 0 .../pre_authorization/pre_authorization.rs | 0 .../pre_authorization/subintent_response.rs | 2 + .../proof_of_ownership/mod.rs | 0 .../proof_of_ownership/proof.rs | 0 .../proof_of_ownership/proof_of_ownership.rs | 0 .../success_response/success.rs | 0 .../success_response/transaction/mod.rs | 0 .../transaction/transaction.rs | 2 + .../success_response/unauthorized_request.rs | 0 .../src}/wallet_interaction/mod.rs | 0 .../radix-connect/src}/wallet_persona.rs | 0 .../src}/well_known_client/client.rs | 4 + .../src}/well_known_client/mod.rs | 0 .../models/dapp_definition.rs | 0 .../models/dapp_well_known_data.rs | 0 .../src}/well_known_client/models/mod.rs | 0 crates/app/security-center/Cargo.toml | 19 + .../security-center/src}/client.rs | 0 crates/app/security-center/src/lib.rs | 19 + .../security-center/src}/security_problem.rs | 0 .../src}/security_problem_kind.rs | 0 .../support/addresses_entities_bad_state.rs | 0 .../src}/support/backup_result.rs | 0 .../security-center/src}/support/input.rs | 0 .../security-center/src}/support/mod.rs | 0 crates/app/signing/Cargo.toml | 42 + crates/app/signing/build.rs | 14 + .../rola_challenge_payload_hash_vectors.json | 0 .../src}/authentication/auth_intent.rs | 0 .../src}/authentication/auth_intent_hash.rs | 2 + .../signing/src}/authentication/mod.rs | 0 .../src}/authentication/signed_auth_intent.rs | 0 ...instances_required_to_sign_transactions.rs | 96 +- .../signing/src}/collector/mod.rs | 2 +- .../signatures_collecting_continuation.rs | 0 .../src}/collector/signatures_collector.rs | 1197 ++-------------- .../signatures_collector_dependencies.rs | 0 .../signatures_collector_preprocessor.rs | 9 +- .../collector/signatures_collector_state.rs | 0 .../signing_finish_early_strategy.rs | 0 .../extractor_of_entities_requiring_auth.rs | 44 + .../signing/src}/host_interaction/mod.rs | 0 .../src}/host_interaction/sign_interactor.rs | 0 .../src}/host_interaction/sign_request.rs | 0 .../src}/host_interaction/sign_response.rs | 0 .../transaction_sign_request_input.rs | 0 crates/app/signing/src/lib.rs | 59 + .../signing/src}/petition_types/mod.rs | 6 +- .../petition_types/petition_for_entity.rs | 13 +- .../factor_source_referencing.rs | 0 .../petition_for_factors_types/mod.rs | 0 .../neglected_factor_instance.rs | 0 .../petition_for_factors/mod.rs | 0 .../petition_for_factors.rs | 0 .../petition_for_factors_input.rs | 0 .../petition_for_factors_state.rs | 6 +- .../petition_for_factors_state_snapshot.rs | 0 .../petition_for_factors_status.rs | 0 .../petition_for_factors_sub_state.rs | 0 .../petition_for_transaction.rs | 8 +- .../src}/petition_types/petition_status.rs | 0 .../signing/src}/petition_types/petitions.rs | 5 +- .../src}/petition_types/signing_purpose.rs | 0 .../signing/src}/signable_with_entities.rs | 4 +- .../signing/src}/signables/mod.rs | 0 .../signing/src}/signables/signable.rs | 4 +- .../src}/signables/signable_auth_intent.rs | 27 +- .../src}/signables/signable_subintent.rs | 4 +- .../signables/signable_transaction_intent.rs | 4 +- .../maybe_signed_transactions.rs | 11 +- .../src/signatures_outcome_types}/mod.rs | 0 .../petition_transaction_outcome.rs | 0 .../sign_with_factors_outcome.rs | 2 +- .../signatures_outcome.rs | 8 +- .../signing/src/testing/interactors/mod.rs | 7 + .../testing/interactors/test_interactor.rs | 0 .../interactors/test_sign_interactor.rs | 8 +- crates/app/signing/src/testing/mod.rs | 9 + .../signing/src}/testing/simulated_user.rs | 29 +- .../src}/testing/test_signatures_collector.rs | 0 .../signing}/src/types/hd_signature.rs | 8 +- .../signing}/src/types/hd_signature_input.rs | 0 .../types/invalid_transaction_if_neglected.rs | 0 .../signing}/src/types/mod.rs | 0 .../signing}/src/types/owned_types/mod.rs | 0 .../signing}/src/types/owned_types/owned.rs | 0 .../owned_types/owned_factor_instance.rs | 0 crates/common/short-string/Cargo.toml | 2 +- .../common/short-string/src/display_name.rs | 2 +- .../src/has_indexed_sample_values.rs | 4 + .../src/has_many_sample_values.rs | 4 + crates/core/has-sample-values/src/lib.rs | 4 + crates/core/misc/Cargo.toml | 2 +- crates/core/misc/src/image_url_utils.rs | 2 +- crates/core/utils/Cargo.toml | 2 +- crates/crypto/addresses/Cargo.toml | 3 +- .../address/legacy_olympia_account_address.rs | 2 +- .../src/address/non_fungible_global_id.rs | 2 +- .../src/address/non_fungible_local_id.rs | 2 +- .../addresses/src/address/wrap_ret_address.rs | 2 +- crates/crypto/addresses/src/lib.rs | 2 +- crates/crypto/cap26-models/Cargo.toml | 25 + .../src/enums}/cap26_entity_kind.rs | 8 - .../src/enums}/cap26_key_kind.rs | 8 - crates/crypto/cap26-models/src/enums/mod.rs | 30 + crates/crypto/cap26-models/src/lib.rs | 27 + .../src/traits/has_entity_kind.rs | 14 + crates/crypto/cap26-models/src/traits/mod.rs | 3 + crates/crypto/hd/Cargo.toml | 1 + .../crypto/hd/src/bip32/hd_path_component.rs | 16 + crates/crypto/hd/src/cap26/mod.rs | 21 - crates/crypto/hd/src/cap26/paths/traits.rs | 14 - crates/crypto/hd/src/lib.rs | 1 + crates/factors/factors/Cargo.toml | 3 +- .../src/factor_sources/has_factor_sources.rs | 5 + .../ledger_hardware_wallet_model.rs | 2 +- .../factors/factors/src/factor_sources/mod.rs | 2 + crates/factors/factors/src/lib.rs | 1 + .../arculus_card_model.rs | 2 +- crates/factors/instances-provider/Cargo.toml | 2 +- crates/factors/keys-collector/Cargo.toml | 1 + crates/factors/keys-collector/src/lib.rs | 1 + .../src/tests/derivation_tests.rs | 5 +- .../Cargo.toml | 1 + .../src/lib.rs | 1 + crates/gateway/client-and-api/Cargo.toml | 2 +- crates/gateway/client-and-api/src/lib.rs | 2 +- .../profile/logic/logic_SPLIT_ME/Cargo.toml | 2 + .../src/logic/account/accounts_visibility.rs | 26 +- .../logic_SPLIT_ME/src/logic/account/mod.rs | 1 - .../src/logic/account/query_accounts.rs | 55 - .../logic_SPLIT_ME/src/logic/persona/mod.rs | 1 - .../src/logic/persona/query_personas.rs | 24 +- .../src/logic/profile_network/mod.rs | 2 - .../models/account-or-persona/Cargo.toml | 23 + .../src}/account_or_persona.rs | 167 +++ .../account-or-persona/src/is_entity.rs | 12 + .../models/account-or-persona/src/lib.rs | 17 + crates/profile/models/account/Cargo.toml | 26 + ...controller_address_samples_for_accounts.rs | 18 + .../entity => account/src}/account/account.rs | 143 +- .../entity => account/src}/account/mod.rs | 0 .../src}/account/on_ledger_settings/mod.rs | 0 .../on_ledger_settings/on_ledger_settings.rs | 0 .../account/src/account_address_samples.rs | 23 + .../src}/account_samples.rs | 43 +- crates/profile/models/account/src/lib.rs | 30 + crates/profile/models/base-entity/Cargo.toml | 28 + .../src/base_entity}/abstract_entity_type.rs | 0 .../src/base_entity/base_entity.rs | 65 + .../src/base_entity/has_security_state.rs | 55 + .../src/base_entity/is_base_entity.rs} | 6 +- .../models/base-entity/src/base_entity/mod.rs | 10 + .../src/entity_flags}/entity_flag.rs | 0 .../src/entity_flags}/entity_flags.rs | 1 + .../base-entity/src/entity_flags/mod.rs | 5 + .../entity_security_state.rs | 2 + .../src}/entity_security_state/mod.rs | 2 + .../provisional_securified_config.rs | 0 ...ovisional_securified_transaction_queued.rs | 0 .../secured_entity_control/mod.rs | 0 .../secured_entity_control.rs | 0 .../unsecured_entity_control.rs | 0 crates/profile/models/base-entity/src/lib.rs | 33 + crates/profile/models/persona-data/Cargo.toml | 24 + crates/profile/models/persona-data/src/lib.rs | 29 + .../collection_of_email_addresses.rs | 0 .../collection_of_phone_numbers.rs | 0 .../src}/persona_data/entry_kinds/mod.rs | 0 .../persona_data_entry_email_address.rs | 0 .../entry_kinds/persona_data_entry_name.rs | 0 .../persona_data_entry_phone_number.rs | 0 .../src}/persona_data/mod.rs | 0 .../src}/persona_data/persona_data.rs | 0 .../persona_data/persona_data_entry_id.rs | 0 ...ersona_data_identified_collection_types.rs | 0 .../persona_data_identified_entry_types.rs | 10 +- .../src/shared_persona_data/mod.rs | 11 + .../persona_data_shared.rs | 15 + .../shared_persona_data.rs | 0 ..._to_dapp_with_persona_account_addresses.rs | 6 +- ...ith_persona_ids_of_persona_data_entries.rs | 0 .../shared_persona_data}/shared_with_dapp.rs | 0 crates/profile/models/persona/Cargo.toml | 27 + ...ontroller_address_samples_for_personas.rs} | 17 - .../src}/identity_address_samples.rs | 16 +- crates/profile/models/persona/src/lib.rs | 24 + .../entity/persona => persona/src}/persona.rs | 112 +- .../src}/persona_samples.rs | 41 +- .../models/profile_SPLIT_ME/Cargo.toml | 6 + .../models/profile_SPLIT_ME/src/lib.rs | 24 +- .../src/samples/account_address_samples.rs | 13 - .../profile_SPLIT_ME/src/samples/mod.rs | 8 - .../src/supporting_types/mod.rs | 2 - .../src/v100/entity/has_security_state.rs | 181 --- .../profile_SPLIT_ME/src/v100/entity/mod.rs | 15 - .../src/v100/entity/persona/mod.rs | 5 - .../models/profile_SPLIT_ME/src/v100/mod.rs | 8 +- .../authorized_persona_simple.rs | 14 - .../networks/network/authorized_dapp/mod.rs | 8 - .../profile_SPLIT_ME/src/v100/profile.rs | 48 + .../src/v100}/profile_network_get_entities.rs | 39 + .../models/security-structures/Cargo.toml | 4 +- .../models/security-structures/src/lib.rs | 3 +- .../models/supporting-types/Cargo.toml | 2 + .../traits/entity-by-address/Cargo.toml | 19 + .../src/entity_by_address.rs | 29 + .../traits/entity-by-address/src/lib.rs | 13 + crates/sargon_SPLIT_ME/Cargo.toml | 7 +- crates/sargon_SPLIT_ME/build.rs | 12 - .../src/{system => }/bios/bios.rs | 0 .../src/{system => }/bios/mod.rs | 0 crates/sargon_SPLIT_ME/src/home_cards/mod.rs | 13 - .../{system => }/interactors/interactors.rs | 0 .../src/{system => }/interactors/mod.rs | 0 .../{system => }/interactors/testing/mod.rs | 0 .../test_use_factor_sources_interactors.rs | 0 .../use_factor_sources_interactor.rs | 0 crates/sargon_SPLIT_ME/src/lib.rs | 40 +- .../sargon_SPLIT_ME/src/radix_connect/mod.rs | 19 - .../sargon_os/delete_account/mod.rs | 0 .../sargon_os_delete_account.rs | 0 .../sargon_os/delete_account/support/mod.rs | 0 .../delete_account/support/outcome.rs | 0 ...th_factor_source_and_derivation_outcome.rs | 0 .../factor_instances_provider_unit_tests.rs | 0 .../src/{system => }/sargon_os/mod.rs | 0 .../sargon_os/pre_authorization/mod.rs | 0 .../sargon_os_create_subintent.rs | 0 .../sargon_os_pre_authorization_status.rs | 0 .../pre_authorization/support/mod.rs | 0 .../support/pre_authorization_status.rs | 0 .../sargon_os/profile_state_holder.rs | 10 +- .../src/{system => }/sargon_os/sargon_os.rs | 1 + .../sargon_os/sargon_os_accounts.rs | 3 + ...gon_os_entities_linked_to_factor_source.rs | 0 .../sargon_os/sargon_os_factors.rs | 0 .../sargon_os/sargon_os_gateway.rs | 0 .../sargon_os/sargon_os_personas.rs | 3 + .../sargon_os/sargon_os_profile.rs | 0 .../sargon_os/sargon_os_security_center.rs | 0 .../sargon_os_security_structures.rs | 0 .../sargon_os/sargon_os_signing.rs | 1 + .../sargon_os/sargon_os_sync_accounts.rs | 0 .../sargon_os/transactions/mod.rs | 0 .../sargon_os_transaction_analysis.rs | 0 .../sargon_os_transaction_status.rs | 0 .../sargon_os_transaction_submit.rs | 0 .../sargon_os/transactions/support/mod.rs | 0 .../support/pre_auth_to_review.rs | 0 .../support/signable_manifest_summary.rs | 9 +- .../support/transaction_to_review.rs | 0 .../src/security_center/mod.rs | 9 - .../extractor_of_entities_requiring_auth.rs | 138 -- crates/sargon_SPLIT_ME/src/signing/mod.rs | 23 - .../src/signing/testing/interactors/mod.rs | 8 - .../src/signing/testing/mod.rs | 9 - .../src/{system => }/subsystems/README.md | 0 .../subsystems/log_system/log_system.rs | 0 .../{system => }/subsystems/log_system/mod.rs | 0 .../src/{system => }/subsystems/mod.rs | 0 crates/sargon_SPLIT_ME/src/system/mod.rs | 10 - .../test_diagnose_instance_duplicates.rs | 0 .../sargon_SPLIT_ME/tests/integration/main.rs | 1237 ++++++++++++++++- crates/sargon_SPLIT_ME/tests/vectors/main.rs | 4 +- crates/system/clients/http/Cargo.toml | 2 +- crates/system/clients/http/src/lib.rs | 2 +- crates/transaction/manifests/Cargo.toml | 4 +- crates/transaction/manifests/src/lib.rs | 11 +- crates/transaction/models/Cargo.toml | 2 +- .../transaction_hashes/transaction_hashes.rs | 2 +- .../models/src/profile_models/deposit_rule.rs | 2 +- crates/uniffi/uniffi_SPLIT_ME/Cargo.toml | 3 + .../profile/v100/entity/account/account.rs | 36 +- .../profile/v100/entity/persona/persona.rs | 34 +- 376 files changed, 3549 insertions(+), 2191 deletions(-) create mode 100644 crates/app/home-cards/Cargo.toml rename crates/{sargon_SPLIT_ME/src/home_cards => app/home-cards/src}/deferred_deep_link/deferred_deep_link_method.rs (100%) rename crates/{sargon_SPLIT_ME/src/home_cards => app/home-cards/src}/deferred_deep_link/deferred_deep_link_special_dapp.rs (100%) rename crates/{sargon_SPLIT_ME/src/home_cards => app/home-cards/src}/deferred_deep_link/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/home_cards => app/home-cards/src}/deferred_deep_link/onboarding_deep_link_value.rs (100%) rename crates/{sargon_SPLIT_ME/src/home_cards => app/home-cards/src}/deferred_deep_link/parser.rs (99%) rename crates/{sargon_SPLIT_ME/src/home_cards => app/home-cards/src}/home_card.rs (100%) rename crates/{sargon_SPLIT_ME/src/home_cards => app/home-cards/src}/home_cards.rs (100%) create mode 100644 crates/app/home-cards/src/lib.rs rename crates/{sargon_SPLIT_ME/src/home_cards => app/home-cards/src}/manager.rs (99%) rename crates/{sargon_SPLIT_ME/src/home_cards => app/home-cards/src}/observer.rs (100%) rename crates/{sargon_SPLIT_ME/src/home_cards => app/home-cards/src}/storage.rs (100%) create mode 100644 crates/app/radix-connect-models/Cargo.toml rename crates/{sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet => app/radix-connect-models/src}/auth_challenge_nonce.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet => app/radix-connect-models/src}/dapp_metadata/interaction_metadata.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet => app/radix-connect-models/src}/dapp_metadata/interaction_metadata_unvalidated.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet => app/radix-connect-models/src}/dapp_metadata/mod.rs (82%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect-models/src}/interaction_version.rs (100%) create mode 100644 crates/app/radix-connect-models/src/lib.rs rename crates/{sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata => app/radix-connect-models/src}/origin.rs (100%) create mode 100644 crates/app/radix-connect/Cargo.toml create mode 100644 crates/app/radix-connect/build.rs rename crates/{sargon_SPLIT_ME => app/radix-connect}/fixtures/models/well_known.json (100%) rename crates/{sargon_SPLIT_ME => app/radix-connect}/fixtures/vector/deep_link_request_params.json (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/interaction_id.rs (100%) create mode 100644 crates/app/radix-connect/src/lib.rs rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/mobile/client.rs (99%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/mobile/deep_link_parsing/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/mobile/deep_link_parsing/parser.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/mobile/deep_link_parsing/request.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/mobile/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/mobile/relay_service/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/mobile/relay_service/service.rs (98%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/mobile/relay_service/success_response.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/mobile/session/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/mobile/session/session.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/mobile/session/session_id.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/mobile/session/session_origin.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/mobile/session_dapp_request.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/mobile/session_storage.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/mobile/session_wallet_response.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/p2p_links/link_connection_qr_data.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/p2p_links/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/p2p_links/p2p_link.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/p2p_links/p2p_links.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/p2p_links/radix_connect_password.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/p2p_links/radix_connect_purpose.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_account.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/items.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/after_delay.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/at_time.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/expiration.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/status.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/pre_authorization.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/subintent.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/unvalidated_subintent_manifest.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/auth.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/login_with_challenge.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/use_persona.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/authorized_request.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/accounts.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/persona_data.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/proof_of_ownership.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/reset.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/unauthorized_request.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/transaction.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_unvalidated.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/mod.rs (60%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/error_type.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/failure.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/response.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/account_proof.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/accounts.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_login_with_challenge.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_login_without_challenge.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_proof.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_use_persona.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/authorized_request.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/items.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona/persona_proof.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona_data/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona_data/persona_data.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/pre_authorization.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/subintent_response.rs (99%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/proof.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/proof_of_ownership.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/success.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/transaction.rs (98%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/unauthorized_request.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_interaction/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/wallet_persona.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/well_known_client/client.rs (96%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/well_known_client/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/well_known_client/models/dapp_definition.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/well_known_client/models/dapp_well_known_data.rs (100%) rename crates/{sargon_SPLIT_ME/src/radix_connect => app/radix-connect/src}/well_known_client/models/mod.rs (100%) create mode 100644 crates/app/security-center/Cargo.toml rename crates/{sargon_SPLIT_ME/src/security_center => app/security-center/src}/client.rs (100%) create mode 100644 crates/app/security-center/src/lib.rs rename crates/{sargon_SPLIT_ME/src/security_center => app/security-center/src}/security_problem.rs (100%) rename crates/{sargon_SPLIT_ME/src/security_center => app/security-center/src}/security_problem_kind.rs (100%) rename crates/{sargon_SPLIT_ME/src/security_center => app/security-center/src}/support/addresses_entities_bad_state.rs (100%) rename crates/{sargon_SPLIT_ME/src/security_center => app/security-center/src}/support/backup_result.rs (100%) rename crates/{sargon_SPLIT_ME/src/security_center => app/security-center/src}/support/input.rs (100%) rename crates/{sargon_SPLIT_ME/src/security_center => app/security-center/src}/support/mod.rs (100%) create mode 100644 crates/app/signing/Cargo.toml create mode 100644 crates/app/signing/build.rs rename crates/{sargon_SPLIT_ME => app/signing}/fixtures/vector/rola_challenge_payload_hash_vectors.json (100%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/authentication/auth_intent.rs (100%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/authentication/auth_intent_hash.rs (99%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/authentication/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/authentication/signed_auth_intent.rs (100%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/collector/extractor_of_instances_required_to_sign_transactions.rs (62%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/collector/mod.rs (86%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/collector/signatures_collecting_continuation.rs (100%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/collector/signatures_collector.rs (60%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/collector/signatures_collector_dependencies.rs (100%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/collector/signatures_collector_preprocessor.rs (94%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/collector/signatures_collector_state.rs (100%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/collector/signing_finish_early_strategy.rs (100%) create mode 100644 crates/app/signing/src/extractor_of_entities_requiring_auth.rs rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/host_interaction/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/host_interaction/sign_interactor.rs (100%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/host_interaction/sign_request.rs (100%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/host_interaction/sign_response.rs (100%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/host_interaction/transaction_sign_request_input.rs (100%) create mode 100644 crates/app/signing/src/lib.rs rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/petition_types/mod.rs (68%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/petition_types/petition_for_entity.rs (98%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/petition_types/petition_for_factors_types/factor_source_referencing.rs (100%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/petition_types/petition_for_factors_types/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/petition_types/petition_for_factors_types/neglected_factor_instance.rs (100%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/petition_types/petition_for_factors_types/petition_for_factors/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors.rs (100%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_input.rs (100%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state.rs (97%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state_snapshot.rs (100%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_status.rs (100%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_sub_state.rs (100%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/petition_types/petition_for_transaction.rs (98%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/petition_types/petition_status.rs (100%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/petition_types/petitions.rs (98%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/petition_types/signing_purpose.rs (100%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/signable_with_entities.rs (94%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/signables/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/signables/signable.rs (98%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/signables/signable_auth_intent.rs (89%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/signables/signable_subintent.rs (96%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/signables/signable_transaction_intent.rs (96%) rename crates/{sargon_SPLIT_ME/src/signing/signatures_outecome_types => app/signing/src/signatures_outcome_types}/maybe_signed_transactions.rs (97%) rename crates/{sargon_SPLIT_ME/src/signing/signatures_outecome_types => app/signing/src/signatures_outcome_types}/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/signing/signatures_outecome_types => app/signing/src/signatures_outcome_types}/petition_transaction_outcome.rs (100%) rename crates/{sargon_SPLIT_ME/src/signing/signatures_outecome_types => app/signing/src/signatures_outcome_types}/sign_with_factors_outcome.rs (99%) rename crates/{sargon_SPLIT_ME/src/signing/signatures_outecome_types => app/signing/src/signatures_outcome_types}/signatures_outcome.rs (95%) create mode 100644 crates/app/signing/src/testing/interactors/mod.rs rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/testing/interactors/test_interactor.rs (100%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/testing/interactors/test_sign_interactor.rs (89%) create mode 100644 crates/app/signing/src/testing/mod.rs rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/testing/simulated_user.rs (91%) rename crates/{sargon_SPLIT_ME/src/signing => app/signing/src}/testing/test_signatures_collector.rs (100%) rename crates/{sargon_SPLIT_ME => app/signing}/src/types/hd_signature.rs (95%) rename crates/{sargon_SPLIT_ME => app/signing}/src/types/hd_signature_input.rs (100%) rename crates/{sargon_SPLIT_ME => app/signing}/src/types/invalid_transaction_if_neglected.rs (100%) rename crates/{sargon_SPLIT_ME => app/signing}/src/types/mod.rs (100%) rename crates/{sargon_SPLIT_ME => app/signing}/src/types/owned_types/mod.rs (100%) rename crates/{sargon_SPLIT_ME => app/signing}/src/types/owned_types/owned.rs (100%) rename crates/{sargon_SPLIT_ME => app/signing}/src/types/owned_types/owned_factor_instance.rs (100%) create mode 100644 crates/core/has-sample-values/src/has_indexed_sample_values.rs create mode 100644 crates/core/has-sample-values/src/has_many_sample_values.rs create mode 100644 crates/crypto/cap26-models/Cargo.toml rename crates/crypto/{hd/src/cap26 => cap26-models/src/enums}/cap26_entity_kind.rs (92%) rename crates/crypto/{hd/src/cap26 => cap26-models/src/enums}/cap26_key_kind.rs (92%) create mode 100644 crates/crypto/cap26-models/src/enums/mod.rs create mode 100644 crates/crypto/cap26-models/src/lib.rs create mode 100644 crates/crypto/cap26-models/src/traits/has_entity_kind.rs create mode 100644 crates/crypto/cap26-models/src/traits/mod.rs create mode 100644 crates/factors/factors/src/factor_sources/has_factor_sources.rs create mode 100644 crates/profile/models/account-or-persona/Cargo.toml rename crates/profile/models/{profile_SPLIT_ME/src/supporting_types => account-or-persona/src}/account_or_persona.rs (58%) create mode 100644 crates/profile/models/account-or-persona/src/is_entity.rs create mode 100644 crates/profile/models/account-or-persona/src/lib.rs create mode 100644 crates/profile/models/account/Cargo.toml create mode 100644 crates/profile/models/account/src/access_controller_address_samples_for_accounts.rs rename crates/profile/models/{profile_SPLIT_ME/src/v100/entity => account/src}/account/account.rs (89%) rename crates/profile/models/{profile_SPLIT_ME/src/v100/entity => account/src}/account/mod.rs (100%) rename crates/profile/models/{profile_SPLIT_ME/src/v100/entity => account/src}/account/on_ledger_settings/mod.rs (100%) rename crates/profile/models/{profile_SPLIT_ME/src/v100/entity => account/src}/account/on_ledger_settings/on_ledger_settings.rs (100%) create mode 100644 crates/profile/models/account/src/account_address_samples.rs rename crates/profile/models/{profile_SPLIT_ME/src/samples => account/src}/account_samples.rs (90%) create mode 100644 crates/profile/models/account/src/lib.rs create mode 100644 crates/profile/models/base-entity/Cargo.toml rename crates/profile/models/{profile_SPLIT_ME/src/v100/entity => base-entity/src/base_entity}/abstract_entity_type.rs (100%) create mode 100644 crates/profile/models/base-entity/src/base_entity/base_entity.rs create mode 100644 crates/profile/models/base-entity/src/base_entity/has_security_state.rs rename crates/profile/models/{profile_SPLIT_ME/src/v100/entity/is_entity.rs => base-entity/src/base_entity/is_base_entity.rs} (90%) create mode 100644 crates/profile/models/base-entity/src/base_entity/mod.rs rename crates/profile/models/{profile_SPLIT_ME/src/v100/entity => base-entity/src/entity_flags}/entity_flag.rs (100%) rename crates/profile/models/{profile_SPLIT_ME/src/v100/entity => base-entity/src/entity_flags}/entity_flags.rs (99%) create mode 100644 crates/profile/models/base-entity/src/entity_flags/mod.rs rename crates/profile/models/{profile_SPLIT_ME/src/v100 => base-entity/src}/entity_security_state/entity_security_state.rs (99%) rename crates/profile/models/{profile_SPLIT_ME/src/v100 => base-entity/src}/entity_security_state/mod.rs (82%) rename crates/profile/models/{profile_SPLIT_ME/src/v100 => base-entity/src}/entity_security_state/provisional_securified_config.rs (100%) rename crates/profile/models/{profile_SPLIT_ME/src/v100 => base-entity/src}/entity_security_state/provisional_securified_transaction_queued.rs (100%) rename crates/profile/models/{profile_SPLIT_ME/src/v100 => base-entity/src/entity_security_state}/secured_entity_control/mod.rs (100%) rename crates/profile/models/{profile_SPLIT_ME/src/v100 => base-entity/src/entity_security_state}/secured_entity_control/secured_entity_control.rs (100%) rename crates/profile/models/{profile_SPLIT_ME/src/v100 => base-entity/src}/entity_security_state/unsecured_entity_control.rs (100%) create mode 100644 crates/profile/models/base-entity/src/lib.rs create mode 100644 crates/profile/models/persona-data/Cargo.toml create mode 100644 crates/profile/models/persona-data/src/lib.rs rename crates/profile/models/{profile_SPLIT_ME/src/v100/entity/persona => persona-data/src}/persona_data/collection_of_email_addresses.rs (100%) rename crates/profile/models/{profile_SPLIT_ME/src/v100/entity/persona => persona-data/src}/persona_data/collection_of_phone_numbers.rs (100%) rename crates/profile/models/{profile_SPLIT_ME/src/v100/entity/persona => persona-data/src}/persona_data/entry_kinds/mod.rs (100%) rename crates/profile/models/{profile_SPLIT_ME/src/v100/entity/persona => persona-data/src}/persona_data/entry_kinds/persona_data_entry_email_address.rs (100%) rename crates/profile/models/{profile_SPLIT_ME/src/v100/entity/persona => persona-data/src}/persona_data/entry_kinds/persona_data_entry_name.rs (100%) rename crates/profile/models/{profile_SPLIT_ME/src/v100/entity/persona => persona-data/src}/persona_data/entry_kinds/persona_data_entry_phone_number.rs (100%) rename crates/profile/models/{profile_SPLIT_ME/src/v100/entity/persona => persona-data/src}/persona_data/mod.rs (100%) rename crates/profile/models/{profile_SPLIT_ME/src/v100/entity/persona => persona-data/src}/persona_data/persona_data.rs (100%) rename crates/profile/models/{profile_SPLIT_ME/src/v100/entity/persona => persona-data/src}/persona_data/persona_data_entry_id.rs (100%) rename crates/profile/models/{profile_SPLIT_ME/src/v100/entity/persona => persona-data/src}/persona_data/persona_data_identified_collection_types.rs (100%) rename crates/profile/models/{profile_SPLIT_ME/src/v100/entity/persona => persona-data/src}/persona_data/persona_data_identified_entry_types.rs (99%) create mode 100644 crates/profile/models/persona-data/src/shared_persona_data/mod.rs create mode 100644 crates/profile/models/persona-data/src/shared_persona_data/persona_data_shared.rs rename crates/profile/models/{profile_SPLIT_ME/src/v100/networks/network/authorized_dapp => persona-data/src/shared_persona_data}/shared_persona_data.rs (100%) rename crates/profile/models/{profile_SPLIT_ME/src/v100/networks/network/authorized_dapp => persona-data/src/shared_persona_data}/shared_to_dapp_with_persona_account_addresses.rs (85%) rename crates/profile/models/{profile_SPLIT_ME/src/v100/networks/network/authorized_dapp => persona-data/src/shared_persona_data}/shared_to_dapp_with_persona_ids_of_persona_data_entries.rs (100%) rename crates/profile/models/{profile_SPLIT_ME/src/v100/networks/network/authorized_dapp => persona-data/src/shared_persona_data}/shared_with_dapp.rs (100%) create mode 100644 crates/profile/models/persona/Cargo.toml rename crates/profile/models/{profile_SPLIT_ME/src/samples/access_controller_address_samples.rs => persona/src/access_controller_address_samples_for_personas.rs} (51%) rename crates/profile/models/{profile_SPLIT_ME/src/samples => persona/src}/identity_address_samples.rs (63%) create mode 100644 crates/profile/models/persona/src/lib.rs rename crates/profile/models/{profile_SPLIT_ME/src/v100/entity/persona => persona/src}/persona.rs (91%) rename crates/profile/models/{profile_SPLIT_ME/src/samples => persona/src}/persona_samples.rs (92%) delete mode 100644 crates/profile/models/profile_SPLIT_ME/src/samples/account_address_samples.rs delete mode 100644 crates/profile/models/profile_SPLIT_ME/src/v100/entity/has_security_state.rs delete mode 100644 crates/profile/models/profile_SPLIT_ME/src/v100/entity/mod.rs delete mode 100644 crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/mod.rs rename crates/profile/{logic/logic_SPLIT_ME/src/logic/profile_network => models/profile_SPLIT_ME/src/v100}/profile_network_get_entities.rs (81%) create mode 100644 crates/profile/traits/entity-by-address/Cargo.toml create mode 100644 crates/profile/traits/entity-by-address/src/entity_by_address.rs create mode 100644 crates/profile/traits/entity-by-address/src/lib.rs rename crates/sargon_SPLIT_ME/src/{system => }/bios/bios.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/bios/mod.rs (100%) delete mode 100644 crates/sargon_SPLIT_ME/src/home_cards/mod.rs rename crates/sargon_SPLIT_ME/src/{system => }/interactors/interactors.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/interactors/mod.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/interactors/testing/mod.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/interactors/testing/test_use_factor_sources_interactors.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/interactors/use_factor_sources_interactor.rs (100%) delete mode 100644 crates/sargon_SPLIT_ME/src/radix_connect/mod.rs rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/delete_account/mod.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/delete_account/sargon_os_delete_account.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/delete_account/support/mod.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/delete_account/support/outcome.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/entity_creating_with_factor_source_and_derivation_outcome.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/factor_instances_provider_unit_tests.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/mod.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/pre_authorization/mod.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/pre_authorization/sargon_os_create_subintent.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/pre_authorization/sargon_os_pre_authorization_status.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/pre_authorization/support/mod.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/pre_authorization/support/pre_authorization_status.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/profile_state_holder.rs (97%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/sargon_os.rs (99%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/sargon_os_accounts.rs (99%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/sargon_os_entities_linked_to_factor_source.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/sargon_os_factors.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/sargon_os_gateway.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/sargon_os_personas.rs (99%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/sargon_os_profile.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/sargon_os_security_center.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/sargon_os_security_structures.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/sargon_os_signing.rs (99%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/sargon_os_sync_accounts.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/transactions/mod.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/transactions/sargon_os_transaction_analysis.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/transactions/sargon_os_transaction_status.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/transactions/sargon_os_transaction_submit.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/transactions/support/mod.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/transactions/support/pre_auth_to_review.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/transactions/support/signable_manifest_summary.rs (95%) rename crates/sargon_SPLIT_ME/src/{system => }/sargon_os/transactions/support/transaction_to_review.rs (100%) delete mode 100644 crates/sargon_SPLIT_ME/src/security_center/mod.rs delete mode 100644 crates/sargon_SPLIT_ME/src/signing/extractor_of_entities_requiring_auth.rs delete mode 100644 crates/sargon_SPLIT_ME/src/signing/mod.rs delete mode 100644 crates/sargon_SPLIT_ME/src/signing/testing/interactors/mod.rs delete mode 100644 crates/sargon_SPLIT_ME/src/signing/testing/mod.rs rename crates/sargon_SPLIT_ME/src/{system => }/subsystems/README.md (100%) rename crates/sargon_SPLIT_ME/src/{system => }/subsystems/log_system/log_system.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/subsystems/log_system/mod.rs (100%) rename crates/sargon_SPLIT_ME/src/{system => }/subsystems/mod.rs (100%) delete mode 100644 crates/sargon_SPLIT_ME/src/system/mod.rs rename crates/sargon_SPLIT_ME/src/{system => }/test_diagnose_instance_duplicates.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index aae1bdd9c..afe423b65 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -51,6 +51,8 @@ version = "1.1.99" dependencies = [ "assert-json", "bytes 1.1.99", + "cap26-models", + "core-utils", "derive_more", "ecc", "enum-as-inner", @@ -69,7 +71,6 @@ dependencies = [ "radix-engine-interface", "radix-engine-toolkit", "radix-rust", - "sargon-core-utils", "serde", "serde_json 1.0.108", "serde_with 3.4.0", @@ -600,6 +601,22 @@ dependencies = [ "serde", ] +[[package]] +name = "cap26-models" +version = "1.1.99" +dependencies = [ + "assert-json", + "derive_more", + "enum-as-inner", + "error", + "has-sample-values", + "numeric", + "serde", + "serde_json 1.0.108", + "serde_repr", + "strum 0.26.1", +] + [[package]] name = "cargo-platform" version = "0.1.9" @@ -857,6 +874,7 @@ name = "core-misc" version = "1.1.99" dependencies = [ "assert-json", + "core-utils", "derive_more", "error", "has-sample-values", @@ -865,12 +883,25 @@ dependencies = [ "log", "pretty_assertions", "radix-common", - "sargon-core-utils", "serde", "serde_json 1.0.108", "strum 0.26.1", ] +[[package]] +name = "core-utils" +version = "1.1.99" +dependencies = [ + "error", + "iso8601-timestamp", + "log", + "pretty_assertions", + "serde", + "serde_json 1.0.108", + "url", + "uuid 1.6.1", +] + [[package]] name = "cpufeatures" version = "0.2.16" @@ -1228,6 +1259,17 @@ dependencies = [ "zeroize 1.7.0", ] +[[package]] +name = "entity-by-address" +version = "1.1.99" +dependencies = [ + "addresses", + "error", + "profile-account", + "profile-account-or-persona", + "profile-persona", +] + [[package]] name = "entity-foundation" version = "1.1.99" @@ -1363,6 +1405,7 @@ dependencies = [ "addresses", "assert-json", "clients", + "core-utils", "derive_more", "error", "factors", @@ -1375,7 +1418,6 @@ dependencies = [ "profile", "profile-logic", "profile-supporting-types", - "sargon-core-utils", "serde", ] @@ -1384,8 +1426,10 @@ name = "factors" version = "1.1.99" dependencies = [ "bytes 1.1.99", + "cap26-models", "core-collections", "core-misc", + "core-utils", "derive_more", "ecc", "encryption", @@ -1405,7 +1449,6 @@ dependencies = [ "paste 1.0.14", "radix-common", "radix-engine-interface", - "sargon-core-utils", "serde", "serde_json 1.0.108", "serde_with 3.4.0", @@ -1601,13 +1644,13 @@ dependencies = [ "actix-rt", "addresses", "assert-json", + "core-utils", "drivers", "gateway-models", "http-client", "metadata", "profile-gateway", "radix-common", - "sargon-core-utils", "serde", "serde_json 1.0.108", "transaction-models", @@ -1805,6 +1848,7 @@ dependencies = [ "assert-json", "bip39", "bytes 1.1.99", + "cap26-models", "derive_more", "ecc", "enum-as-inner", @@ -1842,6 +1886,31 @@ dependencies = [ "digest", ] +[[package]] +name = "home-cards" +version = "1.1.99" +dependencies = [ + "actix-rt", + "addresses", + "async-trait", + "base64 0.22.1 (git+https://github.com/marshallpierce/rust-base64.git?rev=e14400697453bcc85997119b874bc03d9601d0af)", + "bytes 1.1.99", + "core-utils", + "derive_more", + "drivers", + "enum-as-inner", + "gateway-client-and-api", + "gateway-models", + "identified-vec-of", + "log", + "metadata", + "network", + "paste 1.0.14", + "pretty_assertions", + "serde", + "serde_json 1.0.108", +] + [[package]] name = "host-info" version = "1.1.99" @@ -1894,10 +1963,10 @@ version = "1.1.99" dependencies = [ "actix-rt", "bytes 1.1.99", + "core-utils", "drivers", "error", "reqwest", - "sargon-core-utils", "serde", "serde_json 1.0.108", ] @@ -2310,6 +2379,7 @@ dependencies = [ "actix-rt", "addresses", "async-trait", + "cap26-models", "core-collections", "core-misc", "derive_more", @@ -2396,6 +2466,7 @@ dependencies = [ "account-for-display", "addresses", "cargo_toml 0.15.3 (git+https://gitlab.com/lib.rs/cargo_toml?rev=e498c94fc42a660c1ca1a28999ce1d757cfe77fe)", + "core-utils", "derive_more", "enum-as-inner", "factors", @@ -2407,13 +2478,14 @@ dependencies = [ "paste 1.0.14", "pretty_assertions", "profile", + "profile-account-or-persona", + "profile-base-entity", "radix-common", "radix-engine", "radix-engine-interface", "radix-engine-toolkit", "radix-rust", "radix-transactions", - "sargon-core-utils", "sbor", "serde", "serde_json 1.0.108", @@ -2546,6 +2618,7 @@ version = "1.1.99" dependencies = [ "addresses", "assert-json", + "cap26-models", "derive_more", "enum-iterator", "error", @@ -2891,6 +2964,7 @@ dependencies = [ "core-misc", "derive_more", "encryption", + "entity-by-address", "entity-foundation", "enum-as-inner", "enum-iterator", @@ -2907,7 +2981,12 @@ dependencies = [ "once_cell 1.19.0", "paste 1.0.14", "pretty_assertions", + "profile-account", + "profile-account-or-persona", "profile-app-preferences", + "profile-base-entity", + "profile-persona", + "profile-persona-data", "profile-security-structures", "serde", "serde_json 1.0.108", @@ -2918,6 +2997,41 @@ dependencies = [ "transaction-models", ] +[[package]] +name = "profile-account" +version = "1.1.99" +dependencies = [ + "account-for-display", + "addresses", + "cap26-models", + "derive_more", + "entity-foundation", + "has-sample-values", + "once_cell 1.19.0", + "profile-base-entity", + "profile-security-structures", + "serde", + "serde_json 1.0.108", + "short-string", + "transaction-models", +] + +[[package]] +name = "profile-account-or-persona" +version = "1.1.99" +dependencies = [ + "cap26-models", + "derive_more", + "enum-as-inner", + "hierarchical-deterministic", + "profile-account", + "profile-base-entity", + "profile-persona", + "profile-security-structures", + "serde", + "serde_json 1.0.108", +] + [[package]] name = "profile-app-preferences" version = "1.1.99" @@ -2940,6 +3054,28 @@ dependencies = [ "transaction-models", ] +[[package]] +name = "profile-base-entity" +version = "1.1.99" +dependencies = [ + "addresses", + "derive_more", + "entity-foundation", + "enum-as-inner", + "enum-iterator", + "factors", + "has-sample-values", + "identified-vec-of", + "network", + "paste 1.0.14", + "profile-security-structures", + "serde", + "serde_json 1.0.108", + "short-string", + "strum 0.26.1", + "transaction-models", +] + [[package]] name = "profile-gateway" version = "1.1.99" @@ -2969,6 +3105,7 @@ version = "1.1.99" dependencies = [ "addresses", "derive_more", + "entity-by-address", "factors", "hierarchical-deterministic", "identified-vec-of", @@ -2976,18 +3113,59 @@ dependencies = [ "paste 1.0.14", "pretty_assertions", "profile", + "profile-persona", "profile-supporting-types", "serde", "serde_json 1.0.108", "time-utils", ] +[[package]] +name = "profile-persona" +version = "1.1.99" +dependencies = [ + "addresses", + "cap26-models", + "core-misc", + "derive_more", + "has-sample-values", + "hierarchical-deterministic", + "host-info", + "once_cell 1.19.0", + "profile-base-entity", + "profile-persona-data", + "profile-security-structures", + "serde", + "serde_json 1.0.108", + "short-string", +] + +[[package]] +name = "profile-persona-data" +version = "1.1.99" +dependencies = [ + "addresses", + "assert-json", + "core-misc", + "derive_more", + "entity-foundation", + "has-sample-values", + "identified-vec-of", + "network", + "paste 1.0.14", + "serde", + "serde_json 1.0.108", + "short-string", +] + [[package]] name = "profile-security-structures" version = "1.1.99" dependencies = [ "addresses", + "cap26-models", "core-collections", + "core-utils", "derive_more", "enum-as-inner", "factors", @@ -2999,7 +3177,6 @@ dependencies = [ "next-derivation-index-ephemeral", "pretty_assertions", "radix-engine-interface", - "sargon-core-utils", "serde", "serde_json 1.0.108", "short-string", @@ -3020,6 +3197,8 @@ dependencies = [ "itertools 0.12.0", "pretty_assertions", "profile", + "profile-account-or-persona", + "profile-base-entity", "serde", "serde_json 1.0.108", ] @@ -3093,6 +3272,54 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "radix-connect" +version = "1.1.99" +dependencies = [ + "actix-rt", + "addresses", + "assert-json", + "async-trait", + "base64 0.22.1 (git+https://github.com/marshallpierce/rust-base64.git?rev=e14400697453bcc85997119b874bc03d9601d0af)", + "bytes 1.1.99", + "core-misc", + "core-utils", + "derive_more", + "drivers", + "ecc", + "encryption", + "entity-foundation", + "has-sample-values", + "hash", + "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", + "http-client", + "identified-vec-of", + "paste 1.0.14", + "pretty_assertions", + "profile-persona-data", + "radix-connect-models", + "serde", + "serde_json 1.0.108", + "serde_with 3.4.0", + "short-string", + "transaction-foundation", + "transaction-models", +] + +[[package]] +name = "radix-connect-models" +version = "1.1.99" +dependencies = [ + "addresses", + "bytes 1.1.99", + "core-misc", + "derive_more", + "error", + "has-sample-values", + "network", + "serde", +] + [[package]] name = "radix-engine" version = "1.3.0" @@ -3580,7 +3807,6 @@ dependencies = [ "derive_more", "drivers", "encryption", - "enum-as-inner", "enum-iterator", "factor-instances-provider", "factors", @@ -3589,6 +3815,7 @@ dependencies = [ "gateway-models", "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", "hierarchical-deterministic", + "home-cards", "identified-vec-of", "keys-collector", "log", @@ -3600,32 +3827,22 @@ dependencies = [ "profile-logic", "profile-security-structures", "radix-common", + "radix-connect", + "radix-connect-models", "radix-engine-interface", "radix-engine-toolkit-common", "radix-transactions", + "security-center", "security-framework", "security-framework-sys", "serde", "serde_json 1.0.108", "serde_with 3.4.0", + "signing", "transaction-foundation", "transaction-models", ] -[[package]] -name = "sargon-core-utils" -version = "1.1.99" -dependencies = [ - "error", - "iso8601-timestamp", - "log", - "pretty_assertions", - "serde", - "serde_json 1.0.108", - "url", - "uuid 1.6.1", -] - [[package]] name = "sargon-uniffi" version = "1.1.99" @@ -3663,13 +3880,16 @@ dependencies = [ "pretty_assertions", "pretty_env_logger", "profile", + "profile-account", "profile-logic", + "profile-persona", "profile-security-structures", "radix-engine-toolkit", "rand", "regex 1.9.3 (git+https://github.com/rust-lang/regex/?rev=72f889ef3cca59ebac6a026f3646e8d92f056d88)", "sargon", "sargon-uniffi-conversion-macros", + "signing", "strum 0.26.1", "thiserror 1.0.50", "transaction-models", @@ -3853,6 +4073,19 @@ dependencies = [ "cc", ] +[[package]] +name = "security-center" +version = "1.1.99" +dependencies = [ + "addresses", + "assert-json", + "core-misc", + "derive_more", + "has-sample-values", + "profile-app-preferences", + "serde", +] + [[package]] name = "security-framework" version = "2.10.0" @@ -4050,10 +4283,10 @@ version = "1.1.99" dependencies = [ "arraystring", "assert-json", + "core-utils", "derive_more", "has-sample-values", "identified-vec-of", - "sargon-core-utils", "serde", "serde_json 1.0.108", "serde_with 3.4.0", @@ -4078,6 +4311,42 @@ dependencies = [ "rand_core 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "signing" +version = "1.1.99" +dependencies = [ + "actix-rt", + "addresses", + "assert-json", + "async-trait", + "bytes 1.1.99", + "cap26-models", + "core-collections", + "core-misc", + "derive_more", + "ecc", + "entity-by-address", + "entity-foundation", + "has-sample-values", + "hash", + "identified-vec-of", + "log", + "metadata", + "network", + "pretty_assertions", + "profile-account", + "profile-account-or-persona", + "profile-base-entity", + "profile-persona", + "profile-security-structures", + "radix-connect-models", + "radix-engine-interface", + "radix-transactions", + "serde", + "serde_json 1.0.108", + "transaction-models", +] + [[package]] name = "siphasher" version = "0.3.11" @@ -4529,6 +4798,7 @@ dependencies = [ "cargo_toml 0.15.3 (git+https://gitlab.com/lib.rs/cargo_toml?rev=e498c94fc42a660c1ca1a28999ce1d757cfe77fe)", "core-collections", "core-misc", + "core-utils", "derive_more", "ecc", "enum-as-inner", @@ -4552,7 +4822,6 @@ dependencies = [ "radix-engine-toolkit-common", "radix-rust", "radix-transactions", - "sargon-core-utils", "sbor", "serde", "serde_json 1.0.108", diff --git a/Cargo.toml b/Cargo.toml index ca1c82360..28da683e5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,13 @@ [workspace] resolver = "2" members = [ + # === FOR APP === + "crates/app/home-cards", + "crates/app/radix-connect", + "crates/app/radix-connect-models", + "crates/app/security-center", + "crates/app/signing", + # === COMMON === "crates/common/bytes", "crates/common/entity-foundation", @@ -21,6 +28,7 @@ members = [ "crates/core/utils", # === CRYPTO === + "crates/crypto/cap26-models", "crates/crypto/addresses", "crates/crypto/ecc", "crates/crypto/encryption", @@ -40,12 +48,18 @@ members = [ # === PROFILE === "crates/profile/logic/logic_SPLIT_ME", + "crates/profile/models/account-for-display", + "crates/profile/models/account-or-persona", + "crates/profile/models/account", "crates/profile/models/app-preferences", + "crates/profile/models/base-entity", "crates/profile/models/gateway", - "crates/profile/models/account-for-display", + "crates/profile/models/persona-data", + "crates/profile/models/persona", "crates/profile/models/profile_SPLIT_ME", "crates/profile/models/security-structures", "crates/profile/models/supporting-types", + "crates/profile/traits/entity-by-address", # === SARGON - SPLIT ME === "crates/sargon_SPLIT_ME", @@ -66,6 +80,13 @@ members = [ ] default-members = [ + # === FOR APP === + "crates/app/home-cards", + "crates/app/radix-connect", + "crates/app/radix-connect-models", + "crates/app/security-center", + "crates/app/signing", + # === COMMON === "crates/common/bytes", "crates/common/entity-foundation", @@ -86,6 +107,7 @@ default-members = [ "crates/core/utils", # === CRYPTO === + "crates/crypto/cap26-models", "crates/crypto/addresses", "crates/crypto/ecc", "crates/crypto/encryption", @@ -105,12 +127,18 @@ default-members = [ # === PROFILE === "crates/profile/logic/logic_SPLIT_ME", + "crates/profile/models/account-for-display", + "crates/profile/models/account-or-persona", + "crates/profile/models/account", "crates/profile/models/app-preferences", + "crates/profile/models/base-entity", "crates/profile/models/gateway", - "crates/profile/models/account-for-display", + "crates/profile/models/persona-data", + "crates/profile/models/persona", "crates/profile/models/profile_SPLIT_ME", "crates/profile/models/security-structures", "crates/profile/models/supporting-types", + "crates/profile/traits/entity-by-address", # === SARGON - SPLIT ME === "crates/sargon_SPLIT_ME", diff --git a/crates/app/home-cards/Cargo.toml b/crates/app/home-cards/Cargo.toml new file mode 100644 index 000000000..2a783d93d --- /dev/null +++ b/crates/app/home-cards/Cargo.toml @@ -0,0 +1,31 @@ +[package] +name = "home-cards" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +identified-vec-of = { path = "../../common/identified-vec-of" } +addresses = { path = "../../crypto/addresses" } +bytes = { path = "../../common/bytes" } +core-utils = { path = "../../core/utils" } +network = { path = "../../common/network" } +metadata = { path = "../../common/metadata" } +drivers = { path = "../../system/drivers" } +gateway-client-and-api = { path = "../../gateway/client-and-api" } +gateway-models = { path = "../../gateway/models" } + +# === RADIX DEPENDENCIES === +# None + +# === EXTERNAL DEPENDENCIES === +actix-rt = { workspace = true } +async-trait = { workspace = true } +base64 = { workspace = true } +derive_more = { workspace = true } +enum-as-inner = { workspace = true } +log = { workspace = true } +paste = { workspace = true } +pretty_assertions = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } diff --git a/crates/sargon_SPLIT_ME/src/home_cards/deferred_deep_link/deferred_deep_link_method.rs b/crates/app/home-cards/src/deferred_deep_link/deferred_deep_link_method.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/home_cards/deferred_deep_link/deferred_deep_link_method.rs rename to crates/app/home-cards/src/deferred_deep_link/deferred_deep_link_method.rs diff --git a/crates/sargon_SPLIT_ME/src/home_cards/deferred_deep_link/deferred_deep_link_special_dapp.rs b/crates/app/home-cards/src/deferred_deep_link/deferred_deep_link_special_dapp.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/home_cards/deferred_deep_link/deferred_deep_link_special_dapp.rs rename to crates/app/home-cards/src/deferred_deep_link/deferred_deep_link_special_dapp.rs diff --git a/crates/sargon_SPLIT_ME/src/home_cards/deferred_deep_link/mod.rs b/crates/app/home-cards/src/deferred_deep_link/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/home_cards/deferred_deep_link/mod.rs rename to crates/app/home-cards/src/deferred_deep_link/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/home_cards/deferred_deep_link/onboarding_deep_link_value.rs b/crates/app/home-cards/src/deferred_deep_link/onboarding_deep_link_value.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/home_cards/deferred_deep_link/onboarding_deep_link_value.rs rename to crates/app/home-cards/src/deferred_deep_link/onboarding_deep_link_value.rs diff --git a/crates/sargon_SPLIT_ME/src/home_cards/deferred_deep_link/parser.rs b/crates/app/home-cards/src/deferred_deep_link/parser.rs similarity index 99% rename from crates/sargon_SPLIT_ME/src/home_cards/deferred_deep_link/parser.rs rename to crates/app/home-cards/src/deferred_deep_link/parser.rs index fd4221c33..407b71eb5 100644 --- a/crates/sargon_SPLIT_ME/src/home_cards/deferred_deep_link/parser.rs +++ b/crates/app/home-cards/src/deferred_deep_link/parser.rs @@ -1,5 +1,6 @@ use crate::prelude::*; use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine}; +use gateway_client_and_api::GatewayClient; #[async_trait::async_trait] pub trait DeferredDeepLinkParser: Send + Sync { diff --git a/crates/sargon_SPLIT_ME/src/home_cards/home_card.rs b/crates/app/home-cards/src/home_card.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/home_cards/home_card.rs rename to crates/app/home-cards/src/home_card.rs diff --git a/crates/sargon_SPLIT_ME/src/home_cards/home_cards.rs b/crates/app/home-cards/src/home_cards.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/home_cards/home_cards.rs rename to crates/app/home-cards/src/home_cards.rs diff --git a/crates/app/home-cards/src/lib.rs b/crates/app/home-cards/src/lib.rs new file mode 100644 index 000000000..727abe171 --- /dev/null +++ b/crates/app/home-cards/src/lib.rs @@ -0,0 +1,34 @@ +mod deferred_deep_link; +mod home_card; +mod home_cards; +mod manager; +mod observer; +mod storage; + +pub mod prelude { + pub use crate::deferred_deep_link::*; + pub use crate::home_card::*; + pub use crate::home_cards::*; + pub use crate::manager::*; + pub use crate::observer::*; + pub use crate::storage::*; + + pub(crate) use addresses::prelude::*; + pub(crate) use bytes::prelude::*; + pub(crate) use core_utils::prelude::*; + pub(crate) use drivers::prelude::*; + pub(crate) use enum_as_inner::EnumAsInner; + pub(crate) use identified_vec_of::prelude::*; + pub(crate) use network::prelude::*; + pub(crate) use serde::{Deserialize, Serialize}; + pub(crate) use std::sync::Arc; + + #[cfg(test)] + pub(crate) use gateway_models::prelude::*; + + #[cfg(test)] + pub(crate) use metadata::prelude::*; + + #[cfg(test)] + pub(crate) use serde_json::json; +} diff --git a/crates/sargon_SPLIT_ME/src/home_cards/manager.rs b/crates/app/home-cards/src/manager.rs similarity index 99% rename from crates/sargon_SPLIT_ME/src/home_cards/manager.rs rename to crates/app/home-cards/src/manager.rs index be21a5235..281a4b495 100644 --- a/crates/sargon_SPLIT_ME/src/home_cards/manager.rs +++ b/crates/app/home-cards/src/manager.rs @@ -1,3 +1,5 @@ +use gateway_client_and_api::GatewayClient; + use crate::prelude::*; use std::sync::{RwLock, RwLockWriteGuard}; @@ -191,8 +193,9 @@ impl HomeCardsManager { #[cfg(test)] mod tests { + use std::sync::Mutex; + use super::*; - use std::sync::{Arc, Mutex}; struct MockHomeCardsStorage { stubbed_save_cards_result: Result<()>, diff --git a/crates/sargon_SPLIT_ME/src/home_cards/observer.rs b/crates/app/home-cards/src/observer.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/home_cards/observer.rs rename to crates/app/home-cards/src/observer.rs diff --git a/crates/sargon_SPLIT_ME/src/home_cards/storage.rs b/crates/app/home-cards/src/storage.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/home_cards/storage.rs rename to crates/app/home-cards/src/storage.rs diff --git a/crates/app/radix-connect-models/Cargo.toml b/crates/app/radix-connect-models/Cargo.toml new file mode 100644 index 000000000..c4dc45723 --- /dev/null +++ b/crates/app/radix-connect-models/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "radix-connect-models" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +error = { path = "../../core/error" } +has-sample-values = { path = "../../core/has-sample-values" } +core-misc = { path = "../../core/misc" } +bytes = { path = "../../common/bytes" } +network = { path = "../../common/network" } +addresses = { path = "../../crypto/addresses" } + +# === RADIX DEPENDENCIES === +# None + +# === EXTERNAL DEPENDENCIES === +derive_more = { workspace = true } +serde = { workspace = true } diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/auth_challenge_nonce.rs b/crates/app/radix-connect-models/src/auth_challenge_nonce.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/auth_challenge_nonce.rs rename to crates/app/radix-connect-models/src/auth_challenge_nonce.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/interaction_metadata.rs b/crates/app/radix-connect-models/src/dapp_metadata/interaction_metadata.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/interaction_metadata.rs rename to crates/app/radix-connect-models/src/dapp_metadata/interaction_metadata.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/interaction_metadata_unvalidated.rs b/crates/app/radix-connect-models/src/dapp_metadata/interaction_metadata_unvalidated.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/interaction_metadata_unvalidated.rs rename to crates/app/radix-connect-models/src/dapp_metadata/interaction_metadata_unvalidated.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/mod.rs b/crates/app/radix-connect-models/src/dapp_metadata/mod.rs similarity index 82% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/mod.rs rename to crates/app/radix-connect-models/src/dapp_metadata/mod.rs index 5f54cb6d4..96dbc1f7f 100644 --- a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/mod.rs +++ b/crates/app/radix-connect-models/src/dapp_metadata/mod.rs @@ -1,7 +1,5 @@ mod interaction_metadata; mod interaction_metadata_unvalidated; -mod origin; pub use interaction_metadata::*; pub use interaction_metadata_unvalidated::*; -pub use origin::*; diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/interaction_version.rs b/crates/app/radix-connect-models/src/interaction_version.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/interaction_version.rs rename to crates/app/radix-connect-models/src/interaction_version.rs diff --git a/crates/app/radix-connect-models/src/lib.rs b/crates/app/radix-connect-models/src/lib.rs new file mode 100644 index 000000000..b1320467a --- /dev/null +++ b/crates/app/radix-connect-models/src/lib.rs @@ -0,0 +1,17 @@ +mod auth_challenge_nonce; +mod dapp_metadata; +mod interaction_version; +mod origin; + +pub mod prelude { + pub use crate::auth_challenge_nonce::*; + pub use crate::dapp_metadata::*; + pub use crate::interaction_version::*; + pub use crate::origin::*; + + pub use addresses::prelude::*; + pub use bytes::prelude::*; + pub use network::prelude::*; + + pub(crate) use serde::{Deserialize, Serialize}; +} diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/origin.rs b/crates/app/radix-connect-models/src/origin.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/dapp_metadata/origin.rs rename to crates/app/radix-connect-models/src/origin.rs diff --git a/crates/app/radix-connect/Cargo.toml b/crates/app/radix-connect/Cargo.toml new file mode 100644 index 000000000..088091723 --- /dev/null +++ b/crates/app/radix-connect/Cargo.toml @@ -0,0 +1,41 @@ +[package] +name = "radix-connect" +version = "1.1.99" +edition = "2021" +build = "build.rs" + +[dependencies] +# === SARGON CRATES === +assert-json = { path = "../../core/assert-json" } +core-utils = { path = "../../core/utils" } +addresses = { path = "../../crypto/addresses" } +identified-vec-of = { path = "../../common/identified-vec-of" } +ecc = { path = "../../crypto/ecc" } +hash = { path = "../../crypto/hash" } +bytes = { path = "../../common/bytes" } +profile-persona-data = { path = "../../profile/models/persona-data" } +core-misc = { path = "../../core/misc" } +http-client = { path = "../../system/clients/http" } +drivers = { path = "../../system/drivers" } +encryption = { path = "../../crypto/encryption" } +transaction-foundation = { path = "../../transaction/foundation" } +transaction-models = { path = "../../transaction/models" } +entity-foundation = { path = "../../common/entity-foundation" } +short-string = { path = "../../common/short-string" } +has-sample-values = { path = "../../core/has-sample-values" } +radix-connect-models = { path = "../../app/radix-connect-models" } + +# === RADIX DEPENDENCIES === +# None + +# === EXTERNAL DEPENDENCIES === +actix-rt = { workspace = true } +async-trait = { workspace = true } +base64 = { workspace = true } +derive_more = { workspace = true } +hex = { workspace = true } +paste = { workspace = true } +pretty_assertions = { workspace = true } +serde = { workspace = true } +serde_with = { workspace = true } +serde_json = { workspace = true } diff --git a/crates/app/radix-connect/build.rs b/crates/app/radix-connect/build.rs new file mode 100644 index 000000000..5c1087b63 --- /dev/null +++ b/crates/app/radix-connect/build.rs @@ -0,0 +1,20 @@ +use std::env; +use std::path::Path; + +pub fn main() { + // Paths for reading fixtures used by tests + let fixtures_path = Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures"); + println!("cargo:rustc-env=FIXTURES={}/", fixtures_path.display()); + + let fixtures_models_path = fixtures_path.join("models"); + println!( + "cargo:rustc-env=FIXTURES_MODELS={}/", + fixtures_models_path.display() + ); + + let fixtures_vector_path = fixtures_path.join("vector"); + println!( + "cargo:rustc-env=FIXTURES_VECTOR={}/", + fixtures_vector_path.display() + ); +} diff --git a/crates/sargon_SPLIT_ME/fixtures/models/well_known.json b/crates/app/radix-connect/fixtures/models/well_known.json similarity index 100% rename from crates/sargon_SPLIT_ME/fixtures/models/well_known.json rename to crates/app/radix-connect/fixtures/models/well_known.json diff --git a/crates/sargon_SPLIT_ME/fixtures/vector/deep_link_request_params.json b/crates/app/radix-connect/fixtures/vector/deep_link_request_params.json similarity index 100% rename from crates/sargon_SPLIT_ME/fixtures/vector/deep_link_request_params.json rename to crates/app/radix-connect/fixtures/vector/deep_link_request_params.json diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/interaction_id.rs b/crates/app/radix-connect/src/interaction_id.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/interaction_id.rs rename to crates/app/radix-connect/src/interaction_id.rs diff --git a/crates/app/radix-connect/src/lib.rs b/crates/app/radix-connect/src/lib.rs new file mode 100644 index 000000000..5acd83b07 --- /dev/null +++ b/crates/app/radix-connect/src/lib.rs @@ -0,0 +1,56 @@ +mod interaction_id; +mod p2p_links; +mod wallet_account; +mod wallet_interaction; +mod wallet_persona; +mod well_known_client; + +#[allow(dead_code)] +mod mobile; + +pub mod prelude { + // RE-EXPORT MODULES + pub use crate::interaction_id::*; + pub use crate::mobile::*; + pub use crate::p2p_links::*; + pub use crate::wallet_account::*; + pub use crate::wallet_interaction::*; + pub use crate::wallet_persona::*; + pub use crate::well_known_client::*; + + // INTERNAL DEPENDENCIES + pub(crate) use addresses::prelude::*; + pub(crate) use bytes::prelude::*; + pub(crate) use core_misc::prelude::*; + pub(crate) use core_utils::prelude::*; + pub(crate) use ecc::prelude::*; + pub(crate) use entity_foundation::prelude::*; + pub(crate) use hash::prelude::*; + pub(crate) use identified_vec_of::prelude::*; + pub(crate) use profile_persona_data::prelude::*; + pub(crate) use radix_connect_models::prelude::*; + pub(crate) use short_string::prelude::*; + pub(crate) use transaction_models::prelude::*; + + // EXTERNAL DEPENDENCIES + pub(crate) use serde::{ + de, Deserialize, Deserializer, Serialize, Serializer, + }; + pub(crate) use serde_with::{serde_as, DisplayFromStr}; + + // STD DEPENDENCIES + pub(crate) use std::collections::HashMap; + pub(crate) use std::str::FromStr; + pub(crate) use std::sync::Arc; + #[cfg(test)] + pub(crate) use testing::*; + + #[cfg(test)] + mod testing { + pub(crate) use drivers::prelude::MockNetworkingDriver; + pub(crate) use serde_json::json; + pub(crate) use std::collections::{BTreeSet, HashSet}; + } +} + +pub use prelude::*; diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/mobile/client.rs b/crates/app/radix-connect/src/mobile/client.rs similarity index 99% rename from crates/sargon_SPLIT_ME/src/radix_connect/mobile/client.rs rename to crates/app/radix-connect/src/mobile/client.rs index 12d8baf46..a16b94b9b 100644 --- a/crates/sargon_SPLIT_ME/src/radix_connect/mobile/client.rs +++ b/crates/app/radix-connect/src/mobile/client.rs @@ -1,3 +1,4 @@ +use drivers::NetworkingDriver; use encryption::PbHkdfSha256; use super::deep_link_parsing::*; diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/mobile/deep_link_parsing/mod.rs b/crates/app/radix-connect/src/mobile/deep_link_parsing/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/mobile/deep_link_parsing/mod.rs rename to crates/app/radix-connect/src/mobile/deep_link_parsing/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/mobile/deep_link_parsing/parser.rs b/crates/app/radix-connect/src/mobile/deep_link_parsing/parser.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/mobile/deep_link_parsing/parser.rs rename to crates/app/radix-connect/src/mobile/deep_link_parsing/parser.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/mobile/deep_link_parsing/request.rs b/crates/app/radix-connect/src/mobile/deep_link_parsing/request.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/mobile/deep_link_parsing/request.rs rename to crates/app/radix-connect/src/mobile/deep_link_parsing/request.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/mobile/mod.rs b/crates/app/radix-connect/src/mobile/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/mobile/mod.rs rename to crates/app/radix-connect/src/mobile/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/mobile/relay_service/mod.rs b/crates/app/radix-connect/src/mobile/relay_service/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/mobile/relay_service/mod.rs rename to crates/app/radix-connect/src/mobile/relay_service/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/mobile/relay_service/service.rs b/crates/app/radix-connect/src/mobile/relay_service/service.rs similarity index 98% rename from crates/sargon_SPLIT_ME/src/radix_connect/mobile/relay_service/service.rs rename to crates/app/radix-connect/src/mobile/relay_service/service.rs index 54def6081..f9ba856f5 100644 --- a/crates/sargon_SPLIT_ME/src/radix_connect/mobile/relay_service/service.rs +++ b/crates/app/radix-connect/src/mobile/relay_service/service.rs @@ -1,4 +1,6 @@ +use drivers::{NetworkRequest, NetworkingDriver}; use encryption::{EncryptionScheme, VersionedEncryption}; +use http_client::HttpClient; use super::super::session::*; use super::success_response::SuccessResponse; @@ -100,6 +102,7 @@ impl Service { mod tests { use super::*; use actix_rt::time::timeout; + use drivers::NetworkMethod; use encryption::{EncryptionScheme, VersionedEncryption}; use std::time::Duration; const MAX: Duration = Duration::from_millis(10); diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/mobile/relay_service/success_response.rs b/crates/app/radix-connect/src/mobile/relay_service/success_response.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/mobile/relay_service/success_response.rs rename to crates/app/radix-connect/src/mobile/relay_service/success_response.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/mobile/session/mod.rs b/crates/app/radix-connect/src/mobile/session/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/mobile/session/mod.rs rename to crates/app/radix-connect/src/mobile/session/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/mobile/session/session.rs b/crates/app/radix-connect/src/mobile/session/session.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/mobile/session/session.rs rename to crates/app/radix-connect/src/mobile/session/session.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/mobile/session/session_id.rs b/crates/app/radix-connect/src/mobile/session/session_id.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/mobile/session/session_id.rs rename to crates/app/radix-connect/src/mobile/session/session_id.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/mobile/session/session_origin.rs b/crates/app/radix-connect/src/mobile/session/session_origin.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/mobile/session/session_origin.rs rename to crates/app/radix-connect/src/mobile/session/session_origin.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/mobile/session_dapp_request.rs b/crates/app/radix-connect/src/mobile/session_dapp_request.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/mobile/session_dapp_request.rs rename to crates/app/radix-connect/src/mobile/session_dapp_request.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/mobile/session_storage.rs b/crates/app/radix-connect/src/mobile/session_storage.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/mobile/session_storage.rs rename to crates/app/radix-connect/src/mobile/session_storage.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/mobile/session_wallet_response.rs b/crates/app/radix-connect/src/mobile/session_wallet_response.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/mobile/session_wallet_response.rs rename to crates/app/radix-connect/src/mobile/session_wallet_response.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/p2p_links/link_connection_qr_data.rs b/crates/app/radix-connect/src/p2p_links/link_connection_qr_data.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/p2p_links/link_connection_qr_data.rs rename to crates/app/radix-connect/src/p2p_links/link_connection_qr_data.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/p2p_links/mod.rs b/crates/app/radix-connect/src/p2p_links/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/p2p_links/mod.rs rename to crates/app/radix-connect/src/p2p_links/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/p2p_links/p2p_link.rs b/crates/app/radix-connect/src/p2p_links/p2p_link.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/p2p_links/p2p_link.rs rename to crates/app/radix-connect/src/p2p_links/p2p_link.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/p2p_links/p2p_links.rs b/crates/app/radix-connect/src/p2p_links/p2p_links.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/p2p_links/p2p_links.rs rename to crates/app/radix-connect/src/p2p_links/p2p_links.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/p2p_links/radix_connect_password.rs b/crates/app/radix-connect/src/p2p_links/radix_connect_password.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/p2p_links/radix_connect_password.rs rename to crates/app/radix-connect/src/p2p_links/radix_connect_password.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/p2p_links/radix_connect_purpose.rs b/crates/app/radix-connect/src/p2p_links/radix_connect_purpose.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/p2p_links/radix_connect_purpose.rs rename to crates/app/radix-connect/src/p2p_links/radix_connect_purpose.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_account.rs b/crates/app/radix-connect/src/wallet_account.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_account.rs rename to crates/app/radix-connect/src/wallet_account.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/items.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/items.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/items.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/items.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/mod.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/mod.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/after_delay.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/after_delay.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/after_delay.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/after_delay.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/at_time.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/at_time.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/at_time.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/at_time.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/expiration.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/expiration.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/expiration.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/expiration.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/mod.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/mod.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/status.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/status.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/status.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/status.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/mod.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/mod.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/pre_authorization.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/pre_authorization.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/pre_authorization.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/pre_authorization.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/subintent.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/subintent.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/subintent.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/subintent.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/unvalidated_subintent_manifest.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/unvalidated_subintent_manifest.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/unvalidated_subintent_manifest.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/unvalidated_subintent_manifest.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/auth.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/auth.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/auth.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/auth.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/login_with_challenge.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/login_with_challenge.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/login_with_challenge.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/login_with_challenge.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/mod.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/mod.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/use_persona.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/use_persona.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/use_persona.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/auth/use_persona.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/authorized_request.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/authorized_request.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/authorized_request.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/authorized_request.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/accounts.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/accounts.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/accounts.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/accounts.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/mod.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/mod.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/persona_data.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/persona_data.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/persona_data.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/persona_data.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/proof_of_ownership.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/proof_of_ownership.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/proof_of_ownership.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/proof_of_ownership.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/reset.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/reset.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/reset.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/entity/reset.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/mod.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/mod.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/unauthorized_request.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/unauthorized_request.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/unauthorized_request.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/request/unauthorized_request.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/mod.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/mod.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/transaction.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/transaction.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/transaction.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/transaction/transaction.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_unvalidated.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_unvalidated.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_unvalidated.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_unvalidated.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/mod.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/mod.rs similarity index 60% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/mod.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/mod.rs index 8515d4c8e..430a0c1c9 100644 --- a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/mod.rs +++ b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/mod.rs @@ -1,11 +1,7 @@ -mod auth_challenge_nonce; -mod dapp_metadata; mod interaction; mod interaction_items; mod interaction_unvalidated; -pub use auth_challenge_nonce::*; -pub use dapp_metadata::*; pub use interaction::*; pub use interaction_items::*; pub use interaction_unvalidated::*; diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/mod.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/mod.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/error_type.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/error_type.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/error_type.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/error_type.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/failure.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/failure.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/failure.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/failure.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/mod.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/mod.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/failure_response/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/mod.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/mod.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/response.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/response.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/response.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/response.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/account_proof.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/account_proof.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/account_proof.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/account_proof.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/accounts.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/accounts.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/accounts.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/accounts.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/mod.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/mod.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/account/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_login_with_challenge.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_login_with_challenge.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_login_with_challenge.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_login_with_challenge.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_login_without_challenge.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_login_without_challenge.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_login_without_challenge.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_login_without_challenge.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_proof.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_proof.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_proof.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_proof.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_use_persona.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_use_persona.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_use_persona.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/auth_use_persona.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/mod.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/mod.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/auth/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/authorized_request.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/authorized_request.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/authorized_request.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/authorized_request.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/items.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/items.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/items.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/items.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/mod.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/mod.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona/mod.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona/mod.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona/persona_proof.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona/persona_proof.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona/persona_proof.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona/persona_proof.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona_data/mod.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona_data/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona_data/mod.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona_data/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona_data/persona_data.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona_data/persona_data.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona_data/persona_data.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/persona_data/persona_data.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/mod.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/mod.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/pre_authorization.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/pre_authorization.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/pre_authorization.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/pre_authorization.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/subintent_response.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/subintent_response.rs similarity index 99% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/subintent_response.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/subintent_response.rs index dea59a5f9..da520c90b 100644 --- a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/subintent_response.rs +++ b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/pre_authorization/subintent_response.rs @@ -1,3 +1,5 @@ +use serde::ser::SerializeStruct; + use crate::prelude::*; #[derive(Debug, Clone, PartialEq)] diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/mod.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/mod.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/proof.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/proof.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/proof.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/proof.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/proof_of_ownership.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/proof_of_ownership.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/proof_of_ownership.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/proof_of_ownership/proof_of_ownership.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/success.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/success.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/success.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/success.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/mod.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/mod.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/transaction.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/transaction.rs similarity index 98% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/transaction.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/transaction.rs index d072bfd2c..ae9df96e1 100644 --- a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/transaction.rs +++ b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/transaction/transaction.rs @@ -1,3 +1,5 @@ +use serde::ser::SerializeStruct; + use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/unauthorized_request.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/unauthorized_request.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/unauthorized_request.rs rename to crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/wallet_to_dapp/success_response/unauthorized_request.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/mod.rs b/crates/app/radix-connect/src/wallet_interaction/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_interaction/mod.rs rename to crates/app/radix-connect/src/wallet_interaction/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/wallet_persona.rs b/crates/app/radix-connect/src/wallet_persona.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/wallet_persona.rs rename to crates/app/radix-connect/src/wallet_persona.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/well_known_client/client.rs b/crates/app/radix-connect/src/well_known_client/client.rs similarity index 96% rename from crates/sargon_SPLIT_ME/src/radix_connect/well_known_client/client.rs rename to crates/app/radix-connect/src/well_known_client/client.rs index f257886a8..39d051f18 100644 --- a/crates/sargon_SPLIT_ME/src/radix_connect/well_known_client/client.rs +++ b/crates/app/radix-connect/src/well_known_client/client.rs @@ -1,3 +1,6 @@ +use drivers::{NetworkRequest, NetworkingDriver}; +use http_client::HttpClient; + use crate::prelude::*; const SUFFIX_WELL_KNOWN_FILE: &str = ".well-known/radix.json"; @@ -58,6 +61,7 @@ impl WellKnownClient { mod tests { use super::*; use actix_rt::time::timeout; + use drivers::{MockNetworkingDriver, NetworkMethod}; use std::time::Duration; const MAX: Duration = Duration::from_millis(10); diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/well_known_client/mod.rs b/crates/app/radix-connect/src/well_known_client/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/well_known_client/mod.rs rename to crates/app/radix-connect/src/well_known_client/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/well_known_client/models/dapp_definition.rs b/crates/app/radix-connect/src/well_known_client/models/dapp_definition.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/well_known_client/models/dapp_definition.rs rename to crates/app/radix-connect/src/well_known_client/models/dapp_definition.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/well_known_client/models/dapp_well_known_data.rs b/crates/app/radix-connect/src/well_known_client/models/dapp_well_known_data.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/well_known_client/models/dapp_well_known_data.rs rename to crates/app/radix-connect/src/well_known_client/models/dapp_well_known_data.rs diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/well_known_client/models/mod.rs b/crates/app/radix-connect/src/well_known_client/models/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/radix_connect/well_known_client/models/mod.rs rename to crates/app/radix-connect/src/well_known_client/models/mod.rs diff --git a/crates/app/security-center/Cargo.toml b/crates/app/security-center/Cargo.toml new file mode 100644 index 000000000..9a613378f --- /dev/null +++ b/crates/app/security-center/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "security-center" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +assert-json = { path = "../../core/assert-json" } +addresses = { path = "../../crypto/addresses" } +has-sample-values = { path = "../../core/has-sample-values" } +core-misc = { path = "../../core/misc" } +profile-app-preferences = { path = "../../profile/models/app-preferences" } + +# === RADIX DEPENDENCIES === +# None + +# === EXTERNAL DEPENDENCIES === +derive_more = { workspace = true } +serde = { workspace = true } diff --git a/crates/sargon_SPLIT_ME/src/security_center/client.rs b/crates/app/security-center/src/client.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/security_center/client.rs rename to crates/app/security-center/src/client.rs diff --git a/crates/app/security-center/src/lib.rs b/crates/app/security-center/src/lib.rs new file mode 100644 index 000000000..b33513f4c --- /dev/null +++ b/crates/app/security-center/src/lib.rs @@ -0,0 +1,19 @@ +mod client; +mod security_problem; +mod security_problem_kind; +mod support; + +pub mod prelude { + pub use crate::client::*; + pub use crate::security_problem::*; + pub use crate::security_problem_kind::*; + pub use crate::support::*; + + pub(crate) use addresses::prelude::*; + pub(crate) use has_sample_values::prelude::*; + pub(crate) use profile_app_preferences::prelude::*; + + pub(crate) use serde::{Deserialize, Serialize}; +} + +pub use prelude::*; diff --git a/crates/sargon_SPLIT_ME/src/security_center/security_problem.rs b/crates/app/security-center/src/security_problem.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/security_center/security_problem.rs rename to crates/app/security-center/src/security_problem.rs diff --git a/crates/sargon_SPLIT_ME/src/security_center/security_problem_kind.rs b/crates/app/security-center/src/security_problem_kind.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/security_center/security_problem_kind.rs rename to crates/app/security-center/src/security_problem_kind.rs diff --git a/crates/sargon_SPLIT_ME/src/security_center/support/addresses_entities_bad_state.rs b/crates/app/security-center/src/support/addresses_entities_bad_state.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/security_center/support/addresses_entities_bad_state.rs rename to crates/app/security-center/src/support/addresses_entities_bad_state.rs diff --git a/crates/sargon_SPLIT_ME/src/security_center/support/backup_result.rs b/crates/app/security-center/src/support/backup_result.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/security_center/support/backup_result.rs rename to crates/app/security-center/src/support/backup_result.rs diff --git a/crates/sargon_SPLIT_ME/src/security_center/support/input.rs b/crates/app/security-center/src/support/input.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/security_center/support/input.rs rename to crates/app/security-center/src/support/input.rs diff --git a/crates/sargon_SPLIT_ME/src/security_center/support/mod.rs b/crates/app/security-center/src/support/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/security_center/support/mod.rs rename to crates/app/security-center/src/support/mod.rs diff --git a/crates/app/signing/Cargo.toml b/crates/app/signing/Cargo.toml new file mode 100644 index 000000000..23696de61 --- /dev/null +++ b/crates/app/signing/Cargo.toml @@ -0,0 +1,42 @@ +[package] +name = "signing" +version = "1.1.99" +edition = "2021" +build = "build.rs" + +[dependencies] +# === SARGON CRATES === +assert-json = { path = "../../core/assert-json" } +addresses = { path = "../../crypto/addresses" } +has-sample-values = { path = "../../core/has-sample-values" } +core-misc = { path = "../../core/misc" } +core-collections = { path = "../../core/collections" } +bytes = { path = "../../common/bytes" } +ecc = { path = "../../crypto/ecc" } +metadata = { path = "../../common/metadata" } +hash = { path = "../../crypto/hash" } +cap26-models = { path = "../../crypto/cap26-models" } +transaction-models = { path = "../../transaction/models" } +network = { path = "../../common/network" } +identified-vec-of = { path = "../../common/identified-vec-of" } +radix-connect-models = { path = "../../app/radix-connect-models" } +profile-account-or-persona = { path = "../../profile/models/account-or-persona" } +profile-persona = { path = "../../profile/models/persona" } +profile-base-entity = { path = "../../profile/models/base-entity" } +profile-account = { path = "../../profile/models/account" } +entity-foundation = { path = "../../common/entity-foundation" } +profile-security-structures = { path = "../../profile/models/security-structures" } # TODO only RoleKind and FactorListKind and GeneralRoleWithHierarchicalDeterministicFactorInstances? maybe move to a smaller crate? +entity-by-address = { path = "../../profile/traits/entity-by-address" } + +# === RADIX DEPENDENCIES === +radix-engine-interface = { workspace = true } +radix-transactions = { workspace = true } + +# === EXTERNAL DEPENDENCIES === +actix-rt = { workspace = true } +async-trait = { workspace = true } +derive_more = { workspace = true } +log = { workspace = true } +pretty_assertions = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } diff --git a/crates/app/signing/build.rs b/crates/app/signing/build.rs new file mode 100644 index 000000000..8d09b6b65 --- /dev/null +++ b/crates/app/signing/build.rs @@ -0,0 +1,14 @@ +use std::env; +use std::path::Path; + +pub fn main() { + // Paths for reading fixtures used by tests + let fixtures_path = Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures"); + println!("cargo:rustc-env=FIXTURES={}/", fixtures_path.display()); + + let fixtures_vector_path = fixtures_path.join("vector"); + println!( + "cargo:rustc-env=FIXTURES_VECTOR={}/", + fixtures_vector_path.display() + ); +} diff --git a/crates/sargon_SPLIT_ME/fixtures/vector/rola_challenge_payload_hash_vectors.json b/crates/app/signing/fixtures/vector/rola_challenge_payload_hash_vectors.json similarity index 100% rename from crates/sargon_SPLIT_ME/fixtures/vector/rola_challenge_payload_hash_vectors.json rename to crates/app/signing/fixtures/vector/rola_challenge_payload_hash_vectors.json diff --git a/crates/sargon_SPLIT_ME/src/signing/authentication/auth_intent.rs b/crates/app/signing/src/authentication/auth_intent.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/signing/authentication/auth_intent.rs rename to crates/app/signing/src/authentication/auth_intent.rs diff --git a/crates/sargon_SPLIT_ME/src/signing/authentication/auth_intent_hash.rs b/crates/app/signing/src/authentication/auth_intent_hash.rs similarity index 99% rename from crates/sargon_SPLIT_ME/src/signing/authentication/auth_intent_hash.rs rename to crates/app/signing/src/authentication/auth_intent_hash.rs index 2b2846801..c40923bf0 100644 --- a/crates/sargon_SPLIT_ME/src/signing/authentication/auth_intent_hash.rs +++ b/crates/app/signing/src/authentication/auth_intent_hash.rs @@ -58,6 +58,8 @@ impl From for AuthIntentHash { #[cfg(test)] mod tests { + use serde::{de, Deserializer}; + use super::*; #[allow(clippy::upper_case_acronyms)] diff --git a/crates/sargon_SPLIT_ME/src/signing/authentication/mod.rs b/crates/app/signing/src/authentication/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/signing/authentication/mod.rs rename to crates/app/signing/src/authentication/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/signing/authentication/signed_auth_intent.rs b/crates/app/signing/src/authentication/signed_auth_intent.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/signing/authentication/signed_auth_intent.rs rename to crates/app/signing/src/authentication/signed_auth_intent.rs diff --git a/crates/sargon_SPLIT_ME/src/signing/collector/extractor_of_instances_required_to_sign_transactions.rs b/crates/app/signing/src/collector/extractor_of_instances_required_to_sign_transactions.rs similarity index 62% rename from crates/sargon_SPLIT_ME/src/signing/collector/extractor_of_instances_required_to_sign_transactions.rs rename to crates/app/signing/src/collector/extractor_of_instances_required_to_sign_transactions.rs index 67da0be14..1c48483d6 100644 --- a/crates/sargon_SPLIT_ME/src/signing/collector/extractor_of_instances_required_to_sign_transactions.rs +++ b/crates/app/signing/src/collector/extractor_of_instances_required_to_sign_transactions.rs @@ -7,20 +7,18 @@ impl ExtractorOfInstancesRequiredToSignTransactions { /// Extracts factor instances required to sign transactions. /// Returns a set of `HierarchicalDeterministicFactorInstance`. /// Returns an error if the `SignaturesCollectorPreprocessor` fails to initialize. - pub fn extract( - profile: &Profile, + pub fn extract( + proto_profile: &P, transactions: Vec, signing_purpose: SigningPurpose, ) -> Result> { let preprocessor = SignaturesCollectorPreprocessor::analyzing_signables( - profile, + proto_profile, transactions, )?; - let (petitions, _) = preprocessor.preprocess( - IndexSet::from_iter(profile.factor_sources.iter()), - signing_purpose, - ); + let (petitions, _) = preprocessor + .preprocess(proto_profile.factor_sources(), signing_purpose); let factor_instances = petitions .txid_to_petition @@ -41,8 +39,82 @@ impl ExtractorOfInstancesRequiredToSignTransactions { } } +#[cfg(test)] +#[derive(Debug, Default)] +pub(crate) struct ProtoProfile { + pub(crate) accounts: Vec, + pub(crate) personas: Vec, + pub(crate) factor_sources: Vec, +} + +#[cfg(test)] +impl ProtoProfile { + pub(crate) fn new( + accounts: impl IntoIterator, + personas: impl IntoIterator, + factor_sources: impl IntoIterator, + ) -> Self { + Self { + accounts: accounts.into_iter().collect(), + personas: personas.into_iter().collect(), + factor_sources: factor_sources.into_iter().collect(), + } + } +} + +#[cfg(test)] +impl ProfileAccountByAddress for ProtoProfile { + fn account_by_address(&self, address: AccountAddress) -> Result { + self.accounts + .iter() + .find(|a| a.address == address) + .cloned() + .ok_or(CommonError::UnknownAccount) + } +} +#[cfg(test)] +impl ProfilePersonaByAddress for ProtoProfile { + fn persona_by_address(&self, address: IdentityAddress) -> Result { + self.personas + .iter() + .find(|p| p.address == address) + .cloned() + .ok_or(CommonError::UnknownPersona) + } +} +#[cfg(test)] +impl ProfileEntityByAddress for ProtoProfile { + fn entity_by_address( + &self, + address: AddressOfAccountOrPersona, + ) -> Result { + if let Some(account_address) = address.as_account() { + return self + .account_by_address(*account_address) + .map(AccountOrPersona::AccountEntity); + } + + if let Some(identity_address) = address.as_identity() { + return self + .persona_by_address(*identity_address) + .map(AccountOrPersona::PersonaEntity); + } + + Err(CommonError::Unknown) + } +} +#[cfg(test)] +impl HasFactorSources for ProtoProfile { + fn factor_sources(&self) -> IndexSet { + self.factor_sources.iter().cloned().collect() + } +} + #[cfg(test)] mod tests { + use entity_foundation::prelude::AppearanceID; + use profile_security_structures::prelude::DisplayName; + use super::*; #[test] @@ -54,7 +126,7 @@ mod tests { ); let result = ExtractorOfInstancesRequiredToSignTransactions::extract( - &Profile::sample_other(), + &ProtoProfile::default(), vec![intent_with_invalid_persona], SigningPurpose::sign_transaction_primary(), ); @@ -99,6 +171,12 @@ mod tests { None, ); + let profile = ProtoProfile::new( + vec![account_1.clone(), account_2.clone()], + vec![persona.clone()], + vec![private_hd_factor_source.factor_source.clone().into()], + ); + let intent_1 = TransactionIntent::sample_entity_addresses_requiring_auth( vec![account_1.address], @@ -111,7 +189,7 @@ mod tests { ); let result = ExtractorOfInstancesRequiredToSignTransactions::extract( - &Profile::sample(), + &profile, vec![intent_1, intent_2], SigningPurpose::sign_transaction_primary(), ); diff --git a/crates/sargon_SPLIT_ME/src/signing/collector/mod.rs b/crates/app/signing/src/collector/mod.rs similarity index 86% rename from crates/sargon_SPLIT_ME/src/signing/collector/mod.rs rename to crates/app/signing/src/collector/mod.rs index 47613ec8e..d056dc78e 100644 --- a/crates/sargon_SPLIT_ME/src/signing/collector/mod.rs +++ b/crates/app/signing/src/collector/mod.rs @@ -6,7 +6,7 @@ mod signatures_collector_preprocessor; mod signatures_collector_state; mod signing_finish_early_strategy; -pub(crate) use extractor_of_instances_required_to_sign_transactions::*; +pub use extractor_of_instances_required_to_sign_transactions::*; pub(crate) use signatures_collector_preprocessor::*; pub use signatures_collecting_continuation::*; diff --git a/crates/sargon_SPLIT_ME/src/signing/collector/signatures_collecting_continuation.rs b/crates/app/signing/src/collector/signatures_collecting_continuation.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/signing/collector/signatures_collecting_continuation.rs rename to crates/app/signing/src/collector/signatures_collecting_continuation.rs diff --git a/crates/sargon_SPLIT_ME/src/signing/collector/signatures_collector.rs b/crates/app/signing/src/collector/signatures_collector.rs similarity index 60% rename from crates/sargon_SPLIT_ME/src/signing/collector/signatures_collector.rs rename to crates/app/signing/src/collector/signatures_collector.rs index 86ca6ea0e..d2b3668ef 100644 --- a/crates/sargon_SPLIT_ME/src/signing/collector/signatures_collector.rs +++ b/crates/app/signing/src/collector/signatures_collector.rs @@ -27,20 +27,22 @@ pub struct SignaturesCollector { // === PUBLIC === impl SignaturesCollector { - pub fn new( + pub fn new( finish_early_strategy: SigningFinishEarlyStrategy, transactions: impl IntoIterator, interactor: Arc>, - profile: &Profile, + proto_profile: &P, purpose: SigningPurpose, ) -> Result { Self::with_signers_extraction( finish_early_strategy, - IndexSet::from_iter(profile.factor_sources.iter()), + proto_profile.factor_sources(), transactions, interactor, purpose, - |i| SignableWithEntities::extracting_from_profile(&i, profile), + |i| { + SignableWithEntities::extracting_from_profile(&i, proto_profile) + }, ) } @@ -415,244 +417,121 @@ impl SignaturesCollector { outcome } } -#[cfg(test)] -mod tests { - use std::iter; - - use super::*; - - impl SignaturesCollector { - /// Used by tests - pub(crate) fn petitions(self) -> Petitions { - self.state - .read() - .expect("SignaturesCollector lock should not have been poisoned.") - .petitions - .read() - .expect("SignaturesCollectorState lock should not have been poisoned.") - .clone() - } - } - - fn assert_petition( - petitions: &Petitions, - t: &S, - threshold_factors: HashMap< - AddressOfAccountOrPersona, - HashSet, - >, - override_factors: HashMap< - AddressOfAccountOrPersona, - HashSet, - >, - ) { - let petitions_ref = petitions - .txid_to_petition - .read() - .expect("Petitions lock should not have been poisoned"); - let signable_id = t.get_id(); - let petition = petitions_ref.get(&signable_id).unwrap(); - assert_eq!(petition.signable.get_id(), signable_id); - let mut addresses = threshold_factors.keys().collect::>(); - addresses.extend(override_factors.keys().collect::>()); - - assert_eq!( - petition - .for_entities - .read() - .expect("PetitionForTransaction lock should not have been poisoned.") - .keys() - .collect::>(), - addresses - ); - - assert!(petition +pub fn assert_petition( + petitions: &Petitions, + t: &S, + threshold_factors: HashMap< + AddressOfAccountOrPersona, + HashSet, + >, + override_factors: HashMap< + AddressOfAccountOrPersona, + HashSet, + >, +) { + let petitions_ref = petitions + .txid_to_petition + .read() + .expect("Petitions lock should not have been poisoned"); + let signable_id = t.get_id(); + let petition = petitions_ref.get(&signable_id).unwrap(); + assert_eq!(petition.signable.get_id(), signable_id); + + let mut addresses = threshold_factors.keys().collect::>(); + addresses.extend(override_factors.keys().collect::>()); + + assert_eq!( + petition .for_entities .read() .expect( "PetitionForTransaction lock should not have been poisoned." ) - .iter() - .all(|(a, p)| { p.entity == *a })); + .keys() + .collect::>(), + addresses + ); + + assert!(petition + .for_entities + .read() + .expect("PetitionForTransaction lock should not have been poisoned.") + .iter() + .all(|(a, p)| { p.entity == *a })); + + assert!(petition + .for_entities + .read() + .expect("PetitionForTransaction lock should not have been poisoned.") + .iter() + .all(|(_, p)| { p.payload_id == t.get_id() })); + + for (k, v) in petition + .for_entities + .read() + .expect("PetitionForTransaction lock should not have been poisoned.") + .iter() + { + let threshold = threshold_factors.get(k); + if let Some(actual_threshold) = &v.threshold_factors { + let threshold = threshold.unwrap().clone(); + assert_eq!( + actual_threshold + .read() + .expect( + "PetitionForEntity lock should not have been poisoned." + ) + .factor_instances() + .into_iter() + .map(|f| f.factor_source_id) + .collect::>(), + threshold + ); + } else { + assert!(threshold.is_none()); + } - assert!(petition - .for_entities - .read() - .expect( - "PetitionForTransaction lock should not have been poisoned." - ) - .iter() - .all(|(_, p)| { p.payload_id == t.get_id() })); + let override_ = override_factors.get(k); + if let Some(actual_override) = &v.override_factors { + let override_ = override_.unwrap().clone(); + assert_eq!( + actual_override + .read() + .expect( + "PetitionForEntity lock should not have been poisoned." + ) + .factor_instances() + .into_iter() + .map(|f| f.factor_source_id) + .collect::>(), + override_ + ); + } else { + assert!(override_.is_none()); + } + } +} - for (k, v) in petition - .for_entities +impl SignaturesCollector { + /// Used by tests + pub fn petitions(self) -> Petitions { + self.state + .read() + .expect("SignaturesCollector lock should not have been poisoned.") + .petitions .read() .expect( - "PetitionForTransaction lock should not have been poisoned.", + "SignaturesCollectorState lock should not have been poisoned.", ) - .iter() - { - let threshold = threshold_factors.get(k); - if let Some(actual_threshold) = &v.threshold_factors { - let threshold = threshold.unwrap().clone(); - assert_eq!( - actual_threshold - .read() - .expect("PetitionForEntity lock should not have been poisoned.") - .factor_instances() - .into_iter() - .map(|f| f.factor_source_id) - .collect::>(), - threshold - ); - } else { - assert!(threshold.is_none()); - } - - let override_ = override_factors.get(k); - if let Some(actual_override) = &v.override_factors { - let override_ = override_.unwrap().clone(); - assert_eq!( - actual_override - .read() - .expect("PetitionForEntity lock should not have been poisoned.") - .factor_instances() - .into_iter() - .map(|f| f.factor_source_id) - .collect::>(), - override_ - ); - } else { - assert!(override_.is_none()); - } - } - } - - #[test] - fn profile_with_unknown_account() { - let res = SignaturesCollector::new( - SigningFinishEarlyStrategy::default(), - [TransactionIntent::sample_entities_requiring_auth( - [&Account::sample_at(0)], - [], - )], - Arc::new(TestSignInteractor::new(SimulatedUser::prudent_no_fail())), - &Profile::sample_from(IndexSet::new(), [], []), - SigningPurpose::sign_transaction_primary(), - ); - assert!(res.is_ok()); - } - - #[test] - fn invalid_profile_unknown_persona() { - let res = SignaturesCollector::new( - SigningFinishEarlyStrategy::default(), - [TransactionIntent::sample_entities_requiring_auth( - [], - [&Persona::sample_at(0)], - )], - Arc::new(TestSignInteractor::new(SimulatedUser::prudent_no_fail())), - &Profile::sample_from(IndexSet::new(), [], []), - SigningPurpose::sign_transaction_primary(), - ); - assert!(matches!(res, Err(CommonError::UnknownPersona))); - } - - #[actix_rt::test] - async fn valid_profile() { - let factors_sources = FactorSource::sample_all(); - let persona = Persona::sample_at(0); - - let collector = SignaturesCollector::new( - SigningFinishEarlyStrategy::default(), - [TransactionIntent::sample_entities_requiring_auth( - [], - [&persona], - )], - Arc::new(TestSignInteractor::new(SimulatedUser::prudent_no_fail())), - &Profile::sample_from(factors_sources, [], [&persona]), - SigningPurpose::sign_transaction_primary(), - ) - .unwrap(); - let outcome = collector.collect_signatures().await.unwrap(); - assert!(outcome.successful()) - } - - #[actix_rt::test] - async fn continues_even_with_failed_tx_when_configured_to() { - let factor_sources = &FactorSource::sample_all(); - let a0 = &Account::sample_at(0); - let a1 = &Account::sample_at(1); - - let t0 = TransactionIntent::sample_entities_requiring_auth([a1], []); - let t1 = TransactionIntent::sample_entities_requiring_auth([a0], []); - - let profile = - Profile::sample_from(factor_sources.clone(), [a0, a1], []); - - let collector = SignaturesCollector::new( - SigningFinishEarlyStrategy::new( - WhenAllTransactionsAreValid(FinishEarly), - WhenSomeTransactionIsInvalid(Continue), - ), - [t0.clone(), t1.clone()], - Arc::new(TestSignInteractor::new( - SimulatedUser::prudent_with_failures( - SimulatedFailures::with_simulated_failures([ - FactorSourceIDFromHash::sample_at(1), - ]), - ), - )), - &profile, - SigningPurpose::sign_transaction_primary(), - ) - .unwrap(); - - let outcome = collector.collect_signatures().await.unwrap(); - assert!(!outcome.successful()); - assert_eq!(outcome.failed_transactions().len(), 1); - assert_eq!(outcome.successful_transactions().len(), 1); + .clone() } +} - #[actix_rt::test] - async fn continues_even_when_all_valid_if_configured_to() { - let test = async move |when_all_valid: WhenAllTransactionsAreValid, - expected_sig_count: usize| { - let factor_sources = &FactorSource::sample_all(); - let a5 = &Account::sample_at(5); - - let t0 = - TransactionIntent::sample_entities_requiring_auth([a5], []); - - let profile = - Profile::sample_from(factor_sources.clone(), [a5], []); - - let collector = SignaturesCollector::new( - SigningFinishEarlyStrategy::new( - when_all_valid, - WhenSomeTransactionIsInvalid::default(), - ), - [t0.clone()], - Arc::new(TestSignInteractor::new( - SimulatedUser::prudent_no_fail(), - )), - &profile, - SigningPurpose::sign_transaction_primary(), - ) - .unwrap(); - - let outcome = collector.collect_signatures().await.unwrap(); - assert!(outcome.successful()); - assert_eq!( - outcome.signatures_of_successful_transactions().len(), - expected_sig_count - ); - }; +#[cfg(test)] +mod tests { - test(WhenAllTransactionsAreValid(FinishEarly), 1).await; - test(WhenAllTransactionsAreValid(Continue), 2).await; - } + use super::*; #[test] fn factor_source_kinds_order() { @@ -676,769 +555,6 @@ mod tests { ) } - #[test] - fn test_profile() { - let factor_sources = &FactorSource::sample_all(); - let a0 = &Account::sample_at(0); - let a1 = &Account::sample_at(1); - let a2 = &Account::sample_at(2); - let a6 = &Account::sample_at(6); - - let p0 = &Persona::sample_at(0); - let p1 = &Persona::sample_at(1); - let p2 = &Persona::sample_at(2); - let p6 = &Persona::sample_at(6); - - let t0 = TransactionIntent::sample_entities_requiring_auth( - [a0, a1], - [p0, p1], - ); - let t1 = - TransactionIntent::sample_entities_requiring_auth([a0, a1, a2], []); - let t2 = - TransactionIntent::sample_entities_requiring_auth([], [p0, p1, p2]); - let t3 = TransactionIntent::sample_entities_requiring_auth([a6], [p6]); - - let profile = Profile::sample_from( - factor_sources.clone(), - [a0, a1, a2, a6], - [p0, p1, p2, p6], - ); - - let collector = SignaturesCollector::new( - SigningFinishEarlyStrategy::default(), - [t0.clone(), t1.clone(), t2.clone(), t3.clone()], - Arc::new(TestSignInteractor::new(SimulatedUser::prudent_no_fail())), - &profile, - SigningPurpose::sign_transaction_primary(), - ) - .unwrap(); - - let petitions = collector.petitions(); - - assert_eq!( - petitions - .txid_to_petition - .read() - .expect("Petitions lock should not have been poisoned") - .len(), - 4 - ); - - { - let petitions_ref = petitions - .txid_to_petition - .read() - .expect("Petitions lock should not have been poisoned"); - let petition = - petitions_ref.get(&t3.transaction_intent_hash()).unwrap(); - let for_entities = petition - .for_entities - .read() - .expect("PetitionForTransaction lock should not have been poisoned.") - .clone(); - let pet6 = for_entities.get(&a6.address.into()).unwrap(); - - let paths6 = pet6 - .all_factor_instances() - .iter() - .map(|f| f.factor_instance().derivation_path()) - .collect_vec(); - - pretty_assertions::assert_eq!( - paths6, - iter::repeat_n( - DerivationPath::from(AccountPath::new( - NetworkID::Mainnet, - CAP26KeyKind::TransactionSigning, - Hardened::from_local_key_space( - U31::try_from(6u32).unwrap(), - IsSecurified(true) - ) - .unwrap() - )), - 5 - ) - .collect_vec() - ); - } - - assert_petition( - &petitions, - &t0, - HashMap::from_iter([ - ( - a0.address.into(), - HashSet::just(FactorSourceIDFromHash::sample_at(0)), - ), - ( - a1.address.into(), - HashSet::just(FactorSourceIDFromHash::sample_at(1)), - ), - ( - p0.address.into(), - HashSet::just(FactorSourceIDFromHash::sample_at(0)), - ), - ( - p1.address.into(), - HashSet::just(FactorSourceIDFromHash::sample_at(1)), - ), - ]), - HashMap::new(), - ); - - assert_petition( - &petitions, - &t1, - HashMap::from_iter([ - ( - a0.address.into(), - HashSet::just(FactorSourceIDFromHash::sample_at(0)), - ), - ( - a1.address.into(), - HashSet::just(FactorSourceIDFromHash::sample_at(1)), - ), - ( - a2.address.into(), - HashSet::just(FactorSourceIDFromHash::sample_at(0)), - ), - ]), - HashMap::new(), - ); - - assert_petition( - &petitions, - &t2, - HashMap::from_iter([ - ( - p0.address.into(), - HashSet::just(FactorSourceIDFromHash::sample_at(0)), - ), - ( - p1.address.into(), - HashSet::just(FactorSourceIDFromHash::sample_at(1)), - ), - ( - p2.address.into(), - HashSet::just(FactorSourceIDFromHash::sample_at(0)), - ), - ]), - HashMap::new(), - ); - - assert_petition( - &petitions, - &t3, - HashMap::from_iter([ - ( - a6.address.into(), - HashSet::from_iter([ - FactorSourceIDFromHash::sample_at(0), - FactorSourceIDFromHash::sample_at(3), - FactorSourceIDFromHash::sample_at(5), - ]), - ), - ( - p6.address.into(), - HashSet::from_iter([ - FactorSourceIDFromHash::sample_at(0), - FactorSourceIDFromHash::sample_at(3), - FactorSourceIDFromHash::sample_at(5), - ]), - ), - ]), - HashMap::from_iter([ - ( - a6.address.into(), - HashSet::from_iter([ - FactorSourceIDFromHash::sample_at(1), - FactorSourceIDFromHash::sample_at(4), - ]), - ), - ( - p6.address.into(), - HashSet::from_iter([ - FactorSourceIDFromHash::sample_at(1), - FactorSourceIDFromHash::sample_at(4), - ]), - ), - ]), - ); - } - - mod multi_tx { - use super::*; - - async fn multi_accounts_multi_personas_all_single_factor_controlled_with_sim_user( - sim: SimulatedUser, - ) { - let factor_sources = &FactorSource::sample_all(); - let a0 = Account::sample_at(0); - let a1 = Account::sample_at(1); - let a2 = Account::sample_at(2); - - let p0 = Persona::sample_at(0); - let p1 = Persona::sample_at(1); - let p2 = Persona::sample_at(2); - - let t0 = TransactionIntent::sample_entities_requiring_auth( - [&a0, &a1], - [&p0, &p1], - ); - let t1 = TransactionIntent::sample_entities_requiring_auth( - [&a0, &a1, &a2], - [], - ); - let t2 = TransactionIntent::sample_entities_requiring_auth( - [], - [&p0, &p1, &p2], - ); - - let profile = Profile::sample_from( - factor_sources.clone(), - [&a0, &a1, &a2], - [&p0, &p1, &p2], - ); - - let collector = SignaturesCollector::new( - SigningFinishEarlyStrategy::default(), - [t0.clone(), t1.clone(), t2.clone()], - Arc::new(TestSignInteractor::new(sim)), - &profile, - SigningPurpose::sign_transaction_primary(), - ) - .unwrap(); - - let outcome = collector.collect_signatures().await.unwrap(); - assert!(outcome.successful()); - assert!(outcome.failed_transactions().is_empty()); - assert_eq!( - outcome.signatures_of_successful_transactions().len(), - 10 - ); - assert_eq!( - outcome - .successful_transactions() - .into_iter() - .map(|t| t.signable_id) - .collect::>(), - HashSet::from_iter([ - t0.clone().transaction_intent_hash(), - t1.clone().transaction_intent_hash(), - t2.clone().transaction_intent_hash(), - ]) - ); - let st0 = outcome - .successful_transactions() - .into_iter() - .find(|st| st.signable_id == t0.transaction_intent_hash()) - .unwrap(); - - assert_eq!( - st0.signatures - .clone() - .into_iter() - .map(|s| s.owned_factor_instance().owner) - .collect::>(), - HashSet::from_iter([ - AddressOfAccountOrPersona::from(a0.address), - AddressOfAccountOrPersona::from(a1.address), - AddressOfAccountOrPersona::from(p0.address), - AddressOfAccountOrPersona::from(p1.address), - ]) - ); - - let st1 = outcome - .successful_transactions() - .into_iter() - .find(|st| st.signable_id == t1.transaction_intent_hash()) - .unwrap(); - - assert_eq!( - st1.signatures - .clone() - .into_iter() - .map(|s| s.owned_factor_instance().owner) - .collect::>(), - HashSet::from_iter([ - AddressOfAccountOrPersona::from(a0.address), - AddressOfAccountOrPersona::from(a1.address), - AddressOfAccountOrPersona::from(a2.address), - ]) - ); - - let st2 = outcome - .successful_transactions() - .into_iter() - .find(|st| st.signable_id == t2.transaction_intent_hash()) - .unwrap(); - - assert_eq!( - st2.signatures - .clone() - .into_iter() - .map(|s| s.owned_factor_instance().owner) - .collect::>(), - HashSet::from_iter([ - AddressOfAccountOrPersona::from(p0.address), - AddressOfAccountOrPersona::from(p1.address), - AddressOfAccountOrPersona::from(p2.address), - ]) - ); - - // Assert sorted in increasing "friction order". - assert_eq!( - outcome - .signatures_of_successful_transactions() - .iter() - .map(|f| { f.factor_source_id().kind }) - .collect::>(), - IndexSet::::from_iter([ - FactorSourceKind::Device, - FactorSourceKind::LedgerHQHardwareWallet - ]) - ); - } - - #[derive(Clone, Debug)] - struct Vector { - simulated_user: SimulatedUser, - expected: Expected, - } - #[derive(Clone, Debug, PartialEq, Eq)] - struct Expected { - successful_txs_signature_count: usize, - signed_factor_source_kinds: IndexSet, - expected_neglected_factor_source_count: usize, - } - async fn multi_securified_entities_with_sim_user(vector: Vector) { - let factor_sources = &FactorSource::sample_all(); - - let a4 = &Account::sample_at(4); - let a5 = &Account::sample_at(5); - let a6 = &Account::sample_at(6); - - let p4 = &Persona::sample_at(4); - let p5 = &Persona::sample_at(5); - let p6 = &Persona::sample_at(6); - - let t0 = - TransactionIntent::sample_entities_requiring_auth([a5], [p5]); - let t1 = TransactionIntent::sample_entities_requiring_auth( - [a4, a5, a6], - [], - ); - let t2 = TransactionIntent::sample_entities_requiring_auth( - [a4, a6], - [p4, p6], - ); - let t3 = TransactionIntent::sample_entities_requiring_auth( - [], - [p4, p5, p6], - ); - - let profile = Profile::sample_from( - factor_sources.clone(), - [a4, a5, a6], - [p4, p5, p6], - ); - - let collector = SignaturesCollector::new( - SigningFinishEarlyStrategy::default(), - [t0.clone(), t1.clone(), t2.clone(), t3.clone()], - Arc::new(TestSignInteractor::new(vector.simulated_user)), - &profile, - SigningPurpose::sign_transaction_primary(), - ) - .unwrap(); - - let outcome = collector.collect_signatures().await.unwrap(); - - assert_eq!( - outcome.neglected_factor_sources().len(), - vector.expected.expected_neglected_factor_source_count - ); - - assert!(outcome.successful()); - assert!(outcome.failed_transactions().is_empty()); - assert_eq!( - outcome.signatures_of_successful_transactions().len(), - vector.expected.successful_txs_signature_count - ); - assert_eq!( - outcome - .successful_transactions() - .into_iter() - .map(|t| t.signable_id) - .collect::>(), - HashSet::from_iter([ - t0.clone().transaction_intent_hash(), - t1.clone().transaction_intent_hash(), - t2.clone().transaction_intent_hash(), - t3.clone().transaction_intent_hash(), - ]) - ); - - // Assert sorted in increasing "friction order". - assert_eq!( - outcome - .signatures_of_successful_transactions() - .iter() - .map(|f| { f.factor_source_id().kind }) - .collect::>(), - vector.expected.signed_factor_source_kinds - ); - } - - mod with_failure { - use std::{cell::RefCell, rc::Rc}; - - use super::*; - - #[actix_rt::test] - async fn multi_securified_entities() { - multi_securified_entities_with_sim_user(Vector { - simulated_user: SimulatedUser::prudent_with_failures( - SimulatedFailures::with_simulated_failures([ - FactorSourceIDFromHash::sample_at(1), - ]), - ), - expected: Expected { - successful_txs_signature_count: 24, - // We always end early - // `Device` FactorSourceKind never got used since it - // we are done after Passphrase. - signed_factor_source_kinds: - IndexSet::::from_iter([ - FactorSourceKind::ArculusCard, - FactorSourceKind::Password, - ]), - expected_neglected_factor_source_count: 1, - }, - }) - .await; - } - - #[actix_rt::test] - async fn failed_threshold_successful_override() { - let factor_sources = &FactorSource::sample_all(); - let a9 = &Account::sample_at(9); - let tx0 = - TransactionIntent::sample_entities_requiring_auth([a9], []); - - let all_transactions = [tx0.clone()]; - - let profile = - Profile::sample_from(factor_sources.clone(), [a9], []); - - let collector = SignaturesCollector::new( - SigningFinishEarlyStrategy::default(), - all_transactions, - Arc::new(TestSignInteractor::new( - SimulatedUser::prudent_with_failures( - SimulatedFailures::with_simulated_failures([ - FactorSourceIDFromHash::sample_at(1), - ]), - ), - )), - &profile, - SigningPurpose::sign_transaction_primary(), - ) - .unwrap(); - - let outcome = collector.collect_signatures().await.unwrap(); - assert!(outcome.successful()); - assert_eq!( - outcome - .successful_transactions() - .into_iter() - .map(|t| t.signable_id.clone()) - .collect_vec(), - vec![tx0.clone().transaction_intent_hash()] - ); - assert_eq!( - outcome - .all_signatures() - .into_iter() - .map(|s| s.factor_source_id()) - .collect_vec(), - vec![FactorSourceIDFromHash::sample_at(8)] - ); - } - - #[actix_rt::test] - async fn many_failing_tx() { - let factor_sources = &FactorSource::sample_all(); - let a0 = &Account::sample_at(0); - let p3 = &Persona::sample_at(3); - let tx = - TransactionIntent::sample_entities_requiring_auth([], [p3]); - - // In need of different PublicKeyHashes so the IntentHash of each transaction is different - let make_random_pk_hash = || { - let private_key = Ed25519PrivateKey::generate(); - PublicKeyHash::hash(private_key.public_key()) - }; - let failing_transactions = (0..100) - .map(|_| { - TransactionIntent::sample_entity_addresses_with_pub_key_hashes_requiring_auth( - [(a0.address, make_random_pk_hash())], - [], - ) - }) - .collect::>(); - let mut all_transactions = failing_transactions.clone(); - all_transactions.push(tx.clone()); - - let profile = - Profile::sample_from(factor_sources.clone(), [a0], [p3]); - - let collector = SignaturesCollector::new( - SigningFinishEarlyStrategy::default(), - all_transactions, - Arc::new(TestSignInteractor::new( - SimulatedUser::prudent_with_failures( - SimulatedFailures::with_simulated_failures([ - FactorSourceIDFromHash::sample_at(0), - ]), - ), - )), - &profile, - SigningPurpose::sign_transaction_primary(), - ) - .unwrap(); - - let outcome = collector.collect_signatures().await.unwrap(); - assert!(!outcome.successful()); - assert_eq!( - outcome - .failed_transactions() - .iter() - .map(|t| t.signable_id.clone()) - .collect_vec(), - failing_transactions - .iter() - .map(|t| t.transaction_intent_hash().clone()) - .collect_vec() - ); - - assert_eq!( - outcome - .ids_of_neglected_factor_sources_failed() - .into_iter() - .collect_vec(), - vec![FactorSourceIDFromHash::sample_at(0)] - ); - - assert!(outcome - .ids_of_neglected_factor_sources_skipped_by_user() - .is_empty()); - - assert_eq!( - outcome - .successful_transactions() - .into_iter() - .map(|t| t.signable_id) - .collect_vec(), - vec![tx.transaction_intent_hash()] - ) - } - - #[actix_rt::test] - async fn same_tx_is_not_shown_to_user_in_case_of_already_failure() { - let factor_sources = FactorSource::sample_all(); - - let a7 = Account::sample_at(7); - let a0 = Account::sample_at(0); - - let tx0 = TransactionIntent::sample_entities_requiring_auth( - [&a7, &a0], - [], - ); - let tx1 = TransactionIntent::sample_entities_requiring_auth( - [&a0], - [], - ); - - let profile = Profile::sample_from( - factor_sources.clone(), - [&a7, &a0], - [], - ); - - type Tuple = ( - FactorSourceKind, - IndexSet< - InvalidTransactionIfNeglected, - >, - ); - type Tuples = Vec; - let tuples = - Rc::>::new(RefCell::new(Tuples::default())); - let tuples_clone = tuples.clone(); - let collector = SignaturesCollector::new( - SigningFinishEarlyStrategy::default(), - [tx0.clone(), tx1.clone()], - Arc::new(TestSignInteractor::new(SimulatedUser::with_spy( - move |kind, invalid| { - let tuple = (kind, invalid); - let mut x = RefCell::borrow_mut(&tuples_clone); - x.push(tuple) - }, - SimulatedUserMode::Prudent, - SimulatedFailures::with_simulated_failures([ - FactorSourceIDFromHash::sample_at(2), // will cause any TX with a7 to fail - ]), - ))), - &profile, - SigningPurpose::sign_transaction_primary(), - ) - .unwrap(); - - let outcome = collector.collect_signatures().await.unwrap(); - - let tuples = tuples.borrow().clone(); - assert_eq!( - tuples, - vec![ - ( - FactorSourceKind::LedgerHQHardwareWallet, - IndexSet::just(InvalidTransactionIfNeglected::new( - tx0.clone().transaction_intent_hash(), - [a7.address.into()] - )) - ), - // Important that we do NOT display any mentioning of `tx0` here again! - ( - FactorSourceKind::Device, - IndexSet::just(InvalidTransactionIfNeglected::new( - tx1.clone().transaction_intent_hash(), - [a0.address.into()] - )) - ), - ] - ); - - assert!(!outcome.successful()); - assert_eq!( - outcome.ids_of_neglected_factor_sources_failed(), - IndexSet::::just( - FactorSourceIDFromHash::sample_at(2) - ) - ); - assert_eq!( - outcome.ids_of_neglected_factor_sources_irrelevant(), - IndexSet::::from_iter([ - FactorSourceIDFromHash::sample_at(6), - FactorSourceIDFromHash::sample_at(7), - FactorSourceIDFromHash::sample_at(8), - FactorSourceIDFromHash::sample_at(9) - ]) - ); - assert_eq!( - outcome - .successful_transactions() - .into_iter() - .map(|t| t.signable_id) - .collect_vec(), - vec![tx1.transaction_intent_hash().clone()] - ); - - assert_eq!( - outcome - .failed_transactions() - .into_iter() - .map(|t| t.signable_id) - .collect_vec(), - vec![tx0.transaction_intent_hash().clone()] - ); - - assert_eq!(outcome.all_signatures().len(), 1); - - assert!(outcome - .all_signatures() - .into_iter() - .map(|s| s.payload_id().clone()) - .all(|i| i == tx1.transaction_intent_hash())); - - assert_eq!( - outcome - .all_signatures() - .into_iter() - .map(|s| s.derivation_path()) - .collect_vec(), - vec![DerivationPath::from(AccountPath::new( - NetworkID::Mainnet, - CAP26KeyKind::TransactionSigning, - Hardened::from_local_key_space( - U31::ZERO, - IsSecurified(false) - ) // unsecurified account at `0`. - .unwrap() - ))] - ) - } - } - - mod no_fail { - use super::*; - - #[actix_rt::test] - async fn multi_accounts_multi_personas_all_single_factor_controlled( - ) { - multi_accounts_multi_personas_all_single_factor_controlled_with_sim_user( - SimulatedUser::prudent_no_fail(), - ) - .await; - - // Same result with lazy user, not able to skip without failures. - multi_accounts_multi_personas_all_single_factor_controlled_with_sim_user( - SimulatedUser::lazy_sign_minimum([]), - ) - .await - } - - #[actix_rt::test] - async fn multi_securified_entities() { - multi_securified_entities_with_sim_user(Vector { - simulated_user: SimulatedUser::prudent_no_fail(), - expected: Expected { - successful_txs_signature_count: 32, - // We always end early - // `Device` FactorSourceKind never got used since it - // we are done after YubiKey. - signed_factor_source_kinds: - IndexSet::::from_iter([ - FactorSourceKind::LedgerHQHardwareWallet, - FactorSourceKind::ArculusCard, - FactorSourceKind::Password, - ]), - expected_neglected_factor_source_count: 0, - }, - }) - .await; - - multi_securified_entities_with_sim_user(Vector { - simulated_user: SimulatedUser::lazy_sign_minimum([]), - expected: Expected { - successful_txs_signature_count: 24, - // We always end early, this lazy user was able to skip - // Ledger. - signed_factor_source_kinds: - IndexSet::::from_iter([ - FactorSourceKind::ArculusCard, - FactorSourceKind::Password, - FactorSourceKind::Device, - ]), - expected_neglected_factor_source_count: 2, - }, - }) - .await; - } - } - } - mod single_tx { use super::*; @@ -2533,103 +1649,4 @@ mod tests { } } } - - mod rola { - use super::*; - - #[actix_rt::test] - async fn test_petitions_for() { - let factor_sources = &FactorSource::sample_all(); - - let a0 = &Account::sample_at(0); - let a1 = &Account::sample_at(1); - let a6 = &Account::sample_at(6); - - let p0 = &Persona::sample_at(0); - let p1 = &Persona::sample_at(1); - let p6 = &Persona::sample_at(6); - - let entities_to_sign = vec![ - AddressOfAccountOrPersona::Account(a0.address), - AddressOfAccountOrPersona::Account(a1.address), - AddressOfAccountOrPersona::Account(a6.address), - AddressOfAccountOrPersona::Identity(p0.address), - AddressOfAccountOrPersona::Identity(p1.address), - AddressOfAccountOrPersona::Identity(p6.address), - ]; - - let auth_intent = AuthIntent::new_from_request( - DappToWalletInteractionAuthChallengeNonce::sample(), - DappToWalletInteractionMetadata::sample(), - entities_to_sign, - ) - .unwrap(); - - let profile = Profile::sample_from( - factor_sources.clone(), - [a0, a1, a6], - [p0, p1, p6], - ); - - let collector = SignaturesCollector::new( - SigningFinishEarlyStrategy::default(), - [auth_intent.clone()], - Arc::new(TestSignInteractor::new( - SimulatedUser::prudent_no_fail(), - )), - &profile, - SigningPurpose::ROLA, - ) - .unwrap(); - - let petitions = collector.petitions(); - - assert_eq!( - petitions - .txid_to_petition - .read() - .expect("Petitions lock should not have been poisoned") - .len(), - 1 - ); - - assert_petition( - &petitions, - &auth_intent, - HashMap::from_iter([ - ( - a0.address.into(), - HashSet::just(FactorSourceIDFromHash::sample_at(0)), - ), - ( - a1.address.into(), - HashSet::just(FactorSourceIDFromHash::sample_at(1)), - ), - ( - a6.address.into(), - HashSet::from_iter([ - // Only device factor source is used for signing auth for securified entity - FactorSourceIDFromHash::sample_at(0), - ]), - ), - ( - p0.address.into(), - HashSet::just(FactorSourceIDFromHash::sample_at(0)), - ), - ( - p1.address.into(), - HashSet::just(FactorSourceIDFromHash::sample_at(1)), - ), - ( - p6.address.into(), - HashSet::from_iter([ - // Only device factor source is used for signing auth for securified entity - FactorSourceIDFromHash::sample_at(0), - ]), - ), - ]), - HashMap::from_iter([]), - ); - } - } } diff --git a/crates/sargon_SPLIT_ME/src/signing/collector/signatures_collector_dependencies.rs b/crates/app/signing/src/collector/signatures_collector_dependencies.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/signing/collector/signatures_collector_dependencies.rs rename to crates/app/signing/src/collector/signatures_collector_dependencies.rs diff --git a/crates/sargon_SPLIT_ME/src/signing/collector/signatures_collector_preprocessor.rs b/crates/app/signing/src/collector/signatures_collector_preprocessor.rs similarity index 94% rename from crates/sargon_SPLIT_ME/src/signing/collector/signatures_collector_preprocessor.rs rename to crates/app/signing/src/collector/signatures_collector_preprocessor.rs index 0714209fd..1f252e870 100644 --- a/crates/sargon_SPLIT_ME/src/signing/collector/signatures_collector_preprocessor.rs +++ b/crates/app/signing/src/collector/signatures_collector_preprocessor.rs @@ -14,12 +14,17 @@ impl SignaturesCollectorPreprocessor { } pub fn analyzing_signables( - profile: &Profile, + entity_querying: &impl GetEntityByAddress, signables: Vec, ) -> Result { let signables_with_entities = signables .into_iter() - .map(|s| SignableWithEntities::extracting_from_profile(&s, profile)) + .map(|s| { + SignableWithEntities::extracting_from_profile( + &s, + entity_querying, + ) + }) .collect::>>()?; Ok(Self::new(IdentifiedVecOf::from_iter( diff --git a/crates/sargon_SPLIT_ME/src/signing/collector/signatures_collector_state.rs b/crates/app/signing/src/collector/signatures_collector_state.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/signing/collector/signatures_collector_state.rs rename to crates/app/signing/src/collector/signatures_collector_state.rs diff --git a/crates/sargon_SPLIT_ME/src/signing/collector/signing_finish_early_strategy.rs b/crates/app/signing/src/collector/signing_finish_early_strategy.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/signing/collector/signing_finish_early_strategy.rs rename to crates/app/signing/src/collector/signing_finish_early_strategy.rs diff --git a/crates/app/signing/src/extractor_of_entities_requiring_auth.rs b/crates/app/signing/src/extractor_of_entities_requiring_auth.rs new file mode 100644 index 000000000..3bb43e5ec --- /dev/null +++ b/crates/app/signing/src/extractor_of_entities_requiring_auth.rs @@ -0,0 +1,44 @@ +use crate::prelude::*; + +/// Utility to extract entities requiring auth from a profile and a manifest summary. +pub struct ExtractorOfEntitiesRequiringAuth; +impl ExtractorOfEntitiesRequiringAuth { + /// Matches entities requiring auth from a manifest summary with the entities in the given profile. + /// Returns a set of `AccountOrPersona` or empty if the manifest summary does not require auth. + /// Returns an error if persona is unknown. + pub fn extract( + entity_querying: &impl GetEntityByAddress, + summary: ManifestSummary, + ) -> Result> { + let mut entities_requiring_auth: IndexSet = + IndexSet::new(); + + let accounts = summary + .addresses_of_accounts_requiring_auth + .iter() + .map(|a| entity_querying.account_by_address(*a)) + .filter_map(|a| a.ok()) + .collect::>(); + + entities_requiring_auth.extend( + accounts + .into_iter() + .map(AccountOrPersona::from) + .collect_vec(), + ); + + let personas = summary + .addresses_of_personas_requiring_auth + .into_iter() + .map(|a| entity_querying.persona_by_address(a)) + .collect::>>()?; + + entities_requiring_auth.extend( + personas + .into_iter() + .map(AccountOrPersona::from) + .collect_vec(), + ); + Ok(entities_requiring_auth) + } +} diff --git a/crates/sargon_SPLIT_ME/src/signing/host_interaction/mod.rs b/crates/app/signing/src/host_interaction/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/signing/host_interaction/mod.rs rename to crates/app/signing/src/host_interaction/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/signing/host_interaction/sign_interactor.rs b/crates/app/signing/src/host_interaction/sign_interactor.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/signing/host_interaction/sign_interactor.rs rename to crates/app/signing/src/host_interaction/sign_interactor.rs diff --git a/crates/sargon_SPLIT_ME/src/signing/host_interaction/sign_request.rs b/crates/app/signing/src/host_interaction/sign_request.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/signing/host_interaction/sign_request.rs rename to crates/app/signing/src/host_interaction/sign_request.rs diff --git a/crates/sargon_SPLIT_ME/src/signing/host_interaction/sign_response.rs b/crates/app/signing/src/host_interaction/sign_response.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/signing/host_interaction/sign_response.rs rename to crates/app/signing/src/host_interaction/sign_response.rs diff --git a/crates/sargon_SPLIT_ME/src/signing/host_interaction/transaction_sign_request_input.rs b/crates/app/signing/src/host_interaction/transaction_sign_request_input.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/signing/host_interaction/transaction_sign_request_input.rs rename to crates/app/signing/src/host_interaction/transaction_sign_request_input.rs diff --git a/crates/app/signing/src/lib.rs b/crates/app/signing/src/lib.rs new file mode 100644 index 000000000..e7b996bbf --- /dev/null +++ b/crates/app/signing/src/lib.rs @@ -0,0 +1,59 @@ +mod authentication; +mod collector; +mod extractor_of_entities_requiring_auth; +mod host_interaction; +mod petition_types; +mod signable_with_entities; +mod signables; +mod signatures_outcome_types; +mod testing; +mod types; + +pub mod prelude { + pub use crate::authentication::*; + pub use crate::collector::*; + pub use crate::extractor_of_entities_requiring_auth::*; + pub use crate::host_interaction::*; + pub use crate::petition_types::*; + pub(crate) use crate::signable_with_entities::*; + pub use crate::signables::*; + pub use crate::signatures_outcome_types::*; + pub use crate::testing::*; + pub use crate::types::*; + + pub(crate) use addresses::prelude::*; + pub(crate) use bytes::prelude::*; + pub(crate) use cap26_models::prelude::*; + pub(crate) use core_collections::prelude::*; + pub(crate) use ecc::prelude::*; + pub(crate) use entity_by_address::prelude::*; + pub(crate) use hash::prelude::*; + pub(crate) use identified_vec_of::prelude::*; + pub(crate) use metadata::prelude::*; + pub(crate) use network::prelude::*; + pub(crate) use profile_account::prelude::*; + pub(crate) use profile_account_or_persona::prelude::*; + pub(crate) use profile_base_entity::prelude::*; + pub(crate) use profile_persona::prelude::*; + pub(crate) use profile_security_structures::prelude::{ + FactorListKind, + GeneralRoleWithHierarchicalDeterministicFactorInstances, RoleKind, + }; + pub(crate) use radix_connect_models::prelude::*; + pub(crate) use transaction_models::prelude::*; + + pub(crate) use radix_engine_interface::prelude::MetadataValue as ScryptoMetadataValue; + pub(crate) use radix_transactions::prelude::{ + SubintentManifestV2Builder as ScryptoSubintentManifestV2Builder, + TransactionManifestV1Builder as ScryptoTransactionManifestBuilder, + }; + + pub(crate) use log::*; + pub(crate) use std::collections::{HashMap, HashSet}; + pub(crate) use std::sync::{Arc, RwLock}; + + #[cfg(test)] + pub(crate) use serde::Deserialize; +} + +pub use prelude::*; diff --git a/crates/sargon_SPLIT_ME/src/signing/petition_types/mod.rs b/crates/app/signing/src/petition_types/mod.rs similarity index 68% rename from crates/sargon_SPLIT_ME/src/signing/petition_types/mod.rs rename to crates/app/signing/src/petition_types/mod.rs index fec017e74..b43cd662c 100644 --- a/crates/sargon_SPLIT_ME/src/signing/petition_types/mod.rs +++ b/crates/app/signing/src/petition_types/mod.rs @@ -5,10 +5,10 @@ mod petition_status; mod petitions; mod signing_purpose; -pub(crate) use petition_for_entity::*; -pub(crate) use petition_for_transaction::*; +pub use petition_for_entity::*; +pub use petition_for_transaction::*; pub(crate) use petition_status::*; -pub(crate) use petitions::*; +pub use petitions::*; pub use petition_for_factors_types::*; pub use signing_purpose::*; diff --git a/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_entity.rs b/crates/app/signing/src/petition_types/petition_for_entity.rs similarity index 98% rename from crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_entity.rs rename to crates/app/signing/src/petition_types/petition_for_entity.rs index 211b0b2b3..ae4edf8c4 100644 --- a/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_entity.rs +++ b/crates/app/signing/src/petition_types/petition_for_entity.rs @@ -5,7 +5,7 @@ use crate::prelude::*; /// `{ threshold: PetitionForFactors, override: PetitionForFactors }` #[derive(derive_more::Debug)] #[debug("{}", self.debug_str())] -pub(crate) struct PetitionForEntity { +pub struct PetitionForEntity { /// The owner of these factors pub(crate) entity: AddressOfAccountOrPersona, @@ -159,7 +159,7 @@ impl PetitionForEntity { } /// Returns the aggregate of **all** owned factor instances from both lists, either threshold or override. - pub(crate) fn all_factor_instances(&self) -> IndexSet { + pub fn all_factor_instances(&self) -> IndexSet { self.access_both_list_then_form_union(|l| l.factor_instances()) .into_iter() .map(|f| { @@ -681,7 +681,8 @@ mod tests { ), ), ); - let signature = HDSignature::produced_signing_with_input(sign_input); + let signature = + unsafe { HDSignature::produced_signing_with_input(sign_input) }; sut.add_signature(signature.clone()); sut.add_signature(signature.clone()); @@ -690,7 +691,8 @@ mod tests { #[test] fn invalid_transactions_if_neglected_success() { let sut = SUT::sample(); - let signature = HDSignature::produced_signing_with_input( + let signature = unsafe { + HDSignature::produced_signing_with_input( HDSignatureInput::new( sut.payload_id.clone(), OwnedFactorInstance::new( @@ -701,7 +703,8 @@ mod tests { ), ), ) - ); + ) + }; sut.add_signature(signature); let can_skip = |f: FactorSourceIDFromHash| { assert!(sut diff --git a/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/factor_source_referencing.rs b/crates/app/signing/src/petition_types/petition_for_factors_types/factor_source_referencing.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/factor_source_referencing.rs rename to crates/app/signing/src/petition_types/petition_for_factors_types/factor_source_referencing.rs diff --git a/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/mod.rs b/crates/app/signing/src/petition_types/petition_for_factors_types/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/mod.rs rename to crates/app/signing/src/petition_types/petition_for_factors_types/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/neglected_factor_instance.rs b/crates/app/signing/src/petition_types/petition_for_factors_types/neglected_factor_instance.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/neglected_factor_instance.rs rename to crates/app/signing/src/petition_types/petition_for_factors_types/neglected_factor_instance.rs diff --git a/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/petition_for_factors/mod.rs b/crates/app/signing/src/petition_types/petition_for_factors_types/petition_for_factors/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/petition_for_factors/mod.rs rename to crates/app/signing/src/petition_types/petition_for_factors_types/petition_for_factors/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors.rs b/crates/app/signing/src/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors.rs rename to crates/app/signing/src/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors.rs diff --git a/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_input.rs b/crates/app/signing/src/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_input.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_input.rs rename to crates/app/signing/src/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_input.rs diff --git a/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state.rs b/crates/app/signing/src/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state.rs similarity index 97% rename from crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state.rs rename to crates/app/signing/src/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state.rs index e751910f2..1d32465d8 100644 --- a/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state.rs +++ b/crates/app/signing/src/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state.rs @@ -193,7 +193,8 @@ mod tests { factor_instance.clone(), ), ); - let signature = HDSignature::produced_signing_with_input(sign_input); + let signature = + unsafe { HDSignature::produced_signing_with_input(sign_input) }; sut.add_signature(&signature); @@ -222,7 +223,8 @@ mod tests { ), ); - let signature = HDSignature::produced_signing_with_input(sign_input); + let signature = + unsafe { HDSignature::produced_signing_with_input(sign_input) }; sut.add_signature(&signature); } diff --git a/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state_snapshot.rs b/crates/app/signing/src/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state_snapshot.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state_snapshot.rs rename to crates/app/signing/src/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_state_snapshot.rs diff --git a/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_status.rs b/crates/app/signing/src/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_status.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_status.rs rename to crates/app/signing/src/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_status.rs diff --git a/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_sub_state.rs b/crates/app/signing/src/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_sub_state.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_sub_state.rs rename to crates/app/signing/src/petition_types/petition_for_factors_types/petition_for_factors/petition_for_factors_sub_state.rs diff --git a/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_transaction.rs b/crates/app/signing/src/petition_types/petition_for_transaction.rs similarity index 98% rename from crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_transaction.rs rename to crates/app/signing/src/petition_types/petition_for_transaction.rs index ecd51d1d2..a54787ec8 100644 --- a/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_for_transaction.rs +++ b/crates/app/signing/src/petition_types/petition_for_transaction.rs @@ -6,11 +6,11 @@ use crate::prelude::*; /// Essentially a wrapper around `Iterator`. #[derive(derive_more::Debug)] #[debug("{}", self.debug_str())] -pub(crate) struct PetitionForTransaction { +pub struct PetitionForTransaction { /// Transaction to sign pub(crate) signable: S, - pub(crate) for_entities: + pub for_entities: RwLock>>, } @@ -340,7 +340,7 @@ mod tests { [account.address], [], ); - let matrix = match account.security_state { + let matrix = match &account.security_state { EntitySecurityState::Securified { value } => { value.security_structure.matrix_of_factors.clone() } @@ -384,7 +384,7 @@ mod tests { let account = Account::sample_at(5); let intent = TransactionIntent::sample_entities_requiring_auth([&account], []); - let matrix = match account.security_state { + let matrix = match &account.security_state { EntitySecurityState::Securified { value } => { value.security_structure.matrix_of_factors.clone() } diff --git a/crates/sargon_SPLIT_ME/src/signing/petition_types/petition_status.rs b/crates/app/signing/src/petition_types/petition_status.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/signing/petition_types/petition_status.rs rename to crates/app/signing/src/petition_types/petition_status.rs diff --git a/crates/sargon_SPLIT_ME/src/signing/petition_types/petitions.rs b/crates/app/signing/src/petition_types/petitions.rs similarity index 98% rename from crates/sargon_SPLIT_ME/src/signing/petition_types/petitions.rs rename to crates/app/signing/src/petition_types/petitions.rs index b0d0757ac..ca787d4b1 100644 --- a/crates/sargon_SPLIT_ME/src/signing/petition_types/petitions.rs +++ b/crates/app/signing/src/petition_types/petitions.rs @@ -6,7 +6,7 @@ use crate::prelude::*; #[derive(derive_more::Debug)] #[debug("{}", self.debug_str())] -pub(crate) struct Petitions { +pub struct Petitions { /// Lookup from factor to TXID. /// /// @@ -23,8 +23,7 @@ pub(crate) struct Petitions { /// Lookup from TXID to signatures builders, sorted according to the order of /// transactions passed to the SignaturesBuilder. - pub(crate) txid_to_petition: - RwLock>>, + pub txid_to_petition: RwLock>>, } impl Clone for Petitions { diff --git a/crates/sargon_SPLIT_ME/src/signing/petition_types/signing_purpose.rs b/crates/app/signing/src/petition_types/signing_purpose.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/signing/petition_types/signing_purpose.rs rename to crates/app/signing/src/petition_types/signing_purpose.rs diff --git a/crates/sargon_SPLIT_ME/src/signing/signable_with_entities.rs b/crates/app/signing/src/signable_with_entities.rs similarity index 94% rename from crates/sargon_SPLIT_ME/src/signing/signable_with_entities.rs rename to crates/app/signing/src/signable_with_entities.rs index a9f1106d0..2da63a268 100644 --- a/crates/sargon_SPLIT_ME/src/signing/signable_with_entities.rs +++ b/crates/app/signing/src/signable_with_entities.rs @@ -39,9 +39,9 @@ impl SignableWithEntities { pub(crate) fn extracting_from_profile( signable: &S, - profile: &Profile, + entity_querying: &impl GetEntityByAddress, ) -> Result { - let entities = signable.entities_requiring_signing(profile)?; + let entities = signable.entities_requiring_signing(entity_querying)?; Ok(Self::with(signable.clone(), entities)) } diff --git a/crates/sargon_SPLIT_ME/src/signing/signables/mod.rs b/crates/app/signing/src/signables/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/signing/signables/mod.rs rename to crates/app/signing/src/signables/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/signing/signables/signable.rs b/crates/app/signing/src/signables/signable.rs similarity index 98% rename from crates/sargon_SPLIT_ME/src/signing/signables/signable.rs rename to crates/app/signing/src/signables/signable.rs index 6e7a19217..2cc7dbd8a 100644 --- a/crates/sargon_SPLIT_ME/src/signing/signables/signable.rs +++ b/crates/app/signing/src/signables/signable.rs @@ -27,7 +27,7 @@ pub trait Signable: /// A function that extracts the involved entities that require signing. fn entities_requiring_signing( &self, - profile: &Profile, + entity_querying: &impl GetEntityByAddress, ) -> Result>; fn get_payload(&self) -> Self::Payload { @@ -54,6 +54,8 @@ pub trait SignableID: { } +impl SignableID for Exactly32Bytes {} + /// A trait which provides the ability to construct a `Signable` sample by building a manifest. pub trait ProvidesSamplesByBuildingManifest: PartialEq + Eq + Clone + Send + Sync diff --git a/crates/sargon_SPLIT_ME/src/signing/signables/signable_auth_intent.rs b/crates/app/signing/src/signables/signable_auth_intent.rs similarity index 89% rename from crates/sargon_SPLIT_ME/src/signing/signables/signable_auth_intent.rs rename to crates/app/signing/src/signables/signable_auth_intent.rs index 3cebcb814..5f7a22148 100644 --- a/crates/sargon_SPLIT_ME/src/signing/signables/signable_auth_intent.rs +++ b/crates/app/signing/src/signables/signable_auth_intent.rs @@ -7,18 +7,20 @@ impl Signable for AuthIntent { fn entities_requiring_signing( &self, - profile: &Profile, + entity_querying: &impl GetEntityByAddress, ) -> Result> { let entities = self .entities_to_sign .iter() .filter_map(|address| match address { - AddressOfAccountOrPersona::Account(account_address) => profile - .account_by_address(*account_address) - .map(AccountOrPersona::AccountEntity) - .ok(), + AddressOfAccountOrPersona::Account(account_address) => { + entity_querying + .account_by_address(*account_address) + .map(AccountOrPersona::AccountEntity) + .ok() + } AddressOfAccountOrPersona::Identity(identity_address) => { - profile + entity_querying .persona_by_address(*identity_address) .map(AccountOrPersona::PersonaEntity) .ok() @@ -70,11 +72,13 @@ mod tests { #[test] fn test_get_entities_requiring_signing() { - let profile = Profile::sample(); - let accounts_in_profile = - profile.accounts_on_current_network().unwrap(); - let personas_in_profile = - profile.personas_on_current_network().unwrap(); + let profile = ProtoProfile::new( + [Account::sample_alice()], + [Persona::sample_mainnet()], + [FactorSource::sample_device()], + ); + let accounts_in_profile = profile.accounts.clone(); + let personas_in_profile = profile.personas.clone(); let unknown_account_address_to_profile = AddressOfAccountOrPersona::Account( @@ -84,6 +88,7 @@ mod tests { AddressOfAccountOrPersona::Identity( Persona::sample_mainnet_third().address, ); + let mut addresses_requested = accounts_in_profile .clone() .into_iter() diff --git a/crates/sargon_SPLIT_ME/src/signing/signables/signable_subintent.rs b/crates/app/signing/src/signables/signable_subintent.rs similarity index 96% rename from crates/sargon_SPLIT_ME/src/signing/signables/signable_subintent.rs rename to crates/app/signing/src/signables/signable_subintent.rs index a714b4cbf..4e2bb3fe4 100644 --- a/crates/sargon_SPLIT_ME/src/signing/signables/signable_subintent.rs +++ b/crates/app/signing/src/signables/signable_subintent.rs @@ -9,11 +9,11 @@ impl Signable for Subintent { fn entities_requiring_signing( &self, - profile: &Profile, + entity_querying: &impl GetEntityByAddress, ) -> Result> { let summary = self.manifest.summary().unwrap(); - ExtractorOfEntitiesRequiringAuth::extract(profile, summary) + ExtractorOfEntitiesRequiringAuth::extract(entity_querying, summary) } fn signed( diff --git a/crates/sargon_SPLIT_ME/src/signing/signables/signable_transaction_intent.rs b/crates/app/signing/src/signables/signable_transaction_intent.rs similarity index 96% rename from crates/sargon_SPLIT_ME/src/signing/signables/signable_transaction_intent.rs rename to crates/app/signing/src/signables/signable_transaction_intent.rs index f0177efa1..87f20b922 100644 --- a/crates/sargon_SPLIT_ME/src/signing/signables/signable_transaction_intent.rs +++ b/crates/app/signing/src/signables/signable_transaction_intent.rs @@ -9,11 +9,11 @@ impl Signable for TransactionIntent { fn entities_requiring_signing( &self, - profile: &Profile, + entity_querying: &impl GetEntityByAddress, ) -> Result> { let summary = self.manifest_summary()?; - ExtractorOfEntitiesRequiringAuth::extract(profile, summary) + ExtractorOfEntitiesRequiringAuth::extract(entity_querying, summary) } fn signed( diff --git a/crates/sargon_SPLIT_ME/src/signing/signatures_outecome_types/maybe_signed_transactions.rs b/crates/app/signing/src/signatures_outcome_types/maybe_signed_transactions.rs similarity index 97% rename from crates/sargon_SPLIT_ME/src/signing/signatures_outecome_types/maybe_signed_transactions.rs rename to crates/app/signing/src/signatures_outcome_types/maybe_signed_transactions.rs index 69cabbdd9..bb76392c7 100644 --- a/crates/sargon_SPLIT_ME/src/signing/signatures_outecome_types/maybe_signed_transactions.rs +++ b/crates/app/signing/src/signatures_outcome_types/maybe_signed_transactions.rs @@ -9,10 +9,11 @@ pub(crate) struct MaybeSignedTransactions { #[derive(Debug, PartialEq, Eq, Clone)] pub struct SignedTransaction { /// The transaction intent hash. - pub(crate) signable_id: ID, + pub signable_id: ID, /// The signatures for this transaction. - pub(crate) signatures: IndexSet>, + pub signatures: IndexSet>, } + impl SignedTransaction { pub(crate) fn new( signable_id: ID, @@ -287,7 +288,8 @@ mod tests { ), ), ); - let signature = HDSignature::produced_signing_with_input(input); + let signature = + unsafe { HDSignature::produced_signing_with_input(input) }; sut.add_signatures(tx, IndexSet::from_iter([signature])); } @@ -310,7 +312,8 @@ mod tests { ), ), ); - let signature = HDSignature::produced_signing_with_input(input); + let signature = + unsafe { HDSignature::produced_signing_with_input(input) }; sut.add_signatures( TransactionIntentHash::sample_other(), diff --git a/crates/sargon_SPLIT_ME/src/signing/signatures_outecome_types/mod.rs b/crates/app/signing/src/signatures_outcome_types/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/signing/signatures_outecome_types/mod.rs rename to crates/app/signing/src/signatures_outcome_types/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/signing/signatures_outecome_types/petition_transaction_outcome.rs b/crates/app/signing/src/signatures_outcome_types/petition_transaction_outcome.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/signing/signatures_outecome_types/petition_transaction_outcome.rs rename to crates/app/signing/src/signatures_outcome_types/petition_transaction_outcome.rs diff --git a/crates/sargon_SPLIT_ME/src/signing/signatures_outecome_types/sign_with_factors_outcome.rs b/crates/app/signing/src/signatures_outcome_types/sign_with_factors_outcome.rs similarity index 99% rename from crates/sargon_SPLIT_ME/src/signing/signatures_outecome_types/sign_with_factors_outcome.rs rename to crates/app/signing/src/signatures_outcome_types/sign_with_factors_outcome.rs index 84ae8cddc..da0e6334b 100644 --- a/crates/sargon_SPLIT_ME/src/signing/signatures_outecome_types/sign_with_factors_outcome.rs +++ b/crates/app/signing/src/signatures_outcome_types/sign_with_factors_outcome.rs @@ -68,7 +68,7 @@ impl SignWithFactorsOutcome { factor_sources_of_kind .factor_sources() .into_iter() - .map(|f| *f.factor_source_id().as_hash().unwrap()) // TODO ask that + .map(|f| *f.factor_source_id().as_hash().unwrap()) .collect(), )) } diff --git a/crates/sargon_SPLIT_ME/src/signing/signatures_outecome_types/signatures_outcome.rs b/crates/app/signing/src/signatures_outcome_types/signatures_outcome.rs similarity index 95% rename from crates/sargon_SPLIT_ME/src/signing/signatures_outecome_types/signatures_outcome.rs rename to crates/app/signing/src/signatures_outcome_types/signatures_outcome.rs index 9797c310d..7e66af650 100644 --- a/crates/sargon_SPLIT_ME/src/signing/signatures_outecome_types/signatures_outcome.rs +++ b/crates/app/signing/src/signatures_outcome_types/signatures_outcome.rs @@ -110,7 +110,7 @@ impl SignaturesOutcome { } #[allow(unused)] - pub(crate) fn ids_of_neglected_factor_sources_skipped_by_user( + pub fn ids_of_neglected_factor_sources_skipped_by_user( &self, ) -> IndexSet { self.ids_of_neglected_factor_sources_filter(|nf| { @@ -119,7 +119,7 @@ impl SignaturesOutcome { } #[allow(unused)] - pub(crate) fn ids_of_neglected_factor_sources_failed( + pub fn ids_of_neglected_factor_sources_failed( &self, ) -> IndexSet { self.ids_of_neglected_factor_sources_filter(|nf| { @@ -128,7 +128,7 @@ impl SignaturesOutcome { } #[allow(unused)] - pub(crate) fn ids_of_neglected_factor_sources_irrelevant( + pub fn ids_of_neglected_factor_sources_irrelevant( &self, ) -> IndexSet { self.ids_of_neglected_factor_sources_filter(|nf| { @@ -145,7 +145,7 @@ impl SignaturesOutcome { #[allow(unused)] /// All signatures from both successful transactions and failed transactions. - pub(crate) fn all_signatures(&self) -> IndexSet> { + pub fn all_signatures(&self) -> IndexSet> { self.signatures_of_successful_transactions() .union(&self.signatures_of_failed_transactions()) .cloned() diff --git a/crates/app/signing/src/testing/interactors/mod.rs b/crates/app/signing/src/testing/interactors/mod.rs new file mode 100644 index 000000000..f6864ca30 --- /dev/null +++ b/crates/app/signing/src/testing/interactors/mod.rs @@ -0,0 +1,7 @@ +#![allow(unused)] + +mod test_interactor; +mod test_sign_interactor; + +pub use test_interactor::*; +pub use test_sign_interactor::*; diff --git a/crates/sargon_SPLIT_ME/src/signing/testing/interactors/test_interactor.rs b/crates/app/signing/src/testing/interactors/test_interactor.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/signing/testing/interactors/test_interactor.rs rename to crates/app/signing/src/testing/interactors/test_interactor.rs diff --git a/crates/sargon_SPLIT_ME/src/signing/testing/interactors/test_sign_interactor.rs b/crates/app/signing/src/testing/interactors/test_sign_interactor.rs similarity index 89% rename from crates/sargon_SPLIT_ME/src/signing/testing/interactors/test_sign_interactor.rs rename to crates/app/signing/src/testing/interactors/test_sign_interactor.rs index 1b29c9f37..795e6142b 100644 --- a/crates/sargon_SPLIT_ME/src/signing/testing/interactors/test_sign_interactor.rs +++ b/crates/app/signing/src/testing/interactors/test_sign_interactor.rs @@ -2,12 +2,12 @@ use crate::prelude::*; -pub(crate) struct TestSignInteractor { - pub(crate) simulated_user: SimulatedUser, +pub struct TestSignInteractor { + pub simulated_user: SimulatedUser, } impl TestSignInteractor { - pub(crate) fn new(simulated_user: SimulatedUser) -> Self { + pub fn new(simulated_user: SimulatedUser) -> Self { Self { simulated_user } } } @@ -51,7 +51,7 @@ impl SignInteractor for TestSignInteractor { .flat_map(|x| { x.signature_inputs() .iter() - .map(|y| HDSignature::produced_signing_with_input(y.clone())) + .map(|y| unsafe { HDSignature::produced_signing_with_input(y.clone())}) .collect_vec() }) .collect::>>() diff --git a/crates/app/signing/src/testing/mod.rs b/crates/app/signing/src/testing/mod.rs new file mode 100644 index 000000000..05db991bf --- /dev/null +++ b/crates/app/signing/src/testing/mod.rs @@ -0,0 +1,9 @@ +#![allow(unused)] + +mod interactors; +mod simulated_user; +mod test_signatures_collector; + +pub use interactors::*; +pub use simulated_user::*; +pub use test_signatures_collector::*; diff --git a/crates/sargon_SPLIT_ME/src/signing/testing/simulated_user.rs b/crates/app/signing/src/testing/simulated_user.rs similarity index 91% rename from crates/sargon_SPLIT_ME/src/signing/testing/simulated_user.rs rename to crates/app/signing/src/testing/simulated_user.rs index 8dfc97b19..1f1db9b1f 100644 --- a/crates/sargon_SPLIT_ME/src/signing/testing/simulated_user.rs +++ b/crates/app/signing/src/testing/simulated_user.rs @@ -3,7 +3,7 @@ use crate::prelude::*; #[derive(Clone, Debug, PartialEq, Eq)] -pub(crate) enum SigningUserInput { +pub enum SigningUserInput { Sign, Skip, Reject, @@ -14,7 +14,7 @@ pub type SpyOnRequest = #[derive(Clone, derive_more::Debug)] #[debug("SimulatedUser(mode: {mode:?}, failures: {failures:?})")] -pub(crate) struct SimulatedUser { +pub struct SimulatedUser { spy_on_request: SpyOnRequest, mode: SimulatedUserMode, /// `None` means never failures @@ -22,7 +22,7 @@ pub(crate) struct SimulatedUser { } impl SimulatedUser { - pub(crate) fn with_spy( + pub fn with_spy( spy_on_request: impl Fn(FactorSourceKind, IndexSet>) + 'static, mode: SimulatedUserMode, @@ -34,7 +34,8 @@ impl SimulatedUser { failures: failures.into(), } } - pub(crate) fn new( + + pub fn new( mode: SimulatedUserMode, failures: impl Into>, ) -> Self { @@ -43,18 +44,18 @@ impl SimulatedUser { } #[derive(Debug, Clone, Default)] -pub(crate) struct SimulatedFailures { +pub struct SimulatedFailures { /// Set of FactorSources which should always fail. simulated_failures: IndexSet, } impl SimulatedFailures { - pub(crate) fn with_details( + pub fn with_details( simulated_failures: IndexSet, ) -> Self { Self { simulated_failures } } - pub(crate) fn with_simulated_failures( + pub fn with_simulated_failures( failures: impl IntoIterator, ) -> Self { Self::with_details(IndexSet::from_iter(failures)) @@ -72,7 +73,7 @@ impl SimulatedFailures { } #[derive(Clone, Debug, PartialEq, Eq)] -pub(crate) enum SimulatedUserMode { +pub enum SimulatedUserMode { /// Emulation of a "prudent" user, that signs with all factors sources, i.e. /// she never ever "skips" a factor source Prudent, @@ -97,27 +98,27 @@ impl SimulatedUserMode { } impl SimulatedUser { - pub(crate) fn prudent_no_fail() -> Self { + pub fn prudent_no_fail() -> Self { Self::new(SimulatedUserMode::Prudent, None) } - pub(crate) fn rejecting() -> Self { + pub fn rejecting() -> Self { Self::new(SimulatedUserMode::Rejecting, None) } - pub(crate) fn prudent_with_failures( + pub fn prudent_with_failures( simulated_failures: SimulatedFailures, ) -> Self { Self::new(SimulatedUserMode::Prudent, simulated_failures) } - pub(crate) fn lazy_always_skip_no_fail() -> Self { + pub fn lazy_always_skip_no_fail() -> Self { Self::new(SimulatedUserMode::lazy_always_skip(), None) } /// Skips only if `invalid_tx_if_skipped` is empty /// (or if simulated failure for that factor source) - pub(crate) fn lazy_sign_minimum( + pub fn lazy_sign_minimum( simulated_failures: impl IntoIterator, ) -> Self { Self::new( @@ -137,7 +138,7 @@ unsafe impl Send for SimulatedUser {} /// factor. But since user is so lazy, she defers signing with that override /// factor if prompted for it first. #[derive(Clone, Debug, PartialEq, Eq)] -pub(crate) enum Laziness { +pub enum Laziness { SignMinimum, AlwaysSkip, } diff --git a/crates/sargon_SPLIT_ME/src/signing/testing/test_signatures_collector.rs b/crates/app/signing/src/testing/test_signatures_collector.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/signing/testing/test_signatures_collector.rs rename to crates/app/signing/src/testing/test_signatures_collector.rs diff --git a/crates/sargon_SPLIT_ME/src/types/hd_signature.rs b/crates/app/signing/src/types/hd_signature.rs similarity index 95% rename from crates/sargon_SPLIT_ME/src/types/hd_signature.rs rename to crates/app/signing/src/types/hd_signature.rs index f5fe65de5..2a16162f5 100644 --- a/crates/sargon_SPLIT_ME/src/types/hd_signature.rs +++ b/crates/app/signing/src/types/hd_signature.rs @@ -101,9 +101,13 @@ impl HDSignature { } } -#[cfg(test)] impl HDSignature { - pub fn produced_signing_with_input(input: HDSignatureInput) -> Self { + /// # Safety + /// Not Rust unsafe, as in memory-unsafe, but unsafe since it + /// only uses signatures amongst sample value mnemonics. + pub unsafe fn produced_signing_with_input( + input: HDSignatureInput, + ) -> Self { Self::fake_sign_by_looking_up_mnemonic_amongst_samples(input) } } diff --git a/crates/sargon_SPLIT_ME/src/types/hd_signature_input.rs b/crates/app/signing/src/types/hd_signature_input.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/types/hd_signature_input.rs rename to crates/app/signing/src/types/hd_signature_input.rs diff --git a/crates/sargon_SPLIT_ME/src/types/invalid_transaction_if_neglected.rs b/crates/app/signing/src/types/invalid_transaction_if_neglected.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/types/invalid_transaction_if_neglected.rs rename to crates/app/signing/src/types/invalid_transaction_if_neglected.rs diff --git a/crates/sargon_SPLIT_ME/src/types/mod.rs b/crates/app/signing/src/types/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/types/mod.rs rename to crates/app/signing/src/types/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/types/owned_types/mod.rs b/crates/app/signing/src/types/owned_types/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/types/owned_types/mod.rs rename to crates/app/signing/src/types/owned_types/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/types/owned_types/owned.rs b/crates/app/signing/src/types/owned_types/owned.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/types/owned_types/owned.rs rename to crates/app/signing/src/types/owned_types/owned.rs diff --git a/crates/sargon_SPLIT_ME/src/types/owned_types/owned_factor_instance.rs b/crates/app/signing/src/types/owned_types/owned_factor_instance.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/types/owned_types/owned_factor_instance.rs rename to crates/app/signing/src/types/owned_types/owned_factor_instance.rs diff --git a/crates/common/short-string/Cargo.toml b/crates/common/short-string/Cargo.toml index 1becbee6c..32b156234 100644 --- a/crates/common/short-string/Cargo.toml +++ b/crates/common/short-string/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" # === SARGON CRATES === identified-vec-of = { path = "../../common/identified-vec-of" } assert-json = { path = "../../core/assert-json" } -sargon-core-utils = { path = "../../core/utils" } +core-utils = { path = "../../core/utils" } has-sample-values = { path = "../../core/has-sample-values" } # === RADIX DEPENDENCIES === diff --git a/crates/common/short-string/src/display_name.rs b/crates/common/short-string/src/display_name.rs index 487624d75..a19114356 100644 --- a/crates/common/short-string/src/display_name.rs +++ b/crates/common/short-string/src/display_name.rs @@ -1,4 +1,4 @@ -use sargon_core_utils::prelude::prefix_str; +use core_utils::prelude::prefix_str; use crate::prelude::*; diff --git a/crates/core/has-sample-values/src/has_indexed_sample_values.rs b/crates/core/has-sample-values/src/has_indexed_sample_values.rs new file mode 100644 index 000000000..62c1e23d0 --- /dev/null +++ b/crates/core/has-sample-values/src/has_indexed_sample_values.rs @@ -0,0 +1,4 @@ +pub trait HasIndexedSampleValues: Sized { + #[allow(dead_code)] + fn sample_at(index: usize) -> Self; +} diff --git a/crates/core/has-sample-values/src/has_many_sample_values.rs b/crates/core/has-sample-values/src/has_many_sample_values.rs new file mode 100644 index 000000000..2d65869d6 --- /dev/null +++ b/crates/core/has-sample-values/src/has_many_sample_values.rs @@ -0,0 +1,4 @@ +pub trait HasManySampleValues: Sized { + #[allow(dead_code)] + fn sample_all() -> Vec; +} diff --git a/crates/core/has-sample-values/src/lib.rs b/crates/core/has-sample-values/src/lib.rs index 36a6f41bb..a2e6924f5 100644 --- a/crates/core/has-sample-values/src/lib.rs +++ b/crates/core/has-sample-values/src/lib.rs @@ -1,6 +1,10 @@ +mod has_indexed_sample_values; +mod has_many_sample_values; mod has_sample_values; pub mod prelude { + pub use crate::has_indexed_sample_values::*; + pub use crate::has_many_sample_values::*; pub use crate::has_sample_values::*; pub use error::prelude::*; diff --git a/crates/core/misc/Cargo.toml b/crates/core/misc/Cargo.toml index e00648059..26188bc35 100644 --- a/crates/core/misc/Cargo.toml +++ b/crates/core/misc/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" # === SARGON CRATES === assert-json = { path = "../../core/assert-json" } error = { path = "../../core/error" } -sargon-core-utils = { path = "../../core/utils" } +core-utils = { path = "../../core/utils" } has-sample-values = { path = "../../core/has-sample-values" } # === RADIX DEPENDENCIES === diff --git a/crates/core/misc/src/image_url_utils.rs b/crates/core/misc/src/image_url_utils.rs index ed1ef2324..107107dca 100644 --- a/crates/core/misc/src/image_url_utils.rs +++ b/crates/core/misc/src/image_url_utils.rs @@ -1,4 +1,4 @@ -use sargon_core_utils::prelude::url_encode; +use core_utils::prelude::url_encode; use crate::prelude::*; use std::collections::HashMap; diff --git a/crates/core/utils/Cargo.toml b/crates/core/utils/Cargo.toml index d37b55e80..f1e07601c 100644 --- a/crates/core/utils/Cargo.toml +++ b/crates/core/utils/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "sargon-core-utils" +name = "core-utils" version = "1.1.99" edition = "2021" diff --git a/crates/crypto/addresses/Cargo.toml b/crates/crypto/addresses/Cargo.toml index 7e62504a6..3c838ef32 100644 --- a/crates/crypto/addresses/Cargo.toml +++ b/crates/crypto/addresses/Cargo.toml @@ -10,11 +10,12 @@ factors = { path = "../../factors/factors" } hierarchical-deterministic = { path = "../../crypto/hd" } hash = { path = "../../crypto/hash" } ecc = { path = "../../crypto/ecc" } +cap26-models = { path = "../../crypto/cap26-models" } bytes = { path = "../../common/bytes" } network = { path = "../../common/network" } has-sample-values = { path = "../../core/has-sample-values" } assert-json = { path = "../../core/assert-json" } -sargon-core-utils = { path = "../../core/utils" } +core-utils = { path = "../../core/utils" } # ==== RADIX DEPENDENCIES ==== radix-common = { workspace = true } diff --git a/crates/crypto/addresses/src/address/legacy_olympia_account_address.rs b/crates/crypto/addresses/src/address/legacy_olympia_account_address.rs index a06344b11..193aaefa1 100644 --- a/crates/crypto/addresses/src/address/legacy_olympia_account_address.rs +++ b/crates/crypto/addresses/src/address/legacy_olympia_account_address.rs @@ -4,8 +4,8 @@ use radix_engine_toolkit::functions::derive::{ public_key_from_olympia_account_address as RET_public_key_from_olympia_account_address, }; +use core_utils::prelude::format_string; use radix_engine_toolkit::functions::derive::OlympiaNetwork as ScryptoOlympiaNetwork; -use sargon_core_utils::prelude::format_string; #[derive( Clone, diff --git a/crates/crypto/addresses/src/address/non_fungible_global_id.rs b/crates/crypto/addresses/src/address/non_fungible_global_id.rs index 5235dc344..9e0518093 100644 --- a/crates/crypto/addresses/src/address/non_fungible_global_id.rs +++ b/crates/crypto/addresses/src/address/non_fungible_global_id.rs @@ -1,7 +1,7 @@ use crate::prelude::*; +use core_utils::prelude::format_string; use radix_common::address::{AddressBech32Decoder, AddressBech32Encoder}; use radix_engine_toolkit::utils::*; -use sargon_core_utils::prelude::format_string; #[derive( Clone, diff --git a/crates/crypto/addresses/src/address/non_fungible_local_id.rs b/crates/crypto/addresses/src/address/non_fungible_local_id.rs index 1e13e8e8d..c0a43d758 100644 --- a/crates/crypto/addresses/src/address/non_fungible_local_id.rs +++ b/crates/crypto/addresses/src/address/non_fungible_local_id.rs @@ -1,4 +1,4 @@ -use sargon_core_utils::prelude::format_string; +use core_utils::prelude::format_string; use crate::prelude::*; diff --git a/crates/crypto/addresses/src/address/wrap_ret_address.rs b/crates/crypto/addresses/src/address/wrap_ret_address.rs index e8f1701a7..42e5dd714 100644 --- a/crates/crypto/addresses/src/address/wrap_ret_address.rs +++ b/crates/crypto/addresses/src/address/wrap_ret_address.rs @@ -127,7 +127,7 @@ macro_rules! decl_ret_wrapped_address { } use bytes::prelude::generate_byte_array; - use sargon_core_utils::prelude::format_string; + use core_utils::prelude::format_string; impl [< $address_type:camel Address >] { diff --git a/crates/crypto/addresses/src/lib.rs b/crates/crypto/addresses/src/lib.rs index 20f88b3fe..8025df00c 100644 --- a/crates/crypto/addresses/src/lib.rs +++ b/crates/crypto/addresses/src/lib.rs @@ -5,9 +5,9 @@ mod resource; pub mod prelude { pub(crate) use bytes::prelude::*; + pub(crate) use cap26_models::prelude::*; pub(crate) use ecc::prelude::*; pub(crate) use factors::prelude::*; - pub(crate) use hierarchical_deterministic::prelude::*; pub(crate) use identified_vec_of::prelude::*; pub(crate) use network::prelude::*; diff --git a/crates/crypto/cap26-models/Cargo.toml b/crates/crypto/cap26-models/Cargo.toml new file mode 100644 index 000000000..a48c34842 --- /dev/null +++ b/crates/crypto/cap26-models/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "cap26-models" +version = "1.1.99" +edition = "2021" + +[dependencies] +# ==== INTERNAL DEPENDENCIES ==== +has-sample-values = { path = "../../core/has-sample-values" } +error = { path = "../../core/error" } +numeric = { path = "../../common/numeric" } +assert-json = { path = "../../core/assert-json" } +# bytes = { path = "../../common/bytes" } +# hash = { path = "../../crypto/hash" } +# identified-vec-of = { path = "../../common/identified-vec-of" } + +# ==== RADIX DEPENDENCIES ==== +# None + +# ==== EXTERNAL DEPENDENCIES ==== +enum-as-inner = { workspace = true } +derive_more = { workspace = true } +serde = { workspace = true } +serde_repr = { workspace = true } +serde_json = { workspace = true } +strum = { workspace = true } diff --git a/crates/crypto/hd/src/cap26/cap26_entity_kind.rs b/crates/crypto/cap26-models/src/enums/cap26_entity_kind.rs similarity index 92% rename from crates/crypto/hd/src/cap26/cap26_entity_kind.rs rename to crates/crypto/cap26-models/src/enums/cap26_entity_kind.rs index e96f43a4d..243c0b2f8 100644 --- a/crates/crypto/hd/src/cap26/cap26_entity_kind.rs +++ b/crates/crypto/cap26-models/src/enums/cap26_entity_kind.rs @@ -35,14 +35,6 @@ impl CAP26EntityKind { } } -impl TryFrom for CAP26EntityKind { - type Error = CommonError; - - fn try_from(value: HDPathComponent) -> Result { - Self::try_from(value.index_in_local_key_space()) - } -} - impl TryFrom for CAP26EntityKind { type Error = CommonError; fn try_from(value: U31) -> Result { diff --git a/crates/crypto/hd/src/cap26/cap26_key_kind.rs b/crates/crypto/cap26-models/src/enums/cap26_key_kind.rs similarity index 92% rename from crates/crypto/hd/src/cap26/cap26_key_kind.rs rename to crates/crypto/cap26-models/src/enums/cap26_key_kind.rs index 8694dcad1..6608ce351 100644 --- a/crates/crypto/hd/src/cap26/cap26_key_kind.rs +++ b/crates/crypto/cap26-models/src/enums/cap26_key_kind.rs @@ -46,14 +46,6 @@ impl CAP26KeyKind { } } -impl TryFrom for CAP26KeyKind { - type Error = CommonError; - - fn try_from(value: HDPathComponent) -> Result { - Self::try_from(value.index_in_local_key_space()) - } -} - impl TryFrom for CAP26KeyKind { type Error = CommonError; fn try_from(value: U31) -> Result { diff --git a/crates/crypto/cap26-models/src/enums/mod.rs b/crates/crypto/cap26-models/src/enums/mod.rs new file mode 100644 index 000000000..b61673ea6 --- /dev/null +++ b/crates/crypto/cap26-models/src/enums/mod.rs @@ -0,0 +1,30 @@ +mod cap26_entity_kind; +mod cap26_key_kind; + +pub use cap26_entity_kind::*; +pub use cap26_key_kind::*; + +#[cfg(test)] +mod tests { + use super::*; + #[test] + fn ascii_sums() { + let ascii_sum = |s: &str| s.chars().fold(0, |acc, c| acc + c as u32); + assert_eq!( + ascii_sum("ACCOUNT"), + CAP26EntityKind::Account.discriminant() + ); + assert_eq!( + ascii_sum("IDENTITY"), + CAP26EntityKind::Identity.discriminant() + ); + assert_eq!( + ascii_sum("TRANSACTION_SIGNING"), + CAP26KeyKind::TransactionSigning.discriminant() + ); + assert_eq!( + ascii_sum("AUTHENTICATION_SIGNING"), + CAP26KeyKind::AuthenticationSigning.discriminant() + ); + } +} diff --git a/crates/crypto/cap26-models/src/lib.rs b/crates/crypto/cap26-models/src/lib.rs new file mode 100644 index 000000000..456320e6c --- /dev/null +++ b/crates/crypto/cap26-models/src/lib.rs @@ -0,0 +1,27 @@ +mod enums; +mod traits; + +pub mod prelude { + pub use crate::enums::*; + pub use crate::traits::*; + + pub(crate) use error::prelude::*; + pub(crate) use has_sample_values::HasSampleValues; + pub(crate) use numeric::prelude::*; + + pub(crate) use enum_as_inner::EnumAsInner; + + pub(crate) use serde_repr::{Deserialize_repr, Serialize_repr}; + pub(crate) use strum::FromRepr; + + #[cfg(test)] + mod testing { + pub(crate) use assert_json::prelude::*; + pub(crate) use serde_json::json; + pub(crate) use std::collections::BTreeSet; + } + #[cfg(test)] + pub(crate) use testing::*; +} + +pub use prelude::*; diff --git a/crates/crypto/cap26-models/src/traits/has_entity_kind.rs b/crates/crypto/cap26-models/src/traits/has_entity_kind.rs new file mode 100644 index 000000000..409eaa7f8 --- /dev/null +++ b/crates/crypto/cap26-models/src/traits/has_entity_kind.rs @@ -0,0 +1,14 @@ +use crate::prelude::*; +pub trait HasEntityKind { + fn entity_kind() -> CAP26EntityKind; +} + +pub trait HasEntityKindObjectSafe { + fn get_entity_kind(&self) -> CAP26EntityKind; +} + +impl HasEntityKindObjectSafe for T { + fn get_entity_kind(&self) -> CAP26EntityKind { + T::entity_kind() + } +} diff --git a/crates/crypto/cap26-models/src/traits/mod.rs b/crates/crypto/cap26-models/src/traits/mod.rs new file mode 100644 index 000000000..c937086c9 --- /dev/null +++ b/crates/crypto/cap26-models/src/traits/mod.rs @@ -0,0 +1,3 @@ +mod has_entity_kind; + +pub use has_entity_kind::*; diff --git a/crates/crypto/hd/Cargo.toml b/crates/crypto/hd/Cargo.toml index c5624a14b..22f896f4e 100644 --- a/crates/crypto/hd/Cargo.toml +++ b/crates/crypto/hd/Cargo.toml @@ -8,6 +8,7 @@ edition = "2021" identified-vec-of = { path = "../../common/identified-vec-of" } ecc = { path = "../../crypto/ecc" } hash = { path = "../../crypto/hash" } +cap26-models = { path = "../../crypto/cap26-models" } bytes = { path = "../../common/bytes" } has-sample-values = { path = "../../core/has-sample-values" } assert-json = { path = "../../core/assert-json" } diff --git a/crates/crypto/hd/src/bip32/hd_path_component.rs b/crates/crypto/hd/src/bip32/hd_path_component.rs index 4a6df8bac..4e5de3799 100644 --- a/crates/crypto/hd/src/bip32/hd_path_component.rs +++ b/crates/crypto/hd/src/bip32/hd_path_component.rs @@ -234,6 +234,22 @@ impl From for HDPathComponent { } } +impl TryFrom for CAP26EntityKind { + type Error = CommonError; + + fn try_from(value: HDPathComponent) -> Result { + Self::try_from(value.index_in_local_key_space()) + } +} + +impl TryFrom for CAP26KeyKind { + type Error = CommonError; + + fn try_from(value: HDPathComponent) -> Result { + Self::try_from(value.index_in_local_key_space()) + } +} + /// # Safety /// Only use this for tests and constants. const unsafe fn hard(value: u16) -> HDPathComponent { diff --git a/crates/crypto/hd/src/cap26/mod.rs b/crates/crypto/hd/src/cap26/mod.rs index a94805199..84e3deb61 100644 --- a/crates/crypto/hd/src/cap26/mod.rs +++ b/crates/crypto/hd/src/cap26/mod.rs @@ -1,36 +1,15 @@ -mod cap26_entity_kind; -mod cap26_key_kind; mod paths; -pub use cap26_entity_kind::*; -pub use cap26_key_kind::*; pub use paths::*; #[cfg(test)] mod tests { - use super::*; use crate::GET_ID_CAP26_LOCAL; #[test] fn test_asciisum() { let ascii_sum = |s: &str| s.chars().fold(0, |acc, c| acc + c as u32); - assert_eq!( - ascii_sum("ACCOUNT"), - CAP26EntityKind::Account.discriminant() - ); - assert_eq!( - ascii_sum("IDENTITY"), - CAP26EntityKind::Identity.discriminant() - ); - assert_eq!( - ascii_sum("TRANSACTION_SIGNING"), - CAP26KeyKind::TransactionSigning.discriminant() - ); - assert_eq!( - ascii_sum("AUTHENTICATION_SIGNING"), - CAP26KeyKind::AuthenticationSigning.discriminant() - ); assert_eq!(ascii_sum("GETID"), GET_ID_CAP26_LOCAL as u32); } } diff --git a/crates/crypto/hd/src/cap26/paths/traits.rs b/crates/crypto/hd/src/cap26/paths/traits.rs index 96301ac99..e7c798634 100644 --- a/crates/crypto/hd/src/cap26/paths/traits.rs +++ b/crates/crypto/hd/src/cap26/paths/traits.rs @@ -1,19 +1,5 @@ use crate::prelude::*; -pub trait HasEntityKind { - fn entity_kind() -> CAP26EntityKind; -} - -pub trait HasEntityKindObjectSafe { - fn get_entity_kind(&self) -> CAP26EntityKind; -} - -impl HasEntityKindObjectSafe for T { - fn get_entity_kind(&self) -> CAP26EntityKind { - T::entity_kind() - } -} - pub trait NewEntityPath: Sized { fn new( network_id: impl Into, diff --git a/crates/crypto/hd/src/lib.rs b/crates/crypto/hd/src/lib.rs index 6eabb41c7..071022d50 100644 --- a/crates/crypto/hd/src/lib.rs +++ b/crates/crypto/hd/src/lib.rs @@ -10,6 +10,7 @@ mod has_key_kind; pub mod prelude { pub(crate) use bytes::prelude::*; + pub(crate) use cap26_models::prelude::*; pub(crate) use ecc::prelude::*; pub(crate) use hash::prelude::*; pub(crate) use identified_vec_of::prelude::*; diff --git a/crates/factors/factors/Cargo.toml b/crates/factors/factors/Cargo.toml index c733e7211..f779d5e37 100644 --- a/crates/factors/factors/Cargo.toml +++ b/crates/factors/factors/Cargo.toml @@ -12,13 +12,14 @@ hierarchical-deterministic = { path = "../../crypto/hd" } encryption = { path = "../../crypto/encryption" } hash = { path = "../../crypto/hash" } ecc = { path = "../../crypto/ecc" } +cap26-models = { path = "../../crypto/cap26-models" } numeric = { path = "../../common/numeric" } network = { path = "../../common/network" } time-utils = { path = "../../core/time-utils" } short-string = { path = "../../common/short-string" } host-info = { path = "../../common/host-info" } core-misc = { path = "../../core/misc" } -sargon-core-utils = { path = "../../core/utils" } +core-utils = { path = "../../core/utils" } core-collections = { path = "../../core/collections" } # ==== RADIX DEPENDENCIES ==== diff --git a/crates/factors/factors/src/factor_sources/has_factor_sources.rs b/crates/factors/factors/src/factor_sources/has_factor_sources.rs new file mode 100644 index 000000000..148eb529e --- /dev/null +++ b/crates/factors/factors/src/factor_sources/has_factor_sources.rs @@ -0,0 +1,5 @@ +use crate::prelude::*; + +pub trait HasFactorSources { + fn factor_sources(&self) -> IndexSet; +} diff --git a/crates/factors/factors/src/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_model.rs b/crates/factors/factors/src/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_model.rs index d06d0a3bd..f700c6a1e 100644 --- a/crates/factors/factors/src/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_model.rs +++ b/crates/factors/factors/src/factor_sources/ledger_hardware_wallet_factor_source/ledger_hardware_wallet_model.rs @@ -1,4 +1,4 @@ -use sargon_core_utils::prelude::{DeserializeStr, SerializeToString}; +use core_utils::prelude::{DeserializeStr, SerializeToString}; use crate::prelude::*; diff --git a/crates/factors/factors/src/factor_sources/mod.rs b/crates/factors/factors/src/factor_sources/mod.rs index ea5f3c1be..628a362e1 100644 --- a/crates/factors/factors/src/factor_sources/mod.rs +++ b/crates/factors/factors/src/factor_sources/mod.rs @@ -1,9 +1,11 @@ mod device_factor_source; mod factor_sources; +mod has_factor_sources; mod ledger_hardware_wallet_factor_source; mod private_hierarchical_deterministic_factor_source; pub use device_factor_source::*; pub use factor_sources::*; +pub use has_factor_sources::*; pub use ledger_hardware_wallet_factor_source::*; pub use private_hierarchical_deterministic_factor_source::*; diff --git a/crates/factors/factors/src/lib.rs b/crates/factors/factors/src/lib.rs index 8d31a99e8..ee4ad1c25 100644 --- a/crates/factors/factors/src/lib.rs +++ b/crates/factors/factors/src/lib.rs @@ -27,6 +27,7 @@ pub mod prelude { pub(crate) use bytes::prelude::*; pub(crate) use identified_vec_of::prelude::*; + pub(crate) use cap26_models::prelude::*; pub(crate) use ecc::prelude::*; pub(crate) use hierarchical_deterministic::prelude::*; pub(crate) use network::prelude::*; diff --git a/crates/factors/factors/src/mfa_factor_sources/arculus_card_factor_source/arculus_card_model.rs b/crates/factors/factors/src/mfa_factor_sources/arculus_card_factor_source/arculus_card_model.rs index 365da292d..5f208eeda 100644 --- a/crates/factors/factors/src/mfa_factor_sources/arculus_card_factor_source/arculus_card_model.rs +++ b/crates/factors/factors/src/mfa_factor_sources/arculus_card_factor_source/arculus_card_model.rs @@ -1,4 +1,4 @@ -use sargon_core_utils::prelude::{DeserializeStr, SerializeToString}; +use core_utils::prelude::{DeserializeStr, SerializeToString}; use crate::prelude::*; diff --git a/crates/factors/instances-provider/Cargo.toml b/crates/factors/instances-provider/Cargo.toml index 6788227b6..6b052abdf 100644 --- a/crates/factors/instances-provider/Cargo.toml +++ b/crates/factors/instances-provider/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" # === SARGON CRATES === identified-vec-of = { path = "../../common/identified-vec-of" } assert-json = { path = "../../core/assert-json" } -sargon-core-utils = { path = "../../core/utils" } +core-utils = { path = "../../core/utils" } error = { path = "../../core/error" } factors = { path = "../../factors/factors" } hierarchical-deterministic = { path = "../../crypto/hd" } diff --git a/crates/factors/keys-collector/Cargo.toml b/crates/factors/keys-collector/Cargo.toml index 0523686d6..10cb2f62a 100644 --- a/crates/factors/keys-collector/Cargo.toml +++ b/crates/factors/keys-collector/Cargo.toml @@ -10,6 +10,7 @@ factors = { path = "../../factors/factors" } numeric = { path = "../../common/numeric" } hierarchical-deterministic = { path = "../../crypto/hd" } addresses = { path = "../../crypto/addresses" } +cap26-models = { path = "../../crypto/cap26-models" } network = { path = "../../common/network" } error = { path = "../../core/error" } core-misc = { path = "../../core/misc" } # HiddenConstructor diff --git a/crates/factors/keys-collector/src/lib.rs b/crates/factors/keys-collector/src/lib.rs index 3c2481a39..3ccd48977 100644 --- a/crates/factors/keys-collector/src/lib.rs +++ b/crates/factors/keys-collector/src/lib.rs @@ -14,6 +14,7 @@ pub(crate) use tests::*; pub mod prelude { pub(crate) use addresses::prelude::*; + pub(crate) use cap26_models::prelude::*; pub(crate) use core_collections::prelude::Just; pub(crate) use error::prelude::*; pub(crate) use factors::prelude::*; diff --git a/crates/factors/keys-collector/src/tests/derivation_tests.rs b/crates/factors/keys-collector/src/tests/derivation_tests.rs index c5e355722..d45a83ef6 100644 --- a/crates/factors/keys-collector/src/tests/derivation_tests.rs +++ b/crates/factors/keys-collector/src/tests/derivation_tests.rs @@ -1,3 +1,4 @@ +use cap26_models::prelude::*; use network::prelude::NetworkID; use numeric::prelude::*; @@ -211,8 +212,8 @@ mod basic_tests { mod key_derivation_tests { use super::*; - use hierarchical_deterministic::CAP26EntityKind::*; - use hierarchical_deterministic::CAP26KeyKind::*; + use cap26_models::CAP26EntityKind::*; + use cap26_models::CAP26KeyKind::*; use NetworkID::*; #[actix_rt::test] diff --git a/crates/factors/next-derivation-index-ephemeral/Cargo.toml b/crates/factors/next-derivation-index-ephemeral/Cargo.toml index 44640740e..55d130c91 100644 --- a/crates/factors/next-derivation-index-ephemeral/Cargo.toml +++ b/crates/factors/next-derivation-index-ephemeral/Cargo.toml @@ -11,6 +11,7 @@ error = { path = "../../core/error" } hierarchical-deterministic = { path = "../../crypto/hd" } has-sample-values = { path = "../../core/has-sample-values" } factors = { path = "../../factors/factors" } +cap26-models = { path = "../../crypto/cap26-models" } addresses = { path = "../../crypto/addresses" } network = { path = "../../common/network" } diff --git a/crates/factors/next-derivation-index-ephemeral/src/lib.rs b/crates/factors/next-derivation-index-ephemeral/src/lib.rs index fb26f3631..349e2bad4 100644 --- a/crates/factors/next-derivation-index-ephemeral/src/lib.rs +++ b/crates/factors/next-derivation-index-ephemeral/src/lib.rs @@ -11,6 +11,7 @@ pub mod prelude { pub use crate::next_derivation_entity_index_with_ephemeral_offsets_for_factor_source::*; pub(crate) use addresses::prelude::*; + pub(crate) use cap26_models::prelude::*; pub(crate) use factors::prelude::*; pub(crate) use has_sample_values::prelude::*; pub(crate) use hierarchical_deterministic::prelude::*; diff --git a/crates/gateway/client-and-api/Cargo.toml b/crates/gateway/client-and-api/Cargo.toml index c1df55c41..73bc0594d 100644 --- a/crates/gateway/client-and-api/Cargo.toml +++ b/crates/gateway/client-and-api/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] # === SARGON CRATES === assert-json = { path = "../../core/assert-json" } -sargon-core-utils = { path = "../../core/utils" } +core-utils = { path = "../../core/utils" } metadata = { path = "../../common/metadata" } addresses = { path = "../../crypto/addresses" } drivers = { path = "../../system/drivers" } diff --git a/crates/gateway/client-and-api/src/lib.rs b/crates/gateway/client-and-api/src/lib.rs index 544be149e..67b2c2e08 100644 --- a/crates/gateway/client-and-api/src/lib.rs +++ b/crates/gateway/client-and-api/src/lib.rs @@ -7,11 +7,11 @@ pub mod prelude { pub use crate::assert_network_request::*; pub use crate::client::*; + pub use core_utils::prelude::*; pub use drivers::prelude::*; pub use gateway_models::prelude::*; pub use http_client::prelude::*; pub use metadata::prelude::*; - pub use sargon_core_utils::prelude::*; pub use transaction_models::prelude::*; pub use serde::{Deserialize, Serialize}; diff --git a/crates/profile/logic/logic_SPLIT_ME/Cargo.toml b/crates/profile/logic/logic_SPLIT_ME/Cargo.toml index f43b4491b..c99e0a9a9 100644 --- a/crates/profile/logic/logic_SPLIT_ME/Cargo.toml +++ b/crates/profile/logic/logic_SPLIT_ME/Cargo.toml @@ -10,8 +10,10 @@ hierarchical-deterministic = { path = "../../../crypto/hd" } factors = { path = "../../../factors/factors" } addresses = { path = "../../../crypto/addresses" } profile = { path = "../../../profile/models/profile_SPLIT_ME" } +profile-persona = { path = "../../../profile/models/persona" } profile-supporting-types = { path = "../../../profile/models/supporting-types" } time-utils = { path = "../../../core/time-utils" } +entity-by-address = { path = "../../../profile/traits/entity-by-address" } # === RADIX DEPENDENCIES === # None diff --git a/crates/profile/logic/logic_SPLIT_ME/src/logic/account/accounts_visibility.rs b/crates/profile/logic/logic_SPLIT_ME/src/logic/account/accounts_visibility.rs index a786ffd3f..c87091c7e 100644 --- a/crates/profile/logic/logic_SPLIT_ME/src/logic/account/accounts_visibility.rs +++ b/crates/profile/logic/logic_SPLIT_ME/src/logic/account/accounts_visibility.rs @@ -1,29 +1,7 @@ -use crate::prelude::*; - -pub trait VisibleOrHidden { - fn visible(&self) -> Self; - fn hidden(&self) -> Self; -} - -impl VisibleOrHidden for Accounts { - fn visible(&self) -> Self { - self.clone() - .into_iter() - .filter(|p| !p.is_hidden() && !p.is_tombstoned()) - .collect() - } - - fn hidden(&self) -> Self { - self.clone() - .into_iter() - .filter(|p| p.is_hidden() && !p.is_tombstoned()) - .collect() - } -} - #[cfg(test)] mod tests { - use super::*; + + use crate::prelude::*; #[allow(clippy::upper_case_acronyms)] type SUT = Accounts; diff --git a/crates/profile/logic/logic_SPLIT_ME/src/logic/account/mod.rs b/crates/profile/logic/logic_SPLIT_ME/src/logic/account/mod.rs index 342a81de5..252b79063 100644 --- a/crates/profile/logic/logic_SPLIT_ME/src/logic/account/mod.rs +++ b/crates/profile/logic/logic_SPLIT_ME/src/logic/account/mod.rs @@ -4,6 +4,5 @@ mod query_accounts; mod query_security_structures; pub use account_visibility::*; -pub use accounts_visibility::*; pub use query_accounts::*; pub use query_security_structures::*; diff --git a/crates/profile/logic/logic_SPLIT_ME/src/logic/account/query_accounts.rs b/crates/profile/logic/logic_SPLIT_ME/src/logic/account/query_accounts.rs index ea05aaabc..71bc9b68f 100644 --- a/crates/profile/logic/logic_SPLIT_ME/src/logic/account/query_accounts.rs +++ b/crates/profile/logic/logic_SPLIT_ME/src/logic/account/query_accounts.rs @@ -14,46 +14,6 @@ impl ProfileAccountsOnAllNetworksIncludingHidden for Profile { } } -pub trait ProfileAccountByAddress { - fn account_by_address(&self, address: AccountAddress) -> Result; -} - -impl ProfileAccountByAddress for Profile { - /// Looks up the account by account address, returns Err if the account is - /// unknown, will return a hidden, or tombstoned account if queried for. - fn account_by_address(&self, address: AccountAddress) -> Result { - for network in self.networks.iter() { - if let Some(account) = network.accounts.get_id(address) { - return Ok(account.clone()); - } - } - Err(CommonError::UnknownAccount) - } -} - -pub trait ProfileEntityByAddress { - fn entity_by_address( - &self, - entity_address: AddressOfAccountOrPersona, - ) -> Result; -} - -impl ProfileEntityByAddress for Profile { - fn entity_by_address( - &self, - entity_address: AddressOfAccountOrPersona, - ) -> Result { - self.networks - .get_id(entity_address.network_id()) - .and_then(|n| n.entity_by_address(&entity_address)) - .ok_or(if entity_address.is_account() { - CommonError::UnknownAccount - } else { - CommonError::UnknownPersona - }) - } -} - pub trait ProfileEntitiesOfKindOnNetworkInKeySpace { fn get_entities_of_kind_on_network_in_key_space( &self, @@ -149,10 +109,6 @@ pub trait ProfileEntitiesOfKindOnNetworkInKeySpace { /// Returns **ALL** personas - including hidden/deleted ones, on **ALL** networks. fn personas_on_all_networks_including_hidden(&self) -> Personas; - - /// Looks up the persona by identity address, returns Err if the persona is - /// unknown, will return a hidden persona if queried for. - fn persona_by_address(&self, address: IdentityAddress) -> Result; } impl ProfileEntitiesOfKindOnNetworkInKeySpace for Profile { @@ -176,17 +132,6 @@ impl ProfileEntitiesOfKindOnNetworkInKeySpace for Profile { .collect::() } - /// Looks up the persona by identity address, returns Err if the persona is - /// unknown, will return a hidden persona if queried for. - fn persona_by_address(&self, address: IdentityAddress) -> Result { - for network in self.networks.iter() { - if let Some(persona) = network.personas.get_id(address) { - return Ok(persona.clone()); - } - } - Err(CommonError::UnknownPersona) - } - fn get_entities_of_kind_on_network_in_key_space( &self, entity_kind: CAP26EntityKind, diff --git a/crates/profile/logic/logic_SPLIT_ME/src/logic/persona/mod.rs b/crates/profile/logic/logic_SPLIT_ME/src/logic/persona/mod.rs index 48b18bbe2..2a9de115a 100644 --- a/crates/profile/logic/logic_SPLIT_ME/src/logic/persona/mod.rs +++ b/crates/profile/logic/logic_SPLIT_ME/src/logic/persona/mod.rs @@ -3,5 +3,4 @@ mod query_personas; mod shared_persona_data_ids; pub use persona_data_ids::*; -pub use query_personas::*; pub use shared_persona_data_ids::*; diff --git a/crates/profile/logic/logic_SPLIT_ME/src/logic/persona/query_personas.rs b/crates/profile/logic/logic_SPLIT_ME/src/logic/persona/query_personas.rs index 4ed4395f7..13e8839a4 100644 --- a/crates/profile/logic/logic_SPLIT_ME/src/logic/persona/query_personas.rs +++ b/crates/profile/logic/logic_SPLIT_ME/src/logic/persona/query_personas.rs @@ -1,26 +1,6 @@ -use crate::prelude::*; - -pub trait PersonasVisibility { - fn non_hidden(&self) -> Self; - fn hidden(&self) -> Self; -} - -impl PersonasVisibility for Personas { - fn non_hidden(&self) -> Self { - self.clone() - .into_iter() - .filter(|p| !p.is_hidden()) - .collect() - } - - fn hidden(&self) -> Self { - self.clone().into_iter().filter(|p| p.is_hidden()).collect() - } -} - #[cfg(test)] mod personas_tests { - use super::*; + use crate::prelude::*; #[allow(clippy::upper_case_acronyms)] type SUT = Personas; @@ -52,7 +32,7 @@ mod personas_tests { #[cfg(test)] mod profile_tests { - use super::*; + use crate::prelude::*; #[allow(clippy::upper_case_acronyms)] type SUT = Profile; diff --git a/crates/profile/logic/logic_SPLIT_ME/src/logic/profile_network/mod.rs b/crates/profile/logic/logic_SPLIT_ME/src/logic/profile_network/mod.rs index 78d2b0edd..6424e1311 100644 --- a/crates/profile/logic/logic_SPLIT_ME/src/logic/profile_network/mod.rs +++ b/crates/profile/logic/logic_SPLIT_ME/src/logic/profile_network/mod.rs @@ -1,7 +1,5 @@ mod profile_network_details; mod profile_network_entities_linked_to_factor_source; -mod profile_network_get_entities; pub use profile_network_details::*; pub use profile_network_entities_linked_to_factor_source::*; -pub use profile_network_get_entities::*; diff --git a/crates/profile/models/account-or-persona/Cargo.toml b/crates/profile/models/account-or-persona/Cargo.toml new file mode 100644 index 000000000..80b2729bf --- /dev/null +++ b/crates/profile/models/account-or-persona/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "profile-account-or-persona" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +profile-base-entity = { path = "../../../profile/models/base-entity" } +profile-account = { path = "../../../profile/models/account" } +profile-persona = { path = "../../../profile/models/persona" } +hierarchical-deterministic = { path = "../../../crypto/hd" } +cap26-models = { path = "../../../crypto/cap26-models" } +profile-security-structures = { path = "../../../profile/models/security-structures" } + + +# === RADIX DEPENDENCIES === +# None + +# === EXTERNAL DEPENDENCIES === +derive_more = { workspace = true } +enum-as-inner = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } diff --git a/crates/profile/models/profile_SPLIT_ME/src/supporting_types/account_or_persona.rs b/crates/profile/models/account-or-persona/src/account_or_persona.rs similarity index 58% rename from crates/profile/models/profile_SPLIT_ME/src/supporting_types/account_or_persona.rs rename to crates/profile/models/account-or-persona/src/account_or_persona.rs index 21025b226..cf2d0a9d6 100644 --- a/crates/profile/models/profile_SPLIT_ME/src/supporting_types/account_or_persona.rs +++ b/crates/profile/models/account-or-persona/src/account_or_persona.rs @@ -20,11 +20,13 @@ impl HasEntityKindObjectSafe for AccountOrPersona { } } } + impl HasFactorInstances for AccountOrPersona { fn unique_tx_signing_factor_instances(&self) -> IndexSet { self.security_state().unique_tx_signing_factor_instances() } } + impl HasSecurityState for AccountOrPersona { fn security_state(&self) -> EntitySecurityState { match self { @@ -142,6 +144,36 @@ impl Identifiable for AccountOrPersona { } } +impl TryFrom for Persona { + type Error = CommonError; + + fn try_from(value: AccountOrPersona) -> Result { + match value { + AccountOrPersona::PersonaEntity(p) => Ok(p), + AccountOrPersona::AccountEntity(a) => { + Err(CommonError::ExpectedPersonaButGotAccount { + address: a.address.to_string(), + }) + } + } + } +} + +impl TryFrom for Account { + type Error = CommonError; + + fn try_from(value: AccountOrPersona) -> Result { + match value { + AccountOrPersona::AccountEntity(a) => Ok(a), + AccountOrPersona::PersonaEntity(p) => { + Err(CommonError::ExpectedAccountButGotPersona { + address: p.address.to_string(), + }) + } + } + } +} + impl HasSampleValues for AccountOrPersona { fn sample() -> Self { Self::sample_mainnet() @@ -242,6 +274,24 @@ mod tests { assert_eq!(SUT::sample_other().network_id(), NetworkID::Mainnet); } + #[test] + fn test_err_when_try_persona_from_account() { + let account = Account::sample(); + assert!(matches!( + Persona::try_from(AccountOrPersona::AccountEntity(account)), + Err(CommonError::ExpectedPersonaButGotAccount { .. }) + )); + } + + #[test] + fn test_err_when_try_account_from_persona() { + let persona = Persona::sample(); + assert!(matches!( + Account::try_from(AccountOrPersona::PersonaEntity(persona)), + Err(CommonError::ExpectedAccountButGotPersona { .. }) + )); + } + #[test] fn test_id() { assert_eq!(SUT::sample().id(), Account::sample().address.into()); @@ -259,4 +309,121 @@ mod tests { "Batman | identity_rdx12tw6rt9c4l56rz6p866e35tmzp556nymxmpj8hagfewq82kspctdyw" ); } + + fn test_set_security_state_fail_cannot_unsecurify(sut: impl Into) { + let mut sut = sut.into(); + assert!(sut.is_securified()); + + let unsecurified = EntitySecurityState::sample(); + assert!(unsecurified.is_unsecured()); + + let result = sut.set_security_state(unsecurified); + assert_eq!( + result, + Err(CommonError::SecurityStateSecurifiedButExpectedUnsecurified) + ); + + // assert unchanged + assert!(sut.is_securified()); + } + + #[test] + fn set_security_state_fail_cannot_unsecurify_account() { + test_set_security_state_fail_cannot_unsecurify(Account::sample_at(2)) + } + + #[test] + fn set_security_state_fail_cannot_unsecurify_persona() { + test_set_security_state_fail_cannot_unsecurify(Persona::sample_at(2)) + } + + fn test_set_security_state_fail_can_change_unsecurified( + sut: impl Into, + ) { + let mut sut = sut.into(); + assert!(!sut.is_securified()); + + let unsecurified = EntitySecurityState::sample(); + assert!(unsecurified.is_unsecured()); + + let result = sut.set_security_state(unsecurified.clone()); + assert!(result.is_ok()); + assert_eq!(sut.security_state(), unsecurified); + } + + #[test] + fn set_security_state_fail_can_change_unsecurified_account() { + test_set_security_state_fail_can_change_unsecurified(Account::sample()); + } + + #[test] + fn set_security_state_fail_can_change_unsecurified_persona() { + test_set_security_state_fail_can_change_unsecurified(Persona::sample()); + } + + fn test_set_security_state_fail_access_controller_mismatch( + sut: impl Into, + ) { + let mut sut = sut.into(); + let entity_state = sut.security_state(); + assert!(sut.is_securified()); + + let other_securified = EntitySecurityState::Securified { + value: SecuredEntityControl::sample(), + }; + + let result = sut.set_security_state(other_securified); + assert_eq!( + result, + Err(CommonError::SecurityStateAccessControllerAddressMismatch) + ); + + // assert unchanged + assert_eq!(sut.security_state(), entity_state); + } + + #[test] + fn set_security_state_fail_access_controller_mismatch_account() { + test_set_security_state_fail_access_controller_mismatch( + Account::sample_at(2), + ); + } + + #[test] + fn set_security_state_fail_access_controller_mismatch_persona() { + test_set_security_state_fail_access_controller_mismatch( + Persona::sample_at(2), + ) + } + + fn test_set_security_state_can_change_securified(sut: impl Into) { + let mut sut = sut.into(); + let entity_state = sut.security_state(); + assert!(sut.is_securified()); + let access_controller_address = entity_state + .clone() + .as_securified() + .unwrap() + .access_controller_address; + + let mut value = SecuredEntityControl::sample(); + value.access_controller_address = access_controller_address; + let other_securified = EntitySecurityState::Securified { value }; + + let result = sut.set_security_state(other_securified); + + assert!(result.is_ok()); + assert!(sut.is_securified()); + assert_ne!(sut.security_state(), entity_state); + } + + #[test] + fn set_security_state_can_change_securified_account() { + test_set_security_state_can_change_securified(Account::sample_at(2)); + } + + #[test] + fn set_security_state_can_change_securified_persona() { + test_set_security_state_can_change_securified(Persona::sample_at(2)); + } } diff --git a/crates/profile/models/account-or-persona/src/is_entity.rs b/crates/profile/models/account-or-persona/src/is_entity.rs new file mode 100644 index 000000000..91d307307 --- /dev/null +++ b/crates/profile/models/account-or-persona/src/is_entity.rs @@ -0,0 +1,12 @@ +use crate::prelude::*; + +/// A trait bridging Account and Persona. +pub trait IsEntity: + IsEntityWithoutConcreteTypes + + TryFrom + + Into +{ +} + +impl IsEntity for Account {} +impl IsEntity for Persona {} diff --git a/crates/profile/models/account-or-persona/src/lib.rs b/crates/profile/models/account-or-persona/src/lib.rs new file mode 100644 index 000000000..51c43943a --- /dev/null +++ b/crates/profile/models/account-or-persona/src/lib.rs @@ -0,0 +1,17 @@ +mod account_or_persona; +mod is_entity; + +pub mod prelude { + pub use crate::account_or_persona::*; + pub use crate::is_entity::*; + + pub(crate) use cap26_models::prelude::*; + pub(crate) use hierarchical_deterministic::prelude::*; + pub(crate) use profile_account::prelude::*; + pub(crate) use profile_base_entity::prelude::*; + pub(crate) use profile_persona::prelude::*; + pub(crate) use profile_security_structures::prelude::*; + + pub(crate) use enum_as_inner::EnumAsInner; + pub(crate) use serde::{Deserialize, Serialize}; +} diff --git a/crates/profile/models/account/Cargo.toml b/crates/profile/models/account/Cargo.toml new file mode 100644 index 000000000..bed6a59e6 --- /dev/null +++ b/crates/profile/models/account/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "profile-account" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +account-for-display = { path = "../../../profile/models/account-for-display" } +transaction-models = { path = "../../../transaction/models" } +addresses = { path = "../../../crypto/addresses" } +has-sample-values = { path = "../../../core/has-sample-values" } +cap26-models = { path = "../../../crypto/cap26-models" } +entity-foundation = { path = "../../../common/entity-foundation" } +short-string = { path = "../../../common/short-string" } +profile-base-entity = { path = "../../../profile/models/base-entity" } +profile-security-structures = { path = "../../../profile/models/security-structures" } + + +# === RADIX DEPENDENCIES === +# None + +# === EXTERNAL DEPENDENCIES === +derive_more = { workspace = true } +once_cell = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } diff --git a/crates/profile/models/account/src/access_controller_address_samples_for_accounts.rs b/crates/profile/models/account/src/access_controller_address_samples_for_accounts.rs new file mode 100644 index 000000000..e90ed5082 --- /dev/null +++ b/crates/profile/models/account/src/access_controller_address_samples_for_accounts.rs @@ -0,0 +1,18 @@ +use crate::prelude::*; + +pub trait SamplesFromAccountAddress { + fn sample_from_account_address(account_address: AccountAddress) -> Self; +} + +impl SamplesFromAccountAddress for AccessControllerAddress { + fn sample_from_account_address(account_address: AccountAddress) -> Self { + let node_id: [u8; 29] = account_address.node_id().as_bytes()[0..29] + .try_into() + .unwrap(); + + AccessControllerAddress::with_node_id_bytes( + &node_id, + account_address.network_id(), + ) + } +} diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/account/account.rs b/crates/profile/models/account/src/account/account.rs similarity index 89% rename from crates/profile/models/profile_SPLIT_ME/src/v100/entity/account/account.rs rename to crates/profile/models/account/src/account/account.rs index d7971f0a4..d8e346a09 100644 --- a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/account/account.rs +++ b/crates/profile/models/account/src/account/account.rs @@ -1,3 +1,7 @@ +use std::ops::{Deref, DerefMut}; + +use profile_base_entity::BaseEntity; + use crate::prelude::*; /// A network unique account with a unique public address and a set of cryptographic @@ -27,51 +31,60 @@ use crate::prelude::*; Eq, derive_more::Display, )] -#[display("{display_name} | {address}")] +#[display("{} | {}", self.display_name, self.address)] #[serde(rename_all = "camelCase")] pub struct Account { - /// The ID of the network this account can be used with. - #[serde(rename = "networkID")] - pub network_id: NetworkID, - - /// A globally unique identifier of this account, being a human readable - /// address of an account. Always starts with `"account_"``, for example: - /// - /// `account_rdx128y6j78mt0aqv6372evz28hrxp8mn06ccddkr7xppc88hyvynvjdwr` - /// - /// Most commonly the user will see this address in its abbreviated - /// form which is: - /// - /// `acco...nvjdwr` - /// - /// No two addresses will ever be the same even for the same factor source - /// but on different networks, since the public keys controlling the - /// accounts depend on the network id. - pub address: AccountAddress, - - /// An off-ledger display name or description chosen by the user when she - /// created this account. - pub display_name: DisplayName, - - /// Security state of this account, either "securified" or not. - pub security_state: EntitySecurityState, + #[serde(flatten)] + base: BaseEntity, /// The visual cue user learns to associated this account with, typically /// a beautiful colorful gradient. #[serde(rename = "appearanceID")] pub appearance_id: AppearanceID, - /// An order set of `EntityFlag`s used to describe certain Off-ledger - /// user state about Accounts or Personas, such as if an entity is - /// marked as hidden or not. - #[serde(default)] - pub flags: EntityFlags, - /// The on ledger synced settings for this account, contains e.g. /// ThirdPartyDeposit settings, with deposit rules for assets. pub on_ledger_settings: OnLedgerSettings, } +impl Account { + pub fn with( + network_id: impl Into, + address: impl Into, + display_name: impl Into, + security_state: impl Into, + flags: impl IntoIterator, + appearance_id: impl Into, + on_ledger_settings: impl Into, + ) -> Self { + Self { + base: BaseEntity::new( + network_id, + address, + display_name, + security_state, + flags, + ), + appearance_id: appearance_id.into(), + on_ledger_settings: on_ledger_settings.into(), + } + } +} + +impl Deref for Account { + type Target = BaseEntity; + + fn deref(&self) -> &Self::Target { + &self.base + } +} + +impl DerefMut for Account { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.base + } +} + impl From for AccountForDisplay { fn from(value: Account) -> Self { Self::new(value.address, value.display_name, value.appearance_id) @@ -122,7 +135,7 @@ impl IsBaseEntity for Account { } } -impl IsEntity for Account { +impl IsEntityWithoutConcreteTypes for Account { type Path = AccountPath; fn with_veci_and_name( @@ -133,36 +146,34 @@ impl IsEntity for Account { AccountAddress::from_hd_factor_instance_virtual_entity_creation( veci.clone(), ); + let appearance_id = AppearanceID::from_number_of_accounts_on_network( u32::from(veci.path.index().index_in_local_key_space()) as usize, ); - Self { - network_id: veci.network_id(), + + Self::with( + address.network_id(), address, - display_name: name, - security_state: - UnsecuredEntityControl::with_entity_creating_factor_instance( - veci, - ) - .into(), + name, + UnsecuredEntityControl::with_entity_creating_factor_instance(veci), + EntityFlags::default(), appearance_id, - flags: EntityFlags::default(), - on_ledger_settings: OnLedgerSettings::default(), - } + OnLedgerSettings::default(), + ) } } impl Account { pub fn new( account_creating_factor_instance: HDFactorInstanceAccountCreation, - display_name: DisplayName, - appearance_id: AppearanceID, + display_name: impl Into, + appearance_id: impl Into, ) -> Self { let mut self_ = Self::with_veci_and_name( account_creating_factor_instance, - display_name, + display_name.into(), ); - self_.appearance_id = appearance_id; + self_.appearance_id = appearance_id.into(); self_ } } @@ -175,21 +186,6 @@ impl Identifiable for Account { } } -impl TryFrom for Account { - type Error = CommonError; - - fn try_from(value: AccountOrPersona) -> Result { - match value { - AccountOrPersona::AccountEntity(a) => Ok(a), - AccountOrPersona::PersonaEntity(p) => { - Err(CommonError::ExpectedAccountButGotPersona { - address: p.address.to_string(), - }) - } - } - } -} - impl HasSampleValues for Account { /// A sample used to facilitate unit tests. fn sample() -> Self { @@ -210,13 +206,15 @@ impl Account { appearance_id: AppearanceID, ) -> Self { Self { - network_id: address.network_id(), - address, - display_name, + base: BaseEntity::new( + address.network_id(), + address, + display_name, + EntitySecurityState::sample(), + EntityFlags::default(), + ), appearance_id, - flags: EntityFlags::default(), on_ledger_settings: OnLedgerSettings::default(), - security_state: EntitySecurityState::sample(), } } @@ -413,15 +411,6 @@ mod tests { assert_ne!(SUT::sample(), SUT::sample_other()); } - #[test] - fn test_err_when_try_from_persona() { - let persona = Persona::sample(); - assert!(matches!( - SUT::try_from(AccountOrPersona::PersonaEntity(persona)), - Err(CommonError::ExpectedAccountButGotPersona { .. }) - )); - } - #[test] fn test_is_network_aware() { assert_eq!(SUT::sample().network_id(), NetworkID::Mainnet); diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/account/mod.rs b/crates/profile/models/account/src/account/mod.rs similarity index 100% rename from crates/profile/models/profile_SPLIT_ME/src/v100/entity/account/mod.rs rename to crates/profile/models/account/src/account/mod.rs diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/account/on_ledger_settings/mod.rs b/crates/profile/models/account/src/account/on_ledger_settings/mod.rs similarity index 100% rename from crates/profile/models/profile_SPLIT_ME/src/v100/entity/account/on_ledger_settings/mod.rs rename to crates/profile/models/account/src/account/on_ledger_settings/mod.rs diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/account/on_ledger_settings/on_ledger_settings.rs b/crates/profile/models/account/src/account/on_ledger_settings/on_ledger_settings.rs similarity index 100% rename from crates/profile/models/profile_SPLIT_ME/src/v100/entity/account/on_ledger_settings/on_ledger_settings.rs rename to crates/profile/models/account/src/account/on_ledger_settings/on_ledger_settings.rs diff --git a/crates/profile/models/account/src/account_address_samples.rs b/crates/profile/models/account/src/account_address_samples.rs new file mode 100644 index 000000000..a2d73a7b2 --- /dev/null +++ b/crates/profile/models/account/src/account_address_samples.rs @@ -0,0 +1,23 @@ +use crate::prelude::*; + +pub trait HasIndexedAccountSampleValues: Sized { + #[allow(dead_code)] + fn sample_at(index: usize) -> Self; +} + +pub trait HasManyAccountSampleValues: Sized { + #[allow(dead_code)] + fn sample_all() -> Vec; +} + +impl HasIndexedAccountSampleValues for AccountAddress { + fn sample_at(index: usize) -> Self { + Account::sample_at(index).address + } +} + +impl HasManyAccountSampleValues for AccountAddress { + fn sample_all() -> Vec { + Account::sample_all().iter().map(|a| a.address).collect() + } +} diff --git a/crates/profile/models/profile_SPLIT_ME/src/samples/account_samples.rs b/crates/profile/models/account/src/account_samples.rs similarity index 90% rename from crates/profile/models/profile_SPLIT_ME/src/samples/account_samples.rs rename to crates/profile/models/account/src/account_samples.rs index f11e2bbe4..bd6371180 100644 --- a/crates/profile/models/profile_SPLIT_ME/src/samples/account_samples.rs +++ b/crates/profile/models/account/src/account_samples.rs @@ -138,23 +138,21 @@ impl Account { name: impl AsRef, genesis_factor_instance: HierarchicalDeterministicFactorInstance, ) -> Self { - Self { - network_id: NetworkID::Mainnet, - address: AccountAddress::new( + Self::with( + NetworkID::Mainnet, + AccountAddress::new( genesis_factor_instance.public_key.public_key, NetworkID::Mainnet, ), - display_name: DisplayName::new(name).unwrap(), - security_state: - UnsecuredEntityControl::with_transaction_signing_only( - genesis_factor_instance, - ) - .unwrap() - .into(), - appearance_id: Default::default(), - flags: Default::default(), - on_ledger_settings: Default::default(), - } + DisplayName::new(name).unwrap(), + UnsecuredEntityControl::with_transaction_signing_only( + genesis_factor_instance, + ) + .unwrap(), + EntityFlags::default(), + AppearanceID::default(), + OnLedgerSettings::default(), + ) } pub fn sample_securified_mainnet( @@ -199,21 +197,20 @@ impl Account { ) .unwrap(); - Self { + Self::with( network_id, address, - display_name: DisplayName::new(name).unwrap(), - security_state: SecuredEntityControl::new( + DisplayName::new(name).unwrap(), + SecuredEntityControl::new( Some(veci.clone()), AccessControllerAddress::sample_from_account_address(address), security_structure_of_factor_instances, ) - .unwrap() - .into(), - appearance_id: Default::default(), - flags: Default::default(), - on_ledger_settings: Default::default(), - } + .unwrap(), + EntityFlags::default(), + AppearanceID::default(), + OnLedgerSettings::default(), + ) } pub fn sample_at(index: usize) -> Self { diff --git a/crates/profile/models/account/src/lib.rs b/crates/profile/models/account/src/lib.rs new file mode 100644 index 000000000..758639b8b --- /dev/null +++ b/crates/profile/models/account/src/lib.rs @@ -0,0 +1,30 @@ +mod access_controller_address_samples_for_accounts; +mod account; +mod account_address_samples; +mod account_samples; + +pub mod prelude { + pub use crate::access_controller_address_samples_for_accounts::*; + pub use crate::account::*; + pub use crate::account_address_samples::*; + + pub(crate) use account_for_display::prelude::*; + pub(crate) use cap26_models::prelude::*; + pub(crate) use entity_foundation::prelude::*; + pub(crate) use has_sample_values::prelude::*; + pub(crate) use profile_base_entity::prelude::*; + pub(crate) use profile_security_structures::prelude::*; + + pub(crate) use transaction_models::prelude::*; + + pub(crate) use serde::{Deserialize, Serialize}; + + #[cfg(test)] + mod testing { + pub(crate) use std::collections::HashSet; + } + #[cfg(test)] + pub(crate) use testing::*; +} + +pub use prelude::*; diff --git a/crates/profile/models/base-entity/Cargo.toml b/crates/profile/models/base-entity/Cargo.toml new file mode 100644 index 000000000..e2cadf7a4 --- /dev/null +++ b/crates/profile/models/base-entity/Cargo.toml @@ -0,0 +1,28 @@ +[package] +name = "profile-base-entity" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +addresses = { path = "../../../crypto/addresses" } +factors = { path = "../../../factors/factors" } +short-string = { path = "../../../common/short-string" } +entity-foundation = { path = "../../../common/entity-foundation" } +identified-vec-of = { path = "../../../common/identified-vec-of" } +network = { path = "../../../common/network" } +has-sample-values = { path = "../../../core/has-sample-values" } +transaction-models = { path = "../../../transaction/models" } +profile-security-structures = { path = "../../../profile/models/security-structures" } + +# === RADIX DEPENDENCIES === +# None + +# === EXTERNAL DEPENDENCIES === +derive_more = { workspace = true } +enum-iterator = { workspace = true } +enum-as-inner = { workspace = true } +paste = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +strum = { workspace = true } diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/abstract_entity_type.rs b/crates/profile/models/base-entity/src/base_entity/abstract_entity_type.rs similarity index 100% rename from crates/profile/models/profile_SPLIT_ME/src/v100/entity/abstract_entity_type.rs rename to crates/profile/models/base-entity/src/base_entity/abstract_entity_type.rs diff --git a/crates/profile/models/base-entity/src/base_entity/base_entity.rs b/crates/profile/models/base-entity/src/base_entity/base_entity.rs new file mode 100644 index 000000000..16043a1cc --- /dev/null +++ b/crates/profile/models/base-entity/src/base_entity/base_entity.rs @@ -0,0 +1,65 @@ +use crate::prelude::*; + +#[derive( + Serialize, + Deserialize, + Clone, + Debug, + PartialEq, + Hash, + Eq, + derive_more::Display, +)] +#[display("{display_name} | {address}")] +#[serde(rename_all = "camelCase")] +pub struct BaseEntity
{ + /// The ID of the network this Persona or Account can be used with. + #[serde(rename = "networkID")] + pub network_id: NetworkID, + + /// A globally unique identifier of this Persona or Account, being a human readable + /// address of an Persona or Account. Always starts with `"account_"``, for example: + /// + /// `account_rdx128y6j78mt0aqv6372evz28hrxp8mn06ccddkr7xppc88hyvynvjdwr` + /// + /// Most commonly the user will see this address in its abbreviated + /// form which is: + /// + /// `acco...nvjdwr` + /// + /// No two addresses will ever be the same even for the same factor source + /// but on different networks, since the public keys controlling the + /// Persona or Accounts depend on the network id. + pub address: Address, + + /// An off-ledger display name or description chosen by the user when she + /// created this Persona or Account. + pub display_name: DisplayName, + + /// Security state of this Persona or Account, either "securified" or not. + pub security_state: EntitySecurityState, + + /// An order set of `EntityFlag`s used to describe certain Off-ledger + /// user state about Persona or Accounts or Personas, such as if an entity is + /// marked as hidden or not. + #[serde(default)] + pub flags: EntityFlags, +} + +impl
BaseEntity
{ + pub fn new( + network_id: impl Into, + address: impl Into
, + display_name: impl Into, + security_state: impl Into, + flags: impl IntoIterator, + ) -> Self { + Self { + network_id: network_id.into(), + address: address.into(), + display_name: display_name.into(), + security_state: security_state.into(), + flags: flags.into_iter().collect(), + } + } +} diff --git a/crates/profile/models/base-entity/src/base_entity/has_security_state.rs b/crates/profile/models/base-entity/src/base_entity/has_security_state.rs new file mode 100644 index 000000000..0bf2df49c --- /dev/null +++ b/crates/profile/models/base-entity/src/base_entity/has_security_state.rs @@ -0,0 +1,55 @@ +use crate::prelude::*; + +pub trait HasSecurityState: HasFactorInstances + IsSecurityStateAware { + fn security_state(&self) -> EntitySecurityState; + fn set_security_state_unchecked(&mut self, new_state: EntitySecurityState); + + // TODO: Should we check `provisional_securified_config` of `self` and/or + // of `new_state`? + fn set_security_state( + &mut self, + new_state: EntitySecurityState, + ) -> Result<()> { + match (&self.security_state(), &new_state) { + ( + &EntitySecurityState::Securified { .. }, + &EntitySecurityState::Unsecured { .. }, + ) => { + Err(CommonError::SecurityStateSecurifiedButExpectedUnsecurified) + } + ( + EntitySecurityState::Securified { + value: sec_existing, + }, + EntitySecurityState::Securified { value: sec_new }, + ) => { + if sec_new.access_controller_address + != sec_existing.access_controller_address + { + Err(CommonError::SecurityStateAccessControllerAddressMismatch) + } else { + self.set_security_state_unchecked(new_state); + Ok(()) + } + } + _ => { + self.set_security_state_unchecked(new_state); + Ok(()) + } + } + } + + fn try_get_secured_control(&self) -> Result { + self.security_state() + .as_securified() + .cloned() + .ok_or(CommonError::SecurityStateNotSecurified) + } + + fn try_get_unsecured_control(&self) -> Result { + self.security_state() + .as_unsecured() + .cloned() + .ok_or(CommonError::SecurityStateSecurifiedButExpectedUnsecurified) + } +} diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/is_entity.rs b/crates/profile/models/base-entity/src/base_entity/is_base_entity.rs similarity index 90% rename from crates/profile/models/profile_SPLIT_ME/src/v100/entity/is_entity.rs rename to crates/profile/models/base-entity/src/base_entity/is_base_entity.rs index 17da4188b..1a59fd06b 100644 --- a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/is_entity.rs +++ b/crates/profile/models/base-entity/src/base_entity/is_base_entity.rs @@ -31,7 +31,7 @@ pub trait IsBaseEntity: } /// A trait bridging Account and Persona. -pub trait IsEntity: +pub trait IsEntityWithoutConcreteTypes: IsBaseEntity + HasEntityKind + Identifiable @@ -39,8 +39,8 @@ pub trait IsEntity: + Eq + std::fmt::Debug + Clone - + TryFrom - + Into +// + TryFrom +// + Into { type Path: IsEntityPath; diff --git a/crates/profile/models/base-entity/src/base_entity/mod.rs b/crates/profile/models/base-entity/src/base_entity/mod.rs new file mode 100644 index 000000000..c091ef892 --- /dev/null +++ b/crates/profile/models/base-entity/src/base_entity/mod.rs @@ -0,0 +1,10 @@ +mod abstract_entity_type; +#[allow(clippy::module_inception)] +mod base_entity; +mod has_security_state; +mod is_base_entity; + +pub use abstract_entity_type::*; +pub use base_entity::*; +pub use has_security_state::*; +pub use is_base_entity::*; diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/entity_flag.rs b/crates/profile/models/base-entity/src/entity_flags/entity_flag.rs similarity index 100% rename from crates/profile/models/profile_SPLIT_ME/src/v100/entity/entity_flag.rs rename to crates/profile/models/base-entity/src/entity_flags/entity_flag.rs diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/entity_flags.rs b/crates/profile/models/base-entity/src/entity_flags/entity_flags.rs similarity index 99% rename from crates/profile/models/profile_SPLIT_ME/src/v100/entity/entity_flags.rs rename to crates/profile/models/base-entity/src/entity_flags/entity_flags.rs index 9a9e3c721..e8e4f06db 100644 --- a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/entity_flags.rs +++ b/crates/profile/models/base-entity/src/entity_flags/entity_flags.rs @@ -33,6 +33,7 @@ impl FlagInserting for EntityFlags { self.append(flag).0 } } + impl FlagRemoving for EntityFlags { fn remove_flag(&mut self, flag: &EntityFlag) -> Option { self.remove_id(&flag.id()) diff --git a/crates/profile/models/base-entity/src/entity_flags/mod.rs b/crates/profile/models/base-entity/src/entity_flags/mod.rs new file mode 100644 index 000000000..0cc3f27dd --- /dev/null +++ b/crates/profile/models/base-entity/src/entity_flags/mod.rs @@ -0,0 +1,5 @@ +mod entity_flag; +mod entity_flags; + +pub use entity_flag::*; +pub use entity_flags::*; diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/entity_security_state/entity_security_state.rs b/crates/profile/models/base-entity/src/entity_security_state/entity_security_state.rs similarity index 99% rename from crates/profile/models/profile_SPLIT_ME/src/v100/entity_security_state/entity_security_state.rs rename to crates/profile/models/base-entity/src/entity_security_state/entity_security_state.rs index e901e2f9a..beafdfa7b 100644 --- a/crates/profile/models/profile_SPLIT_ME/src/v100/entity_security_state/entity_security_state.rs +++ b/crates/profile/models/base-entity/src/entity_security_state/entity_security_state.rs @@ -1,3 +1,5 @@ +use serde::ser::SerializeStruct; + use crate::prelude::*; /// Describes the state an entity - Account or Persona - is in, in regards to how diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/entity_security_state/mod.rs b/crates/profile/models/base-entity/src/entity_security_state/mod.rs similarity index 82% rename from crates/profile/models/profile_SPLIT_ME/src/v100/entity_security_state/mod.rs rename to crates/profile/models/base-entity/src/entity_security_state/mod.rs index 48ba2abb0..0a0bf28d0 100644 --- a/crates/profile/models/profile_SPLIT_ME/src/v100/entity_security_state/mod.rs +++ b/crates/profile/models/base-entity/src/entity_security_state/mod.rs @@ -1,9 +1,11 @@ mod entity_security_state; mod provisional_securified_config; mod provisional_securified_transaction_queued; +mod secured_entity_control; mod unsecured_entity_control; pub use entity_security_state::*; pub use provisional_securified_config::*; pub use provisional_securified_transaction_queued::*; +pub use secured_entity_control::*; pub use unsecured_entity_control::*; diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/entity_security_state/provisional_securified_config.rs b/crates/profile/models/base-entity/src/entity_security_state/provisional_securified_config.rs similarity index 100% rename from crates/profile/models/profile_SPLIT_ME/src/v100/entity_security_state/provisional_securified_config.rs rename to crates/profile/models/base-entity/src/entity_security_state/provisional_securified_config.rs diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/entity_security_state/provisional_securified_transaction_queued.rs b/crates/profile/models/base-entity/src/entity_security_state/provisional_securified_transaction_queued.rs similarity index 100% rename from crates/profile/models/profile_SPLIT_ME/src/v100/entity_security_state/provisional_securified_transaction_queued.rs rename to crates/profile/models/base-entity/src/entity_security_state/provisional_securified_transaction_queued.rs diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/secured_entity_control/mod.rs b/crates/profile/models/base-entity/src/entity_security_state/secured_entity_control/mod.rs similarity index 100% rename from crates/profile/models/profile_SPLIT_ME/src/v100/secured_entity_control/mod.rs rename to crates/profile/models/base-entity/src/entity_security_state/secured_entity_control/mod.rs diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/secured_entity_control/secured_entity_control.rs b/crates/profile/models/base-entity/src/entity_security_state/secured_entity_control/secured_entity_control.rs similarity index 100% rename from crates/profile/models/profile_SPLIT_ME/src/v100/secured_entity_control/secured_entity_control.rs rename to crates/profile/models/base-entity/src/entity_security_state/secured_entity_control/secured_entity_control.rs diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/entity_security_state/unsecured_entity_control.rs b/crates/profile/models/base-entity/src/entity_security_state/unsecured_entity_control.rs similarity index 100% rename from crates/profile/models/profile_SPLIT_ME/src/v100/entity_security_state/unsecured_entity_control.rs rename to crates/profile/models/base-entity/src/entity_security_state/unsecured_entity_control.rs diff --git a/crates/profile/models/base-entity/src/lib.rs b/crates/profile/models/base-entity/src/lib.rs new file mode 100644 index 000000000..40fea8dca --- /dev/null +++ b/crates/profile/models/base-entity/src/lib.rs @@ -0,0 +1,33 @@ +mod base_entity; +mod entity_flags; +mod entity_security_state; + +pub mod prelude { + pub use crate::base_entity::*; + pub use crate::entity_flags::*; + pub use crate::entity_security_state::*; + + pub(crate) use addresses::prelude::*; + pub(crate) use factors::prelude::*; + pub(crate) use has_sample_values::prelude::*; + pub(crate) use identified_vec_of::prelude::*; + pub(crate) use network::prelude::*; + pub(crate) use profile_security_structures::prelude::*; + + pub(crate) use transaction_models::prelude::*; + + pub(crate) use enum_as_inner::EnumAsInner; + + pub(crate) use serde::{Deserialize, Deserializer, Serialize, Serializer}; + pub(crate) use strum::FromRepr; + + #[cfg(test)] + pub(crate) use testing::*; + + #[cfg(test)] + mod testing { + pub(crate) use serde_json::json; + } +} + +pub use prelude::*; diff --git a/crates/profile/models/persona-data/Cargo.toml b/crates/profile/models/persona-data/Cargo.toml new file mode 100644 index 000000000..0af6d9dcb --- /dev/null +++ b/crates/profile/models/persona-data/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "profile-persona-data" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +assert-json = { path = "../../../core/assert-json" } +addresses = { path = "../../../crypto/addresses" } +core-misc = { path = "../../../core/misc" } +short-string = { path = "../../../common/short-string" } +entity-foundation = { path = "../../../common/entity-foundation" } +identified-vec-of = { path = "../../../common/identified-vec-of" } +network = { path = "../../../common/network" } +has-sample-values = { path = "../../../core/has-sample-values" } + +# === RADIX DEPENDENCIES === +# None + +# === EXTERNAL DEPENDENCIES === +derive_more = { workspace = true } +paste = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } diff --git a/crates/profile/models/persona-data/src/lib.rs b/crates/profile/models/persona-data/src/lib.rs new file mode 100644 index 000000000..dfafd081c --- /dev/null +++ b/crates/profile/models/persona-data/src/lib.rs @@ -0,0 +1,29 @@ +mod persona_data; +mod shared_persona_data; + +pub mod prelude { + pub use crate::persona_data::*; + pub use crate::shared_persona_data::*; + + pub(crate) use addresses::prelude::*; + pub(crate) use core_misc::prelude::*; + pub(crate) use has_sample_values::prelude::*; + pub(crate) use identified_vec_of::prelude::*; + pub(crate) use short_string::prelude::*; + + pub(crate) use serde::{Deserialize, Serialize}; + + pub(crate) use std::str::FromStr; + #[cfg(test)] + pub(crate) use testing::*; + + #[cfg(test)] + mod testing { + + pub(crate) use std::collections::HashSet; + + pub(crate) use serde_json::json; + } +} + +pub use prelude::*; diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/collection_of_email_addresses.rs b/crates/profile/models/persona-data/src/persona_data/collection_of_email_addresses.rs similarity index 100% rename from crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/collection_of_email_addresses.rs rename to crates/profile/models/persona-data/src/persona_data/collection_of_email_addresses.rs diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/collection_of_phone_numbers.rs b/crates/profile/models/persona-data/src/persona_data/collection_of_phone_numbers.rs similarity index 100% rename from crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/collection_of_phone_numbers.rs rename to crates/profile/models/persona-data/src/persona_data/collection_of_phone_numbers.rs diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/entry_kinds/mod.rs b/crates/profile/models/persona-data/src/persona_data/entry_kinds/mod.rs similarity index 100% rename from crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/entry_kinds/mod.rs rename to crates/profile/models/persona-data/src/persona_data/entry_kinds/mod.rs diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_email_address.rs b/crates/profile/models/persona-data/src/persona_data/entry_kinds/persona_data_entry_email_address.rs similarity index 100% rename from crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_email_address.rs rename to crates/profile/models/persona-data/src/persona_data/entry_kinds/persona_data_entry_email_address.rs diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_name.rs b/crates/profile/models/persona-data/src/persona_data/entry_kinds/persona_data_entry_name.rs similarity index 100% rename from crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_name.rs rename to crates/profile/models/persona-data/src/persona_data/entry_kinds/persona_data_entry_name.rs diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_phone_number.rs b/crates/profile/models/persona-data/src/persona_data/entry_kinds/persona_data_entry_phone_number.rs similarity index 100% rename from crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/entry_kinds/persona_data_entry_phone_number.rs rename to crates/profile/models/persona-data/src/persona_data/entry_kinds/persona_data_entry_phone_number.rs diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/mod.rs b/crates/profile/models/persona-data/src/persona_data/mod.rs similarity index 100% rename from crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/mod.rs rename to crates/profile/models/persona-data/src/persona_data/mod.rs diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/persona_data.rs b/crates/profile/models/persona-data/src/persona_data/persona_data.rs similarity index 100% rename from crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/persona_data.rs rename to crates/profile/models/persona-data/src/persona_data/persona_data.rs diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/persona_data_entry_id.rs b/crates/profile/models/persona-data/src/persona_data/persona_data_entry_id.rs similarity index 100% rename from crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/persona_data_entry_id.rs rename to crates/profile/models/persona-data/src/persona_data/persona_data_entry_id.rs diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/persona_data_identified_collection_types.rs b/crates/profile/models/persona-data/src/persona_data/persona_data_identified_collection_types.rs similarity index 100% rename from crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/persona_data_identified_collection_types.rs rename to crates/profile/models/persona-data/src/persona_data/persona_data_identified_collection_types.rs diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/persona_data_identified_entry_types.rs b/crates/profile/models/persona-data/src/persona_data/persona_data_identified_entry_types.rs similarity index 99% rename from crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/persona_data_identified_entry_types.rs rename to crates/profile/models/persona-data/src/persona_data/persona_data_identified_entry_types.rs index cac8b4dd9..16108ed44 100644 --- a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona_data/persona_data_identified_entry_types.rs +++ b/crates/profile/models/persona-data/src/persona_data/persona_data_identified_entry_types.rs @@ -36,37 +36,44 @@ macro_rules! declare_identified_entry { pub id: PersonaDataEntryID, pub value: $value_type, } + impl From<$value_type> for $struct_name { fn from(value: $value_type) -> Self { Self::new(value) } } + impl PersonaDataEntryValue for $struct_name { type Value = $value_type; } + impl Identifiable for $struct_name { type ID = PersonaDataEntryID; fn id(&self) -> Self::ID { self.id.clone() } } + impl $struct_name { - pub(crate) fn with_id( + pub fn with_id( id: PersonaDataEntryID, value: $value_type, ) -> Self { Self { id, value } } + pub fn new(value: $value_type) -> Self { Self::with_id(PersonaDataEntryID::generate(), value) } } + impl std::ops::Deref for $struct_name { type Target = $value_type; fn deref(&self) -> &Self::Target { &self.value } } + impl HasSampleValues for $struct_name { fn sample() -> Self { $struct_name::with_id( @@ -74,6 +81,7 @@ macro_rules! declare_identified_entry { <$value_type>::sample(), ) } + fn sample_other() -> Self { $struct_name::with_id( PersonaDataEntryID::sample_other(), diff --git a/crates/profile/models/persona-data/src/shared_persona_data/mod.rs b/crates/profile/models/persona-data/src/shared_persona_data/mod.rs new file mode 100644 index 000000000..ee4d7ad8d --- /dev/null +++ b/crates/profile/models/persona-data/src/shared_persona_data/mod.rs @@ -0,0 +1,11 @@ +mod persona_data_shared; +#[allow(clippy::module_inception)] +mod shared_persona_data; +mod shared_to_dapp_with_persona_account_addresses; +mod shared_to_dapp_with_persona_ids_of_persona_data_entries; +mod shared_with_dapp; + +pub use shared_persona_data::*; +pub use shared_to_dapp_with_persona_account_addresses::*; +pub use shared_to_dapp_with_persona_ids_of_persona_data_entries::*; +pub(crate) use shared_with_dapp::*; diff --git a/crates/profile/models/persona-data/src/shared_persona_data/persona_data_shared.rs b/crates/profile/models/persona-data/src/shared_persona_data/persona_data_shared.rs new file mode 100644 index 000000000..effb28a11 --- /dev/null +++ b/crates/profile/models/persona-data/src/shared_persona_data/persona_data_shared.rs @@ -0,0 +1,15 @@ +use crate::prelude::*; + +impl PersonaData { + pub fn shared_everything(&self) -> SharedPersonaData { + SharedPersonaData::new( + self.name.clone().map(|x| x.id), + SharedToDappWithPersonaIDsOfPersonaDataEntries::exactly( + self.email_addresses.ids().into_iter().cloned(), + ), + SharedToDappWithPersonaIDsOfPersonaDataEntries::exactly( + self.phone_numbers.ids().into_iter().cloned(), + ), + ) + } +} diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/shared_persona_data.rs b/crates/profile/models/persona-data/src/shared_persona_data/shared_persona_data.rs similarity index 100% rename from crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/shared_persona_data.rs rename to crates/profile/models/persona-data/src/shared_persona_data/shared_persona_data.rs diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_account_addresses.rs b/crates/profile/models/persona-data/src/shared_persona_data/shared_to_dapp_with_persona_account_addresses.rs similarity index 85% rename from crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_account_addresses.rs rename to crates/profile/models/persona-data/src/shared_persona_data/shared_to_dapp_with_persona_account_addresses.rs index 541798c36..4893c9a0a 100644 --- a/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_account_addresses.rs +++ b/crates/profile/models/persona-data/src/shared_persona_data/shared_to_dapp_with_persona_account_addresses.rs @@ -35,15 +35,15 @@ impl SharedToDappWithPersonaAccountAddresses { Self::new( RequestedQuantity::exactly(2), [ - Account::sample_mainnet().address, - Account::sample_mainnet_other().address, + "account_rdx128dtethfy8ujrsfdztemyjk0kvhnah6dafr57frz85dcw2c8z0td87".parse().unwrap(), + "account_rdx12y02nen8zjrq0k0nku98shjq7n05kvl3j9m5d3a6cpduqwzgmenjq7".parse().unwrap(), ], ) } pub fn sample_mainnet_other() -> Self { Self::new( RequestedQuantity::at_least(1), - [Account::sample_mainnet_other().address], + ["account_rdx12y02nen8zjrq0k0nku98shjq7n05kvl3j9m5d3a6cpduqwzgmenjq7".parse().unwrap()], ) } pub fn sample_stokenet() -> Self { diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_ids_of_persona_data_entries.rs b/crates/profile/models/persona-data/src/shared_persona_data/shared_to_dapp_with_persona_ids_of_persona_data_entries.rs similarity index 100% rename from crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/shared_to_dapp_with_persona_ids_of_persona_data_entries.rs rename to crates/profile/models/persona-data/src/shared_persona_data/shared_to_dapp_with_persona_ids_of_persona_data_entries.rs diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/shared_with_dapp.rs b/crates/profile/models/persona-data/src/shared_persona_data/shared_with_dapp.rs similarity index 100% rename from crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/shared_with_dapp.rs rename to crates/profile/models/persona-data/src/shared_persona_data/shared_with_dapp.rs diff --git a/crates/profile/models/persona/Cargo.toml b/crates/profile/models/persona/Cargo.toml new file mode 100644 index 000000000..574ada93c --- /dev/null +++ b/crates/profile/models/persona/Cargo.toml @@ -0,0 +1,27 @@ +[package] +name = "profile-persona" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +short-string = { path = "../../../common/short-string" } +hierarchical-deterministic = { path = "../../../crypto/hd" } +has-sample-values = { path = "../../../core/has-sample-values" } +addresses = { path = "../../../crypto/addresses" } +host-info = { path = "../../../common/host-info" } +core-misc = { path = "../../../core/misc" } +cap26-models = { path = "../../../crypto/cap26-models" } +profile-base-entity = { path = "../../../profile/models/base-entity" } +profile-persona-data = { path = "../../../profile/models/persona-data" } +profile-security-structures = { path = "../../../profile/models/security-structures" } + + +# === RADIX DEPENDENCIES === +# None + +# === EXTERNAL DEPENDENCIES === +derive_more = { workspace = true } +once_cell = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } diff --git a/crates/profile/models/profile_SPLIT_ME/src/samples/access_controller_address_samples.rs b/crates/profile/models/persona/src/access_controller_address_samples_for_personas.rs similarity index 51% rename from crates/profile/models/profile_SPLIT_ME/src/samples/access_controller_address_samples.rs rename to crates/profile/models/persona/src/access_controller_address_samples_for_personas.rs index 9f5be41fc..4567a5991 100644 --- a/crates/profile/models/profile_SPLIT_ME/src/samples/access_controller_address_samples.rs +++ b/crates/profile/models/persona/src/access_controller_address_samples_for_personas.rs @@ -1,26 +1,9 @@ use crate::prelude::*; -pub trait SamplesFromAccountAddress { - fn sample_from_account_address(account_address: AccountAddress) -> Self; -} - pub trait SamplesFromIdentityAddress { fn sample_from_identity_address(identity_address: IdentityAddress) -> Self; } -impl SamplesFromAccountAddress for AccessControllerAddress { - fn sample_from_account_address(account_address: AccountAddress) -> Self { - let node_id: [u8; 29] = account_address.node_id().as_bytes()[0..29] - .try_into() - .unwrap(); - - AccessControllerAddress::with_node_id_bytes( - &node_id, - account_address.network_id(), - ) - } -} - impl SamplesFromIdentityAddress for AccessControllerAddress { fn sample_from_identity_address(identity_address: IdentityAddress) -> Self { let node_id: [u8; 29] = identity_address.node_id().as_bytes()[0..29] diff --git a/crates/profile/models/profile_SPLIT_ME/src/samples/identity_address_samples.rs b/crates/profile/models/persona/src/identity_address_samples.rs similarity index 63% rename from crates/profile/models/profile_SPLIT_ME/src/samples/identity_address_samples.rs rename to crates/profile/models/persona/src/identity_address_samples.rs index bb3e12e66..20352f7e4 100644 --- a/crates/profile/models/profile_SPLIT_ME/src/samples/identity_address_samples.rs +++ b/crates/profile/models/persona/src/identity_address_samples.rs @@ -1,22 +1,22 @@ use crate::prelude::*; -pub trait HasManySampleValues: Sized { - #[allow(dead_code)] - fn sample_all() -> Vec; -} - -pub trait HasIndexedSampleValues: Sized { +pub trait HasIndexedPersonaSampleValues: Sized { #[allow(dead_code)] fn sample_at(index: usize) -> Self; } -impl HasIndexedSampleValues for IdentityAddress { +impl HasIndexedPersonaSampleValues for IdentityAddress { fn sample_at(index: usize) -> Self { Persona::sample_at(index).address } } -impl HasManySampleValues for IdentityAddress { +pub trait HasManyPersonaSampleValues: Sized { + #[allow(dead_code)] + fn sample_all() -> Vec; +} + +impl HasManyPersonaSampleValues for IdentityAddress { fn sample_all() -> Vec { Persona::sample_all().iter().map(|a| a.address).collect() } diff --git a/crates/profile/models/persona/src/lib.rs b/crates/profile/models/persona/src/lib.rs new file mode 100644 index 000000000..3f849ce5b --- /dev/null +++ b/crates/profile/models/persona/src/lib.rs @@ -0,0 +1,24 @@ +mod access_controller_address_samples_for_personas; +mod identity_address_samples; +mod persona; +mod persona_samples; + +pub mod prelude { + pub use crate::access_controller_address_samples_for_personas::*; + pub use crate::identity_address_samples::*; + pub use crate::persona::*; + + pub(crate) use addresses::prelude::*; + pub(crate) use cap26_models::prelude::*; + pub(crate) use core_misc::prelude::*; + pub(crate) use has_sample_values::prelude::*; + pub(crate) use hierarchical_deterministic::prelude::*; + pub(crate) use host_info::prelude::*; + pub(crate) use profile_base_entity::prelude::*; + pub(crate) use profile_persona_data::prelude::*; + pub(crate) use profile_security_structures::prelude::*; + + pub(crate) use serde::{Deserialize, Serialize}; +} + +pub use prelude::*; diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona.rs b/crates/profile/models/persona/src/persona.rs similarity index 91% rename from crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona.rs rename to crates/profile/models/persona/src/persona.rs index b6be8e40e..7d6f4140d 100644 --- a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/persona.rs +++ b/crates/profile/models/persona/src/persona.rs @@ -1,3 +1,5 @@ +use std::ops::{Deref, DerefMut}; + use crate::prelude::*; /// A Persona is an identity a user chooses to login to a dApp with, using @@ -29,43 +31,60 @@ use crate::prelude::*; Eq, derive_more::Display, )] -#[display("{} | {}", display_name, address)] +#[display("{} | {}", self.display_name, self.address)] #[serde(rename_all = "camelCase")] pub struct Persona { - /// The ID of the network this account can be used with. - #[serde(rename = "networkID")] - pub network_id: NetworkID, - - /// The address of an identity, used by Personas, a bech32 encoding of a public key hash - /// that starts with the prefix `"identity_"`, dependent on NetworkID, meaning the same - /// public key used for two IdentityAddresses on two different networks will not have - /// the same address. - pub address: IdentityAddress, - - /// An off-ledger display name or description chosen by the user when they - /// created this persona. - pub display_name: DisplayName, - - /// Describes the state this Persona is in, in regards to how - /// the user controls it, i.e. if it is controlled by a single factor (private key) - /// or an `AccessController` with a potential Multi-Factor setup. - pub security_state: EntitySecurityState, - - /// An order set of `EntityFlag`s used to describe certain Off-ledger - /// user state about this Persona, e.g. if it is marked as hidden or not. - #[serde(default)] - pub flags: EntityFlags, + #[serde(flatten)] + base: BaseEntity, /// Personal information a user has associated with a certain Persona, of different kinds, such as name, /// email address(es) or phone number(s). This information is only ever stored in Profile and is never /// uploaded to the Radix Network. pub persona_data: PersonaData, } + +impl Persona { + pub fn with( + network_id: impl Into, + address: impl Into, + display_name: impl Into, + security_state: impl Into, + flags: impl IntoIterator, + persona_data: impl Into, + ) -> Self { + Self { + base: BaseEntity::new( + network_id, + address, + display_name, + security_state, + flags, + ), + persona_data: persona_data.into(), + } + } +} + +impl Deref for Persona { + type Target = BaseEntity; + + fn deref(&self) -> &Self::Target { + &self.base + } +} + +impl DerefMut for Persona { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.base + } +} + impl HasEntityKind for Persona { fn entity_kind() -> CAP26EntityKind { CAP26EntityKind::Identity } } + impl IsSecurityStateAware for Persona { fn is_securified(&self) -> bool { self.security_state().is_securified() @@ -86,6 +105,7 @@ impl HasSecurityState for Persona { self.security_state = new_state; } } + impl IsBaseEntity for Persona { type Address = IdentityAddress; @@ -97,28 +117,13 @@ impl IsBaseEntity for Persona { } } -impl TryFrom for Persona { - type Error = CommonError; - - fn try_from(value: AccountOrPersona) -> Result { - match value { - AccountOrPersona::PersonaEntity(p) => Ok(p), - AccountOrPersona::AccountEntity(a) => { - Err(CommonError::ExpectedPersonaButGotAccount { - address: a.address.to_string(), - }) - } - } - } -} - impl IsNetworkAware for Persona { fn network_id(&self) -> NetworkID { self.address().network_id() } } -impl IsEntity for Persona { +impl IsEntityWithoutConcreteTypes for Persona { type Path = IdentityPath; fn with_veci_and_name( @@ -129,18 +134,14 @@ impl IsEntity for Persona { IdentityAddress::from_hd_factor_instance_virtual_entity_creation( veci.clone(), ); - Self { - network_id: veci.network_id(), + Self::with( + veci.network_id(), address, - display_name: name, - security_state: - UnsecuredEntityControl::with_entity_creating_factor_instance( - veci, - ) - .into(), - flags: EntityFlags::default(), - persona_data: PersonaData::default(), - } + name, + UnsecuredEntityControl::with_entity_creating_factor_instance(veci), + EntityFlags::default(), + PersonaData::default(), + ) } } @@ -492,15 +493,6 @@ mod tests { assert_eq!(SUT::sample().network_id(), NetworkID::Mainnet); } - #[test] - fn test_err_when_try_from_account() { - let account = Account::sample(); - assert!(matches!( - SUT::try_from(AccountOrPersona::AccountEntity(account)), - Err(CommonError::ExpectedPersonaButGotAccount { .. }) - )); - } - #[test] fn new_with_identity_and_name() { let identity_address: IdentityAddress = diff --git a/crates/profile/models/profile_SPLIT_ME/src/samples/persona_samples.rs b/crates/profile/models/persona/src/persona_samples.rs similarity index 92% rename from crates/profile/models/profile_SPLIT_ME/src/samples/persona_samples.rs rename to crates/profile/models/persona/src/persona_samples.rs index c82f74f87..366a98fe8 100644 --- a/crates/profile/models/profile_SPLIT_ME/src/samples/persona_samples.rs +++ b/crates/profile/models/persona/src/persona_samples.rs @@ -147,22 +147,20 @@ impl Persona { name: impl AsRef, genesis_factor_instance: HierarchicalDeterministicFactorInstance, ) -> Self { - Self { - network_id: NetworkID::Mainnet, - address: IdentityAddress::new( + Self::with( + NetworkID::Mainnet, + IdentityAddress::new( genesis_factor_instance.public_key.public_key, NetworkID::Mainnet, ), - display_name: DisplayName::new(name).unwrap(), - security_state: - UnsecuredEntityControl::with_transaction_signing_only( - genesis_factor_instance, - ) - .unwrap() - .into(), - flags: Default::default(), - persona_data: Default::default(), - } + DisplayName::new(name).unwrap(), + UnsecuredEntityControl::with_transaction_signing_only( + genesis_factor_instance, + ) + .unwrap(), + EntityFlags::default(), + PersonaData::default(), + ) } pub fn sample_securified_mainnet( @@ -239,20 +237,19 @@ impl Persona { ) .unwrap(); - Self { - network_id: NetworkID::Mainnet, + Self::with( + NetworkID::Mainnet, address, - display_name: DisplayName::new(name).unwrap(), - security_state: SecuredEntityControl::new( + DisplayName::new(name).unwrap(), + SecuredEntityControl::new( veci.clone(), AccessControllerAddress::sample_from_identity_address(address), security_structure_of_factor_instances, ) - .unwrap() - .into(), - flags: Default::default(), - persona_data: Default::default(), - } + .unwrap(), + EntityFlags::default(), + PersonaData::default(), + ) } pub fn sample_at(index: usize) -> Self { diff --git a/crates/profile/models/profile_SPLIT_ME/Cargo.toml b/crates/profile/models/profile_SPLIT_ME/Cargo.toml index 3084d1d6e..70b39b0a4 100644 --- a/crates/profile/models/profile_SPLIT_ME/Cargo.toml +++ b/crates/profile/models/profile_SPLIT_ME/Cargo.toml @@ -11,6 +11,7 @@ identified-vec-of = { path = "../../../common/identified-vec-of" } hierarchical-deterministic = { path = "../../../crypto/hd" } factors = { path = "../../../factors/factors" } core-misc = { path = "../../../core/misc" } +profile-persona-data = { path = "../../../profile/models/persona-data" } entity-foundation = { path = "../../../common/entity-foundation" } has-sample-values = { path = "../../../core/has-sample-values" } keys-collector = { path = "../../../factors/keys-collector" } @@ -21,6 +22,11 @@ account-for-display = { path = "../../../profile/models/account-for-display" } profile-security-structures = { path = "../../../profile/models/security-structures" } time-utils = { path = "../../../core/time-utils" } host-info = { path = "../../../common/host-info" } +profile-base-entity = { path = "../../../profile/models/base-entity" } +profile-account-or-persona = { path = "../../../profile/models/account-or-persona" } +profile-account = { path = "../../../profile/models/account" } +profile-persona = { path = "../../../profile/models/persona" } +entity-by-address = { path = "../../../profile/traits/entity-by-address" } # === RADIX DEPENDENCIES === # None diff --git a/crates/profile/models/profile_SPLIT_ME/src/lib.rs b/crates/profile/models/profile_SPLIT_ME/src/lib.rs index a48b4c6cd..df0d34db7 100644 --- a/crates/profile/models/profile_SPLIT_ME/src/lib.rs +++ b/crates/profile/models/profile_SPLIT_ME/src/lib.rs @@ -12,29 +12,31 @@ mod v100; pub mod prelude { + pub use crate::encrypted_profile::*; + pub use crate::profilesnapshot_version::*; + + pub use crate::supporting_types::*; + pub use crate::v100::*; + pub use account_for_display::prelude::*; pub use addresses::prelude::*; pub use core_misc::prelude::*; + pub use entity_by_address::prelude::*; pub use entity_foundation::prelude::*; pub use factors::prelude::*; pub use has_sample_values::prelude::*; pub use hierarchical_deterministic::prelude::*; pub use host_info::prelude::*; pub use identified_vec_of::prelude::*; + pub use profile_account::prelude::*; + pub use profile_account_or_persona::prelude::*; pub use profile_app_preferences::prelude::*; + pub use profile_base_entity::prelude::*; + pub use profile_persona::prelude::*; + pub use profile_persona_data::prelude::*; pub use transaction_models::prelude::*; - pub use crate::encrypted_profile::*; - pub use crate::profilesnapshot_version::*; - pub use crate::samples::*; - pub use crate::supporting_types::*; - pub use crate::v100::*; - - pub(crate) use enum_as_inner::EnumAsInner; - - pub(crate) use serde::{ - ser::SerializeStruct, Deserialize, Deserializer, Serialize, Serializer, - }; + pub(crate) use serde::{Deserialize, Serialize}; #[cfg(test)] pub(crate) use serde_json::json; diff --git a/crates/profile/models/profile_SPLIT_ME/src/samples/account_address_samples.rs b/crates/profile/models/profile_SPLIT_ME/src/samples/account_address_samples.rs deleted file mode 100644 index f7724a93a..000000000 --- a/crates/profile/models/profile_SPLIT_ME/src/samples/account_address_samples.rs +++ /dev/null @@ -1,13 +0,0 @@ -use crate::prelude::*; - -impl HasIndexedSampleValues for AccountAddress { - fn sample_at(index: usize) -> Self { - Account::sample_at(index).address - } -} - -impl HasManySampleValues for AccountAddress { - fn sample_all() -> Vec { - Account::sample_all().iter().map(|a| a.address).collect() - } -} diff --git a/crates/profile/models/profile_SPLIT_ME/src/samples/mod.rs b/crates/profile/models/profile_SPLIT_ME/src/samples/mod.rs index 479dffe70..f5f3e7d37 100644 --- a/crates/profile/models/profile_SPLIT_ME/src/samples/mod.rs +++ b/crates/profile/models/profile_SPLIT_ME/src/samples/mod.rs @@ -1,9 +1 @@ -mod access_controller_address_samples; -mod account_address_samples; -mod account_samples; -mod identity_address_samples; -mod persona_samples; mod profile_samples; - -pub use access_controller_address_samples::*; -pub use identity_address_samples::*; diff --git a/crates/profile/models/profile_SPLIT_ME/src/supporting_types/mod.rs b/crates/profile/models/profile_SPLIT_ME/src/supporting_types/mod.rs index ff89155c4..637a464ed 100644 --- a/crates/profile/models/profile_SPLIT_ME/src/supporting_types/mod.rs +++ b/crates/profile/models/profile_SPLIT_ME/src/supporting_types/mod.rs @@ -1,4 +1,3 @@ -mod account_or_persona; mod accounts_for_display; mod accounts_or_personas; mod authorized_dapp_detailed; @@ -6,7 +5,6 @@ mod authorized_persona_detailed; mod detailed_authorized_personas; mod on_same_network_validating; -pub use account_or_persona::*; pub use accounts_for_display::*; pub use accounts_or_personas::*; pub use authorized_dapp_detailed::*; diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/has_security_state.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity/has_security_state.rs deleted file mode 100644 index 6c47dbb39..000000000 --- a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/has_security_state.rs +++ /dev/null @@ -1,181 +0,0 @@ -use crate::prelude::*; - -pub trait HasSecurityState: HasFactorInstances + IsSecurityStateAware { - fn security_state(&self) -> EntitySecurityState; - fn set_security_state_unchecked(&mut self, new_state: EntitySecurityState); - - // TODO: Should we check `provisional_securified_config` of `self` and/or - // of `new_state`? - fn set_security_state( - &mut self, - new_state: EntitySecurityState, - ) -> Result<()> { - match (&self.security_state(), &new_state) { - ( - &EntitySecurityState::Securified { .. }, - &EntitySecurityState::Unsecured { .. }, - ) => { - Err(CommonError::SecurityStateSecurifiedButExpectedUnsecurified) - } - ( - EntitySecurityState::Securified { - value: sec_existing, - }, - EntitySecurityState::Securified { value: sec_new }, - ) => { - if sec_new.access_controller_address - != sec_existing.access_controller_address - { - Err(CommonError::SecurityStateAccessControllerAddressMismatch) - } else { - self.set_security_state_unchecked(new_state); - Ok(()) - } - } - _ => { - self.set_security_state_unchecked(new_state); - Ok(()) - } - } - } - - fn try_get_secured_control(&self) -> Result { - self.security_state() - .as_securified() - .cloned() - .ok_or(CommonError::SecurityStateNotSecurified) - } - - fn try_get_unsecured_control(&self) -> Result { - self.security_state() - .as_unsecured() - .cloned() - .ok_or(CommonError::SecurityStateSecurifiedButExpectedUnsecurified) - } -} - -#[cfg(test)] -mod tests { - - use super::*; - - #[allow(clippy::upper_case_acronyms)] - type SUT = AccountOrPersona; - - fn test_set_security_state_fail_cannot_unsecurify(sut: impl Into) { - let mut sut = sut.into(); - assert!(sut.is_securified()); - - let unsecurified = EntitySecurityState::sample(); - assert!(unsecurified.is_unsecured()); - - let result = sut.set_security_state(unsecurified); - assert_eq!( - result, - Err(CommonError::SecurityStateSecurifiedButExpectedUnsecurified) - ); - - // assert unchanged - assert!(sut.is_securified()); - } - - #[test] - fn set_security_state_fail_cannot_unsecurify_account() { - test_set_security_state_fail_cannot_unsecurify(Account::sample_at(2)) - } - - #[test] - fn set_security_state_fail_cannot_unsecurify_persona() { - test_set_security_state_fail_cannot_unsecurify(Persona::sample_at(2)) - } - - fn test_set_security_state_fail_can_change_unsecurified( - sut: impl Into, - ) { - let mut sut = sut.into(); - assert!(!sut.is_securified()); - - let unsecurified = EntitySecurityState::sample(); - assert!(unsecurified.is_unsecured()); - - let result = sut.set_security_state(unsecurified.clone()); - assert!(result.is_ok()); - assert_eq!(sut.security_state(), unsecurified); - } - - #[test] - fn set_security_state_fail_can_change_unsecurified_account() { - test_set_security_state_fail_can_change_unsecurified(Account::sample()); - } - - #[test] - fn set_security_state_fail_can_change_unsecurified_persona() { - test_set_security_state_fail_can_change_unsecurified(Persona::sample()); - } - - fn test_set_security_state_fail_access_controller_mismatch( - sut: impl Into, - ) { - let mut sut = sut.into(); - let entity_state = sut.security_state(); - assert!(sut.is_securified()); - - let other_securified = EntitySecurityState::Securified { - value: SecuredEntityControl::sample(), - }; - - let result = sut.set_security_state(other_securified); - assert_eq!( - result, - Err(CommonError::SecurityStateAccessControllerAddressMismatch) - ); - - // assert unchanged - assert_eq!(sut.security_state(), entity_state); - } - - #[test] - fn set_security_state_fail_access_controller_mismatch_account() { - test_set_security_state_fail_access_controller_mismatch( - Account::sample_at(2), - ); - } - - #[test] - fn set_security_state_fail_access_controller_mismatch_persona() { - test_set_security_state_fail_access_controller_mismatch( - Persona::sample_at(2), - ) - } - - fn test_set_security_state_can_change_securified(sut: impl Into) { - let mut sut = sut.into(); - let entity_state = sut.security_state(); - assert!(sut.is_securified()); - let access_controller_address = entity_state - .clone() - .as_securified() - .unwrap() - .access_controller_address; - - let mut value = SecuredEntityControl::sample(); - value.access_controller_address = access_controller_address; - let other_securified = EntitySecurityState::Securified { value }; - - let result = sut.set_security_state(other_securified); - - assert!(result.is_ok()); - assert!(sut.is_securified()); - assert_ne!(sut.security_state(), entity_state); - } - - #[test] - fn set_security_state_can_change_securified_account() { - test_set_security_state_can_change_securified(Account::sample_at(2)); - } - - #[test] - fn set_security_state_can_change_securified_persona() { - test_set_security_state_can_change_securified(Persona::sample_at(2)); - } -} diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/mod.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity/mod.rs deleted file mode 100644 index b8ce3dc18..000000000 --- a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/mod.rs +++ /dev/null @@ -1,15 +0,0 @@ -mod abstract_entity_type; -mod account; -mod entity_flag; -mod entity_flags; -mod has_security_state; -mod is_entity; -mod persona; - -pub use abstract_entity_type::*; -pub use account::*; -pub use entity_flag::*; -pub use entity_flags::*; -pub use has_security_state::*; -pub use is_entity::*; -pub use persona::*; diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/mod.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/mod.rs deleted file mode 100644 index 7bb52af7f..000000000 --- a/crates/profile/models/profile_SPLIT_ME/src/v100/entity/persona/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -mod persona; -mod persona_data; - -pub use persona::*; -pub use persona_data::*; diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/mod.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/mod.rs index 7eb7b9ba2..6965af152 100644 --- a/crates/profile/models/profile_SPLIT_ME/src/v100/mod.rs +++ b/crates/profile/models/profile_SPLIT_ME/src/v100/mod.rs @@ -1,19 +1,15 @@ mod entities_linked_to_factor_source; -mod entity; -mod entity_security_state; mod header; mod networks; mod profile; mod profile_file_contents; +mod profile_network_get_entities; mod proto_profile_maybe_with_legacy_p2p_links; -mod secured_entity_control; pub use entities_linked_to_factor_source::*; -pub use entity::*; -pub use entity_security_state::*; pub use header::*; pub use networks::*; pub use profile::*; pub use profile_file_contents::*; +pub use profile_network_get_entities::*; pub use proto_profile_maybe_with_legacy_p2p_links::*; -pub use secured_entity_control::*; diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/authorized_persona_simple.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/authorized_persona_simple.rs index 8a1e5e0b3..cfbfa63e9 100644 --- a/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/authorized_persona_simple.rs +++ b/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/authorized_persona_simple.rs @@ -99,20 +99,6 @@ impl IsNetworkAware for AuthorizedPersonaSimple { } } -impl PersonaData { - pub(crate) fn shared_everything(&self) -> SharedPersonaData { - SharedPersonaData::new( - self.name.clone().map(|x| x.id), - SharedToDappWithPersonaIDsOfPersonaDataEntries::exactly( - self.email_addresses.ids().into_iter().cloned(), - ), - SharedToDappWithPersonaIDsOfPersonaDataEntries::exactly( - self.phone_numbers.ids().into_iter().cloned(), - ), - ) - } -} - impl AuthorizedPersonaSimple { pub fn sample_mainnet() -> Self { let persona = Persona::sample_mainnet(); diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/mod.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/mod.rs index 5e1fcb1aa..454fdc73d 100644 --- a/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/mod.rs +++ b/crates/profile/models/profile_SPLIT_ME/src/v100/networks/network/authorized_dapp/mod.rs @@ -2,16 +2,8 @@ mod authorized_dapp; mod authorized_persona_simple; mod preferences; mod references_to_authorized_personas; -mod shared_persona_data; -mod shared_to_dapp_with_persona_account_addresses; -mod shared_to_dapp_with_persona_ids_of_persona_data_entries; -mod shared_with_dapp; pub use authorized_dapp::*; pub use authorized_persona_simple::*; pub use preferences::*; pub use references_to_authorized_personas::*; -pub use shared_persona_data::*; -pub use shared_to_dapp_with_persona_account_addresses::*; -pub use shared_to_dapp_with_persona_ids_of_persona_data_entries::*; -pub(crate) use shared_with_dapp::*; diff --git a/crates/profile/models/profile_SPLIT_ME/src/v100/profile.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/profile.rs index 418b0c1bb..47118ca9f 100644 --- a/crates/profile/models/profile_SPLIT_ME/src/v100/profile.rs +++ b/crates/profile/models/profile_SPLIT_ME/src/v100/profile.rs @@ -47,6 +47,54 @@ pub struct Profile { pub networks: ProfileNetworks, } +impl HasFactorSources for Profile { + fn factor_sources(&self) -> IndexSet { + self.factor_sources.iter().collect() + } +} + +impl ProfileAccountByAddress for Profile { + /// Looks up the account by account address, returns Err if the account is + /// unknown, will return a hidden, or tombstoned account if queried for. + fn account_by_address(&self, address: AccountAddress) -> Result { + for network in self.networks.iter() { + if let Some(account) = network.accounts.get_id(address) { + return Ok(account.clone()); + } + } + Err(CommonError::UnknownAccount) + } +} + +impl ProfilePersonaByAddress for Profile { + /// Looks up the persona by identity address, returns Err if the persona is + /// unknown, will return a hidden persona if queried for. + fn persona_by_address(&self, address: IdentityAddress) -> Result { + for network in self.networks.iter() { + if let Some(persona) = network.personas.get_id(address) { + return Ok(persona.clone()); + } + } + Err(CommonError::UnknownPersona) + } +} + +impl ProfileEntityByAddress for Profile { + fn entity_by_address( + &self, + entity_address: AddressOfAccountOrPersona, + ) -> Result { + self.networks + .get_id(entity_address.network_id()) + .and_then(|n| n.entity_by_address(&entity_address)) + .ok_or(if entity_address.is_account() { + CommonError::UnknownAccount + } else { + CommonError::UnknownPersona + }) + } +} + impl Profile { pub fn new_from_json_string(json_str: impl AsRef) -> Result { let json_str = json_str.as_ref(); diff --git a/crates/profile/logic/logic_SPLIT_ME/src/logic/profile_network/profile_network_get_entities.rs b/crates/profile/models/profile_SPLIT_ME/src/v100/profile_network_get_entities.rs similarity index 81% rename from crates/profile/logic/logic_SPLIT_ME/src/logic/profile_network/profile_network_get_entities.rs rename to crates/profile/models/profile_SPLIT_ME/src/v100/profile_network_get_entities.rs index 60dda83dd..4989479d6 100644 --- a/crates/profile/logic/logic_SPLIT_ME/src/logic/profile_network/profile_network_get_entities.rs +++ b/crates/profile/models/profile_SPLIT_ME/src/v100/profile_network_get_entities.rs @@ -1,5 +1,44 @@ use crate::prelude::*; +pub trait VisibleOrHidden { + fn visible(&self) -> Self; + fn hidden(&self) -> Self; +} + +impl VisibleOrHidden for Accounts { + fn visible(&self) -> Self { + self.clone() + .into_iter() + .filter(|p| !p.is_hidden() && !p.is_tombstoned()) + .collect() + } + + fn hidden(&self) -> Self { + self.clone() + .into_iter() + .filter(|p| p.is_hidden() && !p.is_tombstoned()) + .collect() + } +} + +pub trait PersonasVisibility { + fn non_hidden(&self) -> Self; + fn hidden(&self) -> Self; +} + +impl PersonasVisibility for Personas { + fn non_hidden(&self) -> Self { + self.clone() + .into_iter() + .filter(|p| !p.is_hidden()) + .collect() + } + + fn hidden(&self) -> Self { + self.clone().into_iter().filter(|p| p.is_hidden()).collect() + } +} + pub trait ProfileNetworkEntitiesQuerying { fn accounts_non_hidden(&self) -> Accounts; fn accounts_hidden(&self) -> Accounts; diff --git a/crates/profile/models/security-structures/Cargo.toml b/crates/profile/models/security-structures/Cargo.toml index 380f46cf2..0e44cb30c 100644 --- a/crates/profile/models/security-structures/Cargo.toml +++ b/crates/profile/models/security-structures/Cargo.toml @@ -10,12 +10,14 @@ hierarchical-deterministic = { path = "../../../crypto/hd" } factors = { path = "../../../factors/factors" } has-sample-values = { path = "../../../core/has-sample-values" } addresses = { path = "../../../crypto/addresses" } +cap26-models = { path = "../../../crypto/cap26-models" } next-derivation-index-ephemeral = { path = "../../../factors/next-derivation-index-ephemeral" } network = { path = "../../../common/network" } core-collections = { path = "../../../core/collections" } time-utils = { path = "../../../core/time-utils" } short-string = { path = "../../../common/short-string" } -sargon-core-utils = { path = "../../../core/utils" } +core-utils = { path = "../../../core/utils" } + # === RADIX DEPENDENCIES === radix-engine-interface = { workspace = true } diff --git a/crates/profile/models/security-structures/src/lib.rs b/crates/profile/models/security-structures/src/lib.rs index db91d4094..fb2711e3e 100644 --- a/crates/profile/models/security-structures/src/lib.rs +++ b/crates/profile/models/security-structures/src/lib.rs @@ -12,14 +12,15 @@ pub mod prelude { pub use crate::roles_matrices_structures::*; pub use addresses::prelude::*; + pub use cap26_models::prelude::*; pub use core_collections::prelude::{Just, JustKV}; + pub use core_utils::prelude::*; pub use factors::prelude::*; pub use has_sample_values::prelude::*; pub use hierarchical_deterministic::prelude::*; pub use identified_vec_of::prelude::*; pub use network::prelude::*; pub use next_derivation_index_ephemeral::prelude::*; - pub use sargon_core_utils::prelude::*; pub use short_string::prelude::*; pub(crate) use radix_engine_interface::{ diff --git a/crates/profile/models/supporting-types/Cargo.toml b/crates/profile/models/supporting-types/Cargo.toml index 071be2a6b..e1a85d546 100644 --- a/crates/profile/models/supporting-types/Cargo.toml +++ b/crates/profile/models/supporting-types/Cargo.toml @@ -10,6 +10,8 @@ hierarchical-deterministic = { path = "../../../crypto/hd" } factors = { path = "../../../factors/factors" } addresses = { path = "../../../crypto/addresses" } profile = { path = "../../../profile/models/profile_SPLIT_ME" } +profile-base-entity = { path = "../../../profile/models/base-entity" } +profile-account-or-persona = { path = "../../../profile/models/account-or-persona" } # === RADIX DEPENDENCIES === # None diff --git a/crates/profile/traits/entity-by-address/Cargo.toml b/crates/profile/traits/entity-by-address/Cargo.toml new file mode 100644 index 000000000..cc55feeba --- /dev/null +++ b/crates/profile/traits/entity-by-address/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "entity-by-address" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +error = { path = "../../../core/error" } +addresses = { path = "../../../crypto/addresses" } +profile-account = { path = "../../../profile/models/account" } +profile-account-or-persona = { path = "../../../profile/models/account-or-persona" } +profile-persona = { path = "../../../profile/models/persona" } + + +# === RADIX DEPENDENCIES === +# None + +# === EXTERNAL DEPENDENCIES === +# None diff --git a/crates/profile/traits/entity-by-address/src/entity_by_address.rs b/crates/profile/traits/entity-by-address/src/entity_by_address.rs new file mode 100644 index 000000000..2a21f90a6 --- /dev/null +++ b/crates/profile/traits/entity-by-address/src/entity_by_address.rs @@ -0,0 +1,29 @@ +use crate::prelude::*; + +pub trait ProfileEntityByAddress { + fn entity_by_address( + &self, + address: AddressOfAccountOrPersona, + ) -> Result; +} + +pub trait ProfileAccountByAddress { + fn account_by_address(&self, address: AccountAddress) -> Result; +} + +pub trait ProfilePersonaByAddress { + fn persona_by_address(&self, address: IdentityAddress) -> Result; +} + +pub trait GetEntityByAddress: + ProfileAccountByAddress + ProfileEntityByAddress + ProfilePersonaByAddress +{ +} + +impl< + T: ProfileAccountByAddress + + ProfileEntityByAddress + + ProfilePersonaByAddress, + > GetEntityByAddress for T +{ +} diff --git a/crates/profile/traits/entity-by-address/src/lib.rs b/crates/profile/traits/entity-by-address/src/lib.rs new file mode 100644 index 000000000..fff9c317d --- /dev/null +++ b/crates/profile/traits/entity-by-address/src/lib.rs @@ -0,0 +1,13 @@ +mod entity_by_address; + +pub mod prelude { + pub use crate::entity_by_address::*; + + pub(crate) use addresses::prelude::*; + pub(crate) use error::prelude::*; + pub(crate) use profile_account::prelude::*; + pub(crate) use profile_account_or_persona::prelude::*; + pub(crate) use profile_persona::prelude::*; +} + +pub use prelude::*; diff --git a/crates/sargon_SPLIT_ME/Cargo.toml b/crates/sargon_SPLIT_ME/Cargo.toml index 48acf9e70..d568a4313 100644 --- a/crates/sargon_SPLIT_ME/Cargo.toml +++ b/crates/sargon_SPLIT_ME/Cargo.toml @@ -3,6 +3,7 @@ name = "sargon" version = "1.1.99" edition = "2021" build = "build.rs" +resolver = "2" # features enabled in integration test [[test]] name = "vectors" @@ -30,6 +31,11 @@ factor-instances-provider = { path = "../factors/instances-provider" } gateway-models = { path = "../gateway/models" } clients = { path = "../system/clients/clients" } drivers = { path = "../system/drivers" } +home-cards = { path = "../app/home-cards" } +security-center = { path = "../app/security-center" } +radix-connect = { path = "../app/radix-connect" } +radix-connect-models = { path = "../app/radix-connect-models" } +signing = { path = "../app/signing" } gateway-client-and-api = { path = "../gateway/client-and-api" } # === RADIX DEPENDENCIES === @@ -43,7 +49,6 @@ async-std = { workspace = true } async-trait = { workspace = true } base64 = { workspace = true } derive_more = { workspace = true } -enum-as-inner = { workspace = true } enum-iterator = { workspace = true } futures = { workspace = true } hex = { workspace = true } diff --git a/crates/sargon_SPLIT_ME/build.rs b/crates/sargon_SPLIT_ME/build.rs index 1ac47b6d9..8d09b6b65 100644 --- a/crates/sargon_SPLIT_ME/build.rs +++ b/crates/sargon_SPLIT_ME/build.rs @@ -11,16 +11,4 @@ pub fn main() { "cargo:rustc-env=FIXTURES_VECTOR={}/", fixtures_vector_path.display() ); - - let fixtures_models_path = fixtures_path.join("models"); - println!( - "cargo:rustc-env=FIXTURES_MODELS={}/", - fixtures_models_path.display() - ); - - let fixtures_gw_models_path = fixtures_models_path.join("gateway"); - println!( - "cargo:rustc-env=FIXTURES_MODELS_GW={}/", - fixtures_gw_models_path.display() - ); } diff --git a/crates/sargon_SPLIT_ME/src/system/bios/bios.rs b/crates/sargon_SPLIT_ME/src/bios/bios.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/bios/bios.rs rename to crates/sargon_SPLIT_ME/src/bios/bios.rs diff --git a/crates/sargon_SPLIT_ME/src/system/bios/mod.rs b/crates/sargon_SPLIT_ME/src/bios/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/bios/mod.rs rename to crates/sargon_SPLIT_ME/src/bios/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/home_cards/mod.rs b/crates/sargon_SPLIT_ME/src/home_cards/mod.rs deleted file mode 100644 index 44d23e997..000000000 --- a/crates/sargon_SPLIT_ME/src/home_cards/mod.rs +++ /dev/null @@ -1,13 +0,0 @@ -mod deferred_deep_link; -mod home_card; -mod home_cards; -mod manager; -mod observer; -mod storage; - -pub use deferred_deep_link::*; -pub use home_card::*; -pub use home_cards::*; -pub use manager::*; -pub use observer::*; -pub use storage::*; diff --git a/crates/sargon_SPLIT_ME/src/system/interactors/interactors.rs b/crates/sargon_SPLIT_ME/src/interactors/interactors.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/interactors/interactors.rs rename to crates/sargon_SPLIT_ME/src/interactors/interactors.rs diff --git a/crates/sargon_SPLIT_ME/src/system/interactors/mod.rs b/crates/sargon_SPLIT_ME/src/interactors/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/interactors/mod.rs rename to crates/sargon_SPLIT_ME/src/interactors/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/system/interactors/testing/mod.rs b/crates/sargon_SPLIT_ME/src/interactors/testing/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/interactors/testing/mod.rs rename to crates/sargon_SPLIT_ME/src/interactors/testing/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/system/interactors/testing/test_use_factor_sources_interactors.rs b/crates/sargon_SPLIT_ME/src/interactors/testing/test_use_factor_sources_interactors.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/interactors/testing/test_use_factor_sources_interactors.rs rename to crates/sargon_SPLIT_ME/src/interactors/testing/test_use_factor_sources_interactors.rs diff --git a/crates/sargon_SPLIT_ME/src/system/interactors/use_factor_sources_interactor.rs b/crates/sargon_SPLIT_ME/src/interactors/use_factor_sources_interactor.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/interactors/use_factor_sources_interactor.rs rename to crates/sargon_SPLIT_ME/src/interactors/use_factor_sources_interactor.rs diff --git a/crates/sargon_SPLIT_ME/src/lib.rs b/crates/sargon_SPLIT_ME/src/lib.rs index 919b13862..585b5c094 100644 --- a/crates/sargon_SPLIT_ME/src/lib.rs +++ b/crates/sargon_SPLIT_ME/src/lib.rs @@ -11,45 +11,35 @@ #![feature(trivial_bounds)] #![allow(trivial_bounds)] -mod home_cards; -mod radix_connect; -mod security_center; -mod signing; -mod system; -mod types; +mod bios; +mod interactors; +mod sargon_os; +mod subsystems; +mod test_diagnose_instance_duplicates; pub mod prelude { - pub use clients::prelude::*; + pub use crate::bios::*; + pub use crate::interactors::*; + pub use crate::sargon_os::*; + pub use crate::subsystems::*; + pub use clients::prelude::*; pub use factor_instances_provider::prelude::*; + pub use home_cards::prelude::*; pub use keys_collector::prelude::*; pub use manifests::prelude::*; pub use profile_logic::prelude::*; - - pub use crate::home_cards::*; - pub use crate::radix_connect::*; - pub use crate::security_center::*; - pub use crate::signing::*; - pub use crate::system::*; - pub use crate::types::*; + pub use radix_connect::prelude::*; + pub use radix_connect_models::prelude::*; + pub use security_center::prelude::*; + pub use signing::prelude::*; pub(crate) use radix_engine_interface::prelude::MetadataValue as ScryptoMetadataValue; - pub(crate) use serde::{ - de, ser::SerializeStruct, Deserializer, Serializer, - }; - - pub(crate) use enum_as_inner::EnumAsInner; - pub(crate) use serde_with::{serde_as, DisplayFromStr}; pub(crate) use std::collections::HashSet; #[cfg(test)] pub(crate) use radix_common::math::Decimal as ScryptoDecimal192; - #[cfg(test)] - pub(crate) use std::collections::BTreeSet; - - #[cfg(test)] - pub(crate) use serde_json::json; } pub use prelude::*; diff --git a/crates/sargon_SPLIT_ME/src/radix_connect/mod.rs b/crates/sargon_SPLIT_ME/src/radix_connect/mod.rs deleted file mode 100644 index 5fbccc8a9..000000000 --- a/crates/sargon_SPLIT_ME/src/radix_connect/mod.rs +++ /dev/null @@ -1,19 +0,0 @@ -mod interaction_id; -mod interaction_version; -mod p2p_links; -mod wallet_account; -mod wallet_interaction; -mod wallet_persona; -mod well_known_client; - -#[allow(dead_code)] -mod mobile; - -pub use interaction_id::*; -pub use interaction_version::*; -pub use mobile::*; -pub use p2p_links::*; -pub use wallet_account::*; -pub use wallet_interaction::*; -pub use wallet_persona::*; -pub use well_known_client::*; diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/delete_account/mod.rs b/crates/sargon_SPLIT_ME/src/sargon_os/delete_account/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/delete_account/mod.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/delete_account/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/delete_account/sargon_os_delete_account.rs b/crates/sargon_SPLIT_ME/src/sargon_os/delete_account/sargon_os_delete_account.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/delete_account/sargon_os_delete_account.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/delete_account/sargon_os_delete_account.rs diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/delete_account/support/mod.rs b/crates/sargon_SPLIT_ME/src/sargon_os/delete_account/support/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/delete_account/support/mod.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/delete_account/support/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/delete_account/support/outcome.rs b/crates/sargon_SPLIT_ME/src/sargon_os/delete_account/support/outcome.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/delete_account/support/outcome.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/delete_account/support/outcome.rs diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/entity_creating_with_factor_source_and_derivation_outcome.rs b/crates/sargon_SPLIT_ME/src/sargon_os/entity_creating_with_factor_source_and_derivation_outcome.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/entity_creating_with_factor_source_and_derivation_outcome.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/entity_creating_with_factor_source_and_derivation_outcome.rs diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/factor_instances_provider_unit_tests.rs b/crates/sargon_SPLIT_ME/src/sargon_os/factor_instances_provider_unit_tests.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/factor_instances_provider_unit_tests.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/factor_instances_provider_unit_tests.rs diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/mod.rs b/crates/sargon_SPLIT_ME/src/sargon_os/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/mod.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/pre_authorization/mod.rs b/crates/sargon_SPLIT_ME/src/sargon_os/pre_authorization/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/pre_authorization/mod.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/pre_authorization/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/pre_authorization/sargon_os_create_subintent.rs b/crates/sargon_SPLIT_ME/src/sargon_os/pre_authorization/sargon_os_create_subintent.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/pre_authorization/sargon_os_create_subintent.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/pre_authorization/sargon_os_create_subintent.rs diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/pre_authorization/sargon_os_pre_authorization_status.rs b/crates/sargon_SPLIT_ME/src/sargon_os/pre_authorization/sargon_os_pre_authorization_status.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/pre_authorization/sargon_os_pre_authorization_status.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/pre_authorization/sargon_os_pre_authorization_status.rs diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/pre_authorization/support/mod.rs b/crates/sargon_SPLIT_ME/src/sargon_os/pre_authorization/support/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/pre_authorization/support/mod.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/pre_authorization/support/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/pre_authorization/support/pre_authorization_status.rs b/crates/sargon_SPLIT_ME/src/sargon_os/pre_authorization/support/pre_authorization_status.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/pre_authorization/support/pre_authorization_status.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/pre_authorization/support/pre_authorization_status.rs diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/profile_state_holder.rs b/crates/sargon_SPLIT_ME/src/sargon_os/profile_state_holder.rs similarity index 97% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/profile_state_holder.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/profile_state_holder.rs index 6f53eb94e..da9fed3b2 100644 --- a/crates/sargon_SPLIT_ME/src/system/sargon_os/profile_state_holder.rs +++ b/crates/sargon_SPLIT_ME/src/sargon_os/profile_state_holder.rs @@ -269,7 +269,7 @@ mod tests { let sut = ProfileStateHolder::new(state.clone()); let state_holder = Arc::new(sut); - let first_mainnet_account = state_holder + let first_mainnet_account: Account = state_holder .access_profile_with(|profile| { profile .networks @@ -284,6 +284,9 @@ mod tests { let mut handles = vec![]; + let account_address = first_mainnet_account.clone().address; + let expected_name = + first_mainnet_account.clone().display_name.value() + "01234"; for i in 0..5 { let state_holder_clone = Arc::clone(&state_holder); let handle = thread::spawn(move || { @@ -293,7 +296,7 @@ mod tests { &NetworkID::Mainnet, |network| { let _res = network.accounts.try_update_with( - &first_mainnet_account.address, + &account_address, |account| { let display_name = account.display_name.value(); @@ -333,9 +336,6 @@ mod tests { }) .unwrap(); - let expected_name = - first_mainnet_account.display_name.value() + "01234"; - pretty_assertions::assert_eq!(expected_name, result_name) } diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os.rs b/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os.rs similarity index 99% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/sargon_os.rs index d80779481..3e4b278c5 100644 --- a/crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os.rs +++ b/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os.rs @@ -218,6 +218,7 @@ impl SargonOS { .map(|account| { account .security_state + .clone() .into_unsecured() .map(|c| c.transaction_signing.public_key) .map_err(|_| CommonError::EntitiesNotDerivedByFactorSource) diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_accounts.rs b/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_accounts.rs similarity index 99% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_accounts.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_accounts.rs index fd402dba6..ec3d7ce7d 100644 --- a/crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_accounts.rs +++ b/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_accounts.rs @@ -1122,6 +1122,7 @@ mod tests { assert_eq!( account .security_state + .clone() .into_unsecured() .unwrap() .transaction_signing @@ -1155,6 +1156,7 @@ mod tests { assert_eq!( second .security_state + .clone() .into_unsecured() .unwrap() .transaction_signing @@ -1188,6 +1190,7 @@ mod tests { .iter() .map(|x| { x.security_state + .clone() .into_unsecured() .unwrap() .transaction_signing diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_entities_linked_to_factor_source.rs b/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_entities_linked_to_factor_source.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_entities_linked_to_factor_source.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_entities_linked_to_factor_source.rs diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_factors.rs b/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_factors.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_factors.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_factors.rs diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_gateway.rs b/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_gateway.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_gateway.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_gateway.rs diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_personas.rs b/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_personas.rs similarity index 99% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_personas.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_personas.rs index 8376b9070..d59de0d54 100644 --- a/crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_personas.rs +++ b/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_personas.rs @@ -702,6 +702,7 @@ mod tests { assert_eq!( persona .security_state + .clone() .into_unsecured() .unwrap() .transaction_signing @@ -735,6 +736,7 @@ mod tests { assert_eq!( second .security_state + .clone() .into_unsecured() .unwrap() .transaction_signing @@ -768,6 +770,7 @@ mod tests { .iter() .map(|x| { x.security_state + .clone() .into_unsecured() .unwrap() .transaction_signing diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_profile.rs b/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_profile.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_profile.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_profile.rs diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_security_center.rs b/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_security_center.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_security_center.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_security_center.rs diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_security_structures.rs b/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_security_structures.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_security_structures.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_security_structures.rs diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_signing.rs b/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_signing.rs similarity index 99% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_signing.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_signing.rs index 06be8965f..1bea650cc 100644 --- a/crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_signing.rs +++ b/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_signing.rs @@ -378,6 +378,7 @@ mod test { .iter() .map(|a| a.address) .collect_vec(); + ( S::sample_entity_addresses_requiring_auth( accounts_addresses_involved.clone(), diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_sync_accounts.rs b/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_sync_accounts.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/sargon_os_sync_accounts.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_sync_accounts.rs diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/mod.rs b/crates/sargon_SPLIT_ME/src/sargon_os/transactions/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/mod.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/transactions/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/sargon_os_transaction_analysis.rs b/crates/sargon_SPLIT_ME/src/sargon_os/transactions/sargon_os_transaction_analysis.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/sargon_os_transaction_analysis.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/transactions/sargon_os_transaction_analysis.rs diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/sargon_os_transaction_status.rs b/crates/sargon_SPLIT_ME/src/sargon_os/transactions/sargon_os_transaction_status.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/sargon_os_transaction_status.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/transactions/sargon_os_transaction_status.rs diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/sargon_os_transaction_submit.rs b/crates/sargon_SPLIT_ME/src/sargon_os/transactions/sargon_os_transaction_submit.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/sargon_os_transaction_submit.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/transactions/sargon_os_transaction_submit.rs diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/support/mod.rs b/crates/sargon_SPLIT_ME/src/sargon_os/transactions/support/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/support/mod.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/transactions/support/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/support/pre_auth_to_review.rs b/crates/sargon_SPLIT_ME/src/sargon_os/transactions/support/pre_auth_to_review.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/support/pre_auth_to_review.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/transactions/support/pre_auth_to_review.rs diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/support/signable_manifest_summary.rs b/crates/sargon_SPLIT_ME/src/sargon_os/transactions/support/signable_manifest_summary.rs similarity index 95% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/support/signable_manifest_summary.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/transactions/support/signable_manifest_summary.rs index e8d641990..c5baac841 100644 --- a/crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/support/signable_manifest_summary.rs +++ b/crates/sargon_SPLIT_ME/src/sargon_os/transactions/support/signable_manifest_summary.rs @@ -40,8 +40,6 @@ impl IntoIterator for SignableManifestSummary { } } -impl SignableID for Exactly32Bytes {} - impl From for Exactly32Bytes { fn from(val: SignableManifestSummary) -> Exactly32Bytes { val.id @@ -61,9 +59,12 @@ impl Signable for SignableManifestSummary { fn entities_requiring_signing( &self, - profile: &Profile, + entity_querying: &impl GetEntityByAddress, ) -> Result> { - ExtractorOfEntitiesRequiringAuth::extract(profile, self.summary.clone()) + ExtractorOfEntitiesRequiringAuth::extract( + entity_querying, + self.summary.clone(), + ) } fn get_id(&self) -> Self::ID { diff --git a/crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/support/transaction_to_review.rs b/crates/sargon_SPLIT_ME/src/sargon_os/transactions/support/transaction_to_review.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/sargon_os/transactions/support/transaction_to_review.rs rename to crates/sargon_SPLIT_ME/src/sargon_os/transactions/support/transaction_to_review.rs diff --git a/crates/sargon_SPLIT_ME/src/security_center/mod.rs b/crates/sargon_SPLIT_ME/src/security_center/mod.rs deleted file mode 100644 index a71e91342..000000000 --- a/crates/sargon_SPLIT_ME/src/security_center/mod.rs +++ /dev/null @@ -1,9 +0,0 @@ -mod client; -mod security_problem; -mod security_problem_kind; -mod support; - -pub use client::*; -pub use security_problem::*; -pub use security_problem_kind::*; -pub use support::*; diff --git a/crates/sargon_SPLIT_ME/src/signing/extractor_of_entities_requiring_auth.rs b/crates/sargon_SPLIT_ME/src/signing/extractor_of_entities_requiring_auth.rs deleted file mode 100644 index 0912c0a8e..000000000 --- a/crates/sargon_SPLIT_ME/src/signing/extractor_of_entities_requiring_auth.rs +++ /dev/null @@ -1,138 +0,0 @@ -use crate::prelude::*; - -/// Utility to extract entities requiring auth from a profile and a manifest summary. -pub struct ExtractorOfEntitiesRequiringAuth; -impl ExtractorOfEntitiesRequiringAuth { - /// Matches entities requiring auth from a manifest summary with the entities in the given profile. - /// Returns a set of `AccountOrPersona` or empty if the manifest summary does not require auth. - /// Returns an error if persona is unknown. - pub fn extract( - profile: &Profile, - summary: ManifestSummary, - ) -> Result> { - let mut entities_requiring_auth: IndexSet = - IndexSet::new(); - - let accounts = summary - .addresses_of_accounts_requiring_auth - .iter() - .map(|a| profile.account_by_address(*a)) - .filter_map(|a| a.ok()) - .collect::>(); - - entities_requiring_auth.extend( - accounts - .into_iter() - .map(AccountOrPersona::from) - .collect_vec(), - ); - - let personas = summary - .addresses_of_personas_requiring_auth - .into_iter() - .map(|a| profile.persona_by_address(a)) - .collect::>>()?; - - entities_requiring_auth.extend( - personas - .into_iter() - .map(AccountOrPersona::from) - .collect_vec(), - ); - Ok(entities_requiring_auth) - } -} - -#[cfg(test)] -mod tests { - use super::*; - use radix_transactions::prelude::ManifestBuilder; - - #[test] - fn extract_when_account_is_unknown() { - let profile = Profile::sample(); - - let manifest_builder = ManifestBuilder::new(); - let mut manifest = TransactionManifest::sargon_built( - manifest_builder, - NetworkID::Mainnet, - ); - manifest = manifest.modify_add_lock_fee( - &AccountAddress::sample_stokenet(), - Some(Decimal192::one()), - ); - let manifest_summary = manifest.summary().unwrap(); - - let result = ExtractorOfEntitiesRequiringAuth::extract( - &profile, - manifest_summary, - ); - - assert_eq!(result, Ok(IndexSet::new())); - } - - #[test] - fn extract_when_persona_is_unknown() { - let profile = Profile::sample(); - - let manifest = TransactionManifest::set_owner_keys_hashes( - &Persona::sample_mainnet_third().address.into(), - vec![PublicKeyHash::sample()], - ); - let manifest_summary = manifest.summary().unwrap(); - - let result = ExtractorOfEntitiesRequiringAuth::extract( - &profile, - manifest_summary, - ); - - assert!(matches!(result, Err(CommonError::UnknownPersona))); - } - - #[test] - fn extract_when_no_entities_require_auth() { - let profile = Profile::sample(); - - let manifest_builder = ManifestBuilder::new(); - let manifest = TransactionManifest::sargon_built( - manifest_builder, - NetworkID::Mainnet, - ); - let manifest_summary = manifest.summary().unwrap(); - - let result = ExtractorOfEntitiesRequiringAuth::extract( - &profile, - manifest_summary, - ); - - assert!(result.is_ok()); - assert!(result.unwrap().is_empty()); - } - - #[test] - fn extract_entities_success() { - let profile = Profile::sample(); - let account = Account::sample_mainnet(); - let persona = Persona::sample_mainnet(); - - let manifest = TransactionManifest::set_owner_keys_hashes( - &persona.address.into(), - vec![PublicKeyHash::sample()], - ) - .modify_add_lock_fee(&account.address, Some(Decimal192::one())); - let manifest_summary = manifest.summary().unwrap(); - - let result = ExtractorOfEntitiesRequiringAuth::extract( - &profile, - manifest_summary, - ); - - assert_eq!( - result, - Ok(IndexSet::from_iter(vec![ - AccountOrPersona::from(account), - AccountOrPersona::from(persona), - ])) - ); - } -} diff --git a/crates/sargon_SPLIT_ME/src/signing/mod.rs b/crates/sargon_SPLIT_ME/src/signing/mod.rs deleted file mode 100644 index d491b38b6..000000000 --- a/crates/sargon_SPLIT_ME/src/signing/mod.rs +++ /dev/null @@ -1,23 +0,0 @@ -mod authentication; -mod collector; -mod extractor_of_entities_requiring_auth; -mod host_interaction; -mod petition_types; -mod signable_with_entities; -mod signables; -mod signatures_outecome_types; -#[cfg(test)] -mod testing; - -pub use authentication::*; -pub(crate) use extractor_of_entities_requiring_auth::*; -pub(crate) use signable_with_entities::*; - -pub use collector::*; -pub use host_interaction::*; -pub use petition_types::*; -pub use signables::*; -pub use signatures_outecome_types::*; - -#[cfg(test)] -pub(crate) use testing::*; diff --git a/crates/sargon_SPLIT_ME/src/signing/testing/interactors/mod.rs b/crates/sargon_SPLIT_ME/src/signing/testing/interactors/mod.rs deleted file mode 100644 index 87e315414..000000000 --- a/crates/sargon_SPLIT_ME/src/signing/testing/interactors/mod.rs +++ /dev/null @@ -1,8 +0,0 @@ -#![cfg(test)] -#![allow(unused)] - -mod test_interactor; -mod test_sign_interactor; - -pub(crate) use test_interactor::*; -pub(crate) use test_sign_interactor::*; diff --git a/crates/sargon_SPLIT_ME/src/signing/testing/mod.rs b/crates/sargon_SPLIT_ME/src/signing/testing/mod.rs deleted file mode 100644 index b49b7271e..000000000 --- a/crates/sargon_SPLIT_ME/src/signing/testing/mod.rs +++ /dev/null @@ -1,9 +0,0 @@ -#![allow(unused)] - -mod interactors; -mod simulated_user; -mod test_signatures_collector; - -pub(crate) use interactors::*; -pub(crate) use simulated_user::*; -pub(crate) use test_signatures_collector::*; diff --git a/crates/sargon_SPLIT_ME/src/system/subsystems/README.md b/crates/sargon_SPLIT_ME/src/subsystems/README.md similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/subsystems/README.md rename to crates/sargon_SPLIT_ME/src/subsystems/README.md diff --git a/crates/sargon_SPLIT_ME/src/system/subsystems/log_system/log_system.rs b/crates/sargon_SPLIT_ME/src/subsystems/log_system/log_system.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/subsystems/log_system/log_system.rs rename to crates/sargon_SPLIT_ME/src/subsystems/log_system/log_system.rs diff --git a/crates/sargon_SPLIT_ME/src/system/subsystems/log_system/mod.rs b/crates/sargon_SPLIT_ME/src/subsystems/log_system/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/subsystems/log_system/mod.rs rename to crates/sargon_SPLIT_ME/src/subsystems/log_system/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/system/subsystems/mod.rs b/crates/sargon_SPLIT_ME/src/subsystems/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/subsystems/mod.rs rename to crates/sargon_SPLIT_ME/src/subsystems/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/system/mod.rs b/crates/sargon_SPLIT_ME/src/system/mod.rs deleted file mode 100644 index fc1d06dea..000000000 --- a/crates/sargon_SPLIT_ME/src/system/mod.rs +++ /dev/null @@ -1,10 +0,0 @@ -mod bios; -mod interactors; -mod sargon_os; -mod subsystems; -mod test_diagnose_instance_duplicates; - -pub use bios::*; -pub use interactors::*; -pub use sargon_os::*; -pub use subsystems::*; diff --git a/crates/sargon_SPLIT_ME/src/system/test_diagnose_instance_duplicates.rs b/crates/sargon_SPLIT_ME/src/test_diagnose_instance_duplicates.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/system/test_diagnose_instance_duplicates.rs rename to crates/sargon_SPLIT_ME/src/test_diagnose_instance_duplicates.rs diff --git a/crates/sargon_SPLIT_ME/tests/integration/main.rs b/crates/sargon_SPLIT_ME/tests/integration/main.rs index 9eb73b96e..082f11664 100644 --- a/crates/sargon_SPLIT_ME/tests/integration/main.rs +++ b/crates/sargon_SPLIT_ME/tests/integration/main.rs @@ -1,3 +1,6 @@ +#![feature(async_closure)] +#![feature(iter_repeat_n)] + #[cfg(test)] mod integration_tests { use std::time::Duration; @@ -232,56 +235,144 @@ mod integration_tests { assert!(account_address.is_legacy_address()) } - /// Test failing due to Stokenet being down some time - // #[actix_rt::test] - // async fn test_dapp_metadata() { - // let gumball_address = AccountAddress::try_from_bech32( - // "account_tdx_2_129nx5lgkk3fz9gqf3clppeljkezeyyymqqejzp97tpk0r8els7hg3j", - // ) - // .unwrap(); - // let gateway_client = new_gateway_client(NetworkID::Stokenet); - // let sut = gateway_client.fetch_dapp_metadata(gumball_address); - - // let response = timeout(MAX, sut).await.unwrap().unwrap(); - // let icon_url = response.get_icon_url(); - // assert_eq!( - // icon_url, - // Some( - // Url::parse( - // "https://stokenet-gumball-club.radixdlt.com/assets/gumball-club.png" - // ) - // .unwrap() - // ) - // ); - // } - - // #[actix_rt::test] - // async fn get_transaction_status() { - // let network_id = NetworkID::Stokenet; - // let gateway_client = new_gateway_client(network_id); - // let private_key = Ed25519PrivateKey::generate(); - // let (_, tx_id) = - // submit_tx_use_faucet(private_key, network_id).await.unwrap(); - - // let status_response = - // timeout(MAX, gateway_client.get_transaction_status(tx_id)) - // .await - // .unwrap() - // .unwrap(); - - // assert_eq!(status_response.error_message, None); - // let status = status_response - // .known_payloads - // .first() - // .and_then(|payload| payload.payload_status.clone()) - // .unwrap(); - // assert_eq!(status, TransactionStatusResponsePayloadStatus::Pending); - // } + #[actix_rt::test] + async fn test_dapp_metadata() { + let gumball_address = AccountAddress::try_from_bech32( + "account_tdx_2_129nx5lgkk3fz9gqf3clppeljkezeyyymqqejzp97tpk0r8els7hg3j", + ) + .unwrap(); + let gateway_client = new_gateway_client(NetworkID::Stokenet); + let sut = gateway_client.fetch_dapp_metadata(gumball_address); + + let response = timeout(MAX, sut).await.unwrap().unwrap(); + let icon_url = response.get_icon_url(); + assert_eq!( + icon_url, + Some( + Url::parse( + "https://stokenet-gumball-club.radixdlt.com/assets/gumball-club.png" + ) + .unwrap() + ) + ); + } + + #[actix_rt::test] + async fn get_transaction_status() { + let network_id = NetworkID::Stokenet; + let gateway_client = new_gateway_client(network_id); + let private_key = Ed25519PrivateKey::generate(); + let (_, tx_id) = + submit_tx_use_faucet(private_key, network_id).await.unwrap(); + + let status_response = + timeout(MAX, gateway_client.get_transaction_status(tx_id)) + .await + .unwrap() + .unwrap(); + + assert_eq!(status_response.error_message, None); + let status = status_response + .known_payloads + .first() + .and_then(|payload| payload.payload_status.clone()) + .unwrap(); + assert_eq!(status, TransactionStatusResponsePayloadStatus::Pending); + } mod signing { use super::*; use radix_common::prelude::indexmap::IndexSet; - use std::sync::Arc; + use radix_transactions::prelude::ManifestBuilder; + use std::{collections::HashSet, sync::Arc}; + + #[test] + fn extract_when_account_is_unknown() { + let profile = Profile::sample(); + + let manifest_builder = ManifestBuilder::new(); + let mut manifest = TransactionManifest::sargon_built( + manifest_builder, + NetworkID::Mainnet, + ); + manifest = manifest.modify_add_lock_fee( + &AccountAddress::sample_stokenet(), + Some(Decimal192::one()), + ); + let manifest_summary = manifest.summary().unwrap(); + + let result = ExtractorOfEntitiesRequiringAuth::extract( + &profile, + manifest_summary, + ); + + assert_eq!(result, Ok(IndexSet::new())); + } + + #[test] + fn extract_when_persona_is_unknown() { + let profile = Profile::sample(); + + let manifest = TransactionManifest::set_owner_keys_hashes( + &Persona::sample_mainnet_third().address.into(), + vec![PublicKeyHash::sample()], + ); + let manifest_summary = manifest.summary().unwrap(); + + let result = ExtractorOfEntitiesRequiringAuth::extract( + &profile, + manifest_summary, + ); + + assert!(matches!(result, Err(CommonError::UnknownPersona))); + } + + #[test] + fn extract_when_no_entities_require_auth() { + let profile = Profile::sample(); + + let manifest_builder = ManifestBuilder::new(); + let manifest = TransactionManifest::sargon_built( + manifest_builder, + NetworkID::Mainnet, + ); + let manifest_summary = manifest.summary().unwrap(); + + let result = ExtractorOfEntitiesRequiringAuth::extract( + &profile, + manifest_summary, + ); + + assert!(result.is_ok()); + assert!(result.unwrap().is_empty()); + } + + #[test] + fn extract_entities_success() { + let profile = Profile::sample(); + let account = Account::sample_mainnet(); + let persona = Persona::sample_mainnet(); + + let manifest = TransactionManifest::set_owner_keys_hashes( + &persona.address.into(), + vec![PublicKeyHash::sample()], + ) + .modify_add_lock_fee(&account.address, Some(Decimal192::one())); + let manifest_summary = manifest.summary().unwrap(); + + let result = ExtractorOfEntitiesRequiringAuth::extract( + &profile, + manifest_summary, + ); + + assert_eq!( + result, + Ok(IndexSet::from_iter(vec![ + AccountOrPersona::from(account), + AccountOrPersona::from(persona), + ])) + ); + } pub struct TestTransactionSignInteractor; @@ -322,6 +413,356 @@ mod integration_tests { } } + #[test] + fn profile_with_unknown_account() { + let res = SignaturesCollector::new( + SigningFinishEarlyStrategy::default(), + [TransactionIntent::sample_entities_requiring_auth( + [&Account::sample_at(0)], + [], + )], + Arc::new(TestSignInteractor::new( + SimulatedUser::prudent_no_fail(), + )), + &Profile::sample_from(IndexSet::new(), [], []), + SigningPurpose::sign_transaction_primary(), + ); + assert!(res.is_ok()); + } + + #[test] + fn invalid_profile_unknown_persona() { + let res = SignaturesCollector::new( + SigningFinishEarlyStrategy::default(), + [TransactionIntent::sample_entities_requiring_auth( + [], + [&Persona::sample_at(0)], + )], + Arc::new(TestSignInteractor::new( + SimulatedUser::prudent_no_fail(), + )), + &Profile::sample_from(IndexSet::new(), [], []), + SigningPurpose::sign_transaction_primary(), + ); + assert!(matches!(res, Err(CommonError::UnknownPersona))); + } + + #[actix_rt::test] + async fn valid_profile() { + let factors_sources = FactorSource::sample_all(); + let persona = Persona::sample_at(0); + + let collector = SignaturesCollector::new( + SigningFinishEarlyStrategy::default(), + [TransactionIntent::sample_entities_requiring_auth( + [], + [&persona], + )], + Arc::new(TestSignInteractor::new( + SimulatedUser::prudent_no_fail(), + )), + &Profile::sample_from(factors_sources, [], [&persona]), + SigningPurpose::sign_transaction_primary(), + ) + .unwrap(); + let outcome = collector.collect_signatures().await.unwrap(); + assert!(outcome.successful()) + } + + #[actix_rt::test] + async fn continues_even_with_failed_tx_when_configured_to() { + let factor_sources = &FactorSource::sample_all(); + let a0 = &Account::sample_at(0); + let a1 = &Account::sample_at(1); + + let t0 = + TransactionIntent::sample_entities_requiring_auth([a1], []); + let t1 = + TransactionIntent::sample_entities_requiring_auth([a0], []); + + let profile = + Profile::sample_from(factor_sources.clone(), [a0, a1], []); + + let collector = SignaturesCollector::new( + SigningFinishEarlyStrategy::new( + WhenAllTransactionsAreValid( + SignaturesCollectingContinuation::FinishEarly, + ), + WhenSomeTransactionIsInvalid( + SignaturesCollectingContinuation::Continue, + ), + ), + [t0.clone(), t1.clone()], + Arc::new(TestSignInteractor::new( + SimulatedUser::prudent_with_failures( + SimulatedFailures::with_simulated_failures([ + FactorSourceIDFromHash::sample_at(1), + ]), + ), + )), + &profile, + SigningPurpose::sign_transaction_primary(), + ) + .unwrap(); + + let outcome = collector.collect_signatures().await.unwrap(); + assert!(!outcome.successful()); + assert_eq!(outcome.failed_transactions().len(), 1); + assert_eq!(outcome.successful_transactions().len(), 1); + } + + #[actix_rt::test] + async fn continues_even_when_all_valid_if_configured_to() { + let test = + async move |when_all_valid: WhenAllTransactionsAreValid, + expected_sig_count: usize| { + let factor_sources = &FactorSource::sample_all(); + let a5 = &Account::sample_at(5); + + let t0 = TransactionIntent::sample_entities_requiring_auth( + [a5], + [], + ); + + let profile = + Profile::sample_from(factor_sources.clone(), [a5], []); + + let collector = SignaturesCollector::new( + SigningFinishEarlyStrategy::new( + when_all_valid, + WhenSomeTransactionIsInvalid::default(), + ), + [t0.clone()], + Arc::new(TestSignInteractor::new( + SimulatedUser::prudent_no_fail(), + )), + &profile, + SigningPurpose::sign_transaction_primary(), + ) + .unwrap(); + + let outcome = collector.collect_signatures().await.unwrap(); + assert!(outcome.successful()); + assert_eq!( + outcome.signatures_of_successful_transactions().len(), + expected_sig_count + ); + }; + + test( + WhenAllTransactionsAreValid( + SignaturesCollectingContinuation::FinishEarly, + ), + 1, + ) + .await; + test( + WhenAllTransactionsAreValid( + SignaturesCollectingContinuation::Continue, + ), + 2, + ) + .await; + } + + #[test] + fn test_profile() { + let factor_sources = &FactorSource::sample_all(); + let a0 = &Account::sample_at(0); + let a1 = &Account::sample_at(1); + let a2 = &Account::sample_at(2); + let a6 = &Account::sample_at(6); + + let p0 = &Persona::sample_at(0); + let p1 = &Persona::sample_at(1); + let p2 = &Persona::sample_at(2); + let p6 = &Persona::sample_at(6); + + let t0 = TransactionIntent::sample_entities_requiring_auth( + [a0, a1], + [p0, p1], + ); + let t1 = TransactionIntent::sample_entities_requiring_auth( + [a0, a1, a2], + [], + ); + let t2 = TransactionIntent::sample_entities_requiring_auth( + [], + [p0, p1, p2], + ); + let t3 = + TransactionIntent::sample_entities_requiring_auth([a6], [p6]); + + let profile = Profile::sample_from( + factor_sources.clone(), + [a0, a1, a2, a6], + [p0, p1, p2, p6], + ); + + let collector = SignaturesCollector::new( + SigningFinishEarlyStrategy::default(), + [t0.clone(), t1.clone(), t2.clone(), t3.clone()], + Arc::new(TestSignInteractor::new( + SimulatedUser::prudent_no_fail(), + )), + &profile, + SigningPurpose::sign_transaction_primary(), + ) + .unwrap(); + + let petitions = collector.petitions(); + + assert_eq!( + petitions + .txid_to_petition + .read() + .expect("Petitions lock should not have been poisoned") + .len(), + 4 + ); + + { + let petitions_ref = petitions + .txid_to_petition + .read() + .expect("Petitions lock should not have been poisoned"); + let petition = + petitions_ref.get(&t3.transaction_intent_hash()).unwrap(); + let for_entities = petition + .for_entities + .read() + .expect("PetitionForTransaction lock should not have been poisoned.") + .clone(); + let pet6 = for_entities.get(&a6.address.into()).unwrap(); + + let paths6 = pet6 + .all_factor_instances() + .iter() + .map(|f| f.factor_instance().derivation_path()) + .collect_vec(); + + pretty_assertions::assert_eq!( + paths6, + repeat_n( + DerivationPath::from(AccountPath::new( + NetworkID::Mainnet, + CAP26KeyKind::TransactionSigning, + Hardened::from_local_key_space( + U31::try_from(6u32).unwrap(), + IsSecurified(true) + ) + .unwrap() + )), + 5 + ) + .collect_vec() + ); + } + + assert_petition( + &petitions, + &t0, + HashMap::from_iter([ + ( + a0.address.into(), + HashSet::just(FactorSourceIDFromHash::sample_at(0)), + ), + ( + a1.address.into(), + HashSet::just(FactorSourceIDFromHash::sample_at(1)), + ), + ( + p0.address.into(), + HashSet::just(FactorSourceIDFromHash::sample_at(0)), + ), + ( + p1.address.into(), + HashSet::just(FactorSourceIDFromHash::sample_at(1)), + ), + ]), + HashMap::new(), + ); + + assert_petition( + &petitions, + &t1, + HashMap::from_iter([ + ( + a0.address.into(), + HashSet::just(FactorSourceIDFromHash::sample_at(0)), + ), + ( + a1.address.into(), + HashSet::just(FactorSourceIDFromHash::sample_at(1)), + ), + ( + a2.address.into(), + HashSet::just(FactorSourceIDFromHash::sample_at(0)), + ), + ]), + HashMap::new(), + ); + + assert_petition( + &petitions, + &t2, + HashMap::from_iter([ + ( + p0.address.into(), + HashSet::just(FactorSourceIDFromHash::sample_at(0)), + ), + ( + p1.address.into(), + HashSet::just(FactorSourceIDFromHash::sample_at(1)), + ), + ( + p2.address.into(), + HashSet::just(FactorSourceIDFromHash::sample_at(0)), + ), + ]), + HashMap::new(), + ); + + assert_petition( + &petitions, + &t3, + HashMap::from_iter([ + ( + a6.address.into(), + HashSet::from_iter([ + FactorSourceIDFromHash::sample_at(0), + FactorSourceIDFromHash::sample_at(3), + FactorSourceIDFromHash::sample_at(5), + ]), + ), + ( + p6.address.into(), + HashSet::from_iter([ + FactorSourceIDFromHash::sample_at(0), + FactorSourceIDFromHash::sample_at(3), + FactorSourceIDFromHash::sample_at(5), + ]), + ), + ]), + HashMap::from_iter([ + ( + a6.address.into(), + HashSet::from_iter([ + FactorSourceIDFromHash::sample_at(1), + FactorSourceIDFromHash::sample_at(4), + ]), + ), + ( + p6.address.into(), + HashSet::from_iter([ + FactorSourceIDFromHash::sample_at(1), + FactorSourceIDFromHash::sample_at(4), + ]), + ), + ]), + ); + } + #[async_trait::async_trait] impl SignInteractor for TestTransactionSignInteractor { async fn sign( @@ -490,5 +931,709 @@ mod integration_tests { ) ); } + + mod multi_tx { + use std::collections::HashSet; + + use super::*; + + async fn multi_accounts_multi_personas_all_single_factor_controlled_with_sim_user( + sim: SimulatedUser, + ) { + let factor_sources = &FactorSource::sample_all(); + let a0 = Account::sample_at(0); + let a1 = Account::sample_at(1); + let a2 = Account::sample_at(2); + + let p0 = Persona::sample_at(0); + let p1 = Persona::sample_at(1); + let p2 = Persona::sample_at(2); + + let t0 = TransactionIntent::sample_entities_requiring_auth( + [&a0, &a1], + [&p0, &p1], + ); + let t1 = TransactionIntent::sample_entities_requiring_auth( + [&a0, &a1, &a2], + [], + ); + let t2 = TransactionIntent::sample_entities_requiring_auth( + [], + [&p0, &p1, &p2], + ); + + let profile = Profile::sample_from( + factor_sources.clone(), + [&a0, &a1, &a2], + [&p0, &p1, &p2], + ); + + let collector = SignaturesCollector::new( + SigningFinishEarlyStrategy::default(), + [t0.clone(), t1.clone(), t2.clone()], + Arc::new(TestSignInteractor::new(sim)), + &profile, + SigningPurpose::sign_transaction_primary(), + ) + .unwrap(); + + let outcome = collector.collect_signatures().await.unwrap(); + assert!(outcome.successful()); + assert!(outcome.failed_transactions().is_empty()); + assert_eq!( + outcome.signatures_of_successful_transactions().len(), + 10 + ); + assert_eq!( + outcome + .successful_transactions() + .into_iter() + .map(|t| t.signable_id) + .collect::>(), + HashSet::from_iter([ + t0.clone().transaction_intent_hash(), + t1.clone().transaction_intent_hash(), + t2.clone().transaction_intent_hash(), + ]) + ); + let st0 = outcome + .successful_transactions() + .into_iter() + .find(|st| st.signable_id == t0.transaction_intent_hash()) + .unwrap(); + + assert_eq!( + st0.signatures + .clone() + .into_iter() + .map(|s| s.owned_factor_instance().owner) + .collect::>(), + HashSet::from_iter([ + AddressOfAccountOrPersona::from(a0.address), + AddressOfAccountOrPersona::from(a1.address), + AddressOfAccountOrPersona::from(p0.address), + AddressOfAccountOrPersona::from(p1.address), + ]) + ); + + let st1 = outcome + .successful_transactions() + .into_iter() + .find(|st| st.signable_id == t1.transaction_intent_hash()) + .unwrap(); + + assert_eq!( + st1.signatures + .clone() + .into_iter() + .map(|s| s.owned_factor_instance().owner) + .collect::>(), + HashSet::from_iter([ + AddressOfAccountOrPersona::from(a0.address), + AddressOfAccountOrPersona::from(a1.address), + AddressOfAccountOrPersona::from(a2.address), + ]) + ); + + let st2 = outcome + .successful_transactions() + .into_iter() + .find(|st| st.signable_id == t2.transaction_intent_hash()) + .unwrap(); + + assert_eq!( + st2.signatures + .clone() + .into_iter() + .map(|s| s.owned_factor_instance().owner) + .collect::>(), + HashSet::from_iter([ + AddressOfAccountOrPersona::from(p0.address), + AddressOfAccountOrPersona::from(p1.address), + AddressOfAccountOrPersona::from(p2.address), + ]) + ); + + // Assert sorted in increasing "friction order". + assert_eq!( + outcome + .signatures_of_successful_transactions() + .iter() + .map(|f| { f.factor_source_id().kind }) + .collect::>(), + IndexSet::::from_iter([ + FactorSourceKind::Device, + FactorSourceKind::LedgerHQHardwareWallet + ]) + ); + } + + #[derive(Clone, Debug)] + struct Vector { + simulated_user: SimulatedUser, + expected: Expected, + } + #[derive(Clone, Debug, PartialEq, Eq)] + struct Expected { + successful_txs_signature_count: usize, + signed_factor_source_kinds: IndexSet, + expected_neglected_factor_source_count: usize, + } + async fn multi_securified_entities_with_sim_user(vector: Vector) { + let factor_sources = &FactorSource::sample_all(); + + let a4 = &Account::sample_at(4); + let a5 = &Account::sample_at(5); + let a6 = &Account::sample_at(6); + + let p4 = &Persona::sample_at(4); + let p5 = &Persona::sample_at(5); + let p6 = &Persona::sample_at(6); + + let t0 = TransactionIntent::sample_entities_requiring_auth( + [a5], + [p5], + ); + let t1 = TransactionIntent::sample_entities_requiring_auth( + [a4, a5, a6], + [], + ); + let t2 = TransactionIntent::sample_entities_requiring_auth( + [a4, a6], + [p4, p6], + ); + let t3 = TransactionIntent::sample_entities_requiring_auth( + [], + [p4, p5, p6], + ); + + let profile = Profile::sample_from( + factor_sources.clone(), + [a4, a5, a6], + [p4, p5, p6], + ); + + let collector = SignaturesCollector::new( + SigningFinishEarlyStrategy::default(), + [t0.clone(), t1.clone(), t2.clone(), t3.clone()], + Arc::new(TestSignInteractor::new(vector.simulated_user)), + &profile, + SigningPurpose::sign_transaction_primary(), + ) + .unwrap(); + + let outcome = collector.collect_signatures().await.unwrap(); + + assert_eq!( + outcome.neglected_factor_sources().len(), + vector.expected.expected_neglected_factor_source_count + ); + + assert!(outcome.successful()); + assert!(outcome.failed_transactions().is_empty()); + assert_eq!( + outcome.signatures_of_successful_transactions().len(), + vector.expected.successful_txs_signature_count + ); + assert_eq!( + outcome + .successful_transactions() + .into_iter() + .map(|t| t.signable_id) + .collect::>(), + HashSet::from_iter([ + t0.clone().transaction_intent_hash(), + t1.clone().transaction_intent_hash(), + t2.clone().transaction_intent_hash(), + t3.clone().transaction_intent_hash(), + ]) + ); + + // Assert sorted in increasing "friction order". + assert_eq!( + outcome + .signatures_of_successful_transactions() + .iter() + .map(|f| { f.factor_source_id().kind }) + .collect::>(), + vector.expected.signed_factor_source_kinds + ); + } + + mod with_failure { + use std::{cell::RefCell, rc::Rc}; + + use super::*; + + #[actix_rt::test] + async fn multi_securified_entities() { + multi_securified_entities_with_sim_user(Vector { + simulated_user: SimulatedUser::prudent_with_failures( + SimulatedFailures::with_simulated_failures([ + FactorSourceIDFromHash::sample_at(1), + ]), + ), + expected: Expected { + successful_txs_signature_count: 24, + // We always end early + // `Device` FactorSourceKind never got used since it + // we are done after Passphrase. + signed_factor_source_kinds: IndexSet::< + FactorSourceKind, + >::from_iter( + [ + FactorSourceKind::ArculusCard, + FactorSourceKind::Password, + ] + ), + expected_neglected_factor_source_count: 1, + }, + }) + .await; + } + + #[actix_rt::test] + async fn failed_threshold_successful_override() { + let factor_sources = &FactorSource::sample_all(); + let a9 = &Account::sample_at(9); + let tx0 = TransactionIntent::sample_entities_requiring_auth( + [a9], + [], + ); + + let all_transactions = [tx0.clone()]; + + let profile = + Profile::sample_from(factor_sources.clone(), [a9], []); + + let collector = SignaturesCollector::new( + SigningFinishEarlyStrategy::default(), + all_transactions, + Arc::new(TestSignInteractor::new( + SimulatedUser::prudent_with_failures( + SimulatedFailures::with_simulated_failures([ + FactorSourceIDFromHash::sample_at(1), + ]), + ), + )), + &profile, + SigningPurpose::sign_transaction_primary(), + ) + .unwrap(); + + let outcome = collector.collect_signatures().await.unwrap(); + assert!(outcome.successful()); + assert_eq!( + outcome + .successful_transactions() + .into_iter() + .map(|t| t.signable_id.clone()) + .collect_vec(), + vec![tx0.clone().transaction_intent_hash()] + ); + assert_eq!( + outcome + .all_signatures() + .into_iter() + .map(|s| s.factor_source_id()) + .collect_vec(), + vec![FactorSourceIDFromHash::sample_at(8)] + ); + } + + #[actix_rt::test] + async fn many_failing_tx() { + let factor_sources = &FactorSource::sample_all(); + let a0 = &Account::sample_at(0); + let p3 = &Persona::sample_at(3); + let tx = TransactionIntent::sample_entities_requiring_auth( + [], + [p3], + ); + + // In need of different PublicKeyHashes so the IntentHash of each transaction is different + let make_random_pk_hash = || { + let private_key = Ed25519PrivateKey::generate(); + PublicKeyHash::hash(private_key.public_key()) + }; + let failing_transactions = (0..100) + .map(|_| { + TransactionIntent::sample_entity_addresses_with_pub_key_hashes_requiring_auth( + [(a0.address, make_random_pk_hash())], + [], + ) + }) + .collect::>(); + let mut all_transactions = failing_transactions.clone(); + all_transactions.push(tx.clone()); + + let profile = Profile::sample_from( + factor_sources.clone(), + [a0], + [p3], + ); + + let collector = SignaturesCollector::new( + SigningFinishEarlyStrategy::default(), + all_transactions, + Arc::new(TestSignInteractor::new( + SimulatedUser::prudent_with_failures( + SimulatedFailures::with_simulated_failures([ + FactorSourceIDFromHash::sample_at(0), + ]), + ), + )), + &profile, + SigningPurpose::sign_transaction_primary(), + ) + .unwrap(); + + let outcome = collector.collect_signatures().await.unwrap(); + assert!(!outcome.successful()); + assert_eq!( + outcome + .failed_transactions() + .iter() + .map(|t| t.signable_id.clone()) + .collect_vec(), + failing_transactions + .iter() + .map(|t| t.transaction_intent_hash().clone()) + .collect_vec() + ); + + assert_eq!( + outcome + .ids_of_neglected_factor_sources_failed() + .into_iter() + .collect_vec(), + vec![FactorSourceIDFromHash::sample_at(0)] + ); + + assert!(outcome + .ids_of_neglected_factor_sources_skipped_by_user() + .is_empty()); + + assert_eq!( + outcome + .successful_transactions() + .into_iter() + .map(|t| t.signable_id) + .collect_vec(), + vec![tx.transaction_intent_hash()] + ) + } + + #[actix_rt::test] + async fn same_tx_is_not_shown_to_user_in_case_of_already_failure( + ) { + let factor_sources = FactorSource::sample_all(); + + let a7 = Account::sample_at(7); + let a0 = Account::sample_at(0); + + let tx0 = TransactionIntent::sample_entities_requiring_auth( + [&a7, &a0], + [], + ); + let tx1 = TransactionIntent::sample_entities_requiring_auth( + [&a0], + [], + ); + + let profile = Profile::sample_from( + factor_sources.clone(), + [&a7, &a0], + [], + ); + + type Tuple = ( + FactorSourceKind, + IndexSet< + InvalidTransactionIfNeglected< + TransactionIntentHash, + >, + >, + ); + type Tuples = Vec; + let tuples = Rc::>::new(RefCell::new( + Tuples::default(), + )); + let tuples_clone = tuples.clone(); + let collector = SignaturesCollector::new( + SigningFinishEarlyStrategy::default(), + [tx0.clone(), tx1.clone()], + Arc::new(TestSignInteractor::new( + SimulatedUser::with_spy( + move |kind, invalid| { + let tuple = (kind, invalid); + let mut x = + RefCell::borrow_mut(&tuples_clone); + x.push(tuple) + }, + SimulatedUserMode::Prudent, + SimulatedFailures::with_simulated_failures([ + FactorSourceIDFromHash::sample_at(2), // will cause any TX with a7 to fail + ]), + ), + )), + &profile, + SigningPurpose::sign_transaction_primary(), + ) + .unwrap(); + + let outcome = collector.collect_signatures().await.unwrap(); + + let tuples = tuples.borrow().clone(); + assert_eq!( + tuples, + vec![ + ( + FactorSourceKind::LedgerHQHardwareWallet, + IndexSet::just( + InvalidTransactionIfNeglected::new( + tx0.clone().transaction_intent_hash(), + [a7.address.into()] + ) + ) + ), + // Important that we do NOT display any mentioning of `tx0` here again! + ( + FactorSourceKind::Device, + IndexSet::just( + InvalidTransactionIfNeglected::new( + tx1.clone().transaction_intent_hash(), + [a0.address.into()] + ) + ) + ), + ] + ); + + assert!(!outcome.successful()); + assert_eq!( + outcome.ids_of_neglected_factor_sources_failed(), + IndexSet::::just( + FactorSourceIDFromHash::sample_at(2) + ) + ); + assert_eq!( + outcome.ids_of_neglected_factor_sources_irrelevant(), + IndexSet::::from_iter([ + FactorSourceIDFromHash::sample_at(6), + FactorSourceIDFromHash::sample_at(7), + FactorSourceIDFromHash::sample_at(8), + FactorSourceIDFromHash::sample_at(9) + ]) + ); + assert_eq!( + outcome + .successful_transactions() + .into_iter() + .map(|t| t.signable_id) + .collect_vec(), + vec![tx1.transaction_intent_hash().clone()] + ); + + assert_eq!( + outcome + .failed_transactions() + .into_iter() + .map(|t| t.signable_id) + .collect_vec(), + vec![tx0.transaction_intent_hash().clone()] + ); + + assert_eq!(outcome.all_signatures().len(), 1); + + assert!(outcome + .all_signatures() + .into_iter() + .map(|s| s.payload_id().clone()) + .all(|i| i == tx1.transaction_intent_hash())); + + assert_eq!( + outcome + .all_signatures() + .into_iter() + .map(|s| s.derivation_path()) + .collect_vec(), + vec![DerivationPath::from(AccountPath::new( + NetworkID::Mainnet, + CAP26KeyKind::TransactionSigning, + Hardened::from_local_key_space( + U31::ZERO, + IsSecurified(false) + ) // unsecurified account at `0`. + .unwrap() + ))] + ) + } + } + + mod no_fail { + use super::*; + + #[actix_rt::test] + async fn multi_accounts_multi_personas_all_single_factor_controlled( + ) { + multi_accounts_multi_personas_all_single_factor_controlled_with_sim_user( + SimulatedUser::prudent_no_fail(), + ) + .await; + + // Same result with lazy user, not able to skip without failures. + multi_accounts_multi_personas_all_single_factor_controlled_with_sim_user( + SimulatedUser::lazy_sign_minimum([]), + ) + .await + } + + #[actix_rt::test] + async fn multi_securified_entities() { + multi_securified_entities_with_sim_user(Vector { + simulated_user: SimulatedUser::prudent_no_fail(), + expected: Expected { + successful_txs_signature_count: 32, + // We always end early + // `Device` FactorSourceKind never got used since it + // we are done after YubiKey. + signed_factor_source_kinds: IndexSet::< + FactorSourceKind, + >::from_iter( + [ + FactorSourceKind::LedgerHQHardwareWallet, + FactorSourceKind::ArculusCard, + FactorSourceKind::Password, + ] + ), + expected_neglected_factor_source_count: 0, + }, + }) + .await; + + multi_securified_entities_with_sim_user(Vector { + simulated_user: SimulatedUser::lazy_sign_minimum([]), + expected: Expected { + successful_txs_signature_count: 24, + // We always end early, this lazy user was able to skip + // Ledger. + signed_factor_source_kinds: IndexSet::< + FactorSourceKind, + >::from_iter( + [ + FactorSourceKind::ArculusCard, + FactorSourceKind::Password, + FactorSourceKind::Device, + ] + ), + expected_neglected_factor_source_count: 2, + }, + }) + .await; + } + } + } + + mod rola { + use std::collections::HashSet; + + use super::*; + + #[actix_rt::test] + async fn test_petitions_for() { + let factor_sources = &FactorSource::sample_all(); + + let a0 = &Account::sample_at(0); + let a1 = &Account::sample_at(1); + let a6 = &Account::sample_at(6); + + let p0 = &Persona::sample_at(0); + let p1 = &Persona::sample_at(1); + let p6 = &Persona::sample_at(6); + + let entities_to_sign = vec![ + AddressOfAccountOrPersona::Account(a0.address), + AddressOfAccountOrPersona::Account(a1.address), + AddressOfAccountOrPersona::Account(a6.address), + AddressOfAccountOrPersona::Identity(p0.address), + AddressOfAccountOrPersona::Identity(p1.address), + AddressOfAccountOrPersona::Identity(p6.address), + ]; + + let auth_intent = AuthIntent::new_from_request( + DappToWalletInteractionAuthChallengeNonce::sample(), + DappToWalletInteractionMetadata::sample(), + entities_to_sign, + ) + .unwrap(); + + let profile = Profile::sample_from( + factor_sources.clone(), + [a0, a1, a6], + [p0, p1, p6], + ); + + let collector = SignaturesCollector::new( + SigningFinishEarlyStrategy::default(), + [auth_intent.clone()], + Arc::new(TestSignInteractor::new( + SimulatedUser::prudent_no_fail(), + )), + &profile, + SigningPurpose::ROLA, + ) + .unwrap(); + + let petitions = collector.petitions(); + + assert_eq!( + petitions + .txid_to_petition + .read() + .expect("Petitions lock should not have been poisoned") + .len(), + 1 + ); + + assert_petition( + &petitions, + &auth_intent, + HashMap::from_iter([ + ( + a0.address.into(), + HashSet::just(FactorSourceIDFromHash::sample_at(0)), + ), + ( + a1.address.into(), + HashSet::just(FactorSourceIDFromHash::sample_at(1)), + ), + ( + a6.address.into(), + HashSet::from_iter([ + // Only device factor source is used for signing auth for securified entity + FactorSourceIDFromHash::sample_at(0), + ]), + ), + ( + p0.address.into(), + HashSet::just(FactorSourceIDFromHash::sample_at(0)), + ), + ( + p1.address.into(), + HashSet::just(FactorSourceIDFromHash::sample_at(1)), + ), + ( + p6.address.into(), + HashSet::from_iter([ + // Only device factor source is used for signing auth for securified entity + FactorSourceIDFromHash::sample_at(0), + ]), + ), + ]), + HashMap::from_iter([]), + ); + } + } } } diff --git a/crates/sargon_SPLIT_ME/tests/vectors/main.rs b/crates/sargon_SPLIT_ME/tests/vectors/main.rs index 27e86f854..3130aa83e 100644 --- a/crates/sargon_SPLIT_ME/tests/vectors/main.rs +++ b/crates/sargon_SPLIT_ME/tests/vectors/main.rs @@ -387,12 +387,12 @@ mod encrypted_profile_tests { n.accounts .into_iter() - .map(|x| x.security_state) + .map(|x| x.security_state.clone()) .for_each(test); n.personas .into_iter() - .map(|x| x.security_state) + .map(|x| x.security_state.clone()) .for_each(test); Ok::<(), CommonError>(()) diff --git a/crates/system/clients/http/Cargo.toml b/crates/system/clients/http/Cargo.toml index 838823267..70f42ca00 100644 --- a/crates/system/clients/http/Cargo.toml +++ b/crates/system/clients/http/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" drivers = { path = "../../../system/drivers" } bytes = { path = "../../../common/bytes" } error = { path = "../../../core/error" } -sargon-core-utils = { path = "../../../core/utils" } +core-utils = { path = "../../../core/utils" } # === RADIX DEPENDENCIES === diff --git a/crates/system/clients/http/src/lib.rs b/crates/system/clients/http/src/lib.rs index dad49b0ed..1d9f27259 100644 --- a/crates/system/clients/http/src/lib.rs +++ b/crates/system/clients/http/src/lib.rs @@ -4,8 +4,8 @@ pub mod prelude { pub use crate::http_client::*; pub(crate) use bytes::prelude::*; + pub(crate) use core_utils::prelude::*; pub(crate) use drivers::prelude::*; - pub(crate) use sargon_core_utils::prelude::*; pub(crate) use serde::Deserialize; diff --git a/crates/transaction/manifests/Cargo.toml b/crates/transaction/manifests/Cargo.toml index c30ae6d1c..2341bdf48 100644 --- a/crates/transaction/manifests/Cargo.toml +++ b/crates/transaction/manifests/Cargo.toml @@ -6,7 +6,7 @@ build = "build.rs" [dependencies] # === SARGON CRATES === -sargon-core-utils = { path = "../../core/utils" } +core-utils = { path = "../../core/utils" } identified-vec-of = { path = "../../common/identified-vec-of" } hierarchical-deterministic = { path = "../../crypto/hd" } factors = { path = "../../factors/factors" } @@ -15,6 +15,8 @@ metadata = { path = "../../common/metadata" } transaction-models = { path = "../../transaction/models" } gateway-models = { path = "../../gateway/models" } profile = { path = "../../profile/models/profile_SPLIT_ME" } +profile-account-or-persona = { path = "../../profile/models/account-or-persona" } +profile-base-entity = { path = "../../profile/models/base-entity" } account-for-display = { path = "../../profile/models/account-for-display" } # === RADIX DEPENDENCIES === diff --git a/crates/transaction/manifests/src/lib.rs b/crates/transaction/manifests/src/lib.rs index 4f5401a86..21b8733a2 100644 --- a/crates/transaction/manifests/src/lib.rs +++ b/crates/transaction/manifests/src/lib.rs @@ -11,11 +11,6 @@ mod modify_manifest; mod third_party_deposit_update; pub mod prelude { - pub use factors::prelude::*; - pub use gateway_models::prelude::*; - pub use hierarchical_deterministic::prelude::*; - pub use metadata::prelude::*; - pub use profile::prelude::*; pub(crate) use crate::bucket_factory; @@ -29,6 +24,12 @@ pub mod prelude { pub use crate::modify_manifest::*; pub use crate::third_party_deposit_update::*; + pub use factors::prelude::*; + pub use gateway_models::prelude::*; + pub use hierarchical_deterministic::prelude::*; + pub use metadata::prelude::*; + pub use profile::prelude::*; + pub use std::str::FromStr; pub(crate) use radix_common::{ diff --git a/crates/transaction/models/Cargo.toml b/crates/transaction/models/Cargo.toml index 5d0cfedd2..714203bc3 100644 --- a/crates/transaction/models/Cargo.toml +++ b/crates/transaction/models/Cargo.toml @@ -17,7 +17,7 @@ numeric = { path = "../../common/numeric" } has-sample-values = { path = "../../core/has-sample-values" } metadata = { path = "../../common/metadata" } network = { path = "../../common/network" } -sargon-core-utils = { path = "../../core/utils" } +core-utils = { path = "../../core/utils" } transaction-foundation = { path = "../../transaction/foundation" } core-collections = { path = "../../core/collections" } core-misc = { path = "../../core/misc" } # Instant diff --git a/crates/transaction/models/src/low_level/transaction_hashes/transaction_hashes.rs b/crates/transaction/models/src/low_level/transaction_hashes/transaction_hashes.rs index 5d711416e..acea12817 100644 --- a/crates/transaction/models/src/low_level/transaction_hashes/transaction_hashes.rs +++ b/crates/transaction/models/src/low_level/transaction_hashes/transaction_hashes.rs @@ -1,8 +1,8 @@ use crate::prelude::*; use crate::low_level::transaction_hashes::validate_and_decode_hash::validate_and_decode_hash; +use core_utils::prelude::format_string; use radix_common::crypto::IsHash; -use sargon_core_utils::prelude::format_string; macro_rules! decl_tx_hash { ( diff --git a/crates/transaction/models/src/profile_models/deposit_rule.rs b/crates/transaction/models/src/profile_models/deposit_rule.rs index fabf65037..22550e84e 100644 --- a/crates/transaction/models/src/profile_models/deposit_rule.rs +++ b/crates/transaction/models/src/profile_models/deposit_rule.rs @@ -67,7 +67,7 @@ impl From for DepositRule { #[cfg(test)] mod tests { - use sargon_core_utils::prelude::DeserializeStr; + use core_utils::prelude::DeserializeStr; use super::*; diff --git a/crates/uniffi/uniffi_SPLIT_ME/Cargo.toml b/crates/uniffi/uniffi_SPLIT_ME/Cargo.toml index 541f59898..54b9ca5a1 100644 --- a/crates/uniffi/uniffi_SPLIT_ME/Cargo.toml +++ b/crates/uniffi/uniffi_SPLIT_ME/Cargo.toml @@ -32,6 +32,9 @@ gateway-models = { path = "../../gateway/models" } core-misc = { path = "../../core/misc" } clients = { path = "../../system/clients/clients" } drivers = { path = "../../system/drivers" } +signing = { path = "../../app/signing" } +profile-persona = { path = "../../profile/models/persona" } +profile-account = { path = "../../profile/models/account" } gateway-client-and-api = { path = "../../gateway/client-and-api" } sargon = { path = "../../sargon_SPLIT_ME" } diff --git a/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/account/account.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/account/account.rs index a728b27b9..7e9c6f437 100644 --- a/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/account/account.rs +++ b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/account/account.rs @@ -20,7 +20,7 @@ decl_vec_samples_for!(Accounts, Account); /// An account can be either controlled by a "Babylon" DeviceFactorSource or a /// Legacy one imported from Olympia, or a Ledger hardware wallet, which too might /// have been imported from Olympia. -#[derive(Clone, PartialEq, Hash, Eq, InternalConversion, uniffi::Record)] +#[derive(Clone, PartialEq, Hash, Eq, uniffi::Record)] pub struct Account { /// The ID of the network this account can be used with. pub network_id: NetworkID, @@ -61,6 +61,40 @@ pub struct Account { pub on_ledger_settings: OnLedgerSettings, } +impl Account { + pub fn into_internal(&self) -> InternalAccount { + self.clone().into() + } +} + +impl From for InternalAccount { + fn from(value: Account) -> Self { + Self::with( + value.network_id, + value.address, + value.display_name, + value.security_state, + value.flags.into_iter().map(Into::into), + value.appearance_id, + value.on_ledger_settings, + ) + } +} + +impl From for Account { + fn from(value: InternalAccount) -> Self { + Self { + network_id: value.network_id.into(), + address: value.address.into(), + display_name: value.display_name.into(), + security_state: value.security_state.clone().into(), + appearance_id: value.appearance_id.into(), + flags: value.flags.clone().into_iter().map(Into::into).collect(), + on_ledger_settings: value.on_ledger_settings.into(), + } + } +} + #[uniffi::export] pub fn new_account_sample_mainnet_alice() -> Account { InternalAccount::sample_mainnet_alice().into() diff --git a/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/persona/persona.rs b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/persona/persona.rs index 3680d071c..04b7069a3 100644 --- a/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/persona/persona.rs +++ b/crates/uniffi/uniffi_SPLIT_ME/src/profile/v100/entity/persona/persona.rs @@ -22,7 +22,7 @@ decl_vec_samples_for!(Personas, Persona); /// technically, nothing stops a user from building their own wallet and uploading /// personal information to the metadata of the Identity component... but `Sargon` /// never will, nor will the Radix Wallet.). -#[derive(Clone, PartialEq, Hash, Eq, InternalConversion, uniffi::Record)] +#[derive(Clone, PartialEq, Hash, Eq, uniffi::Record)] pub struct Persona { /// The ID of the network this account can be used with. pub network_id: NetworkID, @@ -52,6 +52,38 @@ pub struct Persona { pub persona_data: PersonaData, } +impl Persona { + pub fn into_internal(&self) -> InternalPersona { + self.clone().into() + } +} + +impl From for InternalPersona { + fn from(value: Persona) -> Self { + Self::with( + value.network_id, + value.address, + value.display_name, + value.security_state, + value.flags.into_iter().map(Into::into), + value.persona_data, + ) + } +} + +impl From for Persona { + fn from(value: InternalPersona) -> Self { + Self { + network_id: value.network_id.into(), + address: value.address.into(), + display_name: value.display_name.into(), + security_state: value.security_state.clone().into(), + flags: value.flags.clone().into_iter().map(Into::into).collect(), + persona_data: value.persona_data.into(), + } + } +} + #[uniffi::export] pub fn new_persona_sample() -> Persona { InternalPersona::sample().into() From 16162d611c57bdae4257c7e6dde89c1ebd26d1bc Mon Sep 17 00:00:00 2001 From: Alexander Cyon <116169792+CyonAlexRDX@users.noreply.github.com> Date: Tue, 7 Jan 2025 19:13:28 +0100 Subject: [PATCH 13/13] Split Sargon-OS crate (#332) --- Cargo.lock | 246 ++++++++++++++++++ Cargo.toml | 129 ++++++++- crates/app/home-cards/Cargo.toml | 18 +- crates/app/key-derivation-traits/Cargo.toml | 23 ++ .../src}/derivation_purpose.rs | 0 .../key_derivation_interactor.rs | 0 .../key_derivation_request.rs | 2 +- .../key_derivation_response.rs | 0 .../src/host_interaction/mod.rs | 0 crates/app/key-derivation-traits/src/lib.rs | 26 ++ .../src}/test_derivation_interactor.rs | 0 crates/app/radix-connect-models/Cargo.toml | 12 +- crates/app/radix-connect-models/src/lib.rs | 2 + .../src/pre_auth}/expiration/after_delay.rs | 0 .../src/pre_auth}/expiration/at_time.rs | 0 .../src/pre_auth}/expiration/expiration.rs | 0 .../src/pre_auth}/expiration/mod.rs | 0 .../src/pre_auth}/expiration/status.rs | 0 .../radix-connect-models/src/pre_auth/mod.rs | 3 + crates/app/radix-connect/Cargo.toml | 36 +-- .../pre_authorization/mod.rs | 2 - crates/app/security-center/Cargo.toml | 10 +- crates/app/signing-traits/Cargo.toml | 30 +++ .../src/authentication/auth_intent.rs | 0 .../src/authentication/auth_intent_hash.rs | 57 ++++ .../src/authentication/mod.rs | 0 .../src/authentication/signed_auth_intent.rs | 0 .../extractor_of_entities_requiring_auth.rs | 0 .../src/host_interaction/mod.rs | 2 + .../src/host_interaction/sign_interactor.rs | 0 .../src/host_interaction/sign_request.rs | 5 +- .../src/host_interaction/sign_response.rs | 0 .../sign_with_factors_outcome.rs | 17 +- .../transaction_sign_request_input.rs | 2 +- .../src}/invalid_transaction_if_neglected.rs | 0 crates/app/signing-traits/src/lib.rs | 50 ++++ .../src/signables/mod.rs | 0 .../src/signables/signable.rs | 0 .../src/signables/signable_auth_intent.rs | 64 +++++ .../src/signables/signable_subintent.rs | 0 .../signables/signable_transaction_intent.rs | 0 .../src/testing/interactors/mod.rs | 0 .../testing/interactors/test_interactor.rs | 0 .../interactors/test_sign_interactor.rs | 0 .../src/testing/mod.rs | 2 - .../src/testing/simulated_user.rs | 0 .../src/types/hd_signature.rs | 8 + .../src/types/hd_signature_input.rs | 0 .../src/types/mod.rs | 4 +- .../src/types}/neglected_factor_instance.rs | 7 +- .../src/types/owned_types/mod.rs | 0 .../src/types/owned_types/owned.rs | 0 .../owned_types/owned_factor_instance.rs | 0 crates/app/signing/Cargo.toml | 43 +-- ...instances_required_to_sign_transactions.rs | 113 ++++++++ crates/app/signing/src/lib.rs | 36 +-- crates/app/signing/src/petition_types/mod.rs | 3 +- .../factor_source_referencing.rs | 9 - .../petition_for_factors_types/mod.rs | 4 - .../src/signables/signable_auth_intent.rs | 177 ------------- .../src/signatures_outcome_types/mod.rs | 2 - .../auth_intent_hash.rs | 60 +---- crates/app/signing/src/tests/mod.rs | 4 + .../test_signatures_collector.rs | 1 + crates/common/build-info/Cargo.toml | 21 ++ crates/common/build-info/build.rs | 40 +++ .../dependency_information.rs | 2 +- .../build-info/src}/build_information/mod.rs | 0 .../sargon_build_information.rs | 0 .../build_information/sargon_dependencies.rs | 0 crates/common/build-info/src/lib.rs | 9 + crates/common/bytes/Cargo.toml | 6 +- crates/common/entity-foundation/Cargo.toml | 6 +- crates/common/host-info/Cargo.toml | 6 +- crates/common/identified-vec-of/Cargo.toml | 4 +- crates/common/metadata/Cargo.toml | 2 +- crates/common/network/Cargo.toml | 6 +- crates/common/numeric/Cargo.toml | 6 +- crates/common/short-string/Cargo.toml | 8 +- .../common/short-string/src/email_address.rs | 9 +- crates/core/assert-json/Cargo.toml | 2 +- crates/core/collections/Cargo.toml | 2 +- crates/core/has-sample-values/Cargo.toml | 2 +- crates/core/misc/Cargo.toml | 8 +- crates/core/utils/Cargo.toml | 2 +- crates/crypto/addresses/Cargo.toml | 22 +- crates/crypto/cap26-models/Cargo.toml | 14 +- crates/crypto/ecc/Cargo.toml | 12 +- crates/crypto/encryption/Cargo.toml | 8 +- crates/crypto/hash/Cargo.toml | 2 +- crates/crypto/hd/Cargo.toml | 18 +- crates/factors/factors/Cargo.toml | 30 +-- crates/factors/instances-provider/Cargo.toml | 27 +- crates/factors/instances-provider/src/lib.rs | 1 + crates/factors/keys-collector/Cargo.toml | 23 +- .../keys-collector/src/collector/mod.rs | 2 - .../src/derivation_testing/mod.rs | 2 - .../test_keys_collector/mod.rs | 3 - crates/factors/keys-collector/src/lib.rs | 20 +- .../Cargo.toml | 18 +- crates/factors/supporting-types/Cargo.toml | 8 +- crates/gateway/client-and-api/Cargo.toml | 18 +- crates/gateway/models/Cargo.toml | 10 +- .../profile/logic/logic_SPLIT_ME/Cargo.toml | 18 +- .../models/account-for-display/Cargo.toml | 12 +- .../models/account-or-persona/Cargo.toml | 12 +- crates/profile/models/account/Cargo.toml | 18 +- .../profile/models/app-preferences/Cargo.toml | 20 +- crates/profile/models/base-entity/Cargo.toml | 18 +- crates/profile/models/gateway/Cargo.toml | 22 +- crates/profile/models/persona-data/Cargo.toml | 16 +- crates/profile/models/persona/Cargo.toml | 20 +- .../models/profile_SPLIT_ME/Cargo.toml | 42 +-- .../models/security-structures/Cargo.toml | 24 +- .../models/supporting-types/Cargo.toml | 14 +- .../traits/entity-by-address/Cargo.toml | 10 +- crates/sargon_SPLIT_ME/Cargo.toml | 61 +++-- crates/sargon_SPLIT_ME/src/interactors/mod.rs | 9 - crates/sargon_SPLIT_ME/src/lib.rs | 26 +- crates/sargon_SPLIT_ME/src/sargon_os/mod.rs | 28 -- crates/sargon_SPLIT_ME/src/subsystems/mod.rs | 3 - .../src/test_diagnose_instance_duplicates.rs | 12 +- crates/system/clients/clients/Cargo.toml | 16 +- crates/system/clients/http/Cargo.toml | 8 +- crates/system/drivers/Cargo.toml | 10 +- crates/system/interactors/Cargo.toml | 19 ++ crates/system/interactors/src/interactors.rs | 18 ++ crates/system/interactors/src/lib.rs | 17 ++ .../interactors/src}/testing/mod.rs | 2 - .../test_use_factor_sources_interactors.rs | 0 .../src}/use_factor_sources_interactor.rs | 0 crates/system/os/accounts/Cargo.toml | 27 ++ .../os/accounts/src}/delete_account/mod.rs | 1 + .../sargon_os_delete_account.rs | 42 ++- .../src}/delete_account/support/mod.rs | 0 .../src}/delete_account/support/outcome.rs | 0 crates/system/os/accounts/src/lib.rs | 24 ++ .../accounts/src}/sargon_os_sync_accounts.rs | 34 ++- crates/system/os/factors/Cargo.toml | 25 ++ crates/system/os/factors/src/lib.rs | 19 ++ ...gon_os_entities_linked_to_factor_source.rs | 26 +- .../src}/sargon_os_security_structures.rs | 55 +++- crates/system/os/os/Cargo.toml | 32 +++ .../os/os}/src/bios/bios.rs | 0 .../os/os}/src/bios/mod.rs | 0 ...th_factor_source_and_derivation_outcome.rs | 61 +++-- crates/system/os/os/src/lib.rs | 51 ++++ crates/system/os/os/src/os_testing_support.rs | 229 ++++++++++++++++ .../os/os/src}/sargon_os.rs | 61 ++++- .../os/os/src}/sargon_os_accounts.rs | 0 .../os/os/src}/sargon_os_factors.rs | 32 +-- .../os/os/src}/sargon_os_gateway.rs | 0 .../os/os/src}/sargon_os_personas.rs | 0 .../os/os/src}/sargon_os_profile.rs | 2 +- .../os/os/src/test_instances_provider.rs} | 226 +--------------- .../os/os/src/testing_interactors.rs} | 38 +-- crates/system/os/security-center/Cargo.toml | 21 ++ crates/system/os/security-center/src/lib.rs | 20 ++ .../src}/sargon_os_security_center.rs | 11 +- crates/system/os/signing/Cargo.toml | 34 +++ crates/system/os/signing/src/lib.rs | 28 ++ .../os/signing/src}/sargon_os_signing.rs | 38 ++- crates/system/os/transaction/Cargo.toml | 34 +++ crates/system/os/transaction/src/lib.rs | 29 +++ .../os/transaction/src/pre_auth}/mod.rs | 2 + .../pre_auth}/sargon_os_create_subintent.rs | 33 ++- .../sargon_os_pre_authorization_status.rs | 33 ++- .../transaction/src/pre_auth}/support/mod.rs | 0 .../support/pre_authorization_status.rs | 0 .../os/transaction/src/tx}/mod.rs | 3 + .../src/tx}/sargon_os_transaction_analysis.rs | 127 +++++---- .../src/tx}/sargon_os_transaction_status.rs | 32 ++- .../src/tx}/sargon_os_transaction_submit.rs | 19 +- .../os/transaction/src/tx}/support/mod.rs | 0 .../src/tx}/support/pre_auth_to_review.rs | 0 .../tx}/support/signable_manifest_summary.rs | 0 .../src/tx}/support/transaction_to_review.rs | 0 crates/system/profile-state-holder/Cargo.toml | 20 ++ crates/system/profile-state-holder/src/lib.rs | 11 + .../src}/profile_state_holder.rs | 8 +- crates/system/sub-systems/Cargo.toml | 18 ++ .../sub-systems}/README.md | 0 crates/system/sub-systems/src/lib.rs | 20 ++ .../sub-systems/src}/log_system/log_system.rs | 2 +- .../sub-systems/src}/log_system/mod.rs | 0 crates/transaction/foundation/Cargo.toml | 6 +- crates/transaction/manifests/Cargo.toml | 24 +- crates/transaction/manifests/build.rs | 36 --- .../high_level/sargon_specific_types/mod.rs | 8 +- crates/transaction/manifests/src/lib.rs | 1 - crates/transaction/models/Cargo.toml | 30 +-- crates/transaction/models/src/lib.rs | 2 + .../src/transaction_status}/mod.rs | 0 .../transaction_status}/transaction_status.rs | 0 .../transaction_status_reason.rs | 0 crates/uniffi/uniffi_SPLIT_ME/Cargo.toml | 47 ++-- .../uniffi/uniffi_SPLIT_ME/src/Package.swift | 13 - .../sargon_os_delete_account.rs | 2 + .../sargon_os_create_subintent.rs | 2 + .../sargon_os_pre_authorization_status.rs | 2 + ...gon_os_entities_linked_to_factor_source.rs | 2 + .../sargon_os/sargon_os_security_center.rs | 2 + .../sargon_os_security_structures.rs | 4 + .../src/system/sargon_os/sargon_os_signing.rs | 2 +- .../sargon_os/sargon_os_sync_accounts.rs | 7 +- .../sargon_os_transaction_analysis.rs | 2 + .../sargon_os_transaction_status.rs | 2 + .../sargon_os_transaction_submit.rs | 2 + .../uniffi_SPLIT_ME/tests/Package.swift | 13 - .../uniffi_SPLIT_ME/tests/integration/main.rs | 1 - .../uniffi_SPLIT_ME/tests/vectors/main.rs | 1 - jvm/sargon-android/build.gradle.kts | 1 + 212 files changed, 2491 insertions(+), 1312 deletions(-) create mode 100644 crates/app/key-derivation-traits/Cargo.toml rename crates/{factors/keys-collector/src/collector => app/key-derivation-traits/src}/derivation_purpose.rs (100%) rename crates/{factors/keys-collector => app/key-derivation-traits}/src/host_interaction/key_derivation_interactor.rs (100%) rename crates/{factors/keys-collector => app/key-derivation-traits}/src/host_interaction/key_derivation_request.rs (97%) rename crates/{factors/keys-collector => app/key-derivation-traits}/src/host_interaction/key_derivation_response.rs (100%) rename crates/{factors/keys-collector => app/key-derivation-traits}/src/host_interaction/mod.rs (100%) create mode 100644 crates/app/key-derivation-traits/src/lib.rs rename crates/{factors/keys-collector/src/derivation_testing/test_keys_collector => app/key-derivation-traits/src}/test_derivation_interactor.rs (100%) rename crates/app/{radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization => radix-connect-models/src/pre_auth}/expiration/after_delay.rs (100%) rename crates/app/{radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization => radix-connect-models/src/pre_auth}/expiration/at_time.rs (100%) rename crates/app/{radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization => radix-connect-models/src/pre_auth}/expiration/expiration.rs (100%) rename crates/app/{radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization => radix-connect-models/src/pre_auth}/expiration/mod.rs (100%) rename crates/app/{radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization => radix-connect-models/src/pre_auth}/expiration/status.rs (100%) create mode 100644 crates/app/radix-connect-models/src/pre_auth/mod.rs create mode 100644 crates/app/signing-traits/Cargo.toml rename crates/app/{signing => signing-traits}/src/authentication/auth_intent.rs (100%) create mode 100644 crates/app/signing-traits/src/authentication/auth_intent_hash.rs rename crates/app/{signing => signing-traits}/src/authentication/mod.rs (100%) rename crates/app/{signing => signing-traits}/src/authentication/signed_auth_intent.rs (100%) rename crates/app/{signing => signing-traits}/src/extractor_of_entities_requiring_auth.rs (100%) rename crates/app/{signing => signing-traits}/src/host_interaction/mod.rs (75%) rename crates/app/{signing => signing-traits}/src/host_interaction/sign_interactor.rs (100%) rename crates/app/{signing => signing-traits}/src/host_interaction/sign_request.rs (97%) rename crates/app/{signing => signing-traits}/src/host_interaction/sign_response.rs (100%) rename crates/app/{signing/src/signatures_outcome_types => signing-traits/src/host_interaction}/sign_with_factors_outcome.rs (82%) rename crates/app/{signing => signing-traits}/src/host_interaction/transaction_sign_request_input.rs (99%) rename crates/app/{signing/src/types => signing-traits/src}/invalid_transaction_if_neglected.rs (100%) create mode 100644 crates/app/signing-traits/src/lib.rs rename crates/app/{signing => signing-traits}/src/signables/mod.rs (100%) rename crates/app/{signing => signing-traits}/src/signables/signable.rs (100%) create mode 100644 crates/app/signing-traits/src/signables/signable_auth_intent.rs rename crates/app/{signing => signing-traits}/src/signables/signable_subintent.rs (100%) rename crates/app/{signing => signing-traits}/src/signables/signable_transaction_intent.rs (100%) rename crates/app/{signing => signing-traits}/src/testing/interactors/mod.rs (100%) rename crates/app/{signing => signing-traits}/src/testing/interactors/test_interactor.rs (100%) rename crates/app/{signing => signing-traits}/src/testing/interactors/test_sign_interactor.rs (100%) rename crates/app/{signing => signing-traits}/src/testing/mod.rs (61%) rename crates/app/{signing => signing-traits}/src/testing/simulated_user.rs (100%) rename crates/app/{signing => signing-traits}/src/types/hd_signature.rs (95%) rename crates/app/{signing => signing-traits}/src/types/hd_signature_input.rs (100%) rename crates/app/{signing => signing-traits}/src/types/mod.rs (62%) rename crates/app/{signing/src/petition_types/petition_for_factors_types => signing-traits/src/types}/neglected_factor_instance.rs (94%) rename crates/app/{signing => signing-traits}/src/types/owned_types/mod.rs (100%) rename crates/app/{signing => signing-traits}/src/types/owned_types/owned.rs (100%) rename crates/app/{signing => signing-traits}/src/types/owned_types/owned_factor_instance.rs (100%) delete mode 100644 crates/app/signing/src/petition_types/petition_for_factors_types/factor_source_referencing.rs delete mode 100644 crates/app/signing/src/signables/signable_auth_intent.rs rename crates/app/signing/src/{authentication => tests}/auth_intent_hash.rs (69%) create mode 100644 crates/app/signing/src/tests/mod.rs rename crates/app/signing/src/{testing => tests}/test_signatures_collector.rs (99%) create mode 100644 crates/common/build-info/Cargo.toml create mode 100644 crates/common/build-info/build.rs rename crates/{transaction/manifests/src/high_level/sargon_specific_types => common/build-info/src}/build_information/dependency_information.rs (98%) rename crates/{transaction/manifests/src/high_level/sargon_specific_types => common/build-info/src}/build_information/mod.rs (100%) rename crates/{transaction/manifests/src/high_level/sargon_specific_types => common/build-info/src}/build_information/sargon_build_information.rs (100%) rename crates/{transaction/manifests/src/high_level/sargon_specific_types => common/build-info/src}/build_information/sargon_dependencies.rs (100%) create mode 100644 crates/common/build-info/src/lib.rs delete mode 100644 crates/sargon_SPLIT_ME/src/interactors/mod.rs delete mode 100644 crates/sargon_SPLIT_ME/src/sargon_os/mod.rs delete mode 100644 crates/sargon_SPLIT_ME/src/subsystems/mod.rs create mode 100644 crates/system/interactors/Cargo.toml create mode 100644 crates/system/interactors/src/interactors.rs create mode 100644 crates/system/interactors/src/lib.rs rename crates/{sargon_SPLIT_ME/src/interactors => system/interactors/src}/testing/mod.rs (77%) rename crates/{sargon_SPLIT_ME/src/interactors => system/interactors/src}/testing/test_use_factor_sources_interactors.rs (100%) rename crates/{sargon_SPLIT_ME/src/interactors => system/interactors/src}/use_factor_sources_interactor.rs (100%) create mode 100644 crates/system/os/accounts/Cargo.toml rename crates/{sargon_SPLIT_ME/src/sargon_os => system/os/accounts/src}/delete_account/mod.rs (63%) rename crates/{sargon_SPLIT_ME/src/sargon_os => system/os/accounts/src}/delete_account/sargon_os_delete_account.rs (90%) rename crates/{sargon_SPLIT_ME/src/sargon_os => system/os/accounts/src}/delete_account/support/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/sargon_os => system/os/accounts/src}/delete_account/support/outcome.rs (100%) create mode 100644 crates/system/os/accounts/src/lib.rs rename crates/{sargon_SPLIT_ME/src/sargon_os => system/os/accounts/src}/sargon_os_sync_accounts.rs (86%) create mode 100644 crates/system/os/factors/Cargo.toml create mode 100644 crates/system/os/factors/src/lib.rs rename crates/{sargon_SPLIT_ME/src/sargon_os => system/os/factors/src}/sargon_os_entities_linked_to_factor_source.rs (95%) rename crates/{sargon_SPLIT_ME/src/sargon_os => system/os/factors/src}/sargon_os_security_structures.rs (88%) create mode 100644 crates/system/os/os/Cargo.toml rename crates/{sargon_SPLIT_ME => system/os/os}/src/bios/bios.rs (100%) rename crates/{sargon_SPLIT_ME => system/os/os}/src/bios/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/sargon_os => system/os/os/src}/entity_creating_with_factor_source_and_derivation_outcome.rs (92%) create mode 100644 crates/system/os/os/src/lib.rs create mode 100644 crates/system/os/os/src/os_testing_support.rs rename crates/{sargon_SPLIT_ME/src/sargon_os => system/os/os/src}/sargon_os.rs (93%) rename crates/{sargon_SPLIT_ME/src/sargon_os => system/os/os/src}/sargon_os_accounts.rs (100%) rename crates/{sargon_SPLIT_ME/src/sargon_os => system/os/os/src}/sargon_os_factors.rs (95%) rename crates/{sargon_SPLIT_ME/src/sargon_os => system/os/os/src}/sargon_os_gateway.rs (100%) rename crates/{sargon_SPLIT_ME/src/sargon_os => system/os/os/src}/sargon_os_personas.rs (100%) rename crates/{sargon_SPLIT_ME/src/sargon_os => system/os/os/src}/sargon_os_profile.rs (99%) rename crates/{sargon_SPLIT_ME/src/sargon_os/factor_instances_provider_unit_tests.rs => system/os/os/src/test_instances_provider.rs} (91%) rename crates/{sargon_SPLIT_ME/src/interactors/interactors.rs => system/os/os/src/testing_interactors.rs} (60%) create mode 100644 crates/system/os/security-center/Cargo.toml create mode 100644 crates/system/os/security-center/src/lib.rs rename crates/{sargon_SPLIT_ME/src/sargon_os => system/os/security-center/src}/sargon_os_security_center.rs (82%) create mode 100644 crates/system/os/signing/Cargo.toml create mode 100644 crates/system/os/signing/src/lib.rs rename crates/{sargon_SPLIT_ME/src/sargon_os => system/os/signing/src}/sargon_os_signing.rs (93%) create mode 100644 crates/system/os/transaction/Cargo.toml create mode 100644 crates/system/os/transaction/src/lib.rs rename crates/{sargon_SPLIT_ME/src/sargon_os/pre_authorization => system/os/transaction/src/pre_auth}/mod.rs (55%) rename crates/{sargon_SPLIT_ME/src/sargon_os/pre_authorization => system/os/transaction/src/pre_auth}/sargon_os_create_subintent.rs (91%) rename crates/{sargon_SPLIT_ME/src/sargon_os/pre_authorization => system/os/transaction/src/pre_auth}/sargon_os_pre_authorization_status.rs (93%) rename crates/{sargon_SPLIT_ME/src/sargon_os/pre_authorization => system/os/transaction/src/pre_auth}/support/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/sargon_os/pre_authorization => system/os/transaction/src/pre_auth}/support/pre_authorization_status.rs (100%) rename crates/{sargon_SPLIT_ME/src/sargon_os/transactions => system/os/transaction/src/tx}/mod.rs (52%) rename crates/{sargon_SPLIT_ME/src/sargon_os/transactions => system/os/transaction/src/tx}/sargon_os_transaction_analysis.rs (92%) rename crates/{sargon_SPLIT_ME/src/sargon_os/transactions => system/os/transaction/src/tx}/sargon_os_transaction_status.rs (92%) rename crates/{sargon_SPLIT_ME/src/sargon_os/transactions => system/os/transaction/src/tx}/sargon_os_transaction_submit.rs (86%) rename crates/{sargon_SPLIT_ME/src/sargon_os/transactions => system/os/transaction/src/tx}/support/mod.rs (100%) rename crates/{sargon_SPLIT_ME/src/sargon_os/transactions => system/os/transaction/src/tx}/support/pre_auth_to_review.rs (100%) rename crates/{sargon_SPLIT_ME/src/sargon_os/transactions => system/os/transaction/src/tx}/support/signable_manifest_summary.rs (100%) rename crates/{sargon_SPLIT_ME/src/sargon_os/transactions => system/os/transaction/src/tx}/support/transaction_to_review.rs (100%) create mode 100644 crates/system/profile-state-holder/Cargo.toml create mode 100644 crates/system/profile-state-holder/src/lib.rs rename crates/{sargon_SPLIT_ME/src/sargon_os => system/profile-state-holder/src}/profile_state_holder.rs (97%) create mode 100644 crates/system/sub-systems/Cargo.toml rename crates/{sargon_SPLIT_ME/src/subsystems => system/sub-systems}/README.md (100%) create mode 100644 crates/system/sub-systems/src/lib.rs rename crates/{sargon_SPLIT_ME/src/subsystems => system/sub-systems/src}/log_system/log_system.rs (97%) rename crates/{sargon_SPLIT_ME/src/subsystems => system/sub-systems/src}/log_system/mod.rs (100%) rename crates/transaction/{manifests/src/high_level/sargon_specific_types/transaction => models/src/transaction_status}/mod.rs (100%) rename crates/transaction/{manifests/src/high_level/sargon_specific_types/transaction => models/src/transaction_status}/transaction_status.rs (100%) rename crates/transaction/{manifests/src/high_level/sargon_specific_types/transaction => models/src/transaction_status}/transaction_status_reason.rs (100%) delete mode 100644 crates/uniffi/uniffi_SPLIT_ME/src/Package.swift delete mode 100644 crates/uniffi/uniffi_SPLIT_ME/tests/Package.swift delete mode 100644 crates/uniffi/uniffi_SPLIT_ME/tests/integration/main.rs delete mode 100644 crates/uniffi/uniffi_SPLIT_ME/tests/vectors/main.rs diff --git a/Cargo.lock b/Cargo.lock index afe423b65..0b6ceca56 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -545,6 +545,20 @@ dependencies = [ "num-traits", ] +[[package]] +name = "build-info" +version = "1.1.99" +dependencies = [ + "assert-json", + "cargo_toml 0.15.3 (git+https://gitlab.com/lib.rs/cargo_toml?rev=e498c94fc42a660c1ca1a28999ce1d757cfe77fe)", + "derive_more", + "enum-as-inner", + "error", + "has-sample-values", + "radix-engine", + "radix-engine-toolkit", +] + [[package]] name = "bumpalo" version = "3.16.0" @@ -1413,6 +1427,7 @@ dependencies = [ "hierarchical-deterministic", "identified-vec-of", "indexmap 2.7.0", + "key-derivation-traits", "keys-collector", "next-derivation-index-ephemeral", "profile", @@ -2256,6 +2271,19 @@ dependencies = [ "generic-array 0.14.7", ] +[[package]] +name = "interactors" +version = "1.1.99" +dependencies = [ + "async-trait", + "derive_more", + "key-derivation-traits", + "log", + "serde", + "signing-traits", + "transaction-models", +] + [[package]] name = "iota-crypto" version = "0.23.2" @@ -2372,6 +2400,23 @@ dependencies = [ "cpufeatures", ] +[[package]] +name = "key-derivation-traits" +version = "1.1.99" +dependencies = [ + "addresses", + "async-trait", + "cap26-models", + "core-collections", + "error", + "factors", + "factors-supporting-types", + "has-sample-values", + "hierarchical-deterministic", + "indexmap 2.7.0", + "itertools 0.12.0", +] + [[package]] name = "keys-collector" version = "1.1.99" @@ -2390,6 +2435,7 @@ dependencies = [ "hierarchical-deterministic", "indexmap 2.7.0", "itertools 0.12.0", + "key-derivation-traits", "log", "network", "numeric", @@ -3184,6 +3230,20 @@ dependencies = [ "time-utils", ] +[[package]] +name = "profile-state-holder" +version = "1.1.99" +dependencies = [ + "derive_more", + "error", + "log", + "pretty_assertions", + "profile", + "profile-logic", + "profile-supporting-types", + "serde", +] + [[package]] name = "profile-supporting-types" version = "1.1.99" @@ -3801,6 +3861,7 @@ dependencies = [ "async-std", "async-trait", "base64 0.22.1 (git+https://github.com/marshallpierce/rust-base64.git?rev=e14400697453bcc85997119b874bc03d9601d0af)", + "build-info", "cargo_toml 0.15.3 (git+https://gitlab.com/lib.rs/cargo_toml?rev=e498c94fc42a660c1ca1a28999ce1d757cfe77fe)", "clients", "core-misc", @@ -3817,9 +3878,13 @@ dependencies = [ "hierarchical-deterministic", "home-cards", "identified-vec-of", + "interactors", + "key-derivation-traits", "keys-collector", "log", "manifests", + "network", + "next-derivation-index-ephemeral", "paste 1.0.14", "pretty_assertions", "profile", @@ -3832,6 +3897,12 @@ dependencies = [ "radix-engine-interface", "radix-engine-toolkit-common", "radix-transactions", + "sargon-os", + "sargon-os-accounts", + "sargon-os-factors", + "sargon-os-security-center", + "sargon-os-signing", + "sargon-os-transaction", "security-center", "security-framework", "security-framework-sys", @@ -3839,10 +3910,147 @@ dependencies = [ "serde_json 1.0.108", "serde_with 3.4.0", "signing", + "signing-traits", + "sub-systems", "transaction-foundation", "transaction-models", ] +[[package]] +name = "sargon-os" +version = "1.1.99" +dependencies = [ + "actix-rt", + "async-trait", + "build-info", + "clients", + "derive_more", + "drivers", + "factor-instances-provider", + "futures", + "host-info", + "interactors", + "key-derivation-traits", + "log", + "pretty_assertions", + "profile", + "profile-logic", + "profile-state-holder", + "serde", + "serde_json 1.0.108", + "signing-traits", + "sub-systems", +] + +[[package]] +name = "sargon-os-accounts" +version = "1.1.99" +dependencies = [ + "actix-rt", + "addresses", + "async-trait", + "core-collections", + "derive_more", + "error", + "gateway-client-and-api", + "indexmap 2.7.0", + "log", + "manifests", + "network", + "radix-common", + "radix-engine-interface", + "sargon-os", + "serde", + "transaction-models", +] + +[[package]] +name = "sargon-os-factors" +version = "1.1.99" +dependencies = [ + "actix-rt", + "async-trait", + "clients", + "derive_more", + "drivers", + "error", + "interactors", + "log", + "profile", + "profile-logic", + "sargon-os", + "serde", + "serde_json 1.0.108", +] + +[[package]] +name = "sargon-os-security-center" +version = "1.1.99" +dependencies = [ + "actix-rt", + "derive_more", + "drivers", + "error", + "has-sample-values", + "log", + "sargon-os", + "security-center", + "serde", +] + +[[package]] +name = "sargon-os-signing" +version = "1.1.99" +dependencies = [ + "actix-rt", + "async-trait", + "clients", + "derive_more", + "drivers", + "error", + "factor-instances-provider", + "interactors", + "key-derivation-traits", + "log", + "profile", + "profile-logic", + "profile-security-structures", + "radix-connect-models", + "sargon-os", + "serde", + "signing", + "signing-traits", + "transaction-models", +] + +[[package]] +name = "sargon-os-transaction" +version = "1.1.99" +dependencies = [ + "actix-rt", + "async-std", + "async-trait", + "derive_more", + "entity-by-address", + "gateway-client-and-api", + "itertools 0.12.0", + "log", + "manifests", + "pretty_assertions", + "profile", + "profile-account-or-persona", + "radix-common", + "radix-connect-models", + "radix-engine-interface", + "radix-engine-toolkit-common", + "sargon-os", + "serde", + "serde_json 1.0.108", + "signing", + "signing-traits", + "transaction-models", +] + [[package]] name = "sargon-uniffi" version = "1.1.99" @@ -4344,6 +4552,32 @@ dependencies = [ "radix-transactions", "serde", "serde_json 1.0.108", + "signing-traits", + "transaction-models", +] + +[[package]] +name = "signing-traits" +version = "1.1.99" +dependencies = [ + "async-trait", + "bytes 1.1.99", + "core-collections", + "derive_more", + "ecc", + "entity-by-address", + "error", + "hash", + "indexmap 2.7.0", + "metadata", + "pretty_assertions", + "profile-account", + "profile-account-or-persona", + "profile-persona", + "radix-connect-models", + "radix-engine-interface", + "radix-transactions", + "serde", "transaction-models", ] @@ -4486,6 +4720,18 @@ dependencies = [ "syn 2.0.94", ] +[[package]] +name = "sub-systems" +version = "1.1.99" +dependencies = [ + "derive_more", + "drivers", + "enum-iterator", + "itertools 0.12.0", + "log", + "serde", +] + [[package]] name = "subtle" version = "2.6.1" diff --git a/Cargo.toml b/Cargo.toml index 28da683e5..ed78c9c2d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,8 +7,11 @@ members = [ "crates/app/radix-connect-models", "crates/app/security-center", "crates/app/signing", + "crates/app/signing-traits", + "crates/app/key-derivation-traits", # === COMMON === + "crates/common/build-info", "crates/common/bytes", "crates/common/entity-foundation", "crates/common/host-info", @@ -68,6 +71,15 @@ members = [ "crates/system/clients/clients", "crates/system/clients/http", "crates/system/drivers", + "crates/system/sub-systems", + "crates/system/profile-state-holder", + "crates/system/interactors", + "crates/system/os/accounts", + "crates/system/os/factors", + "crates/system/os/os", + "crates/system/os/security-center", + "crates/system/os/signing", + "crates/system/os/transaction", # === TRANSACTION === "crates/transaction/foundation", @@ -86,9 +98,12 @@ default-members = [ "crates/app/radix-connect-models", "crates/app/security-center", "crates/app/signing", + "crates/app/signing-traits", + "crates/app/key-derivation-traits", # === COMMON === "crates/common/bytes", + "crates/common/build-info", "crates/common/entity-foundation", "crates/common/host-info", "crates/common/identified-vec-of", @@ -140,13 +155,21 @@ default-members = [ "crates/profile/models/supporting-types", "crates/profile/traits/entity-by-address", - # === SARGON - SPLIT ME === - "crates/sargon_SPLIT_ME", + # === SARGON - NOT included! no need === # === SYSTEM === "crates/system/clients/clients", "crates/system/clients/http", "crates/system/drivers", + "crates/system/sub-systems", + "crates/system/profile-state-holder", + "crates/system/interactors", + "crates/system/os/accounts", + "crates/system/os/factors", + "crates/system/os/os", + "crates/system/os/security-center", + "crates/system/os/signing", + "crates/system/os/transaction", # === TRANSACTION === "crates/transaction/foundation", @@ -169,8 +192,103 @@ inherits = "release" debug = true [workspace.dependencies] - -# ===== RADIX DEPENDENCIES ======== +# With `path-bases` we can simplify the path handling for internal crates: +# https://github.com/rust-lang/cargo/issues/14355#issuecomment-2573582438 +# e.g.: +# core = "../crates/core" +# error = { path = "error", base = "core "} + +# === FOR APP === +home-cards = { path = "crates/app/home-cards" } +radix-connect = { path = "crates/app/radix-connect" } +radix-connect-models = { path = "crates/app/radix-connect-models" } +security-center = { path = "crates/app/security-center" } +signing = { path = "crates/app/signing" } +signing-traits = { path = "crates/app/signing-traits" } +key-derivation-traits = { path = "crates/app/key-derivation-traits" } + +# === COMMON === +build-info = { path = "crates/common/build-info" } +bytes = { path = "crates/common/bytes" } +entity-foundation = { path = "crates/common/entity-foundation" } +host-info = { path = "crates/common/host-info" } +identified-vec-of = { path = "crates/common/identified-vec-of" } +metadata = { path = "crates/common/metadata" } +network = { path = "crates/common/network" } +numeric = { path = "crates/common/numeric" } +short-string = { path = "crates/common/short-string" } + +# === CORE === +assert-json = { path = "crates/core/assert-json" } +core-collections = { path = "crates/core/collections" } +error = { path = "crates/core/error" } +has-sample-values = { path = "crates/core/has-sample-values" } +core-misc = { path = "crates/core/misc" } +time-utils = { path = "crates/core/time-utils" } +core-utils = { path = "crates/core/utils" } + +# === CRYPTO === +cap26-models = { path = "crates/crypto/cap26-models" } +addresses = { path = "crates/crypto/addresses" } +ecc = { path = "crates/crypto/ecc" } +encryption = { path = "crates/crypto/encryption" } +hash = { path = "crates/crypto/hash" } +hierarchical-deterministic = { path = "crates/crypto/hd" } + +# === FACTORS === +factors = { path = "crates/factors/factors" } +factor-instances-provider = { path = "crates/factors/instances-provider" } +keys-collector = { path = "crates/factors/keys-collector" } +next-derivation-index-ephemeral = { path = "crates/factors/next-derivation-index-ephemeral" } +factors-supporting-types = { path = "crates/factors/supporting-types" } + +# === GATEWAY === +gateway-client-and-api = { path = "crates/gateway/client-and-api" } +gateway-models = { path = "crates/gateway/models" } + +# === PROFILE === +profile-logic = { path = "crates/profile/logic/logic_SPLIT_ME" } +account-for-display = { path = "crates/profile/models/account-for-display" } +profile-account-or-persona = { path = "crates/profile/models/account-or-persona" } +profile-account = { path = "crates/profile/models/account" } +profile-app-preferences = { path = "crates/profile/models/app-preferences" } +profile-base-entity = { path = "crates/profile/models/base-entity" } +profile-gateway = { path = "crates/profile/models/gateway" } +profile-persona-data = { path = "crates/profile/models/persona-data" } +profile-persona = { path = "crates/profile/models/persona" } +profile = { path = "crates/profile/models/profile_SPLIT_ME" } +profile-security-structures = { path = "crates/profile/models/security-structures" } +profile-supporting-types = { path = "crates/profile/models/supporting-types" } +entity-by-address = { path = "crates/profile/traits/entity-by-address" } + +# === SARGON - SPLIT ME === +sargon = { path = "crates/sargon_SPLIT_ME" } + +# === SYSTEM === +clients = { path = "crates/system/clients/clients" } +http-client = { path = "crates/system/clients/http" } +drivers = { path = "crates/system/drivers" } +sub-systems = { path = "crates/system/sub-systems" } +profile-state-holder = { path = "crates/system/profile-state-holder" } +interactors = { path = "crates/system/interactors" } +sargon-os-accounts = { path = "crates/system/os/accounts" } +sargon-os-factors = { path = "crates/system/os/factors" } +sargon-os = { path = "crates/system/os/os" } +sargon-os-security-center = { path = "crates/system/os/security-center" } +sargon-os-signing = { path = "crates/system/os/signing" } +sargon-os-transaction = { path = "crates/system/os/transaction" } + +# === TRANSACTION === +transaction-foundation = { path = "crates/transaction/foundation" } +manifests = { path = "crates/transaction/manifests" } +transaction-models = { path = "crates/transaction/models" } + +# === UNIFFI === +sargon-uniffi = { path = "crates/uniffi/uniffi_SPLIT_ME" } +sargon-uniffi-conversion-macros = { path = "crates/uniffi/conversion-macros" } + + +# ==== RADIX DEPENDENCIES ==== radix-common = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0", features = [ "serde", "secp256k1_sign_and_validate", @@ -186,7 +304,8 @@ radix-rust = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3 radix-transactions = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } sbor = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } -# ===== EXTERNAL DEPENDENCIES ======== + +# ==== EXTERNAL DEPENDENCIES ==== # actix-rt = "3.3.0" actix-rt = { git = "https://github.com/actix/actix-net", rev = "57fd6ea8098d1f2d281c305fc331216c4fe1992e" } diff --git a/crates/app/home-cards/Cargo.toml b/crates/app/home-cards/Cargo.toml index 2a783d93d..2e55ce83e 100644 --- a/crates/app/home-cards/Cargo.toml +++ b/crates/app/home-cards/Cargo.toml @@ -5,15 +5,15 @@ edition = "2021" [dependencies] # === SARGON CRATES === -identified-vec-of = { path = "../../common/identified-vec-of" } -addresses = { path = "../../crypto/addresses" } -bytes = { path = "../../common/bytes" } -core-utils = { path = "../../core/utils" } -network = { path = "../../common/network" } -metadata = { path = "../../common/metadata" } -drivers = { path = "../../system/drivers" } -gateway-client-and-api = { path = "../../gateway/client-and-api" } -gateway-models = { path = "../../gateway/models" } +identified-vec-of = { workspace = true } +addresses = { workspace = true } +bytes = { workspace = true } +core-utils = { workspace = true } +network = { workspace = true } +metadata = { workspace = true } +drivers = { workspace = true } +gateway-client-and-api = { workspace = true } +gateway-models = { workspace = true } # === RADIX DEPENDENCIES === # None diff --git a/crates/app/key-derivation-traits/Cargo.toml b/crates/app/key-derivation-traits/Cargo.toml new file mode 100644 index 000000000..ed00b7d64 --- /dev/null +++ b/crates/app/key-derivation-traits/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "key-derivation-traits" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +core-collections = { workspace = true } +error = { workspace = true } +has-sample-values = { workspace = true } +addresses = { workspace = true } +factors = { workspace = true } +cap26-models = { workspace = true } +hierarchical-deterministic = { workspace = true } +factors-supporting-types = { workspace = true } + +# === RADIX DEPENDENCIES === +# None + +# === EXTERNAL DEPENDENCIES === +async-trait = { workspace = true } +indexmap = { workspace = true } +itertools = { workspace = true } diff --git a/crates/factors/keys-collector/src/collector/derivation_purpose.rs b/crates/app/key-derivation-traits/src/derivation_purpose.rs similarity index 100% rename from crates/factors/keys-collector/src/collector/derivation_purpose.rs rename to crates/app/key-derivation-traits/src/derivation_purpose.rs diff --git a/crates/factors/keys-collector/src/host_interaction/key_derivation_interactor.rs b/crates/app/key-derivation-traits/src/host_interaction/key_derivation_interactor.rs similarity index 100% rename from crates/factors/keys-collector/src/host_interaction/key_derivation_interactor.rs rename to crates/app/key-derivation-traits/src/host_interaction/key_derivation_interactor.rs diff --git a/crates/factors/keys-collector/src/host_interaction/key_derivation_request.rs b/crates/app/key-derivation-traits/src/host_interaction/key_derivation_request.rs similarity index 97% rename from crates/factors/keys-collector/src/host_interaction/key_derivation_request.rs rename to crates/app/key-derivation-traits/src/host_interaction/key_derivation_request.rs index 1be30d8b6..2daba5f3b 100644 --- a/crates/factors/keys-collector/src/host_interaction/key_derivation_request.rs +++ b/crates/app/key-derivation-traits/src/host_interaction/key_derivation_request.rs @@ -25,7 +25,7 @@ impl KeyDerivationRequest { } } - pub(crate) fn new_mono_factor( + pub fn new_mono_factor( derivation_purpose: DerivationPurpose, factor_source: FactorSourceIDFromHash, derivation_paths: IndexSet, diff --git a/crates/factors/keys-collector/src/host_interaction/key_derivation_response.rs b/crates/app/key-derivation-traits/src/host_interaction/key_derivation_response.rs similarity index 100% rename from crates/factors/keys-collector/src/host_interaction/key_derivation_response.rs rename to crates/app/key-derivation-traits/src/host_interaction/key_derivation_response.rs diff --git a/crates/factors/keys-collector/src/host_interaction/mod.rs b/crates/app/key-derivation-traits/src/host_interaction/mod.rs similarity index 100% rename from crates/factors/keys-collector/src/host_interaction/mod.rs rename to crates/app/key-derivation-traits/src/host_interaction/mod.rs diff --git a/crates/app/key-derivation-traits/src/lib.rs b/crates/app/key-derivation-traits/src/lib.rs new file mode 100644 index 000000000..9c4847fdd --- /dev/null +++ b/crates/app/key-derivation-traits/src/lib.rs @@ -0,0 +1,26 @@ +#![feature(async_closure)] + +mod derivation_purpose; +mod host_interaction; +mod test_derivation_interactor; + +pub mod prelude { + pub use crate::derivation_purpose::*; + pub use crate::host_interaction::*; + pub use crate::test_derivation_interactor::*; + + pub(crate) use addresses::prelude::*; + pub(crate) use cap26_models::prelude::*; + pub(crate) use core_collections::prelude::*; + pub(crate) use error::prelude::*; + pub(crate) use factors::prelude::*; + pub(crate) use factors_supporting_types::prelude::*; + pub(crate) use hierarchical_deterministic::prelude::*; + + pub(crate) use indexmap::{IndexMap, IndexSet}; + pub(crate) use itertools::Itertools; + + pub(crate) use std::sync::Arc; +} + +pub use prelude::*; diff --git a/crates/factors/keys-collector/src/derivation_testing/test_keys_collector/test_derivation_interactor.rs b/crates/app/key-derivation-traits/src/test_derivation_interactor.rs similarity index 100% rename from crates/factors/keys-collector/src/derivation_testing/test_keys_collector/test_derivation_interactor.rs rename to crates/app/key-derivation-traits/src/test_derivation_interactor.rs diff --git a/crates/app/radix-connect-models/Cargo.toml b/crates/app/radix-connect-models/Cargo.toml index c4dc45723..299cc7823 100644 --- a/crates/app/radix-connect-models/Cargo.toml +++ b/crates/app/radix-connect-models/Cargo.toml @@ -5,12 +5,12 @@ edition = "2021" [dependencies] # === SARGON CRATES === -error = { path = "../../core/error" } -has-sample-values = { path = "../../core/has-sample-values" } -core-misc = { path = "../../core/misc" } -bytes = { path = "../../common/bytes" } -network = { path = "../../common/network" } -addresses = { path = "../../crypto/addresses" } +error = { workspace = true } +has-sample-values = { workspace = true } +core-misc = { workspace = true } +bytes = { workspace = true } +network = { workspace = true } +addresses = { workspace = true } # === RADIX DEPENDENCIES === # None diff --git a/crates/app/radix-connect-models/src/lib.rs b/crates/app/radix-connect-models/src/lib.rs index b1320467a..662e4188a 100644 --- a/crates/app/radix-connect-models/src/lib.rs +++ b/crates/app/radix-connect-models/src/lib.rs @@ -2,12 +2,14 @@ mod auth_challenge_nonce; mod dapp_metadata; mod interaction_version; mod origin; +mod pre_auth; pub mod prelude { pub use crate::auth_challenge_nonce::*; pub use crate::dapp_metadata::*; pub use crate::interaction_version::*; pub use crate::origin::*; + pub use crate::pre_auth::*; pub use addresses::prelude::*; pub use bytes::prelude::*; diff --git a/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/after_delay.rs b/crates/app/radix-connect-models/src/pre_auth/expiration/after_delay.rs similarity index 100% rename from crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/after_delay.rs rename to crates/app/radix-connect-models/src/pre_auth/expiration/after_delay.rs diff --git a/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/at_time.rs b/crates/app/radix-connect-models/src/pre_auth/expiration/at_time.rs similarity index 100% rename from crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/at_time.rs rename to crates/app/radix-connect-models/src/pre_auth/expiration/at_time.rs diff --git a/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/expiration.rs b/crates/app/radix-connect-models/src/pre_auth/expiration/expiration.rs similarity index 100% rename from crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/expiration.rs rename to crates/app/radix-connect-models/src/pre_auth/expiration/expiration.rs diff --git a/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/mod.rs b/crates/app/radix-connect-models/src/pre_auth/expiration/mod.rs similarity index 100% rename from crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/mod.rs rename to crates/app/radix-connect-models/src/pre_auth/expiration/mod.rs diff --git a/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/status.rs b/crates/app/radix-connect-models/src/pre_auth/expiration/status.rs similarity index 100% rename from crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/expiration/status.rs rename to crates/app/radix-connect-models/src/pre_auth/expiration/status.rs diff --git a/crates/app/radix-connect-models/src/pre_auth/mod.rs b/crates/app/radix-connect-models/src/pre_auth/mod.rs new file mode 100644 index 000000000..e4b33e436 --- /dev/null +++ b/crates/app/radix-connect-models/src/pre_auth/mod.rs @@ -0,0 +1,3 @@ +mod expiration; + +pub use expiration::*; diff --git a/crates/app/radix-connect/Cargo.toml b/crates/app/radix-connect/Cargo.toml index 088091723..2c0a6e323 100644 --- a/crates/app/radix-connect/Cargo.toml +++ b/crates/app/radix-connect/Cargo.toml @@ -6,24 +6,24 @@ build = "build.rs" [dependencies] # === SARGON CRATES === -assert-json = { path = "../../core/assert-json" } -core-utils = { path = "../../core/utils" } -addresses = { path = "../../crypto/addresses" } -identified-vec-of = { path = "../../common/identified-vec-of" } -ecc = { path = "../../crypto/ecc" } -hash = { path = "../../crypto/hash" } -bytes = { path = "../../common/bytes" } -profile-persona-data = { path = "../../profile/models/persona-data" } -core-misc = { path = "../../core/misc" } -http-client = { path = "../../system/clients/http" } -drivers = { path = "../../system/drivers" } -encryption = { path = "../../crypto/encryption" } -transaction-foundation = { path = "../../transaction/foundation" } -transaction-models = { path = "../../transaction/models" } -entity-foundation = { path = "../../common/entity-foundation" } -short-string = { path = "../../common/short-string" } -has-sample-values = { path = "../../core/has-sample-values" } -radix-connect-models = { path = "../../app/radix-connect-models" } +assert-json = { workspace = true } +core-utils = { workspace = true } +addresses = { workspace = true } +identified-vec-of = { workspace = true } +ecc = { workspace = true } +hash = { workspace = true } +bytes = { workspace = true } +profile-persona-data = { workspace = true } +core-misc = { workspace = true } +http-client = { workspace = true } +drivers = { workspace = true } +encryption = { workspace = true } +transaction-foundation = { workspace = true } +transaction-models = { workspace = true } +entity-foundation = { workspace = true } +short-string = { workspace = true } +has-sample-values = { workspace = true } +radix-connect-models = { workspace = true } # === RADIX DEPENDENCIES === # None diff --git a/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/mod.rs b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/mod.rs index e74de7632..7ea8972c3 100644 --- a/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/mod.rs +++ b/crates/app/radix-connect/src/wallet_interaction/dapp_wallet_interaction/dapp_to_wallet/interaction_items/pre_authorization/mod.rs @@ -1,9 +1,7 @@ -mod expiration; mod pre_authorization; mod subintent; mod unvalidated_subintent_manifest; -pub use expiration::*; pub use pre_authorization::*; pub use subintent::*; pub use unvalidated_subintent_manifest::*; diff --git a/crates/app/security-center/Cargo.toml b/crates/app/security-center/Cargo.toml index 9a613378f..aed0690a1 100644 --- a/crates/app/security-center/Cargo.toml +++ b/crates/app/security-center/Cargo.toml @@ -5,11 +5,11 @@ edition = "2021" [dependencies] # === SARGON CRATES === -assert-json = { path = "../../core/assert-json" } -addresses = { path = "../../crypto/addresses" } -has-sample-values = { path = "../../core/has-sample-values" } -core-misc = { path = "../../core/misc" } -profile-app-preferences = { path = "../../profile/models/app-preferences" } +assert-json = { workspace = true } +addresses = { workspace = true } +has-sample-values = { workspace = true } +core-misc = { workspace = true } +profile-app-preferences = { workspace = true } # === RADIX DEPENDENCIES === # None diff --git a/crates/app/signing-traits/Cargo.toml b/crates/app/signing-traits/Cargo.toml new file mode 100644 index 000000000..70c3e4b78 --- /dev/null +++ b/crates/app/signing-traits/Cargo.toml @@ -0,0 +1,30 @@ +[package] +name = "signing-traits" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +error = { workspace = true } +ecc = { workspace = true } +core-collections = { workspace = true } +bytes = { workspace = true } +hash = { workspace = true } +radix-connect-models = { workspace = true } +transaction-models = { workspace = true } +entity-by-address = { workspace = true } +profile-account-or-persona = { workspace = true } +profile-persona = { workspace = true } +profile-account = { workspace = true } +metadata = { workspace = true } + +# === RADIX DEPENDENCIES === +radix-engine-interface = { workspace = true } +radix-transactions = { workspace = true } + +# === EXTERNAL DEPENDENCIES === +async-trait = { workspace = true } +derive_more = { workspace = true } +indexmap = { workspace = true } +pretty_assertions = { workspace = true } +serde = { workspace = true } diff --git a/crates/app/signing/src/authentication/auth_intent.rs b/crates/app/signing-traits/src/authentication/auth_intent.rs similarity index 100% rename from crates/app/signing/src/authentication/auth_intent.rs rename to crates/app/signing-traits/src/authentication/auth_intent.rs diff --git a/crates/app/signing-traits/src/authentication/auth_intent_hash.rs b/crates/app/signing-traits/src/authentication/auth_intent_hash.rs new file mode 100644 index 000000000..08b92ea96 --- /dev/null +++ b/crates/app/signing-traits/src/authentication/auth_intent_hash.rs @@ -0,0 +1,57 @@ +use crate::prelude::*; + +const ROLA_PREFIX: u8 = 0x52; + +#[derive( + Debug, Clone, PartialEq, Eq, derive_more::Display, std::hash::Hash, +)] +#[display("{}", self.payload.to_hex())] +pub struct AuthIntentHash { + pub payload: BagOfBytes, +} + +impl AuthIntentHash { + pub fn hash(&self) -> Hash { + hash_of(self.payload.clone()) + } +} + +impl From for Hash { + fn from(val: AuthIntentHash) -> Self { + val.hash() + } +} + +impl HasSampleValues for AuthIntentHash { + fn sample() -> Self { + From::::from(AuthIntent::sample()) + } + + fn sample_other() -> Self { + From::::from(AuthIntent::sample_other()) + } +} + +impl From for AuthIntentHash { + /// Constructs a payload to sign in conjunction with the `challenge_nonce` received and + /// the `metadata` of the dApp that sent the request. + /// + /// The logic of constructing the payload is as follows: + /// * Prefixes with constant `ROLA_PREFIX` (0x52) + /// * Extends with the 32 raw bytes of the challenge + /// * Pushes 1 byte which is the length of the bech32-encoded dapp-definition address + /// * Extends with the bytes of the bech32-encoded dapp-definition address + /// * Extends with the bytes of the origin UTF-8 encoded. + fn from(value: AuthIntent) -> Self { + let mut payload = Vec::::new(); + payload.push(ROLA_PREFIX); + payload.extend(value.challenge_nonce.bytes()); + payload.push(value.dapp_definition_address.address().len() as u8); + payload.extend(value.dapp_definition_address.address().bytes()); + payload.extend(value.origin.0.as_bytes()); + + Self { + payload: BagOfBytes::from(payload), + } + } +} diff --git a/crates/app/signing/src/authentication/mod.rs b/crates/app/signing-traits/src/authentication/mod.rs similarity index 100% rename from crates/app/signing/src/authentication/mod.rs rename to crates/app/signing-traits/src/authentication/mod.rs diff --git a/crates/app/signing/src/authentication/signed_auth_intent.rs b/crates/app/signing-traits/src/authentication/signed_auth_intent.rs similarity index 100% rename from crates/app/signing/src/authentication/signed_auth_intent.rs rename to crates/app/signing-traits/src/authentication/signed_auth_intent.rs diff --git a/crates/app/signing/src/extractor_of_entities_requiring_auth.rs b/crates/app/signing-traits/src/extractor_of_entities_requiring_auth.rs similarity index 100% rename from crates/app/signing/src/extractor_of_entities_requiring_auth.rs rename to crates/app/signing-traits/src/extractor_of_entities_requiring_auth.rs diff --git a/crates/app/signing/src/host_interaction/mod.rs b/crates/app/signing-traits/src/host_interaction/mod.rs similarity index 75% rename from crates/app/signing/src/host_interaction/mod.rs rename to crates/app/signing-traits/src/host_interaction/mod.rs index 65d0d7faa..73512add7 100644 --- a/crates/app/signing/src/host_interaction/mod.rs +++ b/crates/app/signing-traits/src/host_interaction/mod.rs @@ -1,9 +1,11 @@ mod sign_interactor; mod sign_request; mod sign_response; +mod sign_with_factors_outcome; mod transaction_sign_request_input; pub use sign_interactor::*; pub use sign_request::*; pub use sign_response::*; +pub use sign_with_factors_outcome::*; pub use transaction_sign_request_input::*; diff --git a/crates/app/signing/src/host_interaction/sign_interactor.rs b/crates/app/signing-traits/src/host_interaction/sign_interactor.rs similarity index 100% rename from crates/app/signing/src/host_interaction/sign_interactor.rs rename to crates/app/signing-traits/src/host_interaction/sign_interactor.rs diff --git a/crates/app/signing/src/host_interaction/sign_request.rs b/crates/app/signing-traits/src/host_interaction/sign_request.rs similarity index 97% rename from crates/app/signing/src/host_interaction/sign_request.rs rename to crates/app/signing-traits/src/host_interaction/sign_request.rs index cb9b49481..59561b247 100644 --- a/crates/app/signing/src/host_interaction/sign_request.rs +++ b/crates/app/signing-traits/src/host_interaction/sign_request.rs @@ -22,7 +22,7 @@ impl SignRequest { /// Panics if `per_factor_source` is empty /// /// Panics if not all factor sources are of the same kind - pub(crate) fn new( + pub fn new( factor_source_kind: FactorSourceKind, per_factor_source: IndexMap< FactorSourceIDFromHash, @@ -55,8 +55,7 @@ impl SignRequest { self.per_factor_source.keys().cloned().collect() } - #[allow(unused)] - pub(crate) fn factor_source_kind(&self) -> FactorSourceKind { + pub fn factor_source_kind(&self) -> FactorSourceKind { self.factor_source_kind } } diff --git a/crates/app/signing/src/host_interaction/sign_response.rs b/crates/app/signing-traits/src/host_interaction/sign_response.rs similarity index 100% rename from crates/app/signing/src/host_interaction/sign_response.rs rename to crates/app/signing-traits/src/host_interaction/sign_response.rs diff --git a/crates/app/signing/src/signatures_outcome_types/sign_with_factors_outcome.rs b/crates/app/signing-traits/src/host_interaction/sign_with_factors_outcome.rs similarity index 82% rename from crates/app/signing/src/signatures_outcome_types/sign_with_factors_outcome.rs rename to crates/app/signing-traits/src/host_interaction/sign_with_factors_outcome.rs index da0e6334b..12fe842e1 100644 --- a/crates/app/signing/src/signatures_outcome_types/sign_with_factors_outcome.rs +++ b/crates/app/signing-traits/src/host_interaction/sign_with_factors_outcome.rs @@ -35,34 +35,25 @@ impl SignWithFactorsOutcome { } } - #[allow(unused)] - pub(crate) fn failure_with_factors( - ids: IndexSet, - ) -> Self { + pub fn failure_with_factors(ids: IndexSet) -> Self { Self::Neglected(NeglectedFactors::new( NeglectFactorReason::Failure, ids, )) } - #[allow(unused)] - pub(crate) fn user_skipped_factors( - ids: IndexSet, - ) -> Self { + pub fn user_skipped_factors(ids: IndexSet) -> Self { Self::Neglected(NeglectedFactors::new( NeglectFactorReason::UserExplicitlySkipped, ids, )) } - #[allow(unused)] - pub(crate) fn user_skipped_factor(id: FactorSourceIDFromHash) -> Self { + pub fn user_skipped_factor(id: FactorSourceIDFromHash) -> Self { Self::user_skipped_factors(IndexSet::from_iter([id])) } - pub(crate) fn irrelevant( - factor_sources_of_kind: &FactorSourcesOfKind, - ) -> Self { + pub fn irrelevant(factor_sources_of_kind: &FactorSourcesOfKind) -> Self { Self::Neglected(NeglectedFactors::new( NeglectFactorReason::Irrelevant, factor_sources_of_kind diff --git a/crates/app/signing/src/host_interaction/transaction_sign_request_input.rs b/crates/app/signing-traits/src/host_interaction/transaction_sign_request_input.rs similarity index 99% rename from crates/app/signing/src/host_interaction/transaction_sign_request_input.rs rename to crates/app/signing-traits/src/host_interaction/transaction_sign_request_input.rs index e3ab61243..f914656b4 100644 --- a/crates/app/signing/src/host_interaction/transaction_sign_request_input.rs +++ b/crates/app/signing-traits/src/host_interaction/transaction_sign_request_input.rs @@ -21,7 +21,7 @@ impl TransactionSignRequestInput { /// Panics if any of the owned factor instances does not match the `factor_source_id`. /// /// Panics if `owned_factor_instances` is empty. - pub(crate) fn new( + pub fn new( payload: S::Payload, factor_source_id: FactorSourceIDFromHash, owned_factor_instances: IndexSet, diff --git a/crates/app/signing/src/types/invalid_transaction_if_neglected.rs b/crates/app/signing-traits/src/invalid_transaction_if_neglected.rs similarity index 100% rename from crates/app/signing/src/types/invalid_transaction_if_neglected.rs rename to crates/app/signing-traits/src/invalid_transaction_if_neglected.rs diff --git a/crates/app/signing-traits/src/lib.rs b/crates/app/signing-traits/src/lib.rs new file mode 100644 index 000000000..ac419c151 --- /dev/null +++ b/crates/app/signing-traits/src/lib.rs @@ -0,0 +1,50 @@ +mod authentication; +mod extractor_of_entities_requiring_auth; +mod host_interaction; +mod invalid_transaction_if_neglected; +mod signables; +mod testing; +mod types; + +pub mod prelude { + pub use crate::authentication::*; + pub use crate::extractor_of_entities_requiring_auth::*; + pub use crate::host_interaction::*; + pub use crate::invalid_transaction_if_neglected::*; + pub use crate::signables::*; + pub use crate::testing::*; + pub use crate::types::*; + + pub(crate) use bytes::prelude::*; + pub(crate) use core_collections::prelude::*; + pub(crate) use ecc::prelude::*; + pub(crate) use entity_by_address::prelude::*; + + pub(crate) use hash::prelude::*; + pub(crate) use metadata::prelude::*; + pub(crate) use profile_account::prelude::*; + pub(crate) use profile_account_or_persona::prelude::*; + pub(crate) use profile_persona::prelude::*; + pub(crate) use radix_connect_models::prelude::*; + pub(crate) use transaction_models::prelude::*; + + pub(crate) use radix_engine_interface::prelude::MetadataValue as ScryptoMetadataValue; + pub(crate) use radix_transactions::prelude::{ + SubintentManifestV2Builder as ScryptoSubintentManifestV2Builder, + TransactionManifestV1Builder as ScryptoTransactionManifestBuilder, + }; + + pub(crate) use indexmap::{IndexMap, IndexSet}; + + pub(crate) use std::fmt::Debug; + pub(crate) use std::sync::Arc; + + #[cfg(test)] + mod testing { + pub(crate) use std::collections::HashSet; + } + #[cfg(test)] + pub(crate) use testing::*; +} + +pub use prelude::*; diff --git a/crates/app/signing/src/signables/mod.rs b/crates/app/signing-traits/src/signables/mod.rs similarity index 100% rename from crates/app/signing/src/signables/mod.rs rename to crates/app/signing-traits/src/signables/mod.rs diff --git a/crates/app/signing/src/signables/signable.rs b/crates/app/signing-traits/src/signables/signable.rs similarity index 100% rename from crates/app/signing/src/signables/signable.rs rename to crates/app/signing-traits/src/signables/signable.rs diff --git a/crates/app/signing-traits/src/signables/signable_auth_intent.rs b/crates/app/signing-traits/src/signables/signable_auth_intent.rs new file mode 100644 index 000000000..770465469 --- /dev/null +++ b/crates/app/signing-traits/src/signables/signable_auth_intent.rs @@ -0,0 +1,64 @@ +use crate::prelude::*; + +impl Signable for AuthIntent { + type ID = AuthIntentHash; + type Payload = Self; + type Signed = SignedAuthIntent; + + fn entities_requiring_signing( + &self, + entity_querying: &impl GetEntityByAddress, + ) -> Result> { + let entities = self + .entities_to_sign + .iter() + .filter_map(|address| match address { + AddressOfAccountOrPersona::Account(account_address) => { + entity_querying + .account_by_address(*account_address) + .map(AccountOrPersona::AccountEntity) + .ok() + } + AddressOfAccountOrPersona::Identity(identity_address) => { + entity_querying + .persona_by_address(*identity_address) + .map(AccountOrPersona::PersonaEntity) + .ok() + } + }) + .collect_vec(); + + Ok(IndexSet::from_iter(entities)) + } + + fn signed( + &self, + signatures_per_owner: IndexMap< + AddressOfAccountOrPersona, + IntentSignature, + >, + ) -> Result { + SignedAuthIntent::new(self.clone(), signatures_per_owner) + } +} + +impl From for AuthIntent { + fn from(val: SignedAuthIntent) -> Self { + val.intent + } +} + +impl IntoIterator for SignedAuthIntent { + type Item = SignatureWithPublicKey; + type IntoIter = as IntoIterator>::IntoIter; + + fn into_iter(self) -> Self::IntoIter { + self.intent_signatures_per_owner + .values() + .map(|s| s.0) + .collect_vec() + .into_iter() + } +} + +impl SignableID for AuthIntentHash {} diff --git a/crates/app/signing/src/signables/signable_subintent.rs b/crates/app/signing-traits/src/signables/signable_subintent.rs similarity index 100% rename from crates/app/signing/src/signables/signable_subintent.rs rename to crates/app/signing-traits/src/signables/signable_subintent.rs diff --git a/crates/app/signing/src/signables/signable_transaction_intent.rs b/crates/app/signing-traits/src/signables/signable_transaction_intent.rs similarity index 100% rename from crates/app/signing/src/signables/signable_transaction_intent.rs rename to crates/app/signing-traits/src/signables/signable_transaction_intent.rs diff --git a/crates/app/signing/src/testing/interactors/mod.rs b/crates/app/signing-traits/src/testing/interactors/mod.rs similarity index 100% rename from crates/app/signing/src/testing/interactors/mod.rs rename to crates/app/signing-traits/src/testing/interactors/mod.rs diff --git a/crates/app/signing/src/testing/interactors/test_interactor.rs b/crates/app/signing-traits/src/testing/interactors/test_interactor.rs similarity index 100% rename from crates/app/signing/src/testing/interactors/test_interactor.rs rename to crates/app/signing-traits/src/testing/interactors/test_interactor.rs diff --git a/crates/app/signing/src/testing/interactors/test_sign_interactor.rs b/crates/app/signing-traits/src/testing/interactors/test_sign_interactor.rs similarity index 100% rename from crates/app/signing/src/testing/interactors/test_sign_interactor.rs rename to crates/app/signing-traits/src/testing/interactors/test_sign_interactor.rs diff --git a/crates/app/signing/src/testing/mod.rs b/crates/app/signing-traits/src/testing/mod.rs similarity index 61% rename from crates/app/signing/src/testing/mod.rs rename to crates/app/signing-traits/src/testing/mod.rs index 05db991bf..a9927515f 100644 --- a/crates/app/signing/src/testing/mod.rs +++ b/crates/app/signing-traits/src/testing/mod.rs @@ -2,8 +2,6 @@ mod interactors; mod simulated_user; -mod test_signatures_collector; pub use interactors::*; pub use simulated_user::*; -pub use test_signatures_collector::*; diff --git a/crates/app/signing/src/testing/simulated_user.rs b/crates/app/signing-traits/src/testing/simulated_user.rs similarity index 100% rename from crates/app/signing/src/testing/simulated_user.rs rename to crates/app/signing-traits/src/testing/simulated_user.rs diff --git a/crates/app/signing/src/types/hd_signature.rs b/crates/app/signing-traits/src/types/hd_signature.rs similarity index 95% rename from crates/app/signing/src/types/hd_signature.rs rename to crates/app/signing-traits/src/types/hd_signature.rs index 2a16162f5..2672278c7 100644 --- a/crates/app/signing/src/types/hd_signature.rs +++ b/crates/app/signing-traits/src/types/hd_signature.rs @@ -17,6 +17,14 @@ pub struct HDSignature { pub signature: SignatureWithPublicKey, } +impl FactorSourceReferencing for HDSignature { + fn factor_source_id(&self) -> FactorSourceIDFromHash { + self.owned_factor_instance() + .factor_instance() + .factor_source_id + } +} + impl HDSignature { /// Constructs a HDSignature from an already produced `Signature`. pub fn new( diff --git a/crates/app/signing/src/types/hd_signature_input.rs b/crates/app/signing-traits/src/types/hd_signature_input.rs similarity index 100% rename from crates/app/signing/src/types/hd_signature_input.rs rename to crates/app/signing-traits/src/types/hd_signature_input.rs diff --git a/crates/app/signing/src/types/mod.rs b/crates/app/signing-traits/src/types/mod.rs similarity index 62% rename from crates/app/signing/src/types/mod.rs rename to crates/app/signing-traits/src/types/mod.rs index 62f30511f..b97136931 100644 --- a/crates/app/signing/src/types/mod.rs +++ b/crates/app/signing-traits/src/types/mod.rs @@ -1,9 +1,9 @@ mod hd_signature; mod hd_signature_input; -mod invalid_transaction_if_neglected; +mod neglected_factor_instance; mod owned_types; pub use hd_signature::*; pub use hd_signature_input::*; -pub use invalid_transaction_if_neglected::*; +pub use neglected_factor_instance::*; pub use owned_types::*; diff --git a/crates/app/signing/src/petition_types/petition_for_factors_types/neglected_factor_instance.rs b/crates/app/signing-traits/src/types/neglected_factor_instance.rs similarity index 94% rename from crates/app/signing/src/petition_types/petition_for_factors_types/neglected_factor_instance.rs rename to crates/app/signing-traits/src/types/neglected_factor_instance.rs index bd18f497b..b3280e14c 100644 --- a/crates/app/signing/src/petition_types/petition_for_factors_types/neglected_factor_instance.rs +++ b/crates/app/signing-traits/src/types/neglected_factor_instance.rs @@ -30,7 +30,7 @@ impl Debug for AbstractNeglectedFactor { impl NeglectedFactorInstance { /// Maps from `Neglected` /// to `Neglected`, - pub(crate) fn as_neglected_factor(&self) -> NeglectedFactor { + pub fn as_neglected_factor(&self) -> NeglectedFactor { NeglectedFactor::new(self.reason, self.factor_source_id()) } } @@ -62,8 +62,7 @@ impl HasSampleValues for NeglectedFactorInstance { } /// ID to some neglected factor source, with the reason why it was neglected (skipped/failed) -pub(crate) type NeglectedFactor = - AbstractNeglectedFactor; +pub type NeglectedFactor = AbstractNeglectedFactor; /// IDs to some neglected factor source, with the reason why they were neglected (skipped/failed) pub type NeglectedFactors = @@ -85,7 +84,7 @@ impl HasSampleValues for NeglectedFactors { } /// A HierarchicalDeterministicFactorInstance which was rejected, with the reason why (skipped/failed) -pub(crate) type NeglectedFactorInstance = +pub type NeglectedFactorInstance = AbstractNeglectedFactor; /// Reason why some FactorSource was neglected, either explicitly skipped by the user diff --git a/crates/app/signing/src/types/owned_types/mod.rs b/crates/app/signing-traits/src/types/owned_types/mod.rs similarity index 100% rename from crates/app/signing/src/types/owned_types/mod.rs rename to crates/app/signing-traits/src/types/owned_types/mod.rs diff --git a/crates/app/signing/src/types/owned_types/owned.rs b/crates/app/signing-traits/src/types/owned_types/owned.rs similarity index 100% rename from crates/app/signing/src/types/owned_types/owned.rs rename to crates/app/signing-traits/src/types/owned_types/owned.rs diff --git a/crates/app/signing/src/types/owned_types/owned_factor_instance.rs b/crates/app/signing-traits/src/types/owned_types/owned_factor_instance.rs similarity index 100% rename from crates/app/signing/src/types/owned_types/owned_factor_instance.rs rename to crates/app/signing-traits/src/types/owned_types/owned_factor_instance.rs diff --git a/crates/app/signing/Cargo.toml b/crates/app/signing/Cargo.toml index 23696de61..5cded8007 100644 --- a/crates/app/signing/Cargo.toml +++ b/crates/app/signing/Cargo.toml @@ -6,27 +6,28 @@ build = "build.rs" [dependencies] # === SARGON CRATES === -assert-json = { path = "../../core/assert-json" } -addresses = { path = "../../crypto/addresses" } -has-sample-values = { path = "../../core/has-sample-values" } -core-misc = { path = "../../core/misc" } -core-collections = { path = "../../core/collections" } -bytes = { path = "../../common/bytes" } -ecc = { path = "../../crypto/ecc" } -metadata = { path = "../../common/metadata" } -hash = { path = "../../crypto/hash" } -cap26-models = { path = "../../crypto/cap26-models" } -transaction-models = { path = "../../transaction/models" } -network = { path = "../../common/network" } -identified-vec-of = { path = "../../common/identified-vec-of" } -radix-connect-models = { path = "../../app/radix-connect-models" } -profile-account-or-persona = { path = "../../profile/models/account-or-persona" } -profile-persona = { path = "../../profile/models/persona" } -profile-base-entity = { path = "../../profile/models/base-entity" } -profile-account = { path = "../../profile/models/account" } -entity-foundation = { path = "../../common/entity-foundation" } -profile-security-structures = { path = "../../profile/models/security-structures" } # TODO only RoleKind and FactorListKind and GeneralRoleWithHierarchicalDeterministicFactorInstances? maybe move to a smaller crate? -entity-by-address = { path = "../../profile/traits/entity-by-address" } +assert-json = { workspace = true } +addresses = { workspace = true } +has-sample-values = { workspace = true } +core-misc = { workspace = true } +core-collections = { workspace = true } +bytes = { workspace = true } +ecc = { workspace = true } +metadata = { workspace = true } +hash = { workspace = true } +cap26-models = { workspace = true } +transaction-models = { workspace = true } +network = { workspace = true } +identified-vec-of = { workspace = true } +radix-connect-models = { workspace = true } +profile-account-or-persona = { workspace = true } +profile-persona = { workspace = true } +profile-base-entity = { workspace = true } +profile-account = { workspace = true } +entity-foundation = { workspace = true } +profile-security-structures = { workspace = true } # TODO only RoleKind and FactorListKind and GeneralRoleWithHierarchicalDeterministicFactorInstances? maybe move to a smaller crate? +entity-by-address = { workspace = true } +signing-traits = { workspace = true } # === RADIX DEPENDENCIES === radix-engine-interface = { workspace = true } diff --git a/crates/app/signing/src/collector/extractor_of_instances_required_to_sign_transactions.rs b/crates/app/signing/src/collector/extractor_of_instances_required_to_sign_transactions.rs index 1c48483d6..2fa7de424 100644 --- a/crates/app/signing/src/collector/extractor_of_instances_required_to_sign_transactions.rs +++ b/crates/app/signing/src/collector/extractor_of_instances_required_to_sign_transactions.rs @@ -214,3 +214,116 @@ mod tests { ); } } + +#[cfg(test)] +mod auth_intent_tests { + use super::*; + + #[allow(clippy::upper_case_acronyms)] + type SUT = AuthIntent; + + #[test] + fn test_get_entities_requiring_signing() { + let profile = ProtoProfile::new( + [Account::sample_alice()], + [Persona::sample_mainnet()], + [FactorSource::sample_device()], + ); + let accounts_in_profile = profile.accounts.clone(); + let personas_in_profile = profile.personas.clone(); + + let unknown_account_address_to_profile = + AddressOfAccountOrPersona::Account( + Account::sample_mainnet_bob().address, + ); + let unknown_identity_address_to_profile = + AddressOfAccountOrPersona::Identity( + Persona::sample_mainnet_third().address, + ); + + let mut addresses_requested = accounts_in_profile + .clone() + .into_iter() + .map(|account| AddressOfAccountOrPersona::Account(account.address)) + .collect_vec(); + // Push an unknown address, this should be filtered out from the result + addresses_requested.push(unknown_account_address_to_profile); + + addresses_requested.extend( + personas_in_profile + .clone() + .into_iter() + .map(|persona| { + AddressOfAccountOrPersona::Identity(persona.address) + }) + .collect_vec(), + ); + addresses_requested.push(unknown_identity_address_to_profile); + + let auth_intent = SUT::new_from_request( + DappToWalletInteractionAuthChallengeNonce::sample(), + DappToWalletInteractionMetadata::sample(), + addresses_requested, + ) + .unwrap(); + + let mut expected_entities = accounts_in_profile + .into_iter() + .map(AccountOrPersona::AccountEntity) + .collect_vec(); + + expected_entities.extend( + personas_in_profile + .into_iter() + .map(AccountOrPersona::PersonaEntity), + ); + + assert_eq!( + auth_intent.entities_requiring_signing(&profile).unwrap(), + IndexSet::::from_iter(expected_entities) + ) + } + + #[test] + fn test_signed() { + let sut = SUT::sample_other(); + let mnemonic_with_passphrase = MnemonicWithPassphrase::sample(); + let signature = mnemonic_with_passphrase + .sign(&sut.auth_intent_hash().hash(), &DerivationPath::sample()); + let intent_signatures = IndexMap::kv( + AddressOfAccountOrPersona::sample(), + IntentSignature(signature), + ); + + let signed = sut.signed(intent_signatures.clone()).unwrap(); + + assert_eq!( + signed, + SignedAuthIntent::new(sut.clone(), intent_signatures).unwrap() + ); + assert_eq!(AuthIntent::from(signed), sut) + } + + #[test] + fn test_signed_get_signatures() { + let sut = SUT::sample(); + let mnemonic_with_passphrase = MnemonicWithPassphrase::sample(); + let signature = mnemonic_with_passphrase + .sign(&sut.auth_intent_hash().hash(), &DerivationPath::sample()); + let intent_signatures = IndexMap::kv( + AddressOfAccountOrPersona::sample(), + IntentSignature(signature), + ); + + let signed = sut.signed(intent_signatures.clone()).unwrap(); + + assert_eq!( + signed.into_iter().collect_vec(), + intent_signatures + .values() + .cloned() + .map(|i| i.0) + .collect_vec() + ) + } +} diff --git a/crates/app/signing/src/lib.rs b/crates/app/signing/src/lib.rs index e7b996bbf..ac75afe36 100644 --- a/crates/app/signing/src/lib.rs +++ b/crates/app/signing/src/lib.rs @@ -1,36 +1,24 @@ -mod authentication; mod collector; -mod extractor_of_entities_requiring_auth; -mod host_interaction; mod petition_types; mod signable_with_entities; -mod signables; mod signatures_outcome_types; -mod testing; -mod types; + +#[cfg(test)] +mod tests; pub mod prelude { - pub use crate::authentication::*; pub use crate::collector::*; - pub use crate::extractor_of_entities_requiring_auth::*; - pub use crate::host_interaction::*; pub use crate::petition_types::*; pub(crate) use crate::signable_with_entities::*; - pub use crate::signables::*; pub use crate::signatures_outcome_types::*; - pub use crate::testing::*; - pub use crate::types::*; pub(crate) use addresses::prelude::*; pub(crate) use bytes::prelude::*; pub(crate) use cap26_models::prelude::*; pub(crate) use core_collections::prelude::*; - pub(crate) use ecc::prelude::*; pub(crate) use entity_by_address::prelude::*; - pub(crate) use hash::prelude::*; + pub(crate) use identified_vec_of::prelude::*; - pub(crate) use metadata::prelude::*; - pub(crate) use network::prelude::*; pub(crate) use profile_account::prelude::*; pub(crate) use profile_account_or_persona::prelude::*; pub(crate) use profile_base_entity::prelude::*; @@ -39,21 +27,21 @@ pub mod prelude { FactorListKind, GeneralRoleWithHierarchicalDeterministicFactorInstances, RoleKind, }; - pub(crate) use radix_connect_models::prelude::*; + pub(crate) use signing_traits::prelude::*; pub(crate) use transaction_models::prelude::*; - pub(crate) use radix_engine_interface::prelude::MetadataValue as ScryptoMetadataValue; - pub(crate) use radix_transactions::prelude::{ - SubintentManifestV2Builder as ScryptoSubintentManifestV2Builder, - TransactionManifestV1Builder as ScryptoTransactionManifestBuilder, - }; - pub(crate) use log::*; pub(crate) use std::collections::{HashMap, HashSet}; pub(crate) use std::sync::{Arc, RwLock}; #[cfg(test)] - pub(crate) use serde::Deserialize; + mod testing { + + pub(crate) use radix_connect_models::prelude::*; + pub(crate) use serde::Deserialize; + } + #[cfg(test)] + pub(crate) use testing::*; } pub use prelude::*; diff --git a/crates/app/signing/src/petition_types/mod.rs b/crates/app/signing/src/petition_types/mod.rs index b43cd662c..029a72aa8 100644 --- a/crates/app/signing/src/petition_types/mod.rs +++ b/crates/app/signing/src/petition_types/mod.rs @@ -10,5 +10,6 @@ pub use petition_for_transaction::*; pub(crate) use petition_status::*; pub use petitions::*; -pub use petition_for_factors_types::*; pub use signing_purpose::*; + +pub(crate) use petition_for_factors_types::*; diff --git a/crates/app/signing/src/petition_types/petition_for_factors_types/factor_source_referencing.rs b/crates/app/signing/src/petition_types/petition_for_factors_types/factor_source_referencing.rs deleted file mode 100644 index 1ead9f2e0..000000000 --- a/crates/app/signing/src/petition_types/petition_for_factors_types/factor_source_referencing.rs +++ /dev/null @@ -1,9 +0,0 @@ -use crate::prelude::*; - -impl FactorSourceReferencing for HDSignature { - fn factor_source_id(&self) -> FactorSourceIDFromHash { - self.owned_factor_instance() - .factor_instance() - .factor_source_id - } -} diff --git a/crates/app/signing/src/petition_types/petition_for_factors_types/mod.rs b/crates/app/signing/src/petition_types/petition_for_factors_types/mod.rs index c5d21dd6b..ec469ca49 100644 --- a/crates/app/signing/src/petition_types/petition_for_factors_types/mod.rs +++ b/crates/app/signing/src/petition_types/petition_for_factors_types/mod.rs @@ -1,7 +1,3 @@ -mod factor_source_referencing; -mod neglected_factor_instance; mod petition_for_factors; pub(crate) use petition_for_factors::*; - -pub use neglected_factor_instance::*; diff --git a/crates/app/signing/src/signables/signable_auth_intent.rs b/crates/app/signing/src/signables/signable_auth_intent.rs deleted file mode 100644 index 5f7a22148..000000000 --- a/crates/app/signing/src/signables/signable_auth_intent.rs +++ /dev/null @@ -1,177 +0,0 @@ -use crate::prelude::*; - -impl Signable for AuthIntent { - type ID = AuthIntentHash; - type Payload = Self; - type Signed = SignedAuthIntent; - - fn entities_requiring_signing( - &self, - entity_querying: &impl GetEntityByAddress, - ) -> Result> { - let entities = self - .entities_to_sign - .iter() - .filter_map(|address| match address { - AddressOfAccountOrPersona::Account(account_address) => { - entity_querying - .account_by_address(*account_address) - .map(AccountOrPersona::AccountEntity) - .ok() - } - AddressOfAccountOrPersona::Identity(identity_address) => { - entity_querying - .persona_by_address(*identity_address) - .map(AccountOrPersona::PersonaEntity) - .ok() - } - }) - .collect_vec(); - - Ok(IndexSet::from_iter(entities)) - } - - fn signed( - &self, - signatures_per_owner: IndexMap< - AddressOfAccountOrPersona, - IntentSignature, - >, - ) -> Result { - SignedAuthIntent::new(self.clone(), signatures_per_owner) - } -} - -impl From for AuthIntent { - fn from(val: SignedAuthIntent) -> Self { - val.intent - } -} - -impl IntoIterator for SignedAuthIntent { - type Item = SignatureWithPublicKey; - type IntoIter = as IntoIterator>::IntoIter; - - fn into_iter(self) -> Self::IntoIter { - self.intent_signatures_per_owner - .values() - .map(|s| s.0) - .collect_vec() - .into_iter() - } -} - -impl SignableID for AuthIntentHash {} - -#[cfg(test)] -mod tests { - use super::*; - - #[allow(clippy::upper_case_acronyms)] - type SUT = AuthIntent; - - #[test] - fn test_get_entities_requiring_signing() { - let profile = ProtoProfile::new( - [Account::sample_alice()], - [Persona::sample_mainnet()], - [FactorSource::sample_device()], - ); - let accounts_in_profile = profile.accounts.clone(); - let personas_in_profile = profile.personas.clone(); - - let unknown_account_address_to_profile = - AddressOfAccountOrPersona::Account( - Account::sample_mainnet_bob().address, - ); - let unknown_identity_address_to_profile = - AddressOfAccountOrPersona::Identity( - Persona::sample_mainnet_third().address, - ); - - let mut addresses_requested = accounts_in_profile - .clone() - .into_iter() - .map(|account| AddressOfAccountOrPersona::Account(account.address)) - .collect_vec(); - // Push an unknown address, this should be filtered out from the result - addresses_requested.push(unknown_account_address_to_profile); - - addresses_requested.extend( - personas_in_profile - .clone() - .into_iter() - .map(|persona| { - AddressOfAccountOrPersona::Identity(persona.address) - }) - .collect_vec(), - ); - addresses_requested.push(unknown_identity_address_to_profile); - - let auth_intent = SUT::new_from_request( - DappToWalletInteractionAuthChallengeNonce::sample(), - DappToWalletInteractionMetadata::sample(), - addresses_requested, - ) - .unwrap(); - - let mut expected_entities = accounts_in_profile - .into_iter() - .map(AccountOrPersona::AccountEntity) - .collect_vec(); - - expected_entities.extend( - personas_in_profile - .into_iter() - .map(AccountOrPersona::PersonaEntity), - ); - - assert_eq!( - auth_intent.entities_requiring_signing(&profile).unwrap(), - IndexSet::::from_iter(expected_entities) - ) - } - - #[test] - fn test_signed() { - let sut = SUT::sample_other(); - let mnemonic_with_passphrase = MnemonicWithPassphrase::sample(); - let signature = mnemonic_with_passphrase - .sign(&sut.auth_intent_hash().hash(), &DerivationPath::sample()); - let intent_signatures = IndexMap::kv( - AddressOfAccountOrPersona::sample(), - IntentSignature(signature), - ); - - let signed = sut.signed(intent_signatures.clone()).unwrap(); - - assert_eq!( - signed, - SignedAuthIntent::new(sut.clone(), intent_signatures).unwrap() - ); - assert_eq!(AuthIntent::from(signed), sut) - } - - #[test] - fn test_signed_get_signatures() { - let sut = SUT::sample(); - let mnemonic_with_passphrase = MnemonicWithPassphrase::sample(); - let signature = mnemonic_with_passphrase - .sign(&sut.auth_intent_hash().hash(), &DerivationPath::sample()); - let intent_signatures = IndexMap::kv( - AddressOfAccountOrPersona::sample(), - IntentSignature(signature), - ); - - let signed = sut.signed(intent_signatures.clone()).unwrap(); - - assert_eq!( - signed.into_iter().collect_vec(), - intent_signatures - .values() - .cloned() - .map(|i| i.0) - .collect_vec() - ) - } -} diff --git a/crates/app/signing/src/signatures_outcome_types/mod.rs b/crates/app/signing/src/signatures_outcome_types/mod.rs index 7342ea650..b0505b40f 100644 --- a/crates/app/signing/src/signatures_outcome_types/mod.rs +++ b/crates/app/signing/src/signatures_outcome_types/mod.rs @@ -1,9 +1,7 @@ mod maybe_signed_transactions; mod petition_transaction_outcome; -mod sign_with_factors_outcome; mod signatures_outcome; pub use maybe_signed_transactions::*; pub(crate) use petition_transaction_outcome::*; -pub use sign_with_factors_outcome::*; pub use signatures_outcome::*; diff --git a/crates/app/signing/src/authentication/auth_intent_hash.rs b/crates/app/signing/src/tests/auth_intent_hash.rs similarity index 69% rename from crates/app/signing/src/authentication/auth_intent_hash.rs rename to crates/app/signing/src/tests/auth_intent_hash.rs index c40923bf0..7cb45ceb9 100644 --- a/crates/app/signing/src/authentication/auth_intent_hash.rs +++ b/crates/app/signing/src/tests/auth_intent_hash.rs @@ -1,66 +1,8 @@ -use crate::prelude::*; - -const ROLA_PREFIX: u8 = 0x52; - -#[derive( - Debug, Clone, PartialEq, Eq, derive_more::Display, std::hash::Hash, -)] -#[display("{}", self.payload.to_hex())] -pub struct AuthIntentHash { - pub payload: BagOfBytes, -} - -impl AuthIntentHash { - pub fn hash(&self) -> Hash { - hash_of(self.payload.clone()) - } -} - -impl From for Hash { - fn from(val: AuthIntentHash) -> Self { - val.hash() - } -} - -impl HasSampleValues for AuthIntentHash { - fn sample() -> Self { - From::::from(AuthIntent::sample()) - } - - fn sample_other() -> Self { - From::::from(AuthIntent::sample_other()) - } -} - -impl From for AuthIntentHash { - /// Constructs a payload to sign in conjunction with the `challenge_nonce` received and - /// the `metadata` of the dApp that sent the request. - /// - /// The logic of constructing the payload is as follows: - /// * Prefixes with constant `ROLA_PREFIX` (0x52) - /// * Extends with the 32 raw bytes of the challenge - /// * Pushes 1 byte which is the length of the bech32-encoded dapp-definition address - /// * Extends with the bytes of the bech32-encoded dapp-definition address - /// * Extends with the bytes of the origin UTF-8 encoded. - fn from(value: AuthIntent) -> Self { - let mut payload = Vec::::new(); - payload.push(ROLA_PREFIX); - payload.extend(value.challenge_nonce.bytes()); - payload.push(value.dapp_definition_address.address().len() as u8); - payload.extend(value.dapp_definition_address.address().bytes()); - payload.extend(value.origin.0.as_bytes()); - - Self { - payload: BagOfBytes::from(payload), - } - } -} - #[cfg(test)] mod tests { use serde::{de, Deserializer}; - use super::*; + use crate::prelude::*; #[allow(clippy::upper_case_acronyms)] type SUT = AuthIntentHash; diff --git a/crates/app/signing/src/tests/mod.rs b/crates/app/signing/src/tests/mod.rs new file mode 100644 index 000000000..eefc92a4f --- /dev/null +++ b/crates/app/signing/src/tests/mod.rs @@ -0,0 +1,4 @@ +mod test_signatures_collector; + +#[cfg(test)] +mod auth_intent_hash; diff --git a/crates/app/signing/src/testing/test_signatures_collector.rs b/crates/app/signing/src/tests/test_signatures_collector.rs similarity index 99% rename from crates/app/signing/src/testing/test_signatures_collector.rs rename to crates/app/signing/src/tests/test_signatures_collector.rs index 82be54b80..676bfc2dd 100644 --- a/crates/app/signing/src/testing/test_signatures_collector.rs +++ b/crates/app/signing/src/tests/test_signatures_collector.rs @@ -18,6 +18,7 @@ impl SignaturesCollector { purpose, ) } + pub(crate) fn new_test( finish_early_strategy: SigningFinishEarlyStrategy, all_factor_sources_in_profile: impl IntoIterator, diff --git a/crates/common/build-info/Cargo.toml b/crates/common/build-info/Cargo.toml new file mode 100644 index 000000000..a71575da5 --- /dev/null +++ b/crates/common/build-info/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "build-info" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +assert-json = { workspace = true } +error = { workspace = true } +has-sample-values = { workspace = true } + +# === RADIX DEPENDENCIES === +radix-engine = { workspace = true } +radix-engine-toolkit = { workspace = true } + +# === EXTERNAL DEPENDENCIES === +derive_more = { workspace = true } +enum-as-inner = { workspace = true } + +[build-dependencies] +cargo_toml = { workspace = true } diff --git a/crates/common/build-info/build.rs b/crates/common/build-info/build.rs new file mode 100644 index 000000000..07546a99a --- /dev/null +++ b/crates/common/build-info/build.rs @@ -0,0 +1,40 @@ +use cargo_toml::{Dependency, Manifest}; +use std::env; +use std::path::Path; + +pub fn main() { + let manifest_path = + Path::new(env!("CARGO_MANIFEST_DIR")).join("Cargo.toml"); + + let manifest = Manifest::from_path(manifest_path).expect("Can't panic"); + let dependencies = manifest.dependencies; + + let set_dep_env = |key: &str| { + let dependency = dependencies.get(key).expect("Can't panic"); + let env_var_value = match dependency { + Dependency::Simple(version) => format!("version={version}"), + Dependency::Inherited(_) => { + panic!("Inherited dependency is not supported") + } + Dependency::Detailed(detailed) => { + if let Some(ref version) = detailed.version { + format!("version={version}") + } else if let Some(ref branch) = detailed.branch { + format!("branch={branch}") + } else if let Some(ref tag) = detailed.tag { + format!("tag={tag}") + } else if let Some(ref rev) = detailed.rev { + format!("rev={rev}") + } else { + panic!("Can't find version of {key} dependency") + } + } + }; + let env_var = + format!("{}_DEPENDENCY={}", key.to_uppercase(), env_var_value); + println!("cargo:rustc-env={}", env_var); + }; + + set_dep_env("radix-engine"); + set_dep_env("radix-engine-toolkit"); +} diff --git a/crates/transaction/manifests/src/high_level/sargon_specific_types/build_information/dependency_information.rs b/crates/common/build-info/src/build_information/dependency_information.rs similarity index 98% rename from crates/transaction/manifests/src/high_level/sargon_specific_types/build_information/dependency_information.rs rename to crates/common/build-info/src/build_information/dependency_information.rs index 75cd9ef1e..1d4b4bd7b 100644 --- a/crates/transaction/manifests/src/high_level/sargon_specific_types/build_information/dependency_information.rs +++ b/crates/common/build-info/src/build_information/dependency_information.rs @@ -5,7 +5,7 @@ use crate::prelude::*; PartialEq, Eq, Hash, - EnumAsInner, + enum_as_inner::EnumAsInner, derive_more::Display, derive_more::Debug, )] diff --git a/crates/transaction/manifests/src/high_level/sargon_specific_types/build_information/mod.rs b/crates/common/build-info/src/build_information/mod.rs similarity index 100% rename from crates/transaction/manifests/src/high_level/sargon_specific_types/build_information/mod.rs rename to crates/common/build-info/src/build_information/mod.rs diff --git a/crates/transaction/manifests/src/high_level/sargon_specific_types/build_information/sargon_build_information.rs b/crates/common/build-info/src/build_information/sargon_build_information.rs similarity index 100% rename from crates/transaction/manifests/src/high_level/sargon_specific_types/build_information/sargon_build_information.rs rename to crates/common/build-info/src/build_information/sargon_build_information.rs diff --git a/crates/transaction/manifests/src/high_level/sargon_specific_types/build_information/sargon_dependencies.rs b/crates/common/build-info/src/build_information/sargon_dependencies.rs similarity index 100% rename from crates/transaction/manifests/src/high_level/sargon_specific_types/build_information/sargon_dependencies.rs rename to crates/common/build-info/src/build_information/sargon_dependencies.rs diff --git a/crates/common/build-info/src/lib.rs b/crates/common/build-info/src/lib.rs new file mode 100644 index 000000000..ede8ec55d --- /dev/null +++ b/crates/common/build-info/src/lib.rs @@ -0,0 +1,9 @@ +mod build_information; + +pub mod prelude { + pub use crate::build_information::*; + + pub(crate) use has_sample_values::prelude::*; +} + +pub use prelude::*; diff --git a/crates/common/bytes/Cargo.toml b/crates/common/bytes/Cargo.toml index b2efa63ac..d1e34aba0 100644 --- a/crates/common/bytes/Cargo.toml +++ b/crates/common/bytes/Cargo.toml @@ -5,9 +5,9 @@ edition = "2021" [dependencies] # === SARGON CRATES === -assert-json = { path = "../../core/assert-json" } -error = { path = "../../core/error" } -has-sample-values = { path = "../../core/has-sample-values" } +assert-json = { workspace = true } +error = { workspace = true } +has-sample-values = { workspace = true } # === RADIX DEPENDENCIES === # None diff --git a/crates/common/entity-foundation/Cargo.toml b/crates/common/entity-foundation/Cargo.toml index 500eaa06c..f9f56c6ae 100644 --- a/crates/common/entity-foundation/Cargo.toml +++ b/crates/common/entity-foundation/Cargo.toml @@ -5,9 +5,9 @@ edition = "2021" [dependencies] # === SARGON CRATES === -assert-json = { path = "../../core/assert-json" } -error = { path = "../../core/error" } -has-sample-values = { path = "../../core/has-sample-values" } +assert-json = { workspace = true } +error = { workspace = true } +has-sample-values = { workspace = true } # === RADIX DEPENDENCIES === # None diff --git a/crates/common/host-info/Cargo.toml b/crates/common/host-info/Cargo.toml index 8b1c0d925..550c4a7e7 100644 --- a/crates/common/host-info/Cargo.toml +++ b/crates/common/host-info/Cargo.toml @@ -5,9 +5,9 @@ edition = "2021" [dependencies] # === SARGON CRATES === -assert-json = { path = "../../core/assert-json" } -has-sample-values = { path = "../../core/has-sample-values" } -time-utils = { path = "../../core/time-utils" } +assert-json = { workspace = true } +has-sample-values = { workspace = true } +time-utils = { workspace = true } # === RADIX DEPENDENCIES === # None diff --git a/crates/common/identified-vec-of/Cargo.toml b/crates/common/identified-vec-of/Cargo.toml index e97a16706..d2edb21f6 100644 --- a/crates/common/identified-vec-of/Cargo.toml +++ b/crates/common/identified-vec-of/Cargo.toml @@ -5,8 +5,8 @@ edition = "2021" [dependencies] # === SARGON CRATES === -assert-json = { path = "../../core/assert-json" } -error = { path = "../../core/error" } +assert-json = { workspace = true } +error = { workspace = true } # === RADIX DEPENDENCIES # None diff --git a/crates/common/metadata/Cargo.toml b/crates/common/metadata/Cargo.toml index fa2c55885..1277a11b8 100644 --- a/crates/common/metadata/Cargo.toml +++ b/crates/common/metadata/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" [dependencies] # === SARGON CRATES === -has-sample-values = { path = "../../core/has-sample-values" } +has-sample-values = { workspace = true } # === RADIX DEPENDENCIES === radix-engine-interface = { workspace = true } diff --git a/crates/common/network/Cargo.toml b/crates/common/network/Cargo.toml index 7910dbd32..41888c0db 100644 --- a/crates/common/network/Cargo.toml +++ b/crates/common/network/Cargo.toml @@ -5,9 +5,9 @@ edition = "2021" [dependencies] # === SARGON CRATES === -assert-json = { path = "../../core/assert-json" } -has-sample-values = { path = "../../core/has-sample-values" } -numeric = { path = "../../common/numeric" } +assert-json = { workspace = true } +has-sample-values = { workspace = true } +numeric = { workspace = true } # === RADIX DEPENDENCIES === radix-common = { workspace = true } diff --git a/crates/common/numeric/Cargo.toml b/crates/common/numeric/Cargo.toml index c78f02a28..1096adf4c 100644 --- a/crates/common/numeric/Cargo.toml +++ b/crates/common/numeric/Cargo.toml @@ -5,9 +5,9 @@ edition = "2021" [dependencies] # === INTERNAL DEPENDENCIES === -error = { path = "../../core/error" } -has-sample-values = { path = "../../core/has-sample-values" } -bytes = { path = "../../common/bytes" } +error = { workspace = true } +has-sample-values = { workspace = true } +bytes = { workspace = true } # === RADIX DEPENDENCIES === radix-common = { workspace = true } diff --git a/crates/common/short-string/Cargo.toml b/crates/common/short-string/Cargo.toml index 32b156234..8023a8cf0 100644 --- a/crates/common/short-string/Cargo.toml +++ b/crates/common/short-string/Cargo.toml @@ -5,10 +5,10 @@ edition = "2021" [dependencies] # === SARGON CRATES === -identified-vec-of = { path = "../../common/identified-vec-of" } -assert-json = { path = "../../core/assert-json" } -core-utils = { path = "../../core/utils" } -has-sample-values = { path = "../../core/has-sample-values" } +identified-vec-of = { workspace = true } +assert-json = { workspace = true } +core-utils = { workspace = true } +has-sample-values = { workspace = true } # === RADIX DEPENDENCIES === # None diff --git a/crates/common/short-string/src/email_address.rs b/crates/common/short-string/src/email_address.rs index 2a8a3f6bf..700acc8e5 100644 --- a/crates/common/short-string/src/email_address.rs +++ b/crates/common/short-string/src/email_address.rs @@ -41,9 +41,8 @@ impl FromStr for EmailAddress { impl EmailAddress { pub fn new(email: impl AsRef) -> Result { let email = email.as_ref().to_owned(); - if email.is_empty() { - return Err(CommonError::EmailAddressEmpty); - } + // Apparently we allows empty string? + // https://rdxworks.slack.com/archives/C031A0V1A1W/p1736262231737039?thread_ts=1736236976.987429&cid=C031A0V1A1W ShortString::new(email).map(Self) } } @@ -75,8 +74,8 @@ mod tests { } #[test] - fn invalid_empty() { - assert_eq!(EmailAddress::new(""), Err(CommonError::EmailAddressEmpty)); + fn empty_is_valid() { + assert_eq!(EmailAddress::new("").unwrap().to_string(), String::new()); } #[test] diff --git a/crates/core/assert-json/Cargo.toml b/crates/core/assert-json/Cargo.toml index 82d572e6f..aebf04e1f 100644 --- a/crates/core/assert-json/Cargo.toml +++ b/crates/core/assert-json/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" [dependencies] # === SARGON CRATES === -error = { path = "../../core/error" } +error = { workspace = true } # === RADIX DEPENDENCIES === # None diff --git a/crates/core/collections/Cargo.toml b/crates/core/collections/Cargo.toml index 3488c635a..2935e2369 100644 --- a/crates/core/collections/Cargo.toml +++ b/crates/core/collections/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" [dependencies] # === SARGON CRATES === -has-sample-values = { path = "../../core/has-sample-values" } +has-sample-values = { workspace = true } # === RADIX DEPENDENCIES === # None diff --git a/crates/core/has-sample-values/Cargo.toml b/crates/core/has-sample-values/Cargo.toml index 86c3f2a44..4dd14c90f 100644 --- a/crates/core/has-sample-values/Cargo.toml +++ b/crates/core/has-sample-values/Cargo.toml @@ -4,7 +4,7 @@ version = "1.1.99" edition = "2021" [dependencies] -error = { path = "../../core/error" } +error = { workspace = true } # ==== RADIX DEPENDENCIES ==== # None diff --git a/crates/core/misc/Cargo.toml b/crates/core/misc/Cargo.toml index 26188bc35..4e43dc050 100644 --- a/crates/core/misc/Cargo.toml +++ b/crates/core/misc/Cargo.toml @@ -5,10 +5,10 @@ edition = "2021" [dependencies] # === SARGON CRATES === -assert-json = { path = "../../core/assert-json" } -error = { path = "../../core/error" } -core-utils = { path = "../../core/utils" } -has-sample-values = { path = "../../core/has-sample-values" } +assert-json = { workspace = true } +error = { workspace = true } +core-utils = { workspace = true } +has-sample-values = { workspace = true } # === RADIX DEPENDENCIES === radix-common = { workspace = true } diff --git a/crates/core/utils/Cargo.toml b/crates/core/utils/Cargo.toml index f1e07601c..1ac8f4379 100644 --- a/crates/core/utils/Cargo.toml +++ b/crates/core/utils/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" [dependencies] # === SARGON CRATES === -error = { path = "../../core/error" } +error = { workspace = true } # === EXTERNAL DEPENDENCIES === iso8601-timestamp = { workspace = true } diff --git a/crates/crypto/addresses/Cargo.toml b/crates/crypto/addresses/Cargo.toml index 3c838ef32..06b9b501a 100644 --- a/crates/crypto/addresses/Cargo.toml +++ b/crates/crypto/addresses/Cargo.toml @@ -5,17 +5,17 @@ edition = "2021" [dependencies] # === SARGON CRATES === -identified-vec-of = { path = "../../common/identified-vec-of" } -factors = { path = "../../factors/factors" } -hierarchical-deterministic = { path = "../../crypto/hd" } -hash = { path = "../../crypto/hash" } -ecc = { path = "../../crypto/ecc" } -cap26-models = { path = "../../crypto/cap26-models" } -bytes = { path = "../../common/bytes" } -network = { path = "../../common/network" } -has-sample-values = { path = "../../core/has-sample-values" } -assert-json = { path = "../../core/assert-json" } -core-utils = { path = "../../core/utils" } +identified-vec-of = { workspace = true } +factors = { workspace = true } +hierarchical-deterministic = { workspace = true } +hash = { workspace = true } +ecc = { workspace = true } +cap26-models = { workspace = true } +bytes = { workspace = true } +network = { workspace = true } +has-sample-values = { workspace = true } +assert-json = { workspace = true } +core-utils = { workspace = true } # ==== RADIX DEPENDENCIES ==== radix-common = { workspace = true } diff --git a/crates/crypto/cap26-models/Cargo.toml b/crates/crypto/cap26-models/Cargo.toml index a48c34842..6ef402bf7 100644 --- a/crates/crypto/cap26-models/Cargo.toml +++ b/crates/crypto/cap26-models/Cargo.toml @@ -5,13 +5,13 @@ edition = "2021" [dependencies] # ==== INTERNAL DEPENDENCIES ==== -has-sample-values = { path = "../../core/has-sample-values" } -error = { path = "../../core/error" } -numeric = { path = "../../common/numeric" } -assert-json = { path = "../../core/assert-json" } -# bytes = { path = "../../common/bytes" } -# hash = { path = "../../crypto/hash" } -# identified-vec-of = { path = "../../common/identified-vec-of" } +has-sample-values = { workspace = true } +error = { workspace = true } +numeric = { workspace = true } +assert-json = { workspace = true } +# bytes = { workspace = true } +# hash = { workspace = true } +# identified-vec-of = { workspace = true } # ==== RADIX DEPENDENCIES ==== # None diff --git a/crates/crypto/ecc/Cargo.toml b/crates/crypto/ecc/Cargo.toml index a3d0241ce..7e4603dc1 100644 --- a/crates/crypto/ecc/Cargo.toml +++ b/crates/crypto/ecc/Cargo.toml @@ -5,12 +5,12 @@ edition = "2021" [dependencies] # ==== INTERNAL DEPENDENCIES ==== -has-sample-values = { path = "../../core/has-sample-values" } -error = { path = "../../core/error" } -assert-json = { path = "../../core/assert-json" } -bytes = { path = "../../common/bytes" } -hash = { path = "../../crypto/hash" } -identified-vec-of = { path = "../../common/identified-vec-of" } +has-sample-values = { workspace = true } +error = { workspace = true } +assert-json = { workspace = true } +bytes = { workspace = true } +hash = { workspace = true } +identified-vec-of = { workspace = true } # ==== RADIX DEPENDENCIES ==== radix-common = { workspace = true } diff --git a/crates/crypto/encryption/Cargo.toml b/crates/crypto/encryption/Cargo.toml index 52a1687f6..d2cc938d0 100644 --- a/crates/crypto/encryption/Cargo.toml +++ b/crates/crypto/encryption/Cargo.toml @@ -5,10 +5,10 @@ edition = "2021" [dependencies] # ==== INTERNAL DEPENDENCIES ==== -has-sample-values = { path = "../../core/has-sample-values" } -error = { path = "../../core/error" } -assert-json = { path = "../../core/assert-json" } -bytes = { path = "../../common/bytes" } +has-sample-values = { workspace = true } +error = { workspace = true } +assert-json = { workspace = true } +bytes = { workspace = true } # ==== RADIX DEPENDENCIES ==== # None diff --git a/crates/crypto/hash/Cargo.toml b/crates/crypto/hash/Cargo.toml index c18b7c864..4c212b281 100644 --- a/crates/crypto/hash/Cargo.toml +++ b/crates/crypto/hash/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" [dependencies] # ==== INTERNAL DEPENDENCIES ==== -bytes = { path = "../../common/bytes" } +bytes = { workspace = true } # ==== RADIX DEPENDENCIES ==== radix-common = { workspace = true } diff --git a/crates/crypto/hd/Cargo.toml b/crates/crypto/hd/Cargo.toml index 22f896f4e..3ef8649f0 100644 --- a/crates/crypto/hd/Cargo.toml +++ b/crates/crypto/hd/Cargo.toml @@ -5,15 +5,15 @@ edition = "2021" [dependencies] # ==== INTERNAL DEPENDENCIES ==== -identified-vec-of = { path = "../../common/identified-vec-of" } -ecc = { path = "../../crypto/ecc" } -hash = { path = "../../crypto/hash" } -cap26-models = { path = "../../crypto/cap26-models" } -bytes = { path = "../../common/bytes" } -has-sample-values = { path = "../../core/has-sample-values" } -assert-json = { path = "../../core/assert-json" } -network = { path = "../../common/network" } -numeric = { path = "../../common/numeric" } +identified-vec-of = { workspace = true } +ecc = { workspace = true } +hash = { workspace = true } +cap26-models = { workspace = true } +bytes = { workspace = true } +has-sample-values = { workspace = true } +assert-json = { workspace = true } +network = { workspace = true } +numeric = { workspace = true } # ==== RADIX DEPENDENCIES ==== radix-common = { workspace = true } diff --git a/crates/factors/factors/Cargo.toml b/crates/factors/factors/Cargo.toml index f779d5e37..cc96745fa 100644 --- a/crates/factors/factors/Cargo.toml +++ b/crates/factors/factors/Cargo.toml @@ -6,21 +6,21 @@ build = "build.rs" [dependencies] # ==== INTERNAL DEPENDENCIES ==== -identified-vec-of = { path = "../../common/identified-vec-of" } -bytes = { path = "../../common/bytes" } -hierarchical-deterministic = { path = "../../crypto/hd" } -encryption = { path = "../../crypto/encryption" } -hash = { path = "../../crypto/hash" } -ecc = { path = "../../crypto/ecc" } -cap26-models = { path = "../../crypto/cap26-models" } -numeric = { path = "../../common/numeric" } -network = { path = "../../common/network" } -time-utils = { path = "../../core/time-utils" } -short-string = { path = "../../common/short-string" } -host-info = { path = "../../common/host-info" } -core-misc = { path = "../../core/misc" } -core-utils = { path = "../../core/utils" } -core-collections = { path = "../../core/collections" } +identified-vec-of = { workspace = true } +bytes = { workspace = true } +hierarchical-deterministic = { workspace = true } +encryption = { workspace = true } +hash = { workspace = true } +ecc = { workspace = true } +cap26-models = { workspace = true } +numeric = { workspace = true } +network = { workspace = true } +time-utils = { workspace = true } +short-string = { workspace = true } +host-info = { workspace = true } +core-misc = { workspace = true } +core-utils = { workspace = true } +core-collections = { workspace = true } # ==== RADIX DEPENDENCIES ==== radix-common = { workspace = true } diff --git a/crates/factors/instances-provider/Cargo.toml b/crates/factors/instances-provider/Cargo.toml index 6b052abdf..fa6ef0fb4 100644 --- a/crates/factors/instances-provider/Cargo.toml +++ b/crates/factors/instances-provider/Cargo.toml @@ -5,19 +5,20 @@ edition = "2021" [dependencies] # === SARGON CRATES === -identified-vec-of = { path = "../../common/identified-vec-of" } -assert-json = { path = "../../core/assert-json" } -core-utils = { path = "../../core/utils" } -error = { path = "../../core/error" } -factors = { path = "../../factors/factors" } -hierarchical-deterministic = { path = "../../crypto/hd" } -keys-collector = { path = "../../factors/keys-collector" } -addresses = { path = "../../crypto/addresses" } -profile = { path = "../../profile/models/profile_SPLIT_ME" } -profile-logic = { path = "../../profile/logic/logic_SPLIT_ME" } -clients = { path = "../../system/clients/clients" } -profile-supporting-types = { path = "../../profile/models/supporting-types" } -next-derivation-index-ephemeral = { path = "../../factors/next-derivation-index-ephemeral" } +identified-vec-of = { workspace = true } +assert-json = { workspace = true } +core-utils = { workspace = true } +error = { workspace = true } +factors = { workspace = true } +hierarchical-deterministic = { workspace = true } +keys-collector = { workspace = true } +addresses = { workspace = true } +profile = { workspace = true } +profile-logic = { workspace = true } +clients = { workspace = true } +key-derivation-traits = { workspace = true } +profile-supporting-types = { workspace = true } +next-derivation-index-ephemeral = { workspace = true } # ==== RADIX DEPENDENCIES ==== # None diff --git a/crates/factors/instances-provider/src/lib.rs b/crates/factors/instances-provider/src/lib.rs index b0d8a867f..b762298ff 100644 --- a/crates/factors/instances-provider/src/lib.rs +++ b/crates/factors/instances-provider/src/lib.rs @@ -5,6 +5,7 @@ mod types; pub mod prelude { pub(crate) use addresses::*; pub(crate) use clients::prelude::*; + pub(crate) use key_derivation_traits::prelude::*; pub(crate) use keys_collector::prelude::*; pub(crate) use profile_logic::prelude::*; diff --git a/crates/factors/keys-collector/Cargo.toml b/crates/factors/keys-collector/Cargo.toml index 10cb2f62a..6e6c9103f 100644 --- a/crates/factors/keys-collector/Cargo.toml +++ b/crates/factors/keys-collector/Cargo.toml @@ -5,17 +5,18 @@ edition = "2021" [dependencies] # === SARGON CRATES === -has-sample-values = { path = "../../core/has-sample-values" } -factors = { path = "../../factors/factors" } -numeric = { path = "../../common/numeric" } -hierarchical-deterministic = { path = "../../crypto/hd" } -addresses = { path = "../../crypto/addresses" } -cap26-models = { path = "../../crypto/cap26-models" } -network = { path = "../../common/network" } -error = { path = "../../core/error" } -core-misc = { path = "../../core/misc" } # HiddenConstructor -core-collections = { path = "../../core/collections" } -factors-supporting-types = { path = "../../factors/supporting-types" } +has-sample-values = { workspace = true } +factors = { workspace = true } +numeric = { workspace = true } +hierarchical-deterministic = { workspace = true } +addresses = { workspace = true } +cap26-models = { workspace = true } +network = { workspace = true } +error = { workspace = true } +core-misc = { workspace = true } # HiddenConstructor +core-collections = { workspace = true } +factors-supporting-types = { workspace = true } +key-derivation-traits = { workspace = true } # === RADIX DEPENDENCIES === # None diff --git a/crates/factors/keys-collector/src/collector/mod.rs b/crates/factors/keys-collector/src/collector/mod.rs index afa1cda7d..0c6133105 100644 --- a/crates/factors/keys-collector/src/collector/mod.rs +++ b/crates/factors/keys-collector/src/collector/mod.rs @@ -1,4 +1,3 @@ -mod derivation_purpose; mod key_derivation_outcome; mod key_ring; mod keys_collector; @@ -6,7 +5,6 @@ mod keys_collector_dependencies; mod keys_collector_preprocessor; mod keys_collector_state; -pub use derivation_purpose::*; pub(crate) use key_derivation_outcome::*; pub(crate) use key_ring::*; pub(crate) use keys_collector_dependencies::*; diff --git a/crates/factors/keys-collector/src/derivation_testing/mod.rs b/crates/factors/keys-collector/src/derivation_testing/mod.rs index 4ac019438..9f486b446 100644 --- a/crates/factors/keys-collector/src/derivation_testing/mod.rs +++ b/crates/factors/keys-collector/src/derivation_testing/mod.rs @@ -3,5 +3,3 @@ mod test_keys_collector; #[cfg(test)] pub(crate) use stateless_dummy_indices::*; - -pub use test_keys_collector::*; diff --git a/crates/factors/keys-collector/src/derivation_testing/test_keys_collector/mod.rs b/crates/factors/keys-collector/src/derivation_testing/test_keys_collector/mod.rs index e46d0513e..e7c42c5fb 100644 --- a/crates/factors/keys-collector/src/derivation_testing/test_keys_collector/mod.rs +++ b/crates/factors/keys-collector/src/derivation_testing/test_keys_collector/mod.rs @@ -1,5 +1,2 @@ -mod test_derivation_interactor; #[allow(clippy::module_inception)] mod test_keys_collector; - -pub use test_derivation_interactor::*; diff --git a/crates/factors/keys-collector/src/lib.rs b/crates/factors/keys-collector/src/lib.rs index 3ccd48977..d4b79d711 100644 --- a/crates/factors/keys-collector/src/lib.rs +++ b/crates/factors/keys-collector/src/lib.rs @@ -1,7 +1,6 @@ #![feature(async_closure)] mod collector; -mod host_interaction; #[cfg(test)] mod tests; @@ -13,25 +12,30 @@ pub(crate) use tests::*; pub mod prelude { - pub(crate) use addresses::prelude::*; - pub(crate) use cap26_models::prelude::*; - pub(crate) use core_collections::prelude::Just; pub(crate) use error::prelude::*; pub(crate) use factors::prelude::*; - pub(crate) use factors_supporting_types::prelude::*; + pub(crate) use hierarchical_deterministic::prelude::*; + pub(crate) use key_derivation_traits::prelude::*; pub use crate::collector::*; - pub use crate::derivation_testing::*; - pub use crate::host_interaction::*; pub(crate) use std::sync::{Arc, RwLock}; - pub(crate) use itertools::Itertools; pub(crate) use log::*; pub(crate) use indexmap::{IndexMap, IndexSet}; pub(crate) use std::collections::{HashMap, HashSet}; + + #[cfg(test)] + mod testing { + pub(crate) use crate::derivation_testing::*; + pub(crate) use cap26_models::prelude::*; + pub(crate) use core_collections::prelude::Just; + pub(crate) use itertools::Itertools; + } + #[cfg(test)] + pub(crate) use testing::*; } pub use prelude::*; diff --git a/crates/factors/next-derivation-index-ephemeral/Cargo.toml b/crates/factors/next-derivation-index-ephemeral/Cargo.toml index 55d130c91..fa6fefd64 100644 --- a/crates/factors/next-derivation-index-ephemeral/Cargo.toml +++ b/crates/factors/next-derivation-index-ephemeral/Cargo.toml @@ -5,15 +5,15 @@ edition = "2021" [dependencies] # === SARGON CRATES === -identified-vec-of = { path = "../../common/identified-vec-of" } -assert-json = { path = "../../core/assert-json" } -error = { path = "../../core/error" } -hierarchical-deterministic = { path = "../../crypto/hd" } -has-sample-values = { path = "../../core/has-sample-values" } -factors = { path = "../../factors/factors" } -cap26-models = { path = "../../crypto/cap26-models" } -addresses = { path = "../../crypto/addresses" } -network = { path = "../../common/network" } +identified-vec-of = { workspace = true } +assert-json = { workspace = true } +error = { workspace = true } +hierarchical-deterministic = { workspace = true } +has-sample-values = { workspace = true } +factors = { workspace = true } +cap26-models = { workspace = true } +addresses = { workspace = true } +network = { workspace = true } # === RADIX DEPENDENCIES #None diff --git a/crates/factors/supporting-types/Cargo.toml b/crates/factors/supporting-types/Cargo.toml index 117da1b32..c5d833187 100644 --- a/crates/factors/supporting-types/Cargo.toml +++ b/crates/factors/supporting-types/Cargo.toml @@ -5,10 +5,10 @@ edition = "2021" [dependencies] # ==== INTERNAL DEPENDENCIES ==== -identified-vec-of = { path = "../../common/identified-vec-of" } -hierarchical-deterministic = { path = "../../crypto/hd" } -factors = { path = "../../factors/factors" } -error = { path = "../../core/error" } +identified-vec-of = { workspace = true } +hierarchical-deterministic = { workspace = true } +factors = { workspace = true } +error = { workspace = true } # === RADIX DEPENDENCIES === # None diff --git a/crates/gateway/client-and-api/Cargo.toml b/crates/gateway/client-and-api/Cargo.toml index 73bc0594d..c320612ea 100644 --- a/crates/gateway/client-and-api/Cargo.toml +++ b/crates/gateway/client-and-api/Cargo.toml @@ -5,15 +5,15 @@ edition = "2021" [dependencies] # === SARGON CRATES === -assert-json = { path = "../../core/assert-json" } -core-utils = { path = "../../core/utils" } -metadata = { path = "../../common/metadata" } -addresses = { path = "../../crypto/addresses" } -drivers = { path = "../../system/drivers" } -http-client = { path = "../../system/clients/http" } -gateway-models = { path = "../../gateway/models" } -transaction-models = { path = "../../transaction/models" } -profile-gateway = { path = "../../profile/models/gateway" } +assert-json = { workspace = true } +core-utils = { workspace = true } +metadata = { workspace = true } +addresses = { workspace = true } +drivers = { workspace = true } +http-client = { workspace = true } +gateway-models = { workspace = true } +transaction-models = { workspace = true } +profile-gateway = { workspace = true } # === RADIX DEPENDENCIES === radix-common = { workspace = true } diff --git a/crates/gateway/models/Cargo.toml b/crates/gateway/models/Cargo.toml index d125bb4a0..72c6edb3d 100644 --- a/crates/gateway/models/Cargo.toml +++ b/crates/gateway/models/Cargo.toml @@ -6,11 +6,11 @@ build = "build.rs" [dependencies] # === SARGON CRATES === -assert-json = { path = "../../core/assert-json" } -addresses = { path = "../../crypto/addresses" } -transaction-models = { path = "../../transaction/models" } -core-misc = { path = "../../core/misc" } # decl_bool_type -metadata = { path = "../../common/metadata" } +assert-json = { workspace = true } +addresses = { workspace = true } +transaction-models = { workspace = true } +core-misc = { workspace = true } # decl_bool_type +metadata = { workspace = true } # === RADIX DEPENDENCIES === radix-engine-toolkit-common = { workspace = true } diff --git a/crates/profile/logic/logic_SPLIT_ME/Cargo.toml b/crates/profile/logic/logic_SPLIT_ME/Cargo.toml index c99e0a9a9..3e357bcd5 100644 --- a/crates/profile/logic/logic_SPLIT_ME/Cargo.toml +++ b/crates/profile/logic/logic_SPLIT_ME/Cargo.toml @@ -5,15 +5,15 @@ edition = "2021" [dependencies] # === SARGON CRATES === -identified-vec-of = { path = "../../../common/identified-vec-of" } -hierarchical-deterministic = { path = "../../../crypto/hd" } -factors = { path = "../../../factors/factors" } -addresses = { path = "../../../crypto/addresses" } -profile = { path = "../../../profile/models/profile_SPLIT_ME" } -profile-persona = { path = "../../../profile/models/persona" } -profile-supporting-types = { path = "../../../profile/models/supporting-types" } -time-utils = { path = "../../../core/time-utils" } -entity-by-address = { path = "../../../profile/traits/entity-by-address" } +identified-vec-of = { workspace = true } +hierarchical-deterministic = { workspace = true } +factors = { workspace = true } +addresses = { workspace = true } +profile = { workspace = true } +profile-persona = { workspace = true } +profile-supporting-types = { workspace = true } +time-utils = { workspace = true } +entity-by-address = { workspace = true } # === RADIX DEPENDENCIES === # None diff --git a/crates/profile/models/account-for-display/Cargo.toml b/crates/profile/models/account-for-display/Cargo.toml index 49a5d8bb7..9db0afe52 100644 --- a/crates/profile/models/account-for-display/Cargo.toml +++ b/crates/profile/models/account-for-display/Cargo.toml @@ -5,12 +5,12 @@ edition = "2021" [dependencies] # === SARGON CRATES === -addresses = { path = "../../../crypto/addresses" } -short-string = { path = "../../../common/short-string" } -entity-foundation = { path = "../../../common/entity-foundation" } -identified-vec-of = { path = "../../../common/identified-vec-of" } -network = { path = "../../../common/network" } -has-sample-values = { path = "../../../core/has-sample-values" } +addresses = { workspace = true } +short-string = { workspace = true } +entity-foundation = { workspace = true } +identified-vec-of = { workspace = true } +network = { workspace = true } +has-sample-values = { workspace = true } # === RADIX DEPENDENCIES === # None diff --git a/crates/profile/models/account-or-persona/Cargo.toml b/crates/profile/models/account-or-persona/Cargo.toml index 80b2729bf..95e069f6b 100644 --- a/crates/profile/models/account-or-persona/Cargo.toml +++ b/crates/profile/models/account-or-persona/Cargo.toml @@ -5,12 +5,12 @@ edition = "2021" [dependencies] # === SARGON CRATES === -profile-base-entity = { path = "../../../profile/models/base-entity" } -profile-account = { path = "../../../profile/models/account" } -profile-persona = { path = "../../../profile/models/persona" } -hierarchical-deterministic = { path = "../../../crypto/hd" } -cap26-models = { path = "../../../crypto/cap26-models" } -profile-security-structures = { path = "../../../profile/models/security-structures" } +profile-base-entity = { workspace = true } +profile-account = { workspace = true } +profile-persona = { workspace = true } +hierarchical-deterministic = { workspace = true } +cap26-models = { workspace = true } +profile-security-structures = { workspace = true } # === RADIX DEPENDENCIES === diff --git a/crates/profile/models/account/Cargo.toml b/crates/profile/models/account/Cargo.toml index bed6a59e6..e92926eaf 100644 --- a/crates/profile/models/account/Cargo.toml +++ b/crates/profile/models/account/Cargo.toml @@ -5,15 +5,15 @@ edition = "2021" [dependencies] # === SARGON CRATES === -account-for-display = { path = "../../../profile/models/account-for-display" } -transaction-models = { path = "../../../transaction/models" } -addresses = { path = "../../../crypto/addresses" } -has-sample-values = { path = "../../../core/has-sample-values" } -cap26-models = { path = "../../../crypto/cap26-models" } -entity-foundation = { path = "../../../common/entity-foundation" } -short-string = { path = "../../../common/short-string" } -profile-base-entity = { path = "../../../profile/models/base-entity" } -profile-security-structures = { path = "../../../profile/models/security-structures" } +account-for-display = { workspace = true } +transaction-models = { workspace = true } +addresses = { workspace = true } +has-sample-values = { workspace = true } +cap26-models = { workspace = true } +entity-foundation = { workspace = true } +short-string = { workspace = true } +profile-base-entity = { workspace = true } +profile-security-structures = { workspace = true } # === RADIX DEPENDENCIES === diff --git a/crates/profile/models/app-preferences/Cargo.toml b/crates/profile/models/app-preferences/Cargo.toml index 0a7bc90d6..5af7c778f 100644 --- a/crates/profile/models/app-preferences/Cargo.toml +++ b/crates/profile/models/app-preferences/Cargo.toml @@ -5,16 +5,16 @@ edition = "2021" [dependencies] # === INTERNAL DEPENDENCIES === -identified-vec-of = { path = "../../../common/identified-vec-of" } -hierarchical-deterministic = { path = "../../../crypto/hd" } -factors = { path = "../../../factors/factors" } -numeric = { path = "../../../common/numeric" } -core-misc = { path = "../../../core/misc" } # decl_bool_Type -keys-collector = { path = "../../../factors/keys-collector" } -addresses = { path = "../../../crypto/addresses" } -transaction-models = { path = "../../../transaction/models" } -profile-gateway = { path = "../../../profile/models/gateway" } -profile-security-structures = { path = "../../../profile/models/security-structures" } +identified-vec-of = { workspace = true } +hierarchical-deterministic = { workspace = true } +factors = { workspace = true } +numeric = { workspace = true } +core-misc = { workspace = true } # decl_bool_Type +keys-collector = { workspace = true } +addresses = { workspace = true } +transaction-models = { workspace = true } +profile-gateway = { workspace = true } +profile-security-structures = { workspace = true } # === RADIX DEPENDENCIES === # None diff --git a/crates/profile/models/base-entity/Cargo.toml b/crates/profile/models/base-entity/Cargo.toml index e2cadf7a4..0b3a7e3e4 100644 --- a/crates/profile/models/base-entity/Cargo.toml +++ b/crates/profile/models/base-entity/Cargo.toml @@ -5,15 +5,15 @@ edition = "2021" [dependencies] # === SARGON CRATES === -addresses = { path = "../../../crypto/addresses" } -factors = { path = "../../../factors/factors" } -short-string = { path = "../../../common/short-string" } -entity-foundation = { path = "../../../common/entity-foundation" } -identified-vec-of = { path = "../../../common/identified-vec-of" } -network = { path = "../../../common/network" } -has-sample-values = { path = "../../../core/has-sample-values" } -transaction-models = { path = "../../../transaction/models" } -profile-security-structures = { path = "../../../profile/models/security-structures" } +addresses = { workspace = true } +factors = { workspace = true } +short-string = { workspace = true } +entity-foundation = { workspace = true } +identified-vec-of = { workspace = true } +network = { workspace = true } +has-sample-values = { workspace = true } +transaction-models = { workspace = true } +profile-security-structures = { workspace = true } # === RADIX DEPENDENCIES === # None diff --git a/crates/profile/models/gateway/Cargo.toml b/crates/profile/models/gateway/Cargo.toml index 07825212f..2c6954445 100644 --- a/crates/profile/models/gateway/Cargo.toml +++ b/crates/profile/models/gateway/Cargo.toml @@ -5,17 +5,17 @@ edition = "2021" [dependencies] # === INTERNAL DEPENDENCIES === -identified-vec-of = { path = "../../../common/identified-vec-of" } -hierarchical-deterministic = { path = "../../../crypto/hd" } -factors = { path = "../../../factors/factors" } -keys-collector = { path = "../../../factors/keys-collector" } -addresses = { path = "../../../crypto/addresses" } -transaction-models = { path = "../../../transaction/models" } -network = { path = "../../../common/network" } -error = { path = "../../../core/error" } -core-misc = { path = "../../../core/misc" } -assert-json = { path = "../../../core/assert-json" } -has-sample-values = { path = "../../../core/has-sample-values" } +identified-vec-of = { workspace = true } +hierarchical-deterministic = { workspace = true } +factors = { workspace = true } +keys-collector = { workspace = true } +addresses = { workspace = true } +transaction-models = { workspace = true } +network = { workspace = true } +error = { workspace = true } +core-misc = { workspace = true } +assert-json = { workspace = true } +has-sample-values = { workspace = true } # === RADIX DEPENDENCIES === # None diff --git a/crates/profile/models/persona-data/Cargo.toml b/crates/profile/models/persona-data/Cargo.toml index 0af6d9dcb..7099aa7ed 100644 --- a/crates/profile/models/persona-data/Cargo.toml +++ b/crates/profile/models/persona-data/Cargo.toml @@ -5,14 +5,14 @@ edition = "2021" [dependencies] # === SARGON CRATES === -assert-json = { path = "../../../core/assert-json" } -addresses = { path = "../../../crypto/addresses" } -core-misc = { path = "../../../core/misc" } -short-string = { path = "../../../common/short-string" } -entity-foundation = { path = "../../../common/entity-foundation" } -identified-vec-of = { path = "../../../common/identified-vec-of" } -network = { path = "../../../common/network" } -has-sample-values = { path = "../../../core/has-sample-values" } +assert-json = { workspace = true } +addresses = { workspace = true } +core-misc = { workspace = true } +short-string = { workspace = true } +entity-foundation = { workspace = true } +identified-vec-of = { workspace = true } +network = { workspace = true } +has-sample-values = { workspace = true } # === RADIX DEPENDENCIES === # None diff --git a/crates/profile/models/persona/Cargo.toml b/crates/profile/models/persona/Cargo.toml index 574ada93c..ff4695d87 100644 --- a/crates/profile/models/persona/Cargo.toml +++ b/crates/profile/models/persona/Cargo.toml @@ -5,16 +5,16 @@ edition = "2021" [dependencies] # === SARGON CRATES === -short-string = { path = "../../../common/short-string" } -hierarchical-deterministic = { path = "../../../crypto/hd" } -has-sample-values = { path = "../../../core/has-sample-values" } -addresses = { path = "../../../crypto/addresses" } -host-info = { path = "../../../common/host-info" } -core-misc = { path = "../../../core/misc" } -cap26-models = { path = "../../../crypto/cap26-models" } -profile-base-entity = { path = "../../../profile/models/base-entity" } -profile-persona-data = { path = "../../../profile/models/persona-data" } -profile-security-structures = { path = "../../../profile/models/security-structures" } +short-string = { workspace = true } +hierarchical-deterministic = { workspace = true } +has-sample-values = { workspace = true } +addresses = { workspace = true } +host-info = { workspace = true } +core-misc = { workspace = true } +cap26-models = { workspace = true } +profile-base-entity = { workspace = true } +profile-persona-data = { workspace = true } +profile-security-structures = { workspace = true } # === RADIX DEPENDENCIES === diff --git a/crates/profile/models/profile_SPLIT_ME/Cargo.toml b/crates/profile/models/profile_SPLIT_ME/Cargo.toml index 70b39b0a4..7c5c5a838 100644 --- a/crates/profile/models/profile_SPLIT_ME/Cargo.toml +++ b/crates/profile/models/profile_SPLIT_ME/Cargo.toml @@ -6,27 +6,27 @@ build = "build.rs" [dependencies] # === INTERNAL DEPENDENCIES === -encryption = { path = "../../../crypto/encryption" } -identified-vec-of = { path = "../../../common/identified-vec-of" } -hierarchical-deterministic = { path = "../../../crypto/hd" } -factors = { path = "../../../factors/factors" } -core-misc = { path = "../../../core/misc" } -profile-persona-data = { path = "../../../profile/models/persona-data" } -entity-foundation = { path = "../../../common/entity-foundation" } -has-sample-values = { path = "../../../core/has-sample-values" } -keys-collector = { path = "../../../factors/keys-collector" } -addresses = { path = "../../../crypto/addresses" } -transaction-models = { path = "../../../transaction/models" } -profile-app-preferences = { path = "../../../profile/models/app-preferences" } -account-for-display = { path = "../../../profile/models/account-for-display" } -profile-security-structures = { path = "../../../profile/models/security-structures" } -time-utils = { path = "../../../core/time-utils" } -host-info = { path = "../../../common/host-info" } -profile-base-entity = { path = "../../../profile/models/base-entity" } -profile-account-or-persona = { path = "../../../profile/models/account-or-persona" } -profile-account = { path = "../../../profile/models/account" } -profile-persona = { path = "../../../profile/models/persona" } -entity-by-address = { path = "../../../profile/traits/entity-by-address" } +encryption = { workspace = true } +identified-vec-of = { workspace = true } +hierarchical-deterministic = { workspace = true } +factors = { workspace = true } +core-misc = { workspace = true } +profile-persona-data = { workspace = true } +entity-foundation = { workspace = true } +has-sample-values = { workspace = true } +keys-collector = { workspace = true } +addresses = { workspace = true } +transaction-models = { workspace = true } +profile-app-preferences = { workspace = true } +account-for-display = { workspace = true } +profile-security-structures = { workspace = true } +time-utils = { workspace = true } +host-info = { workspace = true } +profile-base-entity = { workspace = true } +profile-account-or-persona = { workspace = true } +profile-account = { workspace = true } +profile-persona = { workspace = true } +entity-by-address = { workspace = true } # === RADIX DEPENDENCIES === # None diff --git a/crates/profile/models/security-structures/Cargo.toml b/crates/profile/models/security-structures/Cargo.toml index 0e44cb30c..dcbbedefb 100644 --- a/crates/profile/models/security-structures/Cargo.toml +++ b/crates/profile/models/security-structures/Cargo.toml @@ -5,18 +5,18 @@ edition = "2021" [dependencies] # === INTERNAL DEPENDENCIES === -identified-vec-of = { path = "../../../common/identified-vec-of" } -hierarchical-deterministic = { path = "../../../crypto/hd" } -factors = { path = "../../../factors/factors" } -has-sample-values = { path = "../../../core/has-sample-values" } -addresses = { path = "../../../crypto/addresses" } -cap26-models = { path = "../../../crypto/cap26-models" } -next-derivation-index-ephemeral = { path = "../../../factors/next-derivation-index-ephemeral" } -network = { path = "../../../common/network" } -core-collections = { path = "../../../core/collections" } -time-utils = { path = "../../../core/time-utils" } -short-string = { path = "../../../common/short-string" } -core-utils = { path = "../../../core/utils" } +identified-vec-of = { workspace = true } +hierarchical-deterministic = { workspace = true } +factors = { workspace = true } +has-sample-values = { workspace = true } +addresses = { workspace = true } +cap26-models = { workspace = true } +next-derivation-index-ephemeral = { workspace = true } +network = { workspace = true } +core-collections = { workspace = true } +time-utils = { workspace = true } +short-string = { workspace = true } +core-utils = { workspace = true } # === RADIX DEPENDENCIES === diff --git a/crates/profile/models/supporting-types/Cargo.toml b/crates/profile/models/supporting-types/Cargo.toml index e1a85d546..82c00947b 100644 --- a/crates/profile/models/supporting-types/Cargo.toml +++ b/crates/profile/models/supporting-types/Cargo.toml @@ -5,13 +5,13 @@ edition = "2021" [dependencies] # === SARGON CRATES === -identified-vec-of = { path = "../../../common/identified-vec-of" } -hierarchical-deterministic = { path = "../../../crypto/hd" } -factors = { path = "../../../factors/factors" } -addresses = { path = "../../../crypto/addresses" } -profile = { path = "../../../profile/models/profile_SPLIT_ME" } -profile-base-entity = { path = "../../../profile/models/base-entity" } -profile-account-or-persona = { path = "../../../profile/models/account-or-persona" } +identified-vec-of = { workspace = true } +hierarchical-deterministic = { workspace = true } +factors = { workspace = true } +addresses = { workspace = true } +profile = { workspace = true } +profile-base-entity = { workspace = true } +profile-account-or-persona = { workspace = true } # === RADIX DEPENDENCIES === # None diff --git a/crates/profile/traits/entity-by-address/Cargo.toml b/crates/profile/traits/entity-by-address/Cargo.toml index cc55feeba..bb54878c1 100644 --- a/crates/profile/traits/entity-by-address/Cargo.toml +++ b/crates/profile/traits/entity-by-address/Cargo.toml @@ -5,11 +5,11 @@ edition = "2021" [dependencies] # === SARGON CRATES === -error = { path = "../../../core/error" } -addresses = { path = "../../../crypto/addresses" } -profile-account = { path = "../../../profile/models/account" } -profile-account-or-persona = { path = "../../../profile/models/account-or-persona" } -profile-persona = { path = "../../../profile/models/persona" } +error = { workspace = true } +addresses = { workspace = true } +profile-account = { workspace = true } +profile-account-or-persona = { workspace = true } +profile-persona = { workspace = true } # === RADIX DEPENDENCIES === diff --git a/crates/sargon_SPLIT_ME/Cargo.toml b/crates/sargon_SPLIT_ME/Cargo.toml index d568a4313..382a368d1 100644 --- a/crates/sargon_SPLIT_ME/Cargo.toml +++ b/crates/sargon_SPLIT_ME/Cargo.toml @@ -13,30 +13,43 @@ crate-type = ["staticlib", "cdylib", "lib"] [dependencies] # === SARGON CRATES === -identified-vec-of = { path = "../common/identified-vec-of" } -hierarchical-deterministic = { path = "../crypto/hd" } -factors = { path = "../factors/factors" } -core-misc = { path = "../core/misc" } -transaction-foundation = { path = "../transaction/foundation" } -keys-collector = { path = "../factors/keys-collector" } -encryption = { path = "../crypto/encryption" } -addresses = { path = "../crypto/addresses" } -transaction-models = { path = "../transaction/models" } -manifests = { path = "../transaction/manifests" } -profile = { path = "../profile/models/profile_SPLIT_ME" } -profile-gateway = { path = "../profile/models/gateway" } -profile-logic = { path = "../profile/logic/logic_SPLIT_ME" } -profile-security-structures = { path = "../profile/models/security-structures" } -factor-instances-provider = { path = "../factors/instances-provider" } -gateway-models = { path = "../gateway/models" } -clients = { path = "../system/clients/clients" } -drivers = { path = "../system/drivers" } -home-cards = { path = "../app/home-cards" } -security-center = { path = "../app/security-center" } -radix-connect = { path = "../app/radix-connect" } -radix-connect-models = { path = "../app/radix-connect-models" } -signing = { path = "../app/signing" } -gateway-client-and-api = { path = "../gateway/client-and-api" } +identified-vec-of = { workspace = true } +build-info = { workspace = true } +hierarchical-deterministic = { workspace = true } +factors = { workspace = true } +core-misc = { workspace = true } +transaction-foundation = { workspace = true } +keys-collector = { workspace = true } +encryption = { workspace = true } +addresses = { workspace = true } +transaction-models = { workspace = true } +manifests = { workspace = true } +profile = { workspace = true } +profile-gateway = { workspace = true } +profile-logic = { workspace = true } +profile-security-structures = { workspace = true } +factor-instances-provider = { workspace = true } +gateway-models = { workspace = true } +clients = { workspace = true } +drivers = { workspace = true } +home-cards = { workspace = true } +security-center = { workspace = true } +radix-connect = { workspace = true } +radix-connect-models = { workspace = true } +signing = { workspace = true } +network = { workspace = true } +next-derivation-index-ephemeral = { workspace = true } +sub-systems = { workspace = true } +interactors = { workspace = true } +key-derivation-traits = { workspace = true } +signing-traits = { workspace = true } +sargon-os = { path = "../system/os/os" } +sargon-os-transaction = { path = "../system/os/transaction" } +sargon-os-accounts = { workspace = true } +sargon-os-factors = { workspace = true } +sargon-os-security-center = { workspace = true } +sargon-os-signing = { workspace = true } +gateway-client-and-api = { workspace = true } # === RADIX DEPENDENCIES === radix-common = { workspace = true } diff --git a/crates/sargon_SPLIT_ME/src/interactors/mod.rs b/crates/sargon_SPLIT_ME/src/interactors/mod.rs deleted file mode 100644 index c8a4b6181..000000000 --- a/crates/sargon_SPLIT_ME/src/interactors/mod.rs +++ /dev/null @@ -1,9 +0,0 @@ -mod interactors; -mod testing; -mod use_factor_sources_interactor; - -pub use interactors::*; -pub use use_factor_sources_interactor::*; - -#[cfg(test)] -pub use testing::*; diff --git a/crates/sargon_SPLIT_ME/src/lib.rs b/crates/sargon_SPLIT_ME/src/lib.rs index 585b5c094..0c6bc480a 100644 --- a/crates/sargon_SPLIT_ME/src/lib.rs +++ b/crates/sargon_SPLIT_ME/src/lib.rs @@ -11,35 +11,31 @@ #![feature(trivial_bounds)] #![allow(trivial_bounds)] -mod bios; -mod interactors; -mod sargon_os; -mod subsystems; mod test_diagnose_instance_duplicates; pub mod prelude { - pub use crate::bios::*; - pub use crate::interactors::*; - pub use crate::sargon_os::*; - pub use crate::subsystems::*; + pub use build_info::prelude::*; pub use clients::prelude::*; pub use factor_instances_provider::prelude::*; pub use home_cards::prelude::*; + pub use interactors::prelude::*; + pub use key_derivation_traits::prelude::*; pub use keys_collector::prelude::*; pub use manifests::prelude::*; pub use profile_logic::prelude::*; pub use radix_connect::prelude::*; pub use radix_connect_models::prelude::*; + pub use sargon_os::prelude::*; + pub use sargon_os_accounts::prelude::*; + pub use sargon_os_factors::prelude::*; + pub use sargon_os_security_center::prelude::*; + pub use sargon_os_signing::prelude::*; + pub use sargon_os_transaction::prelude::*; pub use security_center::prelude::*; pub use signing::prelude::*; - - pub(crate) use radix_engine_interface::prelude::MetadataValue as ScryptoMetadataValue; - - pub(crate) use std::collections::HashSet; - - #[cfg(test)] - pub(crate) use radix_common::math::Decimal as ScryptoDecimal192; + pub use signing_traits::prelude::*; + pub use sub_systems::prelude::*; } pub use prelude::*; diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/mod.rs b/crates/sargon_SPLIT_ME/src/sargon_os/mod.rs deleted file mode 100644 index 56f1ad2fa..000000000 --- a/crates/sargon_SPLIT_ME/src/sargon_os/mod.rs +++ /dev/null @@ -1,28 +0,0 @@ -mod delete_account; -mod entity_creating_with_factor_source_and_derivation_outcome; -mod pre_authorization; -mod profile_state_holder; -mod sargon_os; -mod sargon_os_accounts; -mod sargon_os_entities_linked_to_factor_source; -mod sargon_os_factors; -mod sargon_os_gateway; -mod sargon_os_personas; -mod sargon_os_profile; -mod sargon_os_security_center; -mod sargon_os_security_structures; -mod sargon_os_signing; -mod sargon_os_sync_accounts; -mod transactions; - -#[cfg(test)] -mod factor_instances_provider_unit_tests; - -pub use delete_account::*; -pub use entity_creating_with_factor_source_and_derivation_outcome::*; -pub use pre_authorization::*; -pub use profile_state_holder::*; -pub use sargon_os::*; -pub use sargon_os_accounts::*; -pub use sargon_os_factors::*; -pub use transactions::*; diff --git a/crates/sargon_SPLIT_ME/src/subsystems/mod.rs b/crates/sargon_SPLIT_ME/src/subsystems/mod.rs deleted file mode 100644 index a11b45516..000000000 --- a/crates/sargon_SPLIT_ME/src/subsystems/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -mod log_system; - -pub use log_system::*; diff --git a/crates/sargon_SPLIT_ME/src/test_diagnose_instance_duplicates.rs b/crates/sargon_SPLIT_ME/src/test_diagnose_instance_duplicates.rs index 61cd3a8f7..3b67546c9 100644 --- a/crates/sargon_SPLIT_ME/src/test_diagnose_instance_duplicates.rs +++ b/crates/sargon_SPLIT_ME/src/test_diagnose_instance_duplicates.rs @@ -171,8 +171,9 @@ mod tests { struct NotAndroidLog; impl LoggingDriver for NotAndroidLog { fn log(&self, level: LogLevel, msg: String) { - assert_eq!(level, LogLevel::Error); - assert!(msg.contains("Duplicated FactorInstances found")); + if msg.contains("Duplicated FactorInstances found") { + assert_eq!(level, LogLevel::Error); + } } } install_logger(Arc::new(NotAndroidLog)); @@ -244,9 +245,10 @@ mod tests { struct NotAndroidLog; impl LoggingDriver for NotAndroidLog { fn log(&self, level: LogLevel, msg: String) { - assert_eq!(level, LogLevel::Error); - assert!(msg.contains("Duplicated FactorInstances found")); - assert!(!msg.contains("due to Android bug")); + if msg.contains("Duplicated FactorInstances found") { + assert_eq!(level, LogLevel::Error); + assert!(!msg.contains("due to Android bug")); + } } } install_logger(Arc::new(NotAndroidLog)); diff --git a/crates/system/clients/clients/Cargo.toml b/crates/system/clients/clients/Cargo.toml index e00323051..c7a802e35 100644 --- a/crates/system/clients/clients/Cargo.toml +++ b/crates/system/clients/clients/Cargo.toml @@ -6,14 +6,14 @@ build = "build.rs" [dependencies] # === SARGON CRATES === -core-collections = { path = "../../../core/collections" } -profile = { path = "../../../profile/models/profile_SPLIT_ME" } -factors-supporting-types = { path = "../../../factors/supporting-types" } -profile-supporting-types = { path = "../../../profile/models/supporting-types" } -drivers = { path = "../../../system/drivers" } -http-client = { path = "../../../system/clients/http" } -gateway-client-and-api = { path = "../../../gateway/client-and-api" } -hierarchical-deterministic = { path = "../../../crypto/hd" } +core-collections = { workspace = true } +profile = { workspace = true } +factors-supporting-types = { workspace = true } +profile-supporting-types = { workspace = true } +drivers = { workspace = true } +http-client = { workspace = true } +gateway-client-and-api = { workspace = true } +hierarchical-deterministic = { workspace = true } # === RADIX DEPENDENCIES === # None diff --git a/crates/system/clients/http/Cargo.toml b/crates/system/clients/http/Cargo.toml index 70f42ca00..2624665f2 100644 --- a/crates/system/clients/http/Cargo.toml +++ b/crates/system/clients/http/Cargo.toml @@ -5,10 +5,10 @@ edition = "2021" [dependencies] # === SARGON CRATES === -drivers = { path = "../../../system/drivers" } -bytes = { path = "../../../common/bytes" } -error = { path = "../../../core/error" } -core-utils = { path = "../../../core/utils" } +drivers = { workspace = true } +bytes = { workspace = true } +error = { workspace = true } +core-utils = { workspace = true } # === RADIX DEPENDENCIES === diff --git a/crates/system/drivers/Cargo.toml b/crates/system/drivers/Cargo.toml index 8150be461..8e770a678 100644 --- a/crates/system/drivers/Cargo.toml +++ b/crates/system/drivers/Cargo.toml @@ -6,11 +6,11 @@ build = "build.rs" [dependencies] # === SARGON CRATES === -hierarchical-deterministic = { path = "../../crypto/hd" } -addresses = { path = "../../crypto/addresses" } -profile = { path = "../../profile/models/profile_SPLIT_ME" } -profile-supporting-types = { path = "../../profile/models/supporting-types" } -time-utils = { path = "../../core/time-utils" } +hierarchical-deterministic = { workspace = true } +addresses = { workspace = true } +profile = { workspace = true } +profile-supporting-types = { workspace = true } +time-utils = { workspace = true } # === RADIX DEPENDENCIES === # None diff --git a/crates/system/interactors/Cargo.toml b/crates/system/interactors/Cargo.toml new file mode 100644 index 000000000..64ce7355a --- /dev/null +++ b/crates/system/interactors/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "interactors" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +signing-traits = { workspace = true } +key-derivation-traits = { workspace = true } +transaction-models = { workspace = true } + +# ==== RADIX DEPENDENCIES ==== +# None + +# ==== EXTERNAL DEPENDENCIES ==== +async-trait = { workspace = true } +derive_more = { workspace = true } +log = { workspace = true } +serde = { workspace = true } diff --git a/crates/system/interactors/src/interactors.rs b/crates/system/interactors/src/interactors.rs new file mode 100644 index 000000000..c872e9d71 --- /dev/null +++ b/crates/system/interactors/src/interactors.rs @@ -0,0 +1,18 @@ +use crate::prelude::*; + +/// A collection of interactors that the host is providing during boot. +/// Such interactors are used to drive ui from within sargon os. +pub struct Interactors { + /// Interactors related to factor sources. + pub use_factor_sources_interactor: Arc, +} + +impl Interactors { + pub fn new( + use_factor_sources_interactor: Arc, + ) -> Self { + Self { + use_factor_sources_interactor, + } + } +} diff --git a/crates/system/interactors/src/lib.rs b/crates/system/interactors/src/lib.rs new file mode 100644 index 000000000..d75cfb366 --- /dev/null +++ b/crates/system/interactors/src/lib.rs @@ -0,0 +1,17 @@ +mod interactors; +mod testing; +mod use_factor_sources_interactor; + +pub mod prelude { + pub use crate::interactors::*; + pub use crate::testing::*; + pub use crate::use_factor_sources_interactor::*; + + pub(crate) use key_derivation_traits::prelude::*; + pub(crate) use signing_traits::prelude::*; + pub(crate) use transaction_models::prelude::*; + + pub(crate) use std::sync::Arc; +} + +pub use prelude::*; diff --git a/crates/sargon_SPLIT_ME/src/interactors/testing/mod.rs b/crates/system/interactors/src/testing/mod.rs similarity index 77% rename from crates/sargon_SPLIT_ME/src/interactors/testing/mod.rs rename to crates/system/interactors/src/testing/mod.rs index 88cc87c00..61afc59f5 100644 --- a/crates/sargon_SPLIT_ME/src/interactors/testing/mod.rs +++ b/crates/system/interactors/src/testing/mod.rs @@ -1,5 +1,3 @@ -#[cfg(test)] mod test_use_factor_sources_interactors; -#[cfg(test)] pub use test_use_factor_sources_interactors::*; diff --git a/crates/sargon_SPLIT_ME/src/interactors/testing/test_use_factor_sources_interactors.rs b/crates/system/interactors/src/testing/test_use_factor_sources_interactors.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/interactors/testing/test_use_factor_sources_interactors.rs rename to crates/system/interactors/src/testing/test_use_factor_sources_interactors.rs diff --git a/crates/sargon_SPLIT_ME/src/interactors/use_factor_sources_interactor.rs b/crates/system/interactors/src/use_factor_sources_interactor.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/interactors/use_factor_sources_interactor.rs rename to crates/system/interactors/src/use_factor_sources_interactor.rs diff --git a/crates/system/os/accounts/Cargo.toml b/crates/system/os/accounts/Cargo.toml new file mode 100644 index 000000000..a30f9ad8f --- /dev/null +++ b/crates/system/os/accounts/Cargo.toml @@ -0,0 +1,27 @@ +[package] +name = "sargon-os-accounts" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +sargon-os = { path = "../../../system/os/os" } +error = { workspace = true } +core-collections = { workspace = true } +network = { workspace = true } +addresses = { workspace = true } +transaction-models = { workspace = true } +manifests = { workspace = true } +gateway-client-and-api = { workspace = true } + +# ==== RADIX DEPENDENCIES ==== +radix-engine-interface = { workspace = true } +radix-common = { workspace = true } + +# ==== EXTERNAL DEPENDENCIES ==== +actix-rt = { workspace = true } +async-trait = { workspace = true } +derive_more = { workspace = true } +indexmap = { workspace = true } +log = { workspace = true } +serde = { workspace = true } diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/delete_account/mod.rs b/crates/system/os/accounts/src/delete_account/mod.rs similarity index 63% rename from crates/sargon_SPLIT_ME/src/sargon_os/delete_account/mod.rs rename to crates/system/os/accounts/src/delete_account/mod.rs index 2eb7ab935..bbc1029c0 100644 --- a/crates/sargon_SPLIT_ME/src/sargon_os/delete_account/mod.rs +++ b/crates/system/os/accounts/src/delete_account/mod.rs @@ -1,4 +1,5 @@ mod sargon_os_delete_account; mod support; +pub use sargon_os_delete_account::*; pub use support::*; diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/delete_account/sargon_os_delete_account.rs b/crates/system/os/accounts/src/delete_account/sargon_os_delete_account.rs similarity index 90% rename from crates/sargon_SPLIT_ME/src/sargon_os/delete_account/sargon_os_delete_account.rs rename to crates/system/os/accounts/src/delete_account/sargon_os_delete_account.rs index b6e857361..bb93f7258 100644 --- a/crates/sargon_SPLIT_ME/src/sargon_os/delete_account/sargon_os_delete_account.rs +++ b/crates/system/os/accounts/src/delete_account/sargon_os_delete_account.rs @@ -4,20 +4,50 @@ use radix_engine_interface::blueprints::account::{ AccountRemoveResourcePreferenceInput as ScryptoAccountRemoveResourcePreferenceInput, }; +#[async_trait::async_trait] +pub trait OsCreateDeleteAccountManifest { + async fn create_delete_account_manifest( + &self, + account_address: AccountAddress, + recipient_account_address: Option, + ) -> Result; + + async fn fetch_resource_preferences( + &self, + account_address: AccountAddress, + gateway_client: &GatewayClient, + ledger_state: LedgerState, + ) -> Result>; + + async fn fetch_authorized_depositors( + &self, + account_address: AccountAddress, + gateway_client: &GatewayClient, + ledger_state: LedgerState, + ) -> Result>; + + async fn fetch_account_transfers( + &self, + account_address: AccountAddress, + recipient_account_address: Option, + gateway_client: &GatewayClient, + ledger_state: LedgerState, + ) -> Result>; +} + // ================== // Delete Account (Public) // ================== -impl SargonOS { - pub async fn create_delete_account_manifest( +#[async_trait::async_trait] +impl OsCreateDeleteAccountManifest for SargonOS { + async fn create_delete_account_manifest( &self, account_address: AccountAddress, recipient_account_address: Option, ) -> Result { let network_id = account_address.network_id(); - let gateway_client = GatewayClient::new( - self.clients.http_client.driver.clone(), - network_id, - ); + let gateway_client = + GatewayClient::new(self.http_client.driver.clone(), network_id); // Get current ledger state let ledger_state = gateway_client.gateway_status().await?.ledger_state; diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/delete_account/support/mod.rs b/crates/system/os/accounts/src/delete_account/support/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/sargon_os/delete_account/support/mod.rs rename to crates/system/os/accounts/src/delete_account/support/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/delete_account/support/outcome.rs b/crates/system/os/accounts/src/delete_account/support/outcome.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/sargon_os/delete_account/support/outcome.rs rename to crates/system/os/accounts/src/delete_account/support/outcome.rs diff --git a/crates/system/os/accounts/src/lib.rs b/crates/system/os/accounts/src/lib.rs new file mode 100644 index 000000000..007f1a99b --- /dev/null +++ b/crates/system/os/accounts/src/lib.rs @@ -0,0 +1,24 @@ +mod delete_account; +mod sargon_os_sync_accounts; + +pub mod prelude { + pub use super::delete_account::*; + pub use super::sargon_os_sync_accounts::*; + + pub(crate) use addresses::prelude::*; + pub(crate) use error::prelude::*; + pub(crate) use gateway_client_and_api::prelude::*; + pub(crate) use manifests::prelude::*; + pub(crate) use sargon_os::prelude::*; + + pub(crate) use indexmap::IndexMap; + + #[cfg(test)] + mod testing { + pub(crate) use std::sync::Arc; + } + #[cfg(test)] + pub(crate) use testing::*; +} + +pub use prelude::*; diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_sync_accounts.rs b/crates/system/os/accounts/src/sargon_os_sync_accounts.rs similarity index 86% rename from crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_sync_accounts.rs rename to crates/system/os/accounts/src/sargon_os_sync_accounts.rs index c131f92a9..5306785ff 100644 --- a/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_sync_accounts.rs +++ b/crates/system/os/accounts/src/sargon_os_sync_accounts.rs @@ -1,22 +1,33 @@ use crate::prelude::*; +#[async_trait::async_trait] +pub trait OsSyncAccountsDeletedOnLedger { + async fn sync_accounts_deleted_on_ledger(&self) -> Result; + async fn check_accounts_deleted_on_ledger( + &self, + network_id: NetworkID, + account_addresses: IndexSet, + ) -> Result>; +} + // ================== // Sync Profile Accounts with status on ledger // ================== -impl SargonOS { +#[async_trait::async_trait] +impl OsSyncAccountsDeletedOnLedger for SargonOS { /// Checks all active accounts in current network on ledger, if any of them are deleted. /// Any deleted account is marked as tombstoned in profile. /// /// Returns true if any account became tombstoned. - pub async fn sync_accounts_deleted_on_ledger(&self) -> Result { + async fn sync_accounts_deleted_on_ledger(&self) -> Result { let accounts = self.accounts_on_current_network()?; - let network_id = self.profile_state_holder.current_network_id()?; + let network_id = self.current_network_id()?; let account_addresses_with_deleted_status = self .check_accounts_deleted_on_ledger( network_id, - accounts.iter().map(|a| a.address), + accounts.iter().map(|a| a.address).collect(), ) .await?; @@ -47,15 +58,13 @@ impl SargonOS { /// /// Returns an array of the account addresses along with a `bool` being true if that account /// is deleted - pub async fn check_accounts_deleted_on_ledger( + async fn check_accounts_deleted_on_ledger( &self, network_id: NetworkID, - account_addresses: impl IntoIterator, + account_addresses: IndexSet, ) -> Result> { - let gateway_client = GatewayClient::new( - self.clients.http_client.driver.clone(), - network_id, - ); + let gateway_client = + GatewayClient::new(self.http_client.driver.clone(), network_id); gateway_client .check_accounts_are_deleted(network_id, account_addresses) @@ -145,7 +154,10 @@ mod tests { let accounts_status = os .check_accounts_deleted_on_ledger( NetworkID::Stokenet, - vec![account_address_deleted, account_address_not_deleted], + IndexSet::from_iter([ + account_address_deleted, + account_address_not_deleted, + ]), ) .await .unwrap(); diff --git a/crates/system/os/factors/Cargo.toml b/crates/system/os/factors/Cargo.toml new file mode 100644 index 000000000..fc2a293ef --- /dev/null +++ b/crates/system/os/factors/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "sargon-os-factors" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +sargon-os = { path = "../../../system/os/os" } +error = { workspace = true } +profile = { workspace = true } +interactors = { workspace = true } +drivers = { workspace = true } +clients = { workspace = true } +profile-logic = { workspace = true } + +# ==== RADIX DEPENDENCIES ==== +# None + +# ==== EXTERNAL DEPENDENCIES ==== +actix-rt = { workspace = true } +async-trait = { workspace = true } +derive_more = { workspace = true } +log = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } diff --git a/crates/system/os/factors/src/lib.rs b/crates/system/os/factors/src/lib.rs new file mode 100644 index 000000000..baeaa0ee9 --- /dev/null +++ b/crates/system/os/factors/src/lib.rs @@ -0,0 +1,19 @@ +mod sargon_os_entities_linked_to_factor_source; +mod sargon_os_security_structures; + +pub mod prelude { + pub use crate::sargon_os_entities_linked_to_factor_source::*; + pub use crate::sargon_os_security_structures::*; + + pub(crate) use clients::prelude::*; + + pub(crate) use profile_logic::prelude::*; + pub(crate) use sargon_os::prelude::*; + + pub(crate) use std::collections::HashSet; + + #[cfg(test)] + pub(crate) use interactors::prelude::*; +} + +pub use prelude::*; diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_entities_linked_to_factor_source.rs b/crates/system/os/factors/src/sargon_os_entities_linked_to_factor_source.rs similarity index 95% rename from crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_entities_linked_to_factor_source.rs rename to crates/system/os/factors/src/sargon_os_entities_linked_to_factor_source.rs index b528ea42f..915d2b97e 100644 --- a/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_entities_linked_to_factor_source.rs +++ b/crates/system/os/factors/src/sargon_os_entities_linked_to_factor_source.rs @@ -1,8 +1,28 @@ use crate::prelude::*; -impl SargonOS { +#[async_trait::async_trait] +pub trait OsEntitiesLinkedToFactorSource { + async fn entities_linked_to_factor_source( + &self, + factor_source: FactorSource, + profile_to_check: ProfileToCheck, + ) -> Result; + + async fn integrity( + &self, + factor_source: FactorSource, + ) -> Result; + + async fn device_integrity( + &self, + device_factor_source: DeviceFactorSource, + ) -> Result; +} + +#[async_trait::async_trait] +impl OsEntitiesLinkedToFactorSource for SargonOS { /// Returns the entities linked to a given `FactorSource`, either on the current `Profile` or a specific one. - pub async fn entities_linked_to_factor_source( + async fn entities_linked_to_factor_source( &self, factor_source: FactorSource, profile_to_check: ProfileToCheck, @@ -45,12 +65,10 @@ impl SargonOS { device_factor_source: DeviceFactorSource, ) -> Result { let is_mnemonic_present_in_secure_storage = self - .clients .secure_storage .contains_device_mnemonic(device_factor_source.clone()) .await?; let is_mnemonic_marked_as_backed_up = self - .clients .unsafe_storage .check_if_mnemonic_is_backed_up(device_factor_source.clone()) .await?; diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_security_structures.rs b/crates/system/os/factors/src/sargon_os_security_structures.rs similarity index 88% rename from crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_security_structures.rs rename to crates/system/os/factors/src/sargon_os_security_structures.rs index cd30cf643..db1204750 100644 --- a/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_security_structures.rs +++ b/crates/system/os/factors/src/sargon_os_security_structures.rs @@ -1,22 +1,43 @@ use crate::prelude::*; -impl SargonOS { +#[async_trait::async_trait] +pub trait OsSecurityStructuresQuerying { + fn security_structures_of_factor_sources( + &self, + ) -> Result; + + fn security_structures_of_factor_source_ids( + &self, + ) -> Result; + + fn security_structure_of_factor_sources_from_security_structure_of_factor_source_ids( + &self, + structure_of_ids: &SecurityStructureOfFactorSourceIDs, + ) -> Result; + + async fn add_security_structure_of_factor_sources( + &self, + structure: &SecurityStructureOfFactorSources, + ) -> Result; +} + +#[async_trait::async_trait] +impl OsSecurityStructuresQuerying for SargonOS { /// Returns all the SecurityStructuresOfFactorSources, /// by trying to map FactorSourceID level -> FactorSource Level - pub fn security_structures_of_factor_sources( + fn security_structures_of_factor_sources( &self, ) -> Result { - self.profile_state_holder.try_access_profile_with(|p| { - p.security_structures_of_factor_sources() - }) + self.profile() + .and_then(|p| p.security_structures_of_factor_sources()) } /// Returns all the `SecurityStructuresOfFactorSourceIDs` which are stored /// in profile. - pub fn security_structures_of_factor_source_ids( + fn security_structures_of_factor_source_ids( &self, ) -> Result { - self.profile_state_holder.access_profile_with(|p| { + self.profile().map(|p| { p.app_preferences .security .security_structures_of_factor_source_ids @@ -26,11 +47,11 @@ impl SargonOS { /// Returns all the `SecurityStructuresOfFactorSourceIDs` which are stored /// in profile. - pub fn security_structure_of_factor_sources_from_security_structure_of_factor_source_ids( + fn security_structure_of_factor_sources_from_security_structure_of_factor_source_ids( &self, structure_of_ids: &SecurityStructureOfFactorSourceIDs, ) -> Result { - self.profile_state_holder.try_access_profile_with(|p| { + self.profile().and_then(|p| { SecurityStructureOfFactorSources::try_from(( structure_of_ids, &p.factor_sources, @@ -52,7 +73,7 @@ impl SargonOS { /// of the active profile to secure storage. /// /// And also emits `Event::ProfileModified { change: EventProfileModified::SecurityStructureAdded { id } }` - pub async fn add_security_structure_of_factor_sources( + async fn add_security_structure_of_factor_sources( &self, structure: &SecurityStructureOfFactorSources, ) -> Result { @@ -100,18 +121,24 @@ impl SargonOS { } } -impl SargonOS { +pub trait OsSecurityShieldPrerequisiteStatus { + fn security_shield_prerequisites_status( + &self, + ) -> Result; +} + +impl OsSecurityShieldPrerequisiteStatus for SargonOS { /// Returns the status of the prerequisites for building a Security Shield. /// /// According to [definition][doc], a Security Shield can be built if the user has, asides from /// the Identity factor, "2 or more factors, one of which must be Hardware" /// /// [doc]: https://radixdlt.atlassian.net/wiki/spaces/AT/pages/3758063620/MFA+Rules+for+Factors+and+Security+Shields#Factor-Prerequisites - pub fn security_shield_prerequisites_status( + fn security_shield_prerequisites_status( &self, ) -> Result { - self.profile_state_holder - .access_profile_with(|p| p.security_shield_prerequisites_status()) + self.profile() + .map(|p| p.security_shield_prerequisites_status()) } } diff --git a/crates/system/os/os/Cargo.toml b/crates/system/os/os/Cargo.toml new file mode 100644 index 000000000..a5cb890ab --- /dev/null +++ b/crates/system/os/os/Cargo.toml @@ -0,0 +1,32 @@ +[package] +name = "sargon-os" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +profile = { workspace = true } +profile-logic = { workspace = true } +profile-state-holder = { workspace = true } +drivers = { workspace = true } +clients = { workspace = true } +build-info = { workspace = true } +interactors = { workspace = true } +sub-systems = { workspace = true } +host-info = { workspace = true } +key-derivation-traits = { workspace = true } +signing-traits = { workspace = true } +factor-instances-provider = { workspace = true } + +# ==== RADIX DEPENDENCIES ==== +# None + +# ==== EXTERNAL DEPENDENCIES ==== +async-trait = { workspace = true } +actix-rt = { workspace = true } +derive_more = { workspace = true } +futures = { workspace = true } +log = { workspace = true } +pretty_assertions = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } diff --git a/crates/sargon_SPLIT_ME/src/bios/bios.rs b/crates/system/os/os/src/bios/bios.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/bios/bios.rs rename to crates/system/os/os/src/bios/bios.rs diff --git a/crates/sargon_SPLIT_ME/src/bios/mod.rs b/crates/system/os/os/src/bios/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/bios/mod.rs rename to crates/system/os/os/src/bios/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/entity_creating_with_factor_source_and_derivation_outcome.rs b/crates/system/os/os/src/entity_creating_with_factor_source_and_derivation_outcome.rs similarity index 92% rename from crates/sargon_SPLIT_ME/src/sargon_os/entity_creating_with_factor_source_and_derivation_outcome.rs rename to crates/system/os/os/src/entity_creating_with_factor_source_and_derivation_outcome.rs index dd05fcbd9..805829161 100644 --- a/crates/sargon_SPLIT_ME/src/sargon_os/entity_creating_with_factor_source_and_derivation_outcome.rs +++ b/crates/system/os/os/src/entity_creating_with_factor_source_and_derivation_outcome.rs @@ -1,8 +1,10 @@ use crate::prelude::*; +#[async_trait::async_trait] pub trait EntityCreatingWithFactorSourceAndDerivationOutcome { async fn create_unsaved_entities_with_factor_source_with_derivation_outcome< E: IsEntity + Identifiable, + F: Send + Fn(u32) -> DisplayName, >( &self, factor_source: FactorSource, @@ -10,7 +12,7 @@ pub trait EntityCreatingWithFactorSourceAndDerivationOutcome { count: u16, factor_instances_cache_client: Arc, key_derivation_interactor: Arc, - get_name: impl Fn(u32) -> DisplayName, // name of entity at index + get_name: F, // name of entity at index ) -> Result<( FactorSourceID, IdentifiedVecOf, @@ -60,30 +62,37 @@ pub trait EntityCreatingWithFactorSourceAndDerivationOutcome { )) } - async fn create_unsaved_accounts_with_factor_source_with_derivation_outcome( + async fn create_unsaved_accounts_with_factor_source_with_derivation_outcome< + F, + >( &self, factor_source: FactorSource, network_id: NetworkID, count: u16, factor_instances_cache_client: Arc, key_derivation_interactor: Arc, - get_name: impl Fn(u32) -> DisplayName, // name of account at index + get_name: F, // name of account at index ) -> Result<( FactorSourceID, Accounts, InstancesInCacheConsumer, FactorInstancesProviderOutcomeForFactor, - )>; + )> + where + F: Send + Fn(u32) -> DisplayName; - async fn create_unsaved_accounts_with_factor_source( + async fn create_unsaved_accounts_with_factor_source( &self, factor_source: FactorSource, network_id: NetworkID, count: u16, factor_instances_cache_client: Arc, key_derivation_interactor: Arc, - get_name: impl Fn(u32) -> DisplayName, // name of account at index - ) -> Result<(FactorSourceID, Accounts, InstancesInCacheConsumer)> { + get_name: F, // name of account at index + ) -> Result<(FactorSourceID, Accounts, InstancesInCacheConsumer)> + where + F: Send + Fn(u32) -> DisplayName, + { self.create_unsaved_accounts_with_factor_source_with_derivation_outcome( factor_source, network_id, @@ -138,21 +147,26 @@ pub trait EntityCreatingWithFactorSourceAndDerivationOutcome { )) } - async fn create_unsaved_personas_with_factor_source_with_derivation_outcome( + async fn create_unsaved_personas_with_factor_source_with_derivation_outcome< + F, + >( &self, factor_source: FactorSource, network_id: NetworkID, count: u16, factor_instances_cache_client: Arc, key_derivation_interactor: Arc, - get_name: impl Fn(u32) -> DisplayName, // name of persona at index + get_name: F, // name of persona at index ) -> Result<( FactorSourceID, Personas, InstancesInCacheConsumer, FactorInstancesProviderOutcomeForFactor, - )> { - self.create_unsaved_entities_with_factor_source_with_derivation_outcome::( + )> + where + F: Send + Fn(u32) -> DisplayName, + { + self.create_unsaved_entities_with_factor_source_with_derivation_outcome::( factor_source, network_id, count, @@ -164,21 +178,27 @@ pub trait EntityCreatingWithFactorSourceAndDerivationOutcome { } } +#[async_trait::async_trait] impl EntityCreatingWithFactorSourceAndDerivationOutcome for Profile { - async fn create_unsaved_accounts_with_factor_source_with_derivation_outcome( + async fn create_unsaved_accounts_with_factor_source_with_derivation_outcome< + F, + >( &self, factor_source: FactorSource, network_id: NetworkID, count: u16, factor_instances_cache_client: Arc, key_derivation_interactor: Arc, - get_name: impl Fn(u32) -> DisplayName, // name of account at index + get_name: F, // name of account at index ) -> Result<( FactorSourceID, Accounts, InstancesInCacheConsumer, FactorInstancesProviderOutcomeForFactor, - )> { + )> + where + F: Send + Fn(u32) -> DisplayName, + { let number_of_accounts_on_network = self .networks .get_id(network_id) @@ -186,7 +206,7 @@ impl EntityCreatingWithFactorSourceAndDerivationOutcome for Profile { .unwrap_or(0); let (factor_source_id, accounts, instances_in_cache_consumer, derivation_outcome) = self - .create_unsaved_entities_with_factor_source_with_derivation_outcome::( + .create_unsaved_entities_with_factor_source_with_derivation_outcome::( factor_source, network_id, count, @@ -230,7 +250,8 @@ impl EntityCreatingWithFactorSourceAndDerivationOutcome for Profile { /// is safe to delete the instances from the cache - e.g. after having saved the new /// entities into the Profile and persisted it into SecureStorage. async fn create_unsaved_entities_with_factor_source_with_derivation_outcome< - E: IsEntity + Identifiable, + E, + F, >( &self, factor_source: FactorSource, @@ -238,13 +259,17 @@ impl EntityCreatingWithFactorSourceAndDerivationOutcome for Profile { count: u16, factor_instances_cache_client: Arc, key_derivation_interactor: Arc, - get_name: impl Fn(u32) -> DisplayName, // name of entity at index + get_name: F, // name of entity at index ) -> Result<( FactorSourceID, IdentifiedVecOf, InstancesInCacheConsumer, FactorInstancesProviderOutcomeForFactor, - )> { + )> + where + E: IsEntity + Identifiable, + F: Send + Fn(u32) -> DisplayName, + { let count = count as usize; let fsid = factor_source.factor_source_id(); diff --git a/crates/system/os/os/src/lib.rs b/crates/system/os/os/src/lib.rs new file mode 100644 index 000000000..aef326192 --- /dev/null +++ b/crates/system/os/os/src/lib.rs @@ -0,0 +1,51 @@ +#![allow(unused_imports)] +#![feature(let_chains)] +#![feature(trait_upcasting)] + +mod bios; +mod entity_creating_with_factor_source_and_derivation_outcome; +mod os_testing_support; +mod sargon_os; +mod sargon_os_accounts; +mod sargon_os_factors; +mod sargon_os_gateway; +mod sargon_os_personas; +mod sargon_os_profile; +mod test_instances_provider; +mod testing_interactors; + +pub mod prelude { + pub use crate::bios::*; + pub use crate::entity_creating_with_factor_source_and_derivation_outcome::*; + pub use crate::os_testing_support::*; + pub use crate::sargon_os::*; + pub use crate::sargon_os_accounts::*; + pub use crate::sargon_os_factors::*; + pub use crate::sargon_os_gateway::*; + pub use crate::sargon_os_personas::*; + pub use crate::sargon_os_profile::*; + pub use crate::testing_interactors::*; + + pub(crate) use build_info::prelude::*; + pub(crate) use clients::prelude::*; + pub(crate) use drivers::prelude::*; + pub(crate) use factor_instances_provider::prelude::*; + pub(crate) use host_info::prelude::*; + pub(crate) use interactors::prelude::*; + pub(crate) use key_derivation_traits::prelude::*; + pub(crate) use profile_logic::prelude::*; + pub(crate) use profile_state_holder::prelude::*; + pub(crate) use signing_traits::prelude::*; + pub(crate) use sub_systems::prelude::*; + + pub(crate) use std::collections::HashSet; + pub(crate) use std::sync::Arc; + + #[cfg(test)] + mod testing { + pub(crate) use serde_json::json; + } + + #[cfg(test)] + pub(crate) use testing::*; +} diff --git a/crates/system/os/os/src/os_testing_support.rs b/crates/system/os/os/src/os_testing_support.rs new file mode 100644 index 000000000..b4c2579b8 --- /dev/null +++ b/crates/system/os/os/src/os_testing_support.rs @@ -0,0 +1,229 @@ +#![allow(non_snake_case)] + +#[cfg(test)] +use crate::prelude::*; + +#[cfg(test)] +impl SargonOS { + pub async fn with_bdfs() -> (Arc, FactorSource) { + let os = Self::fast_boot().await; + let bdfs = os.bdfs().unwrap(); + (os, bdfs.into()) + } + + pub async fn create_and_save_new_mainnet_account_with_derivation_outcome( + &self, + name: impl AsRef, + ) -> Result<(Account, FactorInstancesProviderOutcomeForFactor)> { + let display_name = DisplayName::new(name)?; + self.create_and_save_new_mainnet_account_with_bdfs_with_derivation_outcome(display_name).await + } + + pub(crate) async fn create_and_save_new_mainnet_persona( + &self, + name: impl AsRef, + ) -> Result { + self.create_and_save_new_mainnet_persona_with_derivation_outcome(name) + .await + .map(|(p, _)| p) + } + + pub(crate) async fn create_and_save_new_mainnet_account( + &self, + name: impl AsRef, + ) -> Result { + self.create_and_save_new_mainnet_account_with_derivation_outcome(name) + .await + .map(|(a, _)| a) + } + + pub(crate) async fn create_and_save_new_persona_with_factor_with_derivation_outcome( + &self, + factor_source: FactorSource, + network_id: NetworkID, + name: impl AsRef, + ) -> Result<(Persona, FactorInstancesProviderOutcomeForFactor)> { + let display_name = DisplayName::new(name)?; + self.create_and_save_new_persona_with_factor_source_with_derivation_outcome(factor_source, network_id, display_name).await + } + + pub(crate) async fn create_and_save_new_account_with_factor_with_derivation_outcome( + &self, + factor_source: FactorSource, + network_id: NetworkID, + name: impl AsRef, + ) -> Result<(Account, FactorInstancesProviderOutcomeForFactor)> { + let display_name = DisplayName::new(name)?; + self.create_and_save_new_account_with_factor_source_with_derivation_outcome(factor_source, network_id, display_name).await + } + + pub(crate) async fn create_and_save_new_mainnet_persona_with_derivation_outcome( + &self, + name: impl AsRef, + ) -> Result<(Persona, FactorInstancesProviderOutcomeForFactor)> { + let display_name = DisplayName::new(name)?; + self.create_and_save_new_mainnet_persona_with_bdfs_with_derivation_outcome(display_name).await + } + + /// Mutates Accounts in Profile ONLY, DOES NOT submit any transaction changing + /// security state on chain + pub(crate) fn __OFFLINE_ONLY_securify_account_without_saving( + &self, + account_address: AccountAddress, + security_structure_of_factor_instances: SecurityStructureOfFactorInstances, + ) -> Result { + let entity = self.__OFFLINE_ONLY_securify_entity_without_saving( + AddressOfAccountOrPersona::Account(account_address), + security_structure_of_factor_instances, + )?; + + entity + .clone() + .as_account_entity() + .ok_or(CommonError::ExpectedAccountButGotPersona { + address: entity.address().to_string(), + }) + .cloned() + } + + pub(crate) fn __OFFLINE_ONLY_securify_entity_without_saving( + &self, + entity_address: AddressOfAccountOrPersona, + security_structure_of_factor_instances: SecurityStructureOfFactorInstances, + ) -> Result { + let mut entity = self.entity_by_address(entity_address)?; + + let veci: HierarchicalDeterministicFactorInstance; + let access_controller_address: AccessControllerAddress; + + match entity.security_state() { + EntitySecurityState::Unsecured { value } => { + veci = value.transaction_signing.clone(); + // THIS IS COMPLETELY WRONG! + // The real solution should get the AccessControllerAddress on chain + access_controller_address = + AccessControllerAddress::with_node_id_of(&entity.address()); + } + EntitySecurityState::Securified { value } => { + veci = value.veci.clone().unwrap(); + access_controller_address = value.access_controller_address; + } + }; + + let securified_control = SecuredEntityControl::new( + veci, + access_controller_address, + security_structure_of_factor_instances, + )?; + + entity.set_security_state(EntitySecurityState::Securified { + value: securified_control, + })?; + + Ok(entity) + } + + /// Uses FactorInstancesProvider to get factor instances for the `shield`. + /// Mutates Accounts in Profile ONLY, DOES NOT submit any transaction changing + /// security state on chain + pub(crate) async fn __OFFLINE_ONLY_securify_accounts( + &self, + account_addresses: IndexSet, + shield: &SecurityStructureOfFactorSources, + ) -> Result<(Accounts, FactorInstancesProviderOutcome)> { + let (entities, outcome) = self + .__OFFLINE_ONLY_securify_entities( + account_addresses.into_iter().map(Into::into).collect(), + shield, + ) + .await?; + + let accounts = entities + .into_iter() + .map(|e| e.into_account_entity().unwrap()) + .collect(); + Ok((accounts, outcome)) + } + + pub(crate) async fn __OFFLINE_ONLY_securify_entities( + &self, + entity_addresses: IndexSet, + shield: &SecurityStructureOfFactorSources, + ) -> Result<( + IdentifiedVecOf, + FactorInstancesProviderOutcome, + )> { + entity_addresses + .iter() + .for_each(|a| assert!(self.entity_by_address(*a).is_ok())); + + let outcome = self.make_security_structure_of_factor_instances_for_entities_without_consuming_cache_with_derivation_outcome( + entity_addresses.clone().into_iter().map(Into::into).collect(), + shield.clone()).await?; + + let ( + security_structures_of_factor_instances, + instances_in_cache_consumer, + derivation_outcome, + ) = outcome; + + let mut security_structures_of_factor_instances = + security_structures_of_factor_instances; + + // consume! + instances_in_cache_consumer.consume().await?; + + let securified_entities = entity_addresses + .into_iter() + .map(|entity_address| { + let security_structure_of_factor_instances = + security_structures_of_factor_instances + .shift_remove(&entity_address) + .unwrap(); + + // Production ready code should batch update entities, submit batch transaction to + // network, and then batch update all accounts in Profile. + self.__OFFLINE_ONLY_securify_entity_without_saving( + entity_address, + security_structure_of_factor_instances, + ) + }) + .collect::>>()?; + + assert!(security_structures_of_factor_instances.is_empty()); + + // Assert that none of the NEW FactorInstances collide with the existing ones + self.profile() + .unwrap() + .assert_new_factor_instances_not_already_used_erased( + securified_entities.clone(), + )?; + self.update_entities_erased(securified_entities.clone()) + .await?; + + Ok(( + securified_entities.into_iter().collect(), + derivation_outcome, + )) + } + + /// Uses FactorInstancesProvider to get factor instances for the `shield`. + /// Mutates Accounts in Profile ONLY, DOES NOT submit any transaction changing + /// security state on chain + #[allow(non_camel_case_types)] + pub(crate) async fn __OFFLINE_ONLY_securify_account( + &self, + account_address: AccountAddress, + shield: &SecurityStructureOfFactorSources, + ) -> Result<(Account, FactorInstancesProviderOutcome)> { + let (accounts, outcome) = self + .__OFFLINE_ONLY_securify_accounts( + IndexSet::just(account_address), + shield, + ) + .await?; + assert_eq!(accounts.len(), 1); + let account = accounts.first().unwrap().clone(); + Ok((account, outcome)) + } +} diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os.rs b/crates/system/os/os/src/sargon_os.rs similarity index 93% rename from crates/sargon_SPLIT_ME/src/sargon_os/sargon_os.rs rename to crates/system/os/os/src/sargon_os.rs index 3e4b278c5..85d3fb07b 100644 --- a/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os.rs +++ b/crates/system/os/os/src/sargon_os.rs @@ -38,7 +38,7 @@ impl SargonOS { Self::boot_with_clients_and_interactor(clients, interactors).await } - pub(crate) async fn boot_with_clients_and_interactor( + pub async fn boot_with_clients_and_interactor( clients: Clients, interactors: Interactors, ) -> Arc { @@ -143,6 +143,34 @@ impl SargonOS { Ok(()) } + #[cfg(test)] // only for test for now, need integration work in hosts before enabling this + pub async fn pre_derive_and_fill_cache_with_instances_for_factor_source( + &self, + factor_source: FactorSource, + ) -> Result { + if !factor_source.factor_source_id().is_hash() { + panic!("Unsupported FactorSource which is not HD.") + } + let profile_snapshot = self.profile()?; + let keys_derivation_interactors = self.keys_derivation_interactor(); + let outcome = CacheFiller::for_new_factor_source( + Arc::new(self.clients.factor_instances_cache.clone()), + Arc::new(profile_snapshot), + factor_source.clone(), + NetworkID::Mainnet, // we care not about other networks here + keys_derivation_interactors.clone(), + ) + .await?; + + assert!(outcome.per_derivation_preset.values().all(|pf| pf + .per_factor + .keys() + .collect_vec() + == vec![&factor_source.id_from_hash()])); + + Ok(outcome) + } + pub async fn import_wallet( &self, profile: &Profile, @@ -261,23 +289,21 @@ impl SargonOS { Ok(()) } - pub(crate) fn sign_transactions_interactor( + pub fn sign_transactions_interactor( &self, ) -> Arc> { self.interactors.use_factor_sources_interactor.clone() as Arc> } - pub(crate) fn sign_subintents_interactor( + pub fn sign_subintents_interactor( &self, ) -> Arc> { self.interactors.use_factor_sources_interactor.clone() as Arc> } - pub(crate) fn sign_auth_interactor( - &self, - ) -> Arc> { + pub fn sign_auth_interactor(&self) -> Arc> { self.interactors.use_factor_sources_interactor.clone() as Arc> } @@ -299,7 +325,7 @@ impl SargonOS { } impl SargonOS { - pub(crate) async fn create_new_profile_with_bdfs( + pub async fn create_new_profile_with_bdfs( &self, mnemonic_with_passphrase: Option, ) -> Result<(Profile, PrivateHierarchicalDeterministicFactorSource)> { @@ -383,11 +409,11 @@ impl SargonOS { } } -#[cfg(test)] -pub(crate) const SARGON_OS_TEST_MAX_ASYNC_DURATION: std::time::Duration = +pub const SARGON_OS_TEST_MAX_ASYNC_DURATION: std::time::Duration = std::time::Duration::from_millis(50); -#[cfg(test)] +// TODO hide behind a feature flag? +// #[cfg(test)] impl SargonOS { pub async fn with_timeout<'a, F, Fut, T>(&'a self, func: F) -> T where @@ -560,6 +586,21 @@ mod tests { assert_eq!(active_profile.unwrap().id(), profile.id()); } + #[actix_rt::test] + async fn profile_not_loaded_error() { + let os = SUT::fast_boot().await; + os.profile_state_holder + .replace_profile_state_with(ProfileState::None) + .unwrap(); + + let result = os.profile(); + + assert!(matches!( + result, + Err(CommonError::ProfileStateNotLoaded { .. }) + )); + } + #[actix_rt::test] async fn test_boot_when_existing_profile_with_no_networks_profile_state_considered_none( ) { diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_accounts.rs b/crates/system/os/os/src/sargon_os_accounts.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_accounts.rs rename to crates/system/os/os/src/sargon_os_accounts.rs diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_factors.rs b/crates/system/os/os/src/sargon_os_factors.rs similarity index 95% rename from crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_factors.rs rename to crates/system/os/os/src/sargon_os_factors.rs index 230cc98cb..459091870 100644 --- a/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_factors.rs +++ b/crates/system/os/os/src/sargon_os_factors.rs @@ -234,34 +234,6 @@ impl SargonOS { } impl SargonOS { - #[cfg(test)] // only for test for now, need integration work in hosts before enabling this - pub async fn pre_derive_and_fill_cache_with_instances_for_factor_source( - &self, - factor_source: FactorSource, - ) -> Result { - if !factor_source.factor_source_id().is_hash() { - panic!("Unsupported FactorSource which is not HD.") - } - let profile_snapshot = self.profile()?; - let keys_derivation_interactors = self.keys_derivation_interactor(); - let outcome = CacheFiller::for_new_factor_source( - Arc::new(self.clients.factor_instances_cache.clone()), - Arc::new(profile_snapshot), - factor_source.clone(), - NetworkID::Mainnet, // we care not about other networks here - keys_derivation_interactors.clone(), - ) - .await?; - - assert!(outcome.per_derivation_preset.values().all(|pf| pf - .per_factor - .keys() - .collect_vec() - == vec![&factor_source.id_from_hash()])); - - Ok(outcome) - } - /// Adds all factor sources to Profile. /// /// # Emits Event @@ -485,7 +457,7 @@ impl SargonOS { >>() } - pub(crate) async fn cache_snapshot(&self) -> FactorInstancesCache { + pub async fn cache_snapshot(&self) -> FactorInstancesCache { self.clients .factor_instances_cache .snapshot() @@ -497,7 +469,7 @@ impl SargonOS { #[allow(unused)] #[cfg(test)] impl SargonOS { - pub(crate) async fn clear_cache(&self) { + pub async fn clear_cache(&self) { println!("💣 CLEAR CACHE"); self.clients.factor_instances_cache.clear().await.unwrap(); } diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_gateway.rs b/crates/system/os/os/src/sargon_os_gateway.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_gateway.rs rename to crates/system/os/os/src/sargon_os_gateway.rs diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_personas.rs b/crates/system/os/os/src/sargon_os_personas.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_personas.rs rename to crates/system/os/os/src/sargon_os_personas.rs diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_profile.rs b/crates/system/os/os/src/sargon_os_profile.rs similarity index 99% rename from crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_profile.rs rename to crates/system/os/os/src/sargon_os_profile.rs index 67c611ee3..494bbf817 100644 --- a/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_profile.rs +++ b/crates/system/os/os/src/sargon_os_profile.rs @@ -125,7 +125,7 @@ impl SargonOS { /// # Emits /// Emits `Event::ProfileSaved` after having successfully written the JSON /// of the active profile to secure storage. - pub(crate) async fn update_profile_with(&self, mutate: F) -> Result + pub async fn update_profile_with(&self, mutate: F) -> Result where F: Fn(&mut Profile) -> Result, { diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/factor_instances_provider_unit_tests.rs b/crates/system/os/os/src/test_instances_provider.rs similarity index 91% rename from crates/sargon_SPLIT_ME/src/sargon_os/factor_instances_provider_unit_tests.rs rename to crates/system/os/os/src/test_instances_provider.rs index 29959378b..a937d0f5f 100644 --- a/crates/sargon_SPLIT_ME/src/sargon_os/factor_instances_provider_unit_tests.rs +++ b/crates/system/os/os/src/test_instances_provider.rs @@ -1,231 +1,6 @@ #![allow(non_snake_case)] - use crate::prelude::*; -impl SargonOS { - pub(crate) async fn with_bdfs() -> (Arc, FactorSource) { - let os = Self::fast_boot().await; - let bdfs = os.bdfs().unwrap(); - (os, bdfs.into()) - } - - pub(crate) async fn create_and_save_new_mainnet_account_with_derivation_outcome( - &self, - name: impl AsRef, - ) -> Result<(Account, FactorInstancesProviderOutcomeForFactor)> { - let display_name = DisplayName::new(name)?; - self.create_and_save_new_mainnet_account_with_bdfs_with_derivation_outcome(display_name).await - } - - pub(crate) async fn create_and_save_new_mainnet_persona( - &self, - name: impl AsRef, - ) -> Result { - self.create_and_save_new_mainnet_persona_with_derivation_outcome(name) - .await - .map(|(p, _)| p) - } - - pub(crate) async fn create_and_save_new_mainnet_account( - &self, - name: impl AsRef, - ) -> Result { - self.create_and_save_new_mainnet_account_with_derivation_outcome(name) - .await - .map(|(a, _)| a) - } - - pub(crate) async fn create_and_save_new_persona_with_factor_with_derivation_outcome( - &self, - factor_source: FactorSource, - network_id: NetworkID, - name: impl AsRef, - ) -> Result<(Persona, FactorInstancesProviderOutcomeForFactor)> { - let display_name = DisplayName::new(name)?; - self.create_and_save_new_persona_with_factor_source_with_derivation_outcome(factor_source, network_id, display_name).await - } - - pub(crate) async fn create_and_save_new_account_with_factor_with_derivation_outcome( - &self, - factor_source: FactorSource, - network_id: NetworkID, - name: impl AsRef, - ) -> Result<(Account, FactorInstancesProviderOutcomeForFactor)> { - let display_name = DisplayName::new(name)?; - self.create_and_save_new_account_with_factor_source_with_derivation_outcome(factor_source, network_id, display_name).await - } - - pub(crate) async fn create_and_save_new_mainnet_persona_with_derivation_outcome( - &self, - name: impl AsRef, - ) -> Result<(Persona, FactorInstancesProviderOutcomeForFactor)> { - let display_name = DisplayName::new(name)?; - self.create_and_save_new_mainnet_persona_with_bdfs_with_derivation_outcome(display_name).await - } - - /// Mutates Accounts in Profile ONLY, DOES NOT submit any transaction changing - /// security state on chain - pub(crate) fn __OFFLINE_ONLY_securify_account_without_saving( - &self, - account_address: AccountAddress, - security_structure_of_factor_instances: SecurityStructureOfFactorInstances, - ) -> Result { - let entity = self.__OFFLINE_ONLY_securify_entity_without_saving( - AddressOfAccountOrPersona::Account(account_address), - security_structure_of_factor_instances, - )?; - - entity - .clone() - .as_account_entity() - .ok_or(CommonError::ExpectedAccountButGotPersona { - address: entity.address().to_string(), - }) - .cloned() - } - - pub(crate) fn __OFFLINE_ONLY_securify_entity_without_saving( - &self, - entity_address: AddressOfAccountOrPersona, - security_structure_of_factor_instances: SecurityStructureOfFactorInstances, - ) -> Result { - let mut entity = self.entity_by_address(entity_address)?; - - let veci: HierarchicalDeterministicFactorInstance; - let access_controller_address: AccessControllerAddress; - - match entity.security_state() { - EntitySecurityState::Unsecured { value } => { - veci = value.transaction_signing.clone(); - // THIS IS COMPLETELY WRONG! - // The real solution should get the AccessControllerAddress on chain - access_controller_address = - AccessControllerAddress::with_node_id_of(&entity.address()); - } - EntitySecurityState::Securified { value } => { - veci = value.veci.clone().unwrap(); - access_controller_address = value.access_controller_address; - } - }; - - let securified_control = SecuredEntityControl::new( - veci, - access_controller_address, - security_structure_of_factor_instances, - )?; - - entity.set_security_state(EntitySecurityState::Securified { - value: securified_control, - })?; - - Ok(entity) - } - - /// Uses FactorInstancesProvider to get factor instances for the `shield`. - /// Mutates Accounts in Profile ONLY, DOES NOT submit any transaction changing - /// security state on chain - async fn __OFFLINE_ONLY_securify_accounts( - &self, - account_addresses: IndexSet, - shield: &SecurityStructureOfFactorSources, - ) -> Result<(Accounts, FactorInstancesProviderOutcome)> { - let (entities, outcome) = self - .__OFFLINE_ONLY_securify_entities( - account_addresses.into_iter().map(Into::into).collect(), - shield, - ) - .await?; - - let accounts = entities - .into_iter() - .map(|e| e.into_account_entity().unwrap()) - .collect(); - Ok((accounts, outcome)) - } - - async fn __OFFLINE_ONLY_securify_entities( - &self, - entity_addresses: IndexSet, - shield: &SecurityStructureOfFactorSources, - ) -> Result<( - IdentifiedVecOf, - FactorInstancesProviderOutcome, - )> { - entity_addresses - .iter() - .for_each(|a| assert!(self.entity_by_address(*a).is_ok())); - - let outcome = self.make_security_structure_of_factor_instances_for_entities_without_consuming_cache_with_derivation_outcome( - entity_addresses.clone().into_iter().map(Into::into).collect(), - shield.clone()).await?; - - let ( - security_structures_of_factor_instances, - instances_in_cache_consumer, - derivation_outcome, - ) = outcome; - - let mut security_structures_of_factor_instances = - security_structures_of_factor_instances; - - // consume! - instances_in_cache_consumer.consume().await?; - - let securified_entities = entity_addresses - .into_iter() - .map(|entity_address| { - let security_structure_of_factor_instances = - security_structures_of_factor_instances - .shift_remove(&entity_address) - .unwrap(); - - // Production ready code should batch update entities, submit batch transaction to - // network, and then batch update all accounts in Profile. - self.__OFFLINE_ONLY_securify_entity_without_saving( - entity_address, - security_structure_of_factor_instances, - ) - }) - .collect::>>()?; - - assert!(security_structures_of_factor_instances.is_empty()); - - // Assert that none of the NEW FactorInstances collide with the existing ones - self.profile() - .unwrap() - .assert_new_factor_instances_not_already_used_erased( - securified_entities.clone(), - )?; - self.update_entities_erased(securified_entities.clone()) - .await?; - - Ok(( - securified_entities.into_iter().collect(), - derivation_outcome, - )) - } - - /// Uses FactorInstancesProvider to get factor instances for the `shield`. - /// Mutates Accounts in Profile ONLY, DOES NOT submit any transaction changing - /// security state on chain - #[allow(non_camel_case_types)] - async fn __OFFLINE_ONLY_securify_account( - &self, - account_address: AccountAddress, - shield: &SecurityStructureOfFactorSources, - ) -> Result<(Account, FactorInstancesProviderOutcome)> { - let (accounts, outcome) = self - .__OFFLINE_ONLY_securify_accounts( - IndexSet::just(account_address), - shield, - ) - .await?; - assert_eq!(accounts.len(), 1); - let account = accounts.first().unwrap().clone(); - Ok((account, outcome)) - } -} - #[actix_rt::test] async fn create_accounts_when_last_is_used_cache_is_fill_only_with_account_vecis_and_if_profile_is_used_a_new_account_is_created( ) { @@ -430,6 +205,7 @@ async fn adding_personas_and_clearing_cache_in_between() { ); } +#[cfg(test)] trait AllHdFactorsFromRole { fn all_hd_factors(&self) -> Vec; } diff --git a/crates/sargon_SPLIT_ME/src/interactors/interactors.rs b/crates/system/os/os/src/testing_interactors.rs similarity index 60% rename from crates/sargon_SPLIT_ME/src/interactors/interactors.rs rename to crates/system/os/os/src/testing_interactors.rs index ec53ece72..9fb37436d 100644 --- a/crates/sargon_SPLIT_ME/src/interactors/interactors.rs +++ b/crates/system/os/os/src/testing_interactors.rs @@ -1,25 +1,22 @@ use crate::prelude::*; -/// A collection of interactors that the host is providing during boot. -/// Such interactors are used to drive ui from within sargon os. -pub struct Interactors { - /// Interactors related to factor sources. - pub use_factor_sources_interactor: Arc, -} +pub trait InteractorsCtors { + fn new_with_derivation_interactor( + keys_derivation_interactor: Arc, + ) -> Interactors; -impl Interactors { - pub fn new( - use_factor_sources_interactor: Arc, - ) -> Self { - Self { - use_factor_sources_interactor, - } + fn new_from_clients(clients: &Clients) -> Interactors { + Self::new_with_derivation_interactor(Arc::new( + TestDerivationInteractor::new( + false, + Arc::new(clients.secure_storage.clone()), + ), + )) } } -#[cfg(test)] -impl Interactors { - pub fn new_with_derivation_interactor( +impl InteractorsCtors for Interactors { + fn new_with_derivation_interactor( keys_derivation_interactor: Arc, ) -> Self { let use_factor_sources_interactors = @@ -38,13 +35,4 @@ impl Interactors { Self::new(Arc::new(use_factor_sources_interactors)) } - - pub fn new_from_clients(clients: &Clients) -> Self { - Self::new_with_derivation_interactor(Arc::new( - TestDerivationInteractor::new( - false, - Arc::new(clients.secure_storage.clone()), - ), - )) - } } diff --git a/crates/system/os/security-center/Cargo.toml b/crates/system/os/security-center/Cargo.toml new file mode 100644 index 000000000..964190972 --- /dev/null +++ b/crates/system/os/security-center/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "sargon-os-security-center" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +sargon-os = { path = "../../../system/os/os" } +drivers = { workspace = true } +has-sample-values = { workspace = true } +error = { workspace = true } +security-center = { workspace = true } + +# ==== RADIX DEPENDENCIES ==== +# None + +# ==== EXTERNAL DEPENDENCIES ==== +actix-rt = { workspace = true } +derive_more = { workspace = true } +log = { workspace = true } +serde = { workspace = true } diff --git a/crates/system/os/security-center/src/lib.rs b/crates/system/os/security-center/src/lib.rs new file mode 100644 index 000000000..d4f2740e5 --- /dev/null +++ b/crates/system/os/security-center/src/lib.rs @@ -0,0 +1,20 @@ +mod sargon_os_security_center; + +pub mod prelude { + pub use crate::sargon_os_security_center::*; + + pub(crate) use error::prelude::*; + pub(crate) use sargon_os::prelude::*; + pub(crate) use security_center::prelude::*; + + #[cfg(test)] + mod testing { + pub(crate) use drivers::prelude::*; + pub(crate) use has_sample_values::prelude::*; + pub(crate) use std::sync::Arc; + } + #[cfg(test)] + pub(crate) use testing::*; +} + +pub use prelude::*; diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_security_center.rs b/crates/system/os/security-center/src/sargon_os_security_center.rs similarity index 82% rename from crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_security_center.rs rename to crates/system/os/security-center/src/sargon_os_security_center.rs index f7aaa510c..9be53d11c 100644 --- a/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_security_center.rs +++ b/crates/system/os/security-center/src/sargon_os_security_center.rs @@ -1,11 +1,18 @@ use crate::prelude::*; +pub trait OsCheckSecurityProblems { + fn check_security_problems( + &self, + input: CheckSecurityProblemsInput, + ) -> Result>; +} + // ================== // Check Security Problems // ================== -impl SargonOS { +impl OsCheckSecurityProblems for SargonOS { /// Returns all the `SecurityProblem`s that are present for the given input. - pub fn check_security_problems( + fn check_security_problems( &self, input: CheckSecurityProblemsInput, ) -> Result> { diff --git a/crates/system/os/signing/Cargo.toml b/crates/system/os/signing/Cargo.toml new file mode 100644 index 000000000..09dd9c9b6 --- /dev/null +++ b/crates/system/os/signing/Cargo.toml @@ -0,0 +1,34 @@ +[package] +name = "sargon-os-signing" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +sargon-os = { path = "../../../system/os/os" } +error = { workspace = true } +signing = { workspace = true } +signing-traits = { workspace = true } +transaction-models = { workspace = true } +profile-security-structures = { workspace = true } +radix-connect-models = { workspace = true } +profile = { workspace = true } +profile-logic = { workspace = true } + +# ==== RADIX DEPENDENCIES ==== +# None + +# ==== EXTERNAL DEPENDENCIES ==== +actix-rt = { workspace = true } +async-trait = { workspace = true } +derive_more = { workspace = true } +log = { workspace = true } +serde = { workspace = true } + +[dev-dependencies] +# === SARGON CRATES === +drivers = { workspace = true } +interactors = { workspace = true } +clients = { workspace = true } +factor-instances-provider = { workspace = true } +key-derivation-traits = { workspace = true } diff --git a/crates/system/os/signing/src/lib.rs b/crates/system/os/signing/src/lib.rs new file mode 100644 index 000000000..133494bc2 --- /dev/null +++ b/crates/system/os/signing/src/lib.rs @@ -0,0 +1,28 @@ +mod sargon_os_signing; + +pub mod prelude { + pub use crate::sargon_os_signing::*; + + pub(crate) use error::prelude::*; + pub(crate) use profile::prelude::*; + pub(crate) use sargon_os::prelude::*; + pub(crate) use signing::prelude::*; + + pub(crate) use signing_traits::prelude::*; + + pub(crate) use std::sync::Arc; + + #[cfg(test)] + mod testing { + pub(crate) use clients::prelude::*; + pub(crate) use factor_instances_provider::prelude::*; + pub(crate) use interactors::prelude::*; + pub(crate) use key_derivation_traits::prelude::*; + pub(crate) use profile_logic::prelude::*; + pub(crate) use radix_connect_models::prelude::*; + } + #[cfg(test)] + pub(crate) use testing::*; +} + +pub use prelude::*; diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_signing.rs b/crates/system/os/signing/src/sargon_os_signing.rs similarity index 93% rename from crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_signing.rs rename to crates/system/os/signing/src/sargon_os_signing.rs index 1bea650cc..0471beb1e 100644 --- a/crates/sargon_SPLIT_ME/src/sargon_os/sargon_os_signing.rs +++ b/crates/system/os/signing/src/sargon_os_signing.rs @@ -1,10 +1,38 @@ use crate::prelude::*; +#[async_trait::async_trait] +pub trait OsSigning { + async fn sign( + &self, + signable: S, + sign_interactor: Arc>, + purpose: SigningPurpose, + ) -> Result; + + async fn sign_auth( + &self, + auth_intent: AuthIntent, + ) -> Result; + + async fn sign_transaction( + &self, + transaction_intent: TransactionIntent, + role_kind: RoleKind, + ) -> Result; + + async fn sign_subintent( + &self, + subintent: Subintent, + role_kind: RoleKind, + ) -> Result; +} + // ================== // Sign Signables // ================== -impl SargonOS { - pub async fn sign_auth( +#[async_trait::async_trait] +impl OsSigning for SargonOS { + async fn sign_auth( &self, auth_intent: AuthIntent, ) -> Result { @@ -16,7 +44,7 @@ impl SargonOS { .await } - pub async fn sign_transaction( + async fn sign_transaction( &self, transaction_intent: TransactionIntent, role_kind: RoleKind, @@ -29,7 +57,7 @@ impl SargonOS { .await } - pub async fn sign_subintent( + async fn sign_subintent( &self, subintent: Subintent, role_kind: RoleKind, @@ -48,7 +76,7 @@ impl SargonOS { sign_interactor: Arc>, purpose: SigningPurpose, ) -> Result { - let profile = &self.profile_state_holder.profile()?; + let profile = &self.profile()?; let collector = SignaturesCollector::new( SigningFinishEarlyStrategy::default(), diff --git a/crates/system/os/transaction/Cargo.toml b/crates/system/os/transaction/Cargo.toml new file mode 100644 index 000000000..7e5495fef --- /dev/null +++ b/crates/system/os/transaction/Cargo.toml @@ -0,0 +1,34 @@ +[package] +name = "sargon-os-transaction" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +sargon-os = { path = "../../../system/os/os" } +transaction-models = { workspace = true } +manifests = { workspace = true } +signing-traits = { workspace = true } +radix-connect-models = { workspace = true } +signing = { workspace = true } +entity-by-address = { workspace = true } +profile = { workspace = true } +# profile-state-holder = { workspace = true } +profile-account-or-persona = { workspace = true } +gateway-client-and-api = { workspace = true } + +# ==== RADIX DEPENDENCIES ==== +radix-engine-interface = { workspace = true } +radix-engine-toolkit-common = { workspace = true } +radix-common = { workspace = true } + +# ==== EXTERNAL DEPENDENCIES ==== +actix-rt = { workspace = true } +async-std = { workspace = true } +async-trait = { workspace = true } +derive_more = { workspace = true } +itertools = { workspace = true } +log = { workspace = true } +pretty_assertions = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } diff --git a/crates/system/os/transaction/src/lib.rs b/crates/system/os/transaction/src/lib.rs new file mode 100644 index 000000000..95aad6bdf --- /dev/null +++ b/crates/system/os/transaction/src/lib.rs @@ -0,0 +1,29 @@ +#![feature(let_chains)] + +mod pre_auth; +mod tx; + +pub mod prelude { + pub use crate::pre_auth::*; + pub use crate::tx::*; + + pub(crate) use entity_by_address::prelude::*; + pub(crate) use gateway_client_and_api::prelude::*; + pub(crate) use manifests::prelude::*; + + pub(crate) use radix_connect_models::prelude::*; + pub(crate) use sargon_os::prelude::*; + pub(crate) use signing::prelude::*; + pub(crate) use signing_traits::prelude::*; + + pub(crate) use radix_engine_interface::prelude::MetadataValue as ScryptoMetadataValue; + + #[cfg(test)] + mod testing { + pub(crate) use std::sync::Arc; + } + #[cfg(test)] + pub(crate) use testing::*; +} + +pub use prelude::*; diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/pre_authorization/mod.rs b/crates/system/os/transaction/src/pre_auth/mod.rs similarity index 55% rename from crates/sargon_SPLIT_ME/src/sargon_os/pre_authorization/mod.rs rename to crates/system/os/transaction/src/pre_auth/mod.rs index 601577bf0..ad4032676 100644 --- a/crates/sargon_SPLIT_ME/src/sargon_os/pre_authorization/mod.rs +++ b/crates/system/os/transaction/src/pre_auth/mod.rs @@ -2,4 +2,6 @@ mod sargon_os_create_subintent; mod sargon_os_pre_authorization_status; mod support; +pub use sargon_os_create_subintent::*; +pub use sargon_os_pre_authorization_status::*; pub use support::*; diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/pre_authorization/sargon_os_create_subintent.rs b/crates/system/os/transaction/src/pre_auth/sargon_os_create_subintent.rs similarity index 91% rename from crates/sargon_SPLIT_ME/src/sargon_os/pre_authorization/sargon_os_create_subintent.rs rename to crates/system/os/transaction/src/pre_auth/sargon_os_create_subintent.rs index 85322965b..a183f2884 100644 --- a/crates/sargon_SPLIT_ME/src/sargon_os/pre_authorization/sargon_os_create_subintent.rs +++ b/crates/system/os/transaction/src/pre_auth/sargon_os_create_subintent.rs @@ -1,12 +1,35 @@ use crate::prelude::*; use std::time::Duration; +#[async_trait::async_trait] +pub trait OSCreateSubintent { + async fn create_subintent( + &self, + intent_discriminator: IntentDiscriminator, + subintent_manifest: SubintentManifest, + expiration: DappToWalletInteractionSubintentExpiration, + message: Option, + ) -> Result; + + fn expiry_time_from_now_in_seconds( + &self, + expiration: DappToWalletInteractionSubintentExpiration, + ) -> u64; + + fn calculate_end_ranges( + &self, + current_epoch: Epoch, + expiry_time_from_now_in_seconds: u64, + ) -> (Epoch, Instant); +} + // ================== // Create Subintent // ================== -impl SargonOS { +#[async_trait::async_trait] +impl OSCreateSubintent for SargonOS { /// Creates a Subintent given its discriminator, manifest and expiration. - pub async fn create_subintent( + async fn create_subintent( &self, intent_discriminator: IntentDiscriminator, subintent_manifest: SubintentManifest, @@ -22,10 +45,8 @@ impl SargonOS { // Get current epoch let network_id = self.current_network_id()?; - let gateway_client = GatewayClient::new( - self.clients.http_client.driver.clone(), - network_id, - ); + let gateway_client = + GatewayClient::new(self.http_client.driver.clone(), network_id); let current_epoch = gateway_client.current_epoch().await?; // Calculate header ranges diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/pre_authorization/sargon_os_pre_authorization_status.rs b/crates/system/os/transaction/src/pre_auth/sargon_os_pre_authorization_status.rs similarity index 93% rename from crates/sargon_SPLIT_ME/src/sargon_os/pre_authorization/sargon_os_pre_authorization_status.rs rename to crates/system/os/transaction/src/pre_auth/sargon_os_pre_authorization_status.rs index bf353fa04..237c73ed2 100644 --- a/crates/sargon_SPLIT_ME/src/sargon_os/pre_authorization/sargon_os_pre_authorization_status.rs +++ b/crates/system/os/transaction/src/pre_auth/sargon_os_pre_authorization_status.rs @@ -1,12 +1,22 @@ use crate::prelude::*; use std::time::Duration; +#[async_trait::async_trait] +pub trait OSPollPreAuthorizationStatus { + async fn poll_pre_authorization_status( + &self, + intent_hash: SubintentHash, + expiration_timestamp: Instant, + ) -> Result; +} + // ================== // Poll PreAuthorization Status (Public) // ================== -impl SargonOS { +#[async_trait::async_trait] +impl OSPollPreAuthorizationStatus for SargonOS { /// Polls the status of a `SubintentHash` until it is either `Success` or `Expired`. - pub async fn poll_pre_authorization_status( + async fn poll_pre_authorization_status( &self, intent_hash: SubintentHash, expiration_timestamp: Instant, @@ -22,10 +32,21 @@ impl SargonOS { } } +#[async_trait::async_trait] +pub trait OSPollPreAuthorizationStatusWithDelays { + fn seconds_until_expiration(&self, expiration_timestamp: Instant) -> u64; + async fn poll_pre_authorization_status_with_delays( + &self, + intent_hash: SubintentHash, + seconds_until_expiration: u64, + ) -> Result<(PreAuthorizationStatus, Vec)>; +} + // ================== // Poll PreAuthorization Status (Internal) // ================== -impl SargonOS { +#[async_trait::async_trait] +impl OSPollPreAuthorizationStatusWithDelays for SargonOS { /// Polls the state of a Subintent until it is submitted /// /// It returns the `PreAuthorizationStatus`, but also the list of delays between each poll. @@ -35,10 +56,8 @@ impl SargonOS { seconds_until_expiration: u64, ) -> Result<(PreAuthorizationStatus, Vec)> { let network_id = self.current_network_id()?; - let gateway_client = GatewayClient::new( - self.clients.http_client.driver.clone(), - network_id, - ); + let gateway_client = + GatewayClient::new(self.http_client.driver.clone(), network_id); // We are going to play safe and leave an extra second to make sure we check the status one second after it has theoretically expired. // This is to avoid considering expired a subintent that got committed in the last instant. diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/pre_authorization/support/mod.rs b/crates/system/os/transaction/src/pre_auth/support/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/sargon_os/pre_authorization/support/mod.rs rename to crates/system/os/transaction/src/pre_auth/support/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/pre_authorization/support/pre_authorization_status.rs b/crates/system/os/transaction/src/pre_auth/support/pre_authorization_status.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/sargon_os/pre_authorization/support/pre_authorization_status.rs rename to crates/system/os/transaction/src/pre_auth/support/pre_authorization_status.rs diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/transactions/mod.rs b/crates/system/os/transaction/src/tx/mod.rs similarity index 52% rename from crates/sargon_SPLIT_ME/src/sargon_os/transactions/mod.rs rename to crates/system/os/transaction/src/tx/mod.rs index d2fa5e92c..58bcdad43 100644 --- a/crates/sargon_SPLIT_ME/src/sargon_os/transactions/mod.rs +++ b/crates/system/os/transaction/src/tx/mod.rs @@ -3,4 +3,7 @@ mod sargon_os_transaction_status; mod sargon_os_transaction_submit; mod support; +pub use sargon_os_transaction_analysis::*; +pub use sargon_os_transaction_status::*; +pub use sargon_os_transaction_submit::*; pub use support::*; diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/transactions/sargon_os_transaction_analysis.rs b/crates/system/os/transaction/src/tx/sargon_os_transaction_analysis.rs similarity index 92% rename from crates/sargon_SPLIT_ME/src/sargon_os/transactions/sargon_os_transaction_analysis.rs rename to crates/system/os/transaction/src/tx/sargon_os_transaction_analysis.rs index 1bb3923d6..4f9a6a55c 100644 --- a/crates/sargon_SPLIT_ME/src/sargon_os/transactions/sargon_os_transaction_analysis.rs +++ b/crates/system/os/transaction/src/tx/sargon_os_transaction_analysis.rs @@ -11,14 +11,35 @@ const GW_ERR_ACCOUNT_DEPOSIT_DISALLOWED: &str = const GW_ERR_NOT_ALL_COULD_BE_DEPOSITED: &str = "AccountError(NotAllBucketsCouldBeDeposited"; -impl SargonOS { +#[async_trait::async_trait] +pub trait OsAnalyseTxPreview { + async fn analyse_transaction_preview( + &self, + instructions: String, + blobs: Blobs, + are_instructions_originating_from_host: bool, + nonce: Nonce, + notary_public_key: PublicKey, + ) -> Result; + + async fn analyse_pre_auth_preview( + &self, + instructions: String, + blobs: Blobs, + nonce: Nonce, + notary_public_key: PublicKey, + ) -> Result; +} + +#[async_trait::async_trait] +impl OsAnalyseTxPreview for SargonOS { /// Performs initial transaction analysis for a given raw manifest, including: /// 1. Extracting the transaction signers. /// 2. Executing the transaction preview GW request. /// 3. Running the execution summary with the manifest and receipt. /// /// Maps relevant errors to ensure proper handling by the hosts. - pub async fn analyse_transaction_preview( + async fn analyse_transaction_preview( &self, instructions: String, blobs: Blobs, @@ -26,7 +47,7 @@ impl SargonOS { nonce: Nonce, notary_public_key: PublicKey, ) -> Result { - let network_id = self.profile_state_holder.current_network_id()?; + let network_id = self.current_network_id()?; let transaction_manifest = TransactionManifest::new(instructions, network_id, blobs)?; @@ -60,14 +81,14 @@ impl SargonOS { /// 3. The execution summary is created with the manifest and receipt. /// /// Maps relevant errors to ensure proper handling by the hosts. - pub async fn analyse_pre_auth_preview( + async fn analyse_pre_auth_preview( &self, instructions: String, blobs: Blobs, nonce: Nonce, notary_public_key: PublicKey, ) -> Result { - let network_id = self.profile_state_holder.current_network_id()?; + let network_id = self.current_network_id()?; let subintent_manifest = SubintentManifest::new( instructions, network_id, @@ -108,8 +129,37 @@ impl SargonOS { } } -impl SargonOS { - async fn get_execution_summary( +#[async_trait::async_trait] +pub trait OsExecutionSummary { + async fn get_execution_summary( + &self, + network_id: NetworkID, + manifest: T, + nonce: Nonce, + notary_public_key: PublicKey, + are_instructions_originating_from_host: bool, + ) -> Result; + + fn extract_signer_public_keys( + &self, + manifest_summary: ManifestSummary, + ) -> Result>; + + fn extract_execution_summary( + manifest: &dyn DynamicallyAnalyzableManifest, + receipts: PreviewResponseReceipts, + network_id: NetworkID, + are_instructions_originating_from_host: bool, + ) -> Result; + + fn map_failed_transaction_preview( + receipt: TransactionReceipt, + ) -> CommonError; +} + +#[async_trait::async_trait] +impl OsExecutionSummary for SargonOS { + async fn get_execution_summary( &self, network_id: NetworkID, manifest: T, @@ -120,10 +170,8 @@ impl SargonOS { let signer_public_keys = self.extract_signer_public_keys(manifest.summary(network_id)?)?; - let gateway_client = GatewayClient::new( - self.clients.http_client.driver.clone(), - network_id, - ); + let gateway_client = + GatewayClient::new(self.http_client.driver.clone(), network_id); let epoch = gateway_client.current_epoch().await?; @@ -151,7 +199,7 @@ impl SargonOS { manifest_summary: ManifestSummary, ) -> Result> { // Extracting the entities requiring auth to check if the notary is signatory - let profile = self.profile_state_holder.profile()?; + let profile = self.profile()?; let signable_summary = SignableManifestSummary::new(manifest_summary.clone()); @@ -226,27 +274,29 @@ impl SargonOS { } } -trait PreviewableManifest: - DynamicallyAnalyzableManifest + StaticallyAnalyzableManifest +#[async_trait::async_trait] +pub trait PreviewableManifest: + DynamicallyAnalyzableManifest + StaticallyAnalyzableManifest + Send + Sync { async fn fetch_preview( &self, gateway_client: &GatewayClient, network_id: NetworkID, start_epoch_inclusive: Epoch, - signer_public_keys: impl IntoIterator, + signer_public_keys: IndexSet, notary_public_key: PublicKey, nonce: Nonce, ) -> Result; } +#[async_trait::async_trait] impl PreviewableManifest for ScryptoTransactionManifestV2 { async fn fetch_preview( &self, gateway_client: &GatewayClient, network_id: NetworkID, start_epoch_inclusive: Epoch, - signer_public_keys: impl IntoIterator, + signer_public_keys: IndexSet, notary_public_key: PublicKey, nonce: Nonce, ) -> Result { @@ -268,13 +318,14 @@ impl PreviewableManifest for ScryptoTransactionManifestV2 { } } +#[async_trait::async_trait] impl PreviewableManifest for TransactionManifest { async fn fetch_preview( &self, gateway_client: &GatewayClient, _network_id: NetworkID, start_epoch_inclusive: Epoch, - signer_public_keys: impl IntoIterator, + signer_public_keys: IndexSet, notary_public_key: PublicKey, nonce: Nonce, ) -> Result { @@ -294,7 +345,7 @@ impl PreviewableManifest for TransactionManifest { } } -struct PreviewResponseReceipts { +pub struct PreviewResponseReceipts { receipt: Option, engine_toolkit_receipt: Option, @@ -331,29 +382,6 @@ mod transaction_preview_analysis_tests { )); } - #[actix_rt::test] - async fn profile_not_loaded_error() { - let os = SUT::fast_boot().await; - os.profile_state_holder - .replace_profile_state_with(ProfileState::None) - .unwrap(); - - let result = os - .analyse_transaction_preview( - TransactionManifest::sample().instructions_string(), - Blobs::sample(), - false, - Nonce::sample(), - PublicKey::sample(), - ) - .await; - - assert!(matches!( - result, - Err(CommonError::ProfileStateNotLoaded { .. }) - )); - } - #[actix_rt::test] async fn failed_network_response_error() { let os = prepare_os(MockNetworkingDriver::new_always_failing()).await; @@ -612,6 +640,8 @@ mod transaction_preview_analysis_tests { ) } + use radix_common::math::Decimal as ScryptoDecimal192; + #[actix_rt::test] async fn success() { let responses = prepare_responses( @@ -871,13 +901,14 @@ mod transaction_preview_analysis_tests { .await .unwrap() .unwrap(); - os.profile_state_holder - .update_profile_with(|profile| { - profile.networks.insert(ProfileNetwork::sample_mainnet()); - profile.factor_sources.insert(FactorSource::sample()); - Ok(()) - }) - .unwrap(); + + os.update_profile_with(|profile| { + profile.networks.insert(ProfileNetwork::sample_mainnet()); + profile.factor_sources.insert(FactorSource::sample()); + Ok(()) + }) + .await + .unwrap(); os } diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/transactions/sargon_os_transaction_status.rs b/crates/system/os/transaction/src/tx/sargon_os_transaction_status.rs similarity index 92% rename from crates/sargon_SPLIT_ME/src/sargon_os/transactions/sargon_os_transaction_status.rs rename to crates/system/os/transaction/src/tx/sargon_os_transaction_status.rs index 16df8259a..812ca8689 100644 --- a/crates/sargon_SPLIT_ME/src/sargon_os/transactions/sargon_os_transaction_status.rs +++ b/crates/system/os/transaction/src/tx/sargon_os_transaction_status.rs @@ -1,12 +1,26 @@ use crate::prelude::*; use std::time::Duration; +#[async_trait::async_trait] +pub trait OsTXStatusPolling { + async fn poll_transaction_status( + &self, + intent_hash: TransactionIntentHash, + ) -> Result; + + async fn poll_transaction_status_with_delays( + &self, + intent_hash: TransactionIntentHash, + ) -> Result<(TransactionStatus, Vec)>; +} + // ================== // Poll Transaction Status (Public) // ================== -impl SargonOS { +#[async_trait::async_trait] +impl OsTXStatusPolling for SargonOS { /// Polls the state of a Transaction until we can determine its `TransactionStatus`. - pub async fn poll_transaction_status( + async fn poll_transaction_status( &self, intent_hash: TransactionIntentHash, ) -> Result { @@ -14,12 +28,10 @@ impl SargonOS { .await .map(|(status, _)| status) } -} -// ================== -// Poll Transaction Status (Internal) -// ================== -impl SargonOS { + // ================== + // Poll Transaction Status (Internal) + // ================== /// Polls the state of a Transaction until we can determine its `TransactionStatus`. /// /// This is the internal implementation of `poll_transaction_status`, which is the public API. @@ -29,10 +41,8 @@ impl SargonOS { intent_hash: TransactionIntentHash, ) -> Result<(TransactionStatus, Vec)> { let network_id = self.current_network_id()?; - let gateway_client = GatewayClient::new( - self.clients.http_client.driver.clone(), - network_id, - ); + let gateway_client = + GatewayClient::new(self.http_client.driver.clone(), network_id); let mut delays: Vec = vec![]; let mut delay_duration = POLLING_DELAY_INCREMENT_IN_SECONDS; diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/transactions/sargon_os_transaction_submit.rs b/crates/system/os/transaction/src/tx/sargon_os_transaction_submit.rs similarity index 86% rename from crates/sargon_SPLIT_ME/src/sargon_os/transactions/sargon_os_transaction_submit.rs rename to crates/system/os/transaction/src/tx/sargon_os_transaction_submit.rs index 44355bd2a..6d95bd680 100644 --- a/crates/sargon_SPLIT_ME/src/sargon_os/transactions/sargon_os_transaction_submit.rs +++ b/crates/system/os/transaction/src/tx/sargon_os_transaction_submit.rs @@ -1,19 +1,26 @@ use crate::prelude::*; +#[async_trait::async_trait] +pub trait OsTxSubmitting { + async fn submit_transaction( + &self, + notarized_transaction: NotarizedTransaction, + ) -> Result; +} + // ================== // Submit Transaction // ================== -impl SargonOS { +#[async_trait::async_trait] +impl OsTxSubmitting for SargonOS { /// Submits a notarized transaction payload to the network. - pub async fn submit_transaction( + async fn submit_transaction( &self, notarized_transaction: NotarizedTransaction, ) -> Result { let network_id = self.current_network_id()?; - let gateway_client = GatewayClient::new( - self.clients.http_client.driver.clone(), - network_id, - ); + let gateway_client = + GatewayClient::new(self.http_client.driver.clone(), network_id); gateway_client .submit_notarized_transaction(notarized_transaction) .await diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/transactions/support/mod.rs b/crates/system/os/transaction/src/tx/support/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/sargon_os/transactions/support/mod.rs rename to crates/system/os/transaction/src/tx/support/mod.rs diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/transactions/support/pre_auth_to_review.rs b/crates/system/os/transaction/src/tx/support/pre_auth_to_review.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/sargon_os/transactions/support/pre_auth_to_review.rs rename to crates/system/os/transaction/src/tx/support/pre_auth_to_review.rs diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/transactions/support/signable_manifest_summary.rs b/crates/system/os/transaction/src/tx/support/signable_manifest_summary.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/sargon_os/transactions/support/signable_manifest_summary.rs rename to crates/system/os/transaction/src/tx/support/signable_manifest_summary.rs diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/transactions/support/transaction_to_review.rs b/crates/system/os/transaction/src/tx/support/transaction_to_review.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/sargon_os/transactions/support/transaction_to_review.rs rename to crates/system/os/transaction/src/tx/support/transaction_to_review.rs diff --git a/crates/system/profile-state-holder/Cargo.toml b/crates/system/profile-state-holder/Cargo.toml new file mode 100644 index 000000000..78346d6f2 --- /dev/null +++ b/crates/system/profile-state-holder/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "profile-state-holder" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +profile = { workspace = true } +error = { workspace = true } +profile-supporting-types = { workspace = true } +profile-logic = { workspace = true } + +# ==== RADIX DEPENDENCIES ==== +# None + +# ==== EXTERNAL DEPENDENCIES ==== +derive_more = { workspace = true } +log = { workspace = true } +pretty_assertions = { workspace = true } +serde = { workspace = true } diff --git a/crates/system/profile-state-holder/src/lib.rs b/crates/system/profile-state-holder/src/lib.rs new file mode 100644 index 000000000..7a588125e --- /dev/null +++ b/crates/system/profile-state-holder/src/lib.rs @@ -0,0 +1,11 @@ +mod profile_state_holder; + +pub mod prelude { + pub use crate::profile_state_holder::*; + + pub(crate) use error::prelude::*; + pub(crate) use profile::prelude::*; + pub(crate) use profile_logic::prelude::*; +} + +pub use prelude::*; diff --git a/crates/sargon_SPLIT_ME/src/sargon_os/profile_state_holder.rs b/crates/system/profile-state-holder/src/profile_state_holder.rs similarity index 97% rename from crates/sargon_SPLIT_ME/src/sargon_os/profile_state_holder.rs rename to crates/system/profile-state-holder/src/profile_state_holder.rs index da9fed3b2..1c19ab377 100644 --- a/crates/sargon_SPLIT_ME/src/sargon_os/profile_state_holder.rs +++ b/crates/system/profile-state-holder/src/profile_state_holder.rs @@ -17,7 +17,7 @@ impl ProfileStateHolder { impl ProfileStateHolder { /// Clone the profile and return it. - pub(super) fn profile(&self) -> Result { + pub fn profile(&self) -> Result { self.access_profile_with(|p| p.clone()) } @@ -111,7 +111,7 @@ impl ProfileStateHolder { .map(access) } - pub(super) fn try_access_profile_with(&self, access: F) -> Result + pub fn try_access_profile_with(&self, access: F) -> Result where F: Fn(&Profile) -> Result, { @@ -130,7 +130,7 @@ impl ProfileStateHolder { } /// Sets the `ProfileState` held by this `ProfileStateHolder` to the latest `profile_state`. - pub(super) fn replace_profile_state_with( + pub fn replace_profile_state_with( &self, profile_state: ProfileState, ) -> Result<()> { @@ -154,7 +154,7 @@ impl ProfileStateHolder { /// Updates the in-memory profile held by this `ProfileStateHolder`, you might /// wanna also persist the change in the `SargonOS` by saving it to secure /// storage. - pub(super) fn update_profile_with(&self, mutate: F) -> Result + pub fn update_profile_with(&self, mutate: F) -> Result where F: Fn(&mut Profile) -> Result, { diff --git a/crates/system/sub-systems/Cargo.toml b/crates/system/sub-systems/Cargo.toml new file mode 100644 index 000000000..01d91d793 --- /dev/null +++ b/crates/system/sub-systems/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "sub-systems" +version = "1.1.99" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +drivers = { workspace = true } # Actually need only logging driver.. TODO split out? + +# ==== RADIX DEPENDENCIES ==== +# None + +# ==== EXTERNAL DEPENDENCIES ==== +derive_more = { workspace = true } +enum-iterator = { workspace = true } +itertools = { workspace = true } +log = { workspace = true } +serde = { workspace = true } diff --git a/crates/sargon_SPLIT_ME/src/subsystems/README.md b/crates/system/sub-systems/README.md similarity index 100% rename from crates/sargon_SPLIT_ME/src/subsystems/README.md rename to crates/system/sub-systems/README.md diff --git a/crates/system/sub-systems/src/lib.rs b/crates/system/sub-systems/src/lib.rs new file mode 100644 index 000000000..0e1fa0805 --- /dev/null +++ b/crates/system/sub-systems/src/lib.rs @@ -0,0 +1,20 @@ +mod log_system; + +pub mod prelude { + pub use crate::log_system::*; + + pub(crate) use drivers::prelude::*; + + pub(crate) use log::*; + + pub(crate) use std::sync::{Arc, RwLock}; + + #[cfg(test)] + mod testing { + pub(crate) use itertools::Itertools; + } + #[cfg(test)] + pub(crate) use testing::*; +} + +pub use prelude::*; diff --git a/crates/sargon_SPLIT_ME/src/subsystems/log_system/log_system.rs b/crates/system/sub-systems/src/log_system/log_system.rs similarity index 97% rename from crates/sargon_SPLIT_ME/src/subsystems/log_system/log_system.rs rename to crates/system/sub-systems/src/log_system/log_system.rs index c8a9afb59..9bd288092 100644 --- a/crates/sargon_SPLIT_ME/src/subsystems/log_system/log_system.rs +++ b/crates/system/sub-systems/src/log_system/log_system.rs @@ -43,7 +43,7 @@ fn init() { }); } -pub(crate) fn install_logger(logging_driver: Arc) { +pub fn install_logger(logging_driver: Arc) { init(); *LOG.0.write().unwrap() = Some(logging_driver); rust_logger_set_level(get_default_level()); // can be called from FFI later diff --git a/crates/sargon_SPLIT_ME/src/subsystems/log_system/mod.rs b/crates/system/sub-systems/src/log_system/mod.rs similarity index 100% rename from crates/sargon_SPLIT_ME/src/subsystems/log_system/mod.rs rename to crates/system/sub-systems/src/log_system/mod.rs diff --git a/crates/transaction/foundation/Cargo.toml b/crates/transaction/foundation/Cargo.toml index 951d89ee9..794331a7d 100644 --- a/crates/transaction/foundation/Cargo.toml +++ b/crates/transaction/foundation/Cargo.toml @@ -5,9 +5,9 @@ edition = "2021" [dependencies] # === SARGON CRATES === -assert-json = { path = "../../core/assert-json" } -has-sample-values = { path = "../../core/has-sample-values" } -bytes = { path = "../../common/bytes" } +assert-json = { workspace = true } +has-sample-values = { workspace = true } +bytes = { workspace = true } # === RADIX DEPENDENCIES === radix-engine-interface = { workspace = true } diff --git a/crates/transaction/manifests/Cargo.toml b/crates/transaction/manifests/Cargo.toml index 2341bdf48..b86d343e9 100644 --- a/crates/transaction/manifests/Cargo.toml +++ b/crates/transaction/manifests/Cargo.toml @@ -6,18 +6,18 @@ build = "build.rs" [dependencies] # === SARGON CRATES === -core-utils = { path = "../../core/utils" } -identified-vec-of = { path = "../../common/identified-vec-of" } -hierarchical-deterministic = { path = "../../crypto/hd" } -factors = { path = "../../factors/factors" } -addresses = { path = "../../crypto/addresses" } -metadata = { path = "../../common/metadata" } -transaction-models = { path = "../../transaction/models" } -gateway-models = { path = "../../gateway/models" } -profile = { path = "../../profile/models/profile_SPLIT_ME" } -profile-account-or-persona = { path = "../../profile/models/account-or-persona" } -profile-base-entity = { path = "../../profile/models/base-entity" } -account-for-display = { path = "../../profile/models/account-for-display" } +core-utils = { workspace = true } +identified-vec-of = { workspace = true } +hierarchical-deterministic = { workspace = true } +factors = { workspace = true } +addresses = { workspace = true } +metadata = { workspace = true } +transaction-models = { workspace = true } +gateway-models = { workspace = true } +profile = { workspace = true } +profile-account-or-persona = { workspace = true } +profile-base-entity = { workspace = true } +account-for-display = { workspace = true } # === RADIX DEPENDENCIES === radix-common = { workspace = true } diff --git a/crates/transaction/manifests/build.rs b/crates/transaction/manifests/build.rs index ed5052f36..50acb5395 100644 --- a/crates/transaction/manifests/build.rs +++ b/crates/transaction/manifests/build.rs @@ -1,4 +1,3 @@ -use cargo_toml::{Dependency, Manifest}; use std::env; use std::path::Path; @@ -12,39 +11,4 @@ pub fn main() { "cargo:rustc-env=FIXTURES_TX={}/", fixtures_tx_path.display() ); - - let manifest_path = - Path::new(env!("CARGO_MANIFEST_DIR")).join("Cargo.toml"); - - let manifest = Manifest::from_path(manifest_path).expect("Can't panic"); - let dependencies = manifest.dependencies; - - let set_dep_env = |key: &str| { - let dependency = dependencies.get(key).expect("Can't panic"); - let env_var_value = match dependency { - Dependency::Simple(version) => format!("version={version}"), - Dependency::Inherited(_) => { - panic!("Inherited dependency is not supported") - } - Dependency::Detailed(detailed) => { - if let Some(ref version) = detailed.version { - format!("version={version}") - } else if let Some(ref branch) = detailed.branch { - format!("branch={branch}") - } else if let Some(ref tag) = detailed.tag { - format!("tag={tag}") - } else if let Some(ref rev) = detailed.rev { - format!("rev={rev}") - } else { - panic!("Can't find version of {key} dependency") - } - } - }; - let env_var = - format!("{}_DEPENDENCY={}", key.to_uppercase(), env_var_value); - println!("cargo:rustc-env={}", env_var); - }; - - set_dep_env("radix-engine"); - set_dep_env("radix-engine-toolkit"); } diff --git a/crates/transaction/manifests/src/high_level/sargon_specific_types/mod.rs b/crates/transaction/manifests/src/high_level/sargon_specific_types/mod.rs index 571658124..e0db2a5ff 100644 --- a/crates/transaction/manifests/src/high_level/sargon_specific_types/mod.rs +++ b/crates/transaction/manifests/src/high_level/sargon_specific_types/mod.rs @@ -1,15 +1,9 @@ mod account_locker; mod assets_transfers; -mod build_information; mod stake_claim; -mod transaction; mod transaction_guarantee; +pub use account_locker::*; pub use assets_transfers::*; -pub use build_information::*; - pub use stake_claim::*; pub use transaction_guarantee::*; - -pub use account_locker::*; -pub use transaction::*; diff --git a/crates/transaction/manifests/src/lib.rs b/crates/transaction/manifests/src/lib.rs index 21b8733a2..5aecc5fb4 100644 --- a/crates/transaction/manifests/src/lib.rs +++ b/crates/transaction/manifests/src/lib.rs @@ -153,7 +153,6 @@ pub mod prelude { }, }; - pub(crate) use enum_as_inner::EnumAsInner; pub(crate) use serde::{Deserialize, Serialize}; pub(crate) use std::collections::BTreeMap; diff --git a/crates/transaction/models/Cargo.toml b/crates/transaction/models/Cargo.toml index 714203bc3..20637279d 100644 --- a/crates/transaction/models/Cargo.toml +++ b/crates/transaction/models/Cargo.toml @@ -6,21 +6,21 @@ build = "build.rs" [dependencies] # === SARGON CRATES === -identified-vec-of = { path = "../../common/identified-vec-of" } -hierarchical-deterministic = { path = "../../crypto/hd" } -factors = { path = "../../factors/factors" } -addresses = { path = "../../crypto/addresses" } -hash = { path = "../../crypto/hash" } -bytes = { path = "../../common/bytes" } -ecc = { path = "../../crypto/ecc" } -numeric = { path = "../../common/numeric" } -has-sample-values = { path = "../../core/has-sample-values" } -metadata = { path = "../../common/metadata" } -network = { path = "../../common/network" } -core-utils = { path = "../../core/utils" } -transaction-foundation = { path = "../../transaction/foundation" } -core-collections = { path = "../../core/collections" } -core-misc = { path = "../../core/misc" } # Instant +identified-vec-of = { workspace = true } +hierarchical-deterministic = { workspace = true } +factors = { workspace = true } +addresses = { workspace = true } +hash = { workspace = true } +bytes = { workspace = true } +ecc = { workspace = true } +numeric = { workspace = true } +has-sample-values = { workspace = true } +metadata = { workspace = true } +network = { workspace = true } +core-utils = { workspace = true } +transaction-foundation = { workspace = true } +core-collections = { workspace = true } +core-misc = { workspace = true } # Instant # === RADIX DEPENDENCIES === radix-common = { workspace = true } diff --git a/crates/transaction/models/src/lib.rs b/crates/transaction/models/src/lib.rs index e74aca824..cb79c8ccd 100644 --- a/crates/transaction/models/src/lib.rs +++ b/crates/transaction/models/src/lib.rs @@ -3,6 +3,7 @@ mod error_from; mod is_intent_signing; mod low_level; mod profile_models; +mod transaction_status; mod unvalidated_transaction_manifest; pub mod prelude { @@ -24,6 +25,7 @@ pub mod prelude { pub use crate::is_intent_signing::*; pub use crate::low_level::*; pub use crate::profile_models::*; + pub use crate::transaction_status::*; pub use crate::unvalidated_transaction_manifest::*; pub(crate) use radix_common::{ diff --git a/crates/transaction/manifests/src/high_level/sargon_specific_types/transaction/mod.rs b/crates/transaction/models/src/transaction_status/mod.rs similarity index 100% rename from crates/transaction/manifests/src/high_level/sargon_specific_types/transaction/mod.rs rename to crates/transaction/models/src/transaction_status/mod.rs diff --git a/crates/transaction/manifests/src/high_level/sargon_specific_types/transaction/transaction_status.rs b/crates/transaction/models/src/transaction_status/transaction_status.rs similarity index 100% rename from crates/transaction/manifests/src/high_level/sargon_specific_types/transaction/transaction_status.rs rename to crates/transaction/models/src/transaction_status/transaction_status.rs diff --git a/crates/transaction/manifests/src/high_level/sargon_specific_types/transaction/transaction_status_reason.rs b/crates/transaction/models/src/transaction_status/transaction_status_reason.rs similarity index 100% rename from crates/transaction/manifests/src/high_level/sargon_specific_types/transaction/transaction_status_reason.rs rename to crates/transaction/models/src/transaction_status/transaction_status_reason.rs diff --git a/crates/uniffi/uniffi_SPLIT_ME/Cargo.toml b/crates/uniffi/uniffi_SPLIT_ME/Cargo.toml index 54b9ca5a1..e301ee69a 100644 --- a/crates/uniffi/uniffi_SPLIT_ME/Cargo.toml +++ b/crates/uniffi/uniffi_SPLIT_ME/Cargo.toml @@ -4,9 +4,6 @@ version = "1.1.99" edition = "2021" build = "build.rs" -[[test]] -name = "vectors" - [lib] crate-type = ["staticlib", "cdylib", "lib"] @@ -16,29 +13,29 @@ path = "src/bindgen/bin.rs" [dependencies] # === SARGON CRATES === -identified-vec-of = { path = "../../common/identified-vec-of" } -hierarchical-deterministic = { path = "../../crypto/hd" } -encryption = { path = "../../crypto/encryption" } -factors = { path = "../../factors/factors" } -keys-collector = { path = "../../factors/keys-collector" } -addresses = { path = "../../crypto/addresses" } -transaction-models = { path = "../../transaction/models" } -manifests = { path = "../../transaction/manifests" } -profile = { path = "../../profile/models/profile_SPLIT_ME" } -profile-logic = { path = "../../profile/logic/logic_SPLIT_ME" } -profile-security-structures = { path = "../../profile/models/security-structures" } -factor-instances-provider = { path = "../../factors/instances-provider" } -gateway-models = { path = "../../gateway/models" } -core-misc = { path = "../../core/misc" } -clients = { path = "../../system/clients/clients" } -drivers = { path = "../../system/drivers" } -signing = { path = "../../app/signing" } -profile-persona = { path = "../../profile/models/persona" } -profile-account = { path = "../../profile/models/account" } -gateway-client-and-api = { path = "../../gateway/client-and-api" } +identified-vec-of = { workspace = true } +hierarchical-deterministic = { workspace = true } +encryption = { workspace = true } +factors = { workspace = true } +keys-collector = { workspace = true } +addresses = { workspace = true } +transaction-models = { workspace = true } +manifests = { workspace = true } +profile = { workspace = true } +profile-logic = { workspace = true } +profile-security-structures = { workspace = true } +factor-instances-provider = { workspace = true } +gateway-models = { workspace = true } +core-misc = { workspace = true } +clients = { workspace = true } +drivers = { workspace = true } +signing = { workspace = true } +profile-persona = { workspace = true } +profile-account = { workspace = true } +gateway-client-and-api = { workspace = true } -sargon = { path = "../../sargon_SPLIT_ME" } -sargon-uniffi-conversion-macros = { path = "../../uniffi/conversion-macros" } +sargon = { workspace = true } +sargon-uniffi-conversion-macros = { workspace = true } # === RADIX DEPENDENCIES === radix-engine-toolkit = { workspace = true } diff --git a/crates/uniffi/uniffi_SPLIT_ME/src/Package.swift b/crates/uniffi/uniffi_SPLIT_ME/src/Package.swift deleted file mode 100644 index b282883d2..000000000 --- a/crates/uniffi/uniffi_SPLIT_ME/src/Package.swift +++ /dev/null @@ -1,13 +0,0 @@ -// swift-tools-version:5.9 - -// This is a HACKY workaround the fact that SPM does not allow for Package level exclusion -// of files/folders. SPM actually HAD support for it but it was removed in 2017, in PR -// https://github.com/apple/swift-package-manager/commit/cb69accf41da55386f9703308958aa49ca2a4c5f -// -// So instead we have to add an empty dummy Package.swift to each folder we wanna hide, as per: -// See: https://github.com/apple/swift-package-manager/issues/4460#issuecomment-1475025748 -// And: https://stackoverflow.com/questions/69382302/swift-package-how-to-exclude-files-in-root-git-directory-from-the-actual-swift/70990534#70990534 -// And: https://github.com/tuist/tuist/pull/2058 -import PackageDescription - -let package = Package() diff --git a/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/delete_account/sargon_os_delete_account.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/delete_account/sargon_os_delete_account.rs index 534cfda36..c40eab717 100644 --- a/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/delete_account/sargon_os_delete_account.rs +++ b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/delete_account/sargon_os_delete_account.rs @@ -1,3 +1,5 @@ +use sargon::OsCreateDeleteAccountManifest; + use crate::prelude::*; // ================== diff --git a/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/pre_authorization/sargon_os_create_subintent.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/pre_authorization/sargon_os_create_subintent.rs index ea8211398..509c0db55 100644 --- a/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/pre_authorization/sargon_os_create_subintent.rs +++ b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/pre_authorization/sargon_os_create_subintent.rs @@ -1,3 +1,5 @@ +use sargon::OSCreateSubintent; + use crate::prelude::*; // ================== diff --git a/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/pre_authorization/sargon_os_pre_authorization_status.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/pre_authorization/sargon_os_pre_authorization_status.rs index 3ae1bdb5a..af1826c4b 100644 --- a/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/pre_authorization/sargon_os_pre_authorization_status.rs +++ b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/pre_authorization/sargon_os_pre_authorization_status.rs @@ -1,3 +1,5 @@ +use sargon::OSPollPreAuthorizationStatus; + use crate::prelude::*; // ================== diff --git a/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_entities_linked_to_factor_source.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_entities_linked_to_factor_source.rs index b429f371f..bc5fefc27 100644 --- a/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_entities_linked_to_factor_source.rs +++ b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_entities_linked_to_factor_source.rs @@ -1,3 +1,5 @@ +use sargon::OsEntitiesLinkedToFactorSource; + use crate::prelude::*; #[uniffi::export] diff --git a/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_security_center.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_security_center.rs index d2c03a1c8..dfc2319fa 100644 --- a/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_security_center.rs +++ b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_security_center.rs @@ -1,3 +1,5 @@ +use sargon::OsCheckSecurityProblems; + use crate::prelude::*; // ================== diff --git a/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_security_structures.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_security_structures.rs index 65a9cb6f6..9e90e3edb 100644 --- a/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_security_structures.rs +++ b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_security_structures.rs @@ -1,3 +1,7 @@ +use sargon::{ + OsSecurityShieldPrerequisiteStatus, OsSecurityStructuresQuerying, +}; + use crate::prelude::*; #[uniffi::export] diff --git a/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_signing.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_signing.rs index 644315f7c..18833aabc 100644 --- a/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_signing.rs +++ b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_signing.rs @@ -1,5 +1,5 @@ use crate::prelude::*; -use sargon::AuthIntent as InternalAuthIntent; +use sargon::{AuthIntent as InternalAuthIntent, OsSigning}; #[uniffi::export] impl SargonOS { diff --git a/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_sync_accounts.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_sync_accounts.rs index 288bef905..e8cd727df 100644 --- a/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_sync_accounts.rs +++ b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/sargon_os_sync_accounts.rs @@ -1,3 +1,5 @@ +use sargon::OsSyncAccountsDeletedOnLedger; + use crate::prelude::*; // ================== @@ -29,7 +31,10 @@ impl SargonOS { .wrapped .check_accounts_deleted_on_ledger( network_id.into_internal(), - account_addresses.iter().map(|a| a.into_internal()), + account_addresses + .iter() + .map(|a| a.into_internal()) + .collect(), ) .await .map_err(CommonError::from)?; diff --git a/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/transactions/sargon_os_transaction_analysis.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/transactions/sargon_os_transaction_analysis.rs index 466c25bea..2a13b7228 100644 --- a/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/transactions/sargon_os_transaction_analysis.rs +++ b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/transactions/sargon_os_transaction_analysis.rs @@ -1,3 +1,5 @@ +use sargon::OsAnalyseTxPreview; + use crate::prelude::*; #[uniffi::export] diff --git a/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/transactions/sargon_os_transaction_status.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/transactions/sargon_os_transaction_status.rs index f016bce80..6ac530d89 100644 --- a/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/transactions/sargon_os_transaction_status.rs +++ b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/transactions/sargon_os_transaction_status.rs @@ -1,3 +1,5 @@ +use sargon::OsTXStatusPolling; + use crate::prelude::*; // ================== diff --git a/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/transactions/sargon_os_transaction_submit.rs b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/transactions/sargon_os_transaction_submit.rs index 1d510ab50..ed7608690 100644 --- a/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/transactions/sargon_os_transaction_submit.rs +++ b/crates/uniffi/uniffi_SPLIT_ME/src/system/sargon_os/transactions/sargon_os_transaction_submit.rs @@ -1,3 +1,5 @@ +use sargon::OsTxSubmitting; + use crate::prelude::*; // ================== diff --git a/crates/uniffi/uniffi_SPLIT_ME/tests/Package.swift b/crates/uniffi/uniffi_SPLIT_ME/tests/Package.swift deleted file mode 100644 index b282883d2..000000000 --- a/crates/uniffi/uniffi_SPLIT_ME/tests/Package.swift +++ /dev/null @@ -1,13 +0,0 @@ -// swift-tools-version:5.9 - -// This is a HACKY workaround the fact that SPM does not allow for Package level exclusion -// of files/folders. SPM actually HAD support for it but it was removed in 2017, in PR -// https://github.com/apple/swift-package-manager/commit/cb69accf41da55386f9703308958aa49ca2a4c5f -// -// So instead we have to add an empty dummy Package.swift to each folder we wanna hide, as per: -// See: https://github.com/apple/swift-package-manager/issues/4460#issuecomment-1475025748 -// And: https://stackoverflow.com/questions/69382302/swift-package-how-to-exclude-files-in-root-git-directory-from-the-actual-swift/70990534#70990534 -// And: https://github.com/tuist/tuist/pull/2058 -import PackageDescription - -let package = Package() diff --git a/crates/uniffi/uniffi_SPLIT_ME/tests/integration/main.rs b/crates/uniffi/uniffi_SPLIT_ME/tests/integration/main.rs deleted file mode 100644 index 8b1378917..000000000 --- a/crates/uniffi/uniffi_SPLIT_ME/tests/integration/main.rs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/crates/uniffi/uniffi_SPLIT_ME/tests/vectors/main.rs b/crates/uniffi/uniffi_SPLIT_ME/tests/vectors/main.rs deleted file mode 100644 index 8b1378917..000000000 --- a/crates/uniffi/uniffi_SPLIT_ME/tests/vectors/main.rs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/jvm/sargon-android/build.gradle.kts b/jvm/sargon-android/build.gradle.kts index e0685fdc9..1e32f8c7c 100644 --- a/jvm/sargon-android/build.gradle.kts +++ b/jvm/sargon-android/build.gradle.kts @@ -97,6 +97,7 @@ cargoNdk { targets = arrayListOf("arm64", "arm") module = "../" librariesNames = arrayListOf("libsargon_uniffi.so") + extraCargoBuildArguments = arrayListOf("--all") } tasks.withType {