From 6dc48ffca4060b7fc679278f2fd683c8ddab404a Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Mon, 30 Dec 2024 11:21:03 +0100 Subject: [PATCH 01/23] WIP: Need to split out GW models? because sargon-manifests references them... --- Cargo.lock | 202 ++++++++++++++ Cargo.toml | 4 + .../AccountOrAddressOf+Wrap+Functions.swift | 2 +- .../AccountOrAddressOf+SampleValues.swift | 2 +- .../AccountOrAddressOf+Swiftified.swift | 12 +- .../Transaction/AccountOrAddressOfTests.swift | 2 +- .../Cargo.toml | 57 ++++ .../src}/agnostic_paths/derivation_preset.rs | 0 .../agnostic_paths/index_agnostic_path.rs | 0 .../src}/agnostic_paths/mod.rs | 0 .../quantified_derivation_preset.rs | 0 .../src}/agnostic_paths/quantities.rs | 0 .../factor_instances_cache.rs | 2 +- .../factor_instances_cache/keyed_instances.rs | 0 .../src}/factor_instances_cache/mod.rs | 0 .../factor_instances_cache_snapshot.rs | 4 +- .../factor_source_id_from_hash_dense_key.rs | 0 .../serializable_cache/mod.rs | 0 .../src/lib.rs | 21 ++ .../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 ...ion_entity_index_with_ephemeral_offsets.rs | 0 ...ith_ephemeral_offsets_for_factor_source.rs | 0 .../provider/factor_instances_provider.rs | 0 .../factor_instances_provider_unit_tests.rs | 0 .../provider/instances_in_cache_consumer.rs | 0 .../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 | 0 .../src}/types/abstract_securified_entity.rs | 0 .../src}/types/any_securified_entity.rs | 0 .../src}/types/appendable_collection.rs | 0 .../src}/types/assert_derivation_path.rs | 0 .../src}/types/is_securified_entity.rs | 0 .../src}/types/mod.rs | 0 .../src}/types/securified_account.rs | 0 .../src}/types/securified_persona.rs | 0 .../src}/types/unsecurified_entity.rs | 0 .../src}/types/veci.rs | 0 crates/sargon-manifests/Cargo.toml | 54 ++++ crates/sargon-manifests/build.rs | 14 + .../src}/bucket.rs | 0 .../src}/bucket_factory.rs | 0 .../delete_account/delete_account_transfer.rs | 0 .../delete_account_transfers.rs | 0 .../delete_account/manifest_delete_account.rs | 0 .../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/account_or_address_of.rs | 73 +++-- .../assets_transfers/mod.rs | 0 .../assets_transfers/per_asset/mod.rs | 0 .../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 | 0 .../per_recipient_asset_transfer.rs | 12 +- .../per_recipient_asset_transfers.rs | 2 +- .../per_recipient_fungible_transfer.rs | 0 .../per_recipient_non_fungibles_transfer.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 .../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 | 0 crates/sargon-manifests/src/lib.rs | 261 ++++++++++++++++++ .../src}/manifest_account_locker.rs | 0 .../src}/manifest_assets_transfers.rs | 0 .../src}/manifests.rs | 0 .../src}/manifests_access_controller.rs | 0 .../src}/manifests_create_tokens.rs | 0 .../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/sargon-profile/Cargo.toml | 117 ++++++++ crates/sargon-profile/build.rs | 14 + .../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 | 0 .../src}/encrypted/encrypted_profile/mod.rs | 0 .../src}/encrypted/key_derivation/mod.rs | 0 .../password_based_key_derivation_scheme.rs | 0 ...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 | 59 ++++ .../src}/logic/account/account_visibility.rs | 0 .../src}/logic/account/accounts_visibility.rs | 0 .../src}/logic/account/create_account.rs | 0 .../src}/logic/account/mod.rs | 0 .../src}/logic/account/query_accounts.rs | 0 .../account/query_security_structures.rs | 0 .../src}/logic/create_entity.rs | 0 .../src}/logic/gateway/current_gateway.rs | 0 .../src}/logic/gateway/mod.rs | 0 .../src}/logic/mod.rs | 0 .../src}/logic/persona/create_persona.rs | 0 .../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 | 0 .../src}/logic/profile_network/mod.rs | 0 .../profile_network_details.rs | 0 ...etwork_entities_linked_to_factor_source.rs | 0 .../profile_network_get_entities.rs | 0 .../src}/logic/profile_networks.rs | 0 .../src}/logic/query_factor_sources.rs | 0 .../src/mfa}/factor_list_kind.rs | 2 +- .../profile => sargon-profile/src}/mfa/mod.rs | 4 + .../src/mfa}/role_kind.rs | 0 .../src}/mfa/secured_entity_control/mod.rs | 0 .../secured_entity_control.rs | 0 .../auto_build_outcome_for_testing.rs | 0 .../automatic_shield_builder.rs | 0 .../factor_selector.rs | 0 .../automatic_shield_builder/mod.rs | 0 .../automatic_shield_builder/proto_shield.rs | 0 .../automatic_shield_builder/quantity.rs | 0 .../mfa/security_structures/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 .../mfa/security_structures/matrices/mod.rs | 0 .../src}/mfa/security_structures/mod.rs | 0 .../roles/abstract_role_builder_or_built.rs | 0 .../confirmation_roles_builder_unit_tests.rs | 0 .../security_structures/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 | 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 | 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 .../src}/mfa/security_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 | 0 .../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 .../src}/profilesnapshot_version.rs | 6 +- .../supporting_types/account_for_display.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 | 0 .../on_same_network_validating.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 .../src}/v100/app_preferences/gateways/mod.rs | 0 .../gateways/network_definition.rs | 3 +- .../gateways/saved_gateways.rs | 0 .../src}/v100/app_preferences/mod.rs | 0 .../src}/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 .../src}/v100/entity/abstract_entity_type.rs | 0 .../src}/v100/entity/account/account.rs | 22 -- .../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 | 0 .../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 | 22 -- .../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 .../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 | 0 .../src}/v100/header/header.rs | 0 .../src}/v100/header/mod.rs | 0 .../src}/v100/header/profile_id.rs | 0 .../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 | 0 .../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 | 3 +- .../resource_visibility.rs | 0 .../src}/v100/networks/profile_networks.rs | 0 .../src}/v100/profile.rs | 0 .../src}/v100/profile_file_contents.rs | 0 .../src}/v100/profile_legacy_state_bugs.rs | 0 ...oto_profile_maybe_with_legacy_p2p_links.rs | 0 crates/sargon-transaction-models/Cargo.toml | 53 ++++ crates/sargon-transaction-models/build.rs | 49 ++++ .../fixtures/transaction/account_delete.dat | 0 .../fixtures/transaction/account_delete.rtm | 0 .../transaction/account_locker_claim.rtm | 0 ...cker_claim_fungibles_and_non_fungibles.dat | 0 ...cker_claim_fungibles_and_non_fungibles.rtm | 0 .../account_locker_claim_max_nft_items.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 .../src}/assert_manifest.rs | 2 - .../src/error_from.rs | 0 .../src}/is_intent_signing.rs | 0 crates/sargon-transaction-models/src/lib.rs | 254 +++++++++++++++++ .../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 | 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 .../src}/low_level/intent_signature.rs | 0 .../manifest_encountered_component_address.rs | 0 .../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 .../src}/low_level/mod.rs | 2 + .../src}/low_level/notarized_transaction.rs | 0 .../src}/low_level/notary_signature.rs | 0 .../src}/low_level/sbor_depth_validation.rs | 0 .../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 | 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 | 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 | 0 .../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 .../low_level/v2/message_v2/message_v2.rs | 0 .../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 | 0 .../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 | 0 .../instructions_v2/mod.rs | 0 .../v2/transaction_manifest_v2/mod.rs | 0 .../subintent_manifest.rs | 0 .../transaction_manifest_v2.rs | 0 .../src}/metadata.rs | 1 - .../src/profile_models}/deposit_rule.rs | 0 .../src/profile_models}/mod.rs | 4 +- .../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 | 2 - .../third_party_deposits.rs | 0 .../src}/unvalidated_transaction_manifest.rs | 0 .../assets_transfers/account_or_address_of.rs | 14 +- .../assets_transfers/mod.rs | 2 + .../owned_or_third_party_account_address.rs | 10 + .../per_recipient_asset_transfer.rs | 2 +- .../assets_transfers/transfer_types.rs | 4 +- crates/sargon/Cargo.toml | 6 +- crates/sargon/build.rs | 43 +-- .../src/factor_instances_provider/mod.rs | 11 - crates/sargon/src/lib.rs | 13 +- crates/sargon/src/profile/mod.rs | 13 - .../interaction_items/transaction/mod.rs | 2 - .../sargon/src/signing/petition_types/mod.rs | 4 - .../support/event_profile_modified.rs | 57 ++++ .../high_level/manifest_building/mod.rs | 25 -- .../src/wrapped_radix_engine_toolkit/mod.rs | 6 - .../sargon/TransactionManifestTest.kt | 8 +- 447 files changed, 1359 insertions(+), 280 deletions(-) create mode 100644 crates/sargon-factor-instances-provider/Cargo.toml rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/agnostic_paths/derivation_preset.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/agnostic_paths/index_agnostic_path.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/agnostic_paths/mod.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/agnostic_paths/quantified_derivation_preset.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/agnostic_paths/quantities.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/factor_instances_cache/factor_instances_cache.rs (99%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/factor_instances_cache/keyed_instances.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/factor_instances_cache/mod.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/factor_instances_cache/serializable_cache/factor_instances_cache_snapshot.rs (96%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/factor_instances_cache/serializable_cache/factor_source_id_from_hash_dense_key.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/factor_instances_cache/serializable_cache/mod.rs (100%) 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 (100%) 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}/next_index_assigner/next_derivation_entity_index_with_ephemeral_offsets.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/next_index_assigner/next_derivation_entity_index_with_ephemeral_offsets_for_factor_source.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/provider/factor_instances_provider.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/provider/factor_instances_provider_unit_tests.rs (100%) 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 (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/provider/outcome/factor_instances_provider_outcome.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/provider/outcome/factor_instances_provider_outcome_for_factor.rs (100%) 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 (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/provider/provider_adopters/virtual_entity_creating_instance_provider.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/types/abstract_securified_entity.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/types/any_securified_entity.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/types/appendable_collection.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/types/assert_derivation_path.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/types/is_securified_entity.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/types/mod.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/types/securified_account.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/types/securified_persona.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/types/unsecurified_entity.rs (100%) rename crates/{sargon/src/factor_instances_provider => sargon-factor-instances-provider/src}/types/veci.rs (100%) create mode 100644 crates/sargon-manifests/Cargo.toml create mode 100644 crates/sargon-manifests/build.rs rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building => sargon-manifests/src}/bucket.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building => sargon-manifests/src}/bucket_factory.rs (100%) 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 (100%) 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/account_or_address_of.rs (52%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-manifests/src}/high_level/sargon_specific_types/assets_transfers/mod.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-manifests/src}/high_level/sargon_specific_types/assets_transfers/per_asset/mod.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_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 (100%) 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 (98%) 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 (95%) 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 (100%) 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 (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building => sargon-manifests/src}/manifest_assets_transfers.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building => sargon-manifests/src}/manifests.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building => sargon-manifests/src}/manifests_access_controller.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building => sargon-manifests/src}/manifests_create_tokens.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building => sargon-manifests/src}/modify_manifest.rs (100%) 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 (100%) 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 (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%) rename crates/{sargon => sargon-profile}/fixtures/vector/multi_profile_snapshots_test_version_100_patch_after_app_version_120.json (100%) rename crates/{sargon => sargon-profile}/fixtures/vector/only_plaintext_profile_snapshot_version_100.json (100%) 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 (100%) 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}/logic/account/account_visibility.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/logic/account/accounts_visibility.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/logic/account/create_account.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/logic/account/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/logic/account/query_accounts.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/logic/account/query_security_structures.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/logic/create_entity.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/logic/gateway/current_gateway.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/logic/gateway/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/logic/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/logic/persona/create_persona.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/logic/persona/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/logic/persona/persona_data_ids.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/logic/persona/query_personas.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/logic/persona/shared_persona_data_ids.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/logic/profile_header.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/logic/profile_network/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/logic/profile_network/profile_network_details.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/logic/profile_network/profile_network_entities_linked_to_factor_source.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/logic/profile_network/profile_network_get_entities.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/logic/profile_networks.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/logic/query_factor_sources.rs (100%) rename crates/{sargon/src/signing/petition_types => sargon-profile/src/mfa}/factor_list_kind.rs (80%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/mod.rs (57%) rename crates/{sargon/src/signing/petition_types => sargon-profile/src/mfa}/role_kind.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/secured_entity_control/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/secured_entity_control/secured_entity_control.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/automatic_shield_builder/auto_build_outcome_for_testing.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/automatic_shield_builder/automatic_shield_builder.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/automatic_shield_builder/factor_selector.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/automatic_shield_builder/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/automatic_shield_builder/proto_shield.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/automatic_shield_builder/quantity.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/has_role_kind.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/matrices/abstract_matrix_builder_or_built.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/matrices/builder/error.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/matrices/builder/matrix_builder.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/matrices/builder/matrix_builder_unit_tests.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/matrices/builder/matrix_template.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/matrices/builder/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/matrices/matrix_of_factor_instances.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/matrices/matrix_of_factor_source_ids.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/matrices/matrix_of_factor_sources.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/matrices/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/roles/abstract_role_builder_or_built.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/roles/builder/confirmation_roles_builder_unit_tests.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/roles/builder/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/roles/builder/primary_roles_builder_unit_tests.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/roles/builder/recovery_roles_builder_unit_tests.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/roles/builder/roles_builder.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/roles/builder/roles_builder_unit_tests.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/roles/factor_levels/factor_instance_level/confirmation_role_with_factor_instances.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/roles/factor_levels/factor_instance_level/general_role_with_hierarchical_deterministic_factor_instances.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/roles/factor_levels/factor_instance_level/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/roles/factor_levels/factor_instance_level/primary_role_with_factor_instances.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/roles/factor_levels/factor_instance_level/recovery_role_with_factor_instances.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/roles/factor_levels/factor_instance_level/role_into_scrypto_access_rule.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/roles/factor_levels/factor_instance_level/role_with_factor_instances.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/roles/factor_levels/factor_source_id_level/confirmation_role_with_factor_source_ids.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/roles/factor_levels/factor_source_id_level/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/roles/factor_levels/factor_source_id_level/primary_role_with_factor_source_ids.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/roles/factor_levels/factor_source_id_level/recovery_role_with_factor_source_ids.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/roles/factor_levels/factor_source_id_level/roles_with_factor_ids.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/roles/factor_levels/factor_source_kind_level/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/roles/factor_levels/factor_source_kind_level/role_template.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/roles/factor_levels/factor_source_level/confirmation_role_with_factor_sources.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/roles/factor_levels/factor_source_level/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/roles/factor_levels/factor_source_level/primary_role_with_factor_sources.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/roles/factor_levels/factor_source_level/recovery_role_with_factor_sources.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/roles/factor_levels/factor_source_level/roles_with_factor_sources.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/roles/factor_levels/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/roles/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/security_shield_builder.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/security_shield_builder_invalid_reason.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/security_shield_prerequisites_status.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/security_structure_id.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/security_structure_metadata.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/security_structure_of_factors/abstract_security_structure_of_factors.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/security_structure_of_factors/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/security_structure_of_factors/security_structure_of_factor_instances.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/security_structure_of_factors/security_structure_of_factor_source_ids.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/security_structure_of_factors/security_structure_of_factor_sources.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/mfa/security_structures/selected_factor_sources_status.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/profilesnapshot_version.rs (94%) 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 (100%) 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/app_preferences/app_display_settings/app_display_settings.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/app_preferences/app_display_settings/fiat_currency.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/app_preferences/app_display_settings/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/app_preferences/app_preferences.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/app_preferences/gateways/gateway.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/app_preferences/gateways/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/app_preferences/gateways/network_definition.rs (99%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/app_preferences/gateways/saved_gateways.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/app_preferences/mod.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/app_preferences/security.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/app_preferences/transaction_preferences.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 (100%) 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 (100%) 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 (100%) 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 (100%) 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 (100%) 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 (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/networks/network/authorized_dapp/authorized_persona_simple.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/networks/network/authorized_dapp/mod.rs (100%) 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 (100%) 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 (100%) 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 (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/profile.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/profile_file_contents.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/profile_legacy_state_bugs.rs (100%) rename crates/{sargon/src/profile => sargon-profile/src}/v100/proto_profile_maybe_with_legacy_p2p_links.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.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/account_locker_claim_max_nft_items.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%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/create_3_nft_collections.rtm (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/create_access_controller_for_account.rtm (100%) rename crates/{sargon => sargon-transaction-models}/fixtures/transaction/create_access_controller_for_persona.rtm (100%) 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 (100%) 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 (100%) 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 (100%) 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 (100%) 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 (93%) 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 (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/signed_intent.rs (100%) 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 (100%) 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 (100%) 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 (100%) 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%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v1/transaction_manifest/execution_summary/mod.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v1/transaction_manifest/execution_summary/transaction_manifest_execution_summary.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v1/transaction_manifest/instructions/instructions.rs (100%) 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 (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v1/transaction_manifest/transaction_manifest.rs (100%) 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 (100%) 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 (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v2/subintent.rs (100%) 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%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v2/transaction_manifest_v2/execution_summary_v2/mod.rs (100%) 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 (100%) 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 (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v2/transaction_manifest_v2/subintent_manifest.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit => sargon-transaction-models/src}/low_level/v2/transaction_manifest_v2/transaction_manifest_v2.rs (100%) rename crates/{sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building => sargon-transaction-models/src}/metadata.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 (100%) 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%) 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/profile/mod.rs 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/mod.rs diff --git a/Cargo.lock b/Cargo.lock index d547a7f1b..ba42e1db0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2803,9 +2803,13 @@ dependencies = [ "reqwest", "sargon-addresses", "sargon-core", + "sargon-factor-instances-provider", "sargon-factors", "sargon-hierarchical-deterministic", "sargon-keys-collector", + "sargon-manifests", + "sargon-profile", + "sargon-transaction-models", "sbor", "security-framework", "security-framework-sys", @@ -2918,6 +2922,52 @@ dependencies = [ "uuid 1.6.1", ] +[[package]] +name = "sargon-factor-instances-provider" +version = "1.2.1" +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", + "pretty_assertions", + "radix-common", + "radix-engine-interface", + "radix-rust", + "radix-transactions", + "rand", + "sargon-addresses", + "sargon-core", + "sargon-core-assert-json", + "sargon-core-error", + "sargon-core-utils", + "sargon-factors", + "sargon-hierarchical-deterministic", + "sargon-keys-collector", + "sargon-profile", + "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" @@ -3010,6 +3060,158 @@ dependencies = [ "sargon-hierarchical-deterministic", ] +[[package]] +name = "sargon-manifests" +version = "1.2.1" +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", + "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.2.1" +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-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]] +name = "sargon-transaction-models" +version = "1.2.1" +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.2.1" diff --git a/Cargo.toml b/Cargo.toml index 2e20d5bb7..5cdab1649 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,6 +13,10 @@ members = [ "crates/sargon-factors", "crates/sargon-addresses", "crates/sargon-keys-collector", + "crates/sargon-transaction-models", + "crates/sargon-manifests", + "crates/sargon-profile", + "crates/sargon-factor-instances-provider", "crates/sargon", # to be split 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/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/crates/sargon-factor-instances-provider/Cargo.toml b/crates/sargon-factor-instances-provider/Cargo.toml new file mode 100644 index 000000000..4765841c5 --- /dev/null +++ b/crates/sargon-factor-instances-provider/Cargo.toml @@ -0,0 +1,57 @@ +[package] +name = "sargon-factor-instances-provider" +version = "1.2.1" +edition = "2021" + +[dependencies] +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" } + +# ==== 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 } +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/factor_instances_provider/agnostic_paths/derivation_preset.rs b/crates/sargon-factor-instances-provider/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/sargon-factor-instances-provider/src/agnostic_paths/derivation_preset.rs diff --git a/crates/sargon/src/factor_instances_provider/agnostic_paths/index_agnostic_path.rs b/crates/sargon-factor-instances-provider/src/agnostic_paths/index_agnostic_path.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/agnostic_paths/index_agnostic_path.rs rename to crates/sargon-factor-instances-provider/src/agnostic_paths/index_agnostic_path.rs diff --git a/crates/sargon/src/factor_instances_provider/agnostic_paths/mod.rs b/crates/sargon-factor-instances-provider/src/agnostic_paths/mod.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/agnostic_paths/mod.rs rename to crates/sargon-factor-instances-provider/src/agnostic_paths/mod.rs diff --git a/crates/sargon/src/factor_instances_provider/agnostic_paths/quantified_derivation_preset.rs b/crates/sargon-factor-instances-provider/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/sargon-factor-instances-provider/src/agnostic_paths/quantified_derivation_preset.rs diff --git a/crates/sargon/src/factor_instances_provider/agnostic_paths/quantities.rs b/crates/sargon-factor-instances-provider/src/agnostic_paths/quantities.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/agnostic_paths/quantities.rs rename to crates/sargon-factor-instances-provider/src/agnostic_paths/quantities.rs diff --git a/crates/sargon/src/factor_instances_provider/factor_instances_cache/factor_instances_cache.rs b/crates/sargon-factor-instances-provider/src/factor_instances_cache/factor_instances_cache.rs similarity index 99% rename from crates/sargon/src/factor_instances_provider/factor_instances_cache/factor_instances_cache.rs rename to crates/sargon-factor-instances-provider/src/factor_instances_cache/factor_instances_cache.rs index b935ce6af..1867da3a1 100644 --- a/crates/sargon/src/factor_instances_provider/factor_instances_cache/factor_instances_cache.rs +++ b/crates/sargon-factor-instances-provider/src/factor_instances_cache/factor_instances_cache.rs @@ -659,7 +659,7 @@ impl FactorInstancesCache { #[cfg(test)] mod tests { - use crate::factor_instances_provider::next_index_assigner; + use crate::next_index_assigner; use super::*; diff --git a/crates/sargon/src/factor_instances_provider/factor_instances_cache/keyed_instances.rs b/crates/sargon-factor-instances-provider/src/factor_instances_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-factor-instances-provider/src/factor_instances_cache/keyed_instances.rs diff --git a/crates/sargon/src/factor_instances_provider/factor_instances_cache/mod.rs b/crates/sargon-factor-instances-provider/src/factor_instances_cache/mod.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/factor_instances_cache/mod.rs rename to crates/sargon-factor-instances-provider/src/factor_instances_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-factor-instances-provider/src/factor_instances_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-factor-instances-provider/src/factor_instances_cache/serializable_cache/factor_instances_cache_snapshot.rs index d2b06e9e7..34a6a35c6 100644 --- a/crates/sargon/src/factor_instances_provider/factor_instances_cache/serializable_cache/factor_instances_cache_snapshot.rs +++ b/crates/sargon-factor-instances-provider/src/factor_instances_cache/serializable_cache/factor_instances_cache_snapshot.rs @@ -1,6 +1,4 @@ -use crate::{ - factor_instances_provider::factor_instances_cache::FICStorage, prelude::*, -}; +use crate::{factor_instances_cache::FICStorage, 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-factor-instances-provider/src/factor_instances_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-factor-instances-provider/src/factor_instances_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-factor-instances-provider/src/factor_instances_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-factor-instances-provider/src/factor_instances_cache/serializable_cache/mod.rs 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..9b190613c --- /dev/null +++ b/crates/sargon-factor-instances-provider/src/lib.rs @@ -0,0 +1,21 @@ +mod agnostic_paths; +mod factor_instances_cache; +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_core::prelude::*; + pub(crate) use sargon_factors::prelude::*; + pub(crate) use sargon_hierarchical_deterministic::prelude::*; + pub(crate) use sargon_keys_collector::prelude::*; + pub(crate) use sargon_profile::prelude::*; + + pub use crate::agnostic_paths::*; + pub use crate::factor_instances_cache::*; + pub use crate::next_index_assigner::*; + pub use crate::provider::*; + pub use crate::types::*; +} 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 100% 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 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/next_index_assigner/next_derivation_entity_index_with_ephemeral_offsets.rs b/crates/sargon-factor-instances-provider/src/next_index_assigner/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/sargon-factor-instances-provider/src/next_index_assigner/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/sargon-factor-instances-provider/src/next_index_assigner/next_derivation_entity_index_with_ephemeral_offsets_for_factor_source.rs similarity index 100% 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/sargon-factor-instances-provider/src/next_index_assigner/next_derivation_entity_index_with_ephemeral_offsets_for_factor_source.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 100% 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 diff --git a/crates/sargon/src/factor_instances_provider/provider/factor_instances_provider_unit_tests.rs b/crates/sargon-factor-instances-provider/src/provider/factor_instances_provider_unit_tests.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/provider/factor_instances_provider_unit_tests.rs rename to crates/sargon-factor-instances-provider/src/provider/factor_instances_provider_unit_tests.rs 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 100% rename from crates/sargon/src/factor_instances_provider/provider/mod.rs rename to crates/sargon-factor-instances-provider/src/provider/mod.rs 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 100% 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 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 100% 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 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 100% 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 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/src/factor_instances_provider/types/abstract_securified_entity.rs b/crates/sargon-factor-instances-provider/src/types/abstract_securified_entity.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/types/abstract_securified_entity.rs rename to crates/sargon-factor-instances-provider/src/types/abstract_securified_entity.rs diff --git a/crates/sargon/src/factor_instances_provider/types/any_securified_entity.rs b/crates/sargon-factor-instances-provider/src/types/any_securified_entity.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/types/any_securified_entity.rs rename to crates/sargon-factor-instances-provider/src/types/any_securified_entity.rs diff --git a/crates/sargon/src/factor_instances_provider/types/appendable_collection.rs b/crates/sargon-factor-instances-provider/src/types/appendable_collection.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/types/appendable_collection.rs rename to crates/sargon-factor-instances-provider/src/types/appendable_collection.rs diff --git a/crates/sargon/src/factor_instances_provider/types/assert_derivation_path.rs b/crates/sargon-factor-instances-provider/src/types/assert_derivation_path.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/types/assert_derivation_path.rs rename to crates/sargon-factor-instances-provider/src/types/assert_derivation_path.rs diff --git a/crates/sargon/src/factor_instances_provider/types/is_securified_entity.rs b/crates/sargon-factor-instances-provider/src/types/is_securified_entity.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/types/is_securified_entity.rs rename to crates/sargon-factor-instances-provider/src/types/is_securified_entity.rs diff --git a/crates/sargon/src/factor_instances_provider/types/mod.rs b/crates/sargon-factor-instances-provider/src/types/mod.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/types/mod.rs rename to crates/sargon-factor-instances-provider/src/types/mod.rs diff --git a/crates/sargon/src/factor_instances_provider/types/securified_account.rs b/crates/sargon-factor-instances-provider/src/types/securified_account.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/types/securified_account.rs rename to crates/sargon-factor-instances-provider/src/types/securified_account.rs diff --git a/crates/sargon/src/factor_instances_provider/types/securified_persona.rs b/crates/sargon-factor-instances-provider/src/types/securified_persona.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/types/securified_persona.rs rename to crates/sargon-factor-instances-provider/src/types/securified_persona.rs diff --git a/crates/sargon/src/factor_instances_provider/types/unsecurified_entity.rs b/crates/sargon-factor-instances-provider/src/types/unsecurified_entity.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/types/unsecurified_entity.rs rename to crates/sargon-factor-instances-provider/src/types/unsecurified_entity.rs diff --git a/crates/sargon/src/factor_instances_provider/types/veci.rs b/crates/sargon-factor-instances-provider/src/types/veci.rs similarity index 100% rename from crates/sargon/src/factor_instances_provider/types/veci.rs rename to crates/sargon-factor-instances-provider/src/types/veci.rs diff --git a/crates/sargon-manifests/Cargo.toml b/crates/sargon-manifests/Cargo.toml new file mode 100644 index 000000000..92ea01263 --- /dev/null +++ b/crates/sargon-manifests/Cargo.toml @@ -0,0 +1,54 @@ +[package] +name = "sargon-manifests" +version = "1.2.1" +edition = "2021" +build = "build.rs" + +[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" } +sargon-transaction-models = { path = "../sargon-transaction-models" } + +# == Radix dependencies == +sbor = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } +radix-rust = { workspace = true } +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 } +radix-engine-toolkit-common = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } +radix-transactions = { workspace = true } +radix-engine-toolkit = { workspace = true } + +# == External Dependencies == +zeroize = { workspace = true } +log = { workspace = true } +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 } +enum-iterator = { workspace = true } +rand = { workspace = true } +hex = { workspace = true } +delegate = { workspace = true } +itertools = { workspace = true } +enum-as-inner = { workspace = true } +iota-crypto = { workspace = true } +k256 = { workspace = true } +assert-json-diff = { workspace = true } +url = { workspace = true } +paste = { workspace = true } +async-trait = { workspace = true } +pretty_assertions = { 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..ee4998cdd --- /dev/null +++ b/crates/sargon-manifests/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() + ); +} \ No newline at end of file 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 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/bucket.rs rename to crates/sargon-manifests/src/bucket.rs 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 100% 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 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 100% 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 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/account_or_address_of.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/account_or_address_of.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/account_or_address_of.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/account_or_address_of.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/mod.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/mod.rs similarity index 100% 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 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 100% 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 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 100% 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 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 98% 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..7058f9f37 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(), 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 95% 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..c0ad345fe 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,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, ); paste! { 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 100% 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 diff --git a/crates/sargon-manifests/src/lib.rs b/crates/sargon-manifests/src/lib.rs new file mode 100644 index 000000000..1929374d7 --- /dev/null +++ b/crates/sargon-manifests/src/lib.rs @@ -0,0 +1,261 @@ +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 modify_manifest; +mod third_party_deposit_update; + +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_transaction_models::prelude::*; + + pub use crate::bucket::*; + pub use crate::bucket_factory::*; + pub use crate::delete_account::*; + 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(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_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_toolkit_common::receipt::RuntimeToolkitTransactionReceipt as ScryptoRuntimeToolkitTransactionReceipt; + + pub(crate) use radix_engine_toolkit_common::receipt::SerializableToolkitTransactionReceipt as ScryptoSerializableToolkitTransactionReceipt; + + 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 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::{ + 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_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, + }, + }; +} + +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 100% 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 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 100% 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 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 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/manifests.rs rename to crates/sargon-manifests/src/manifests.rs 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 100% 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 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 100% 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 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 100% 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 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 100% 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 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 100% 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 diff --git a/crates/sargon-profile/Cargo.toml b/crates/sargon-profile/Cargo.toml new file mode 100644 index 000000000..7e8410579 --- /dev/null +++ b/crates/sargon-profile/Cargo.toml @@ -0,0 +1,117 @@ +[package] +name = "sargon-profile" +version = "1.2.1" +edition = "2021" +build = "build.rs" + +[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" } + +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 } +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 } +radix-engine-toolkit-common = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } + +radix-transactions = { workspace = true } + +radix-engine-toolkit = { workspace = true } + +enum-iterator = { workspace = true } + +rand = { workspace = true } + +hex = { workspace = true } + +delegate = { workspace = true } + +itertools = { workspace = true } + +enum-as-inner = { workspace = true } + +# SLIP10 implementation +iota-crypto = { workspace = true } +# Transitive dependency of iota_crypto - used to construct PubKey from uncompressed bytes. +k256 = { workspace = true } + + +assert-json-diff = { workspace = true } + +url = { 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" + +# 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] + +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/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 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-profile/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-profile/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-profile/fixtures/vector/only_plaintext_profile_snapshot_version_100.json 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 100% 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 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..5c0794002 --- /dev/null +++ b/crates/sargon-profile/src/lib.rs @@ -0,0 +1,59 @@ +#![allow(trivial_bounds)] +#![allow(incomplete_features)] +#![feature(trivial_bounds)] +#![feature(let_chains)] +#![feature(generic_const_exprs)] + +mod encrypted; +mod logic; +mod mfa; +mod profilesnapshot_version; +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_transaction_models::prelude::*; + + pub use crate::encrypted::*; + pub use crate::logic::*; + pub use crate::mfa::*; + pub use crate::profilesnapshot_version::*; + pub use crate::supporting_types::*; + pub use crate::v100::*; + + 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, + }, + 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, + }, + }; +} diff --git a/crates/sargon/src/profile/logic/account/account_visibility.rs b/crates/sargon-profile/src/logic/account/account_visibility.rs similarity index 100% rename from crates/sargon/src/profile/logic/account/account_visibility.rs rename to crates/sargon-profile/src/logic/account/account_visibility.rs diff --git a/crates/sargon/src/profile/logic/account/accounts_visibility.rs b/crates/sargon-profile/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/src/logic/account/accounts_visibility.rs diff --git a/crates/sargon/src/profile/logic/account/create_account.rs b/crates/sargon-profile/src/logic/account/create_account.rs similarity index 100% rename from crates/sargon/src/profile/logic/account/create_account.rs rename to crates/sargon-profile/src/logic/account/create_account.rs diff --git a/crates/sargon/src/profile/logic/account/mod.rs b/crates/sargon-profile/src/logic/account/mod.rs similarity index 100% rename from crates/sargon/src/profile/logic/account/mod.rs rename to crates/sargon-profile/src/logic/account/mod.rs diff --git a/crates/sargon/src/profile/logic/account/query_accounts.rs b/crates/sargon-profile/src/logic/account/query_accounts.rs similarity index 100% rename from crates/sargon/src/profile/logic/account/query_accounts.rs rename to crates/sargon-profile/src/logic/account/query_accounts.rs diff --git a/crates/sargon/src/profile/logic/account/query_security_structures.rs b/crates/sargon-profile/src/logic/account/query_security_structures.rs similarity index 100% rename from crates/sargon/src/profile/logic/account/query_security_structures.rs rename to crates/sargon-profile/src/logic/account/query_security_structures.rs diff --git a/crates/sargon/src/profile/logic/create_entity.rs b/crates/sargon-profile/src/logic/create_entity.rs similarity index 100% rename from crates/sargon/src/profile/logic/create_entity.rs rename to crates/sargon-profile/src/logic/create_entity.rs diff --git a/crates/sargon/src/profile/logic/gateway/current_gateway.rs b/crates/sargon-profile/src/logic/gateway/current_gateway.rs similarity index 100% rename from crates/sargon/src/profile/logic/gateway/current_gateway.rs rename to crates/sargon-profile/src/logic/gateway/current_gateway.rs diff --git a/crates/sargon/src/profile/logic/gateway/mod.rs b/crates/sargon-profile/src/logic/gateway/mod.rs similarity index 100% rename from crates/sargon/src/profile/logic/gateway/mod.rs rename to crates/sargon-profile/src/logic/gateway/mod.rs diff --git a/crates/sargon/src/profile/logic/mod.rs b/crates/sargon-profile/src/logic/mod.rs similarity index 100% rename from crates/sargon/src/profile/logic/mod.rs rename to crates/sargon-profile/src/logic/mod.rs diff --git a/crates/sargon/src/profile/logic/persona/create_persona.rs b/crates/sargon-profile/src/logic/persona/create_persona.rs similarity index 100% rename from crates/sargon/src/profile/logic/persona/create_persona.rs rename to crates/sargon-profile/src/logic/persona/create_persona.rs diff --git a/crates/sargon/src/profile/logic/persona/mod.rs b/crates/sargon-profile/src/logic/persona/mod.rs similarity index 100% rename from crates/sargon/src/profile/logic/persona/mod.rs rename to crates/sargon-profile/src/logic/persona/mod.rs diff --git a/crates/sargon/src/profile/logic/persona/persona_data_ids.rs b/crates/sargon-profile/src/logic/persona/persona_data_ids.rs similarity index 100% rename from crates/sargon/src/profile/logic/persona/persona_data_ids.rs rename to crates/sargon-profile/src/logic/persona/persona_data_ids.rs diff --git a/crates/sargon/src/profile/logic/persona/query_personas.rs b/crates/sargon-profile/src/logic/persona/query_personas.rs similarity index 100% rename from crates/sargon/src/profile/logic/persona/query_personas.rs rename to crates/sargon-profile/src/logic/persona/query_personas.rs diff --git a/crates/sargon/src/profile/logic/persona/shared_persona_data_ids.rs b/crates/sargon-profile/src/logic/persona/shared_persona_data_ids.rs similarity index 100% rename from crates/sargon/src/profile/logic/persona/shared_persona_data_ids.rs rename to crates/sargon-profile/src/logic/persona/shared_persona_data_ids.rs diff --git a/crates/sargon/src/profile/logic/profile_header.rs b/crates/sargon-profile/src/logic/profile_header.rs similarity index 100% rename from crates/sargon/src/profile/logic/profile_header.rs rename to crates/sargon-profile/src/logic/profile_header.rs diff --git a/crates/sargon/src/profile/logic/profile_network/mod.rs b/crates/sargon-profile/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/src/logic/profile_network/mod.rs diff --git a/crates/sargon/src/profile/logic/profile_network/profile_network_details.rs b/crates/sargon-profile/src/logic/profile_network/profile_network_details.rs similarity index 100% rename from crates/sargon/src/profile/logic/profile_network/profile_network_details.rs rename to crates/sargon-profile/src/logic/profile_network/profile_network_details.rs diff --git a/crates/sargon/src/profile/logic/profile_network/profile_network_entities_linked_to_factor_source.rs b/crates/sargon-profile/src/logic/profile_network/profile_network_entities_linked_to_factor_source.rs similarity index 100% rename from crates/sargon/src/profile/logic/profile_network/profile_network_entities_linked_to_factor_source.rs rename to crates/sargon-profile/src/logic/profile_network/profile_network_entities_linked_to_factor_source.rs diff --git a/crates/sargon/src/profile/logic/profile_network/profile_network_get_entities.rs b/crates/sargon-profile/src/logic/profile_network/profile_network_get_entities.rs similarity index 100% rename from crates/sargon/src/profile/logic/profile_network/profile_network_get_entities.rs rename to crates/sargon-profile/src/logic/profile_network/profile_network_get_entities.rs diff --git a/crates/sargon/src/profile/logic/profile_networks.rs b/crates/sargon-profile/src/logic/profile_networks.rs similarity index 100% rename from crates/sargon/src/profile/logic/profile_networks.rs rename to crates/sargon-profile/src/logic/profile_networks.rs diff --git a/crates/sargon/src/profile/logic/query_factor_sources.rs b/crates/sargon-profile/src/logic/query_factor_sources.rs similarity index 100% rename from crates/sargon/src/profile/logic/query_factor_sources.rs rename to crates/sargon-profile/src/logic/query_factor_sources.rs diff --git a/crates/sargon/src/signing/petition_types/factor_list_kind.rs b/crates/sargon-profile/src/mfa/factor_list_kind.rs similarity index 80% rename from crates/sargon/src/signing/petition_types/factor_list_kind.rs rename to crates/sargon-profile/src/mfa/factor_list_kind.rs index acbc6e709..8f349f49e 100644 --- a/crates/sargon/src/signing/petition_types/factor_list_kind.rs +++ b/crates/sargon-profile/src/mfa/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/src/profile/mfa/mod.rs b/crates/sargon-profile/src/mfa/mod.rs similarity index 57% rename from crates/sargon/src/profile/mfa/mod.rs rename to crates/sargon-profile/src/mfa/mod.rs index b39fbbfa8..e03c06672 100644 --- a/crates/sargon/src/profile/mfa/mod.rs +++ b/crates/sargon-profile/src/mfa/mod.rs @@ -1,5 +1,9 @@ +mod role_kind; mod secured_entity_control; mod security_structures; +mod factor_list_kind; +pub use role_kind::*; +pub use factor_list_kind::*; pub use secured_entity_control::*; pub use security_structures::*; diff --git a/crates/sargon/src/signing/petition_types/role_kind.rs b/crates/sargon-profile/src/mfa/role_kind.rs similarity index 100% rename from crates/sargon/src/signing/petition_types/role_kind.rs rename to crates/sargon-profile/src/mfa/role_kind.rs diff --git a/crates/sargon/src/profile/mfa/secured_entity_control/mod.rs b/crates/sargon-profile/src/mfa/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/mfa/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/mfa/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/mfa/secured_entity_control/secured_entity_control.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/automatic_shield_builder/auto_build_outcome_for_testing.rs b/crates/sargon-profile/src/mfa/security_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/src/mfa/security_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/src/mfa/security_structures/automatic_shield_builder/automatic_shield_builder.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/automatic_shield_builder/automatic_shield_builder.rs rename to crates/sargon-profile/src/mfa/security_structures/automatic_shield_builder/automatic_shield_builder.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/automatic_shield_builder/factor_selector.rs b/crates/sargon-profile/src/mfa/security_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/src/mfa/security_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/src/mfa/security_structures/automatic_shield_builder/mod.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/automatic_shield_builder/mod.rs rename to crates/sargon-profile/src/mfa/security_structures/automatic_shield_builder/mod.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/automatic_shield_builder/proto_shield.rs b/crates/sargon-profile/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_structures/automatic_shield_builder/quantity.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/has_role_kind.rs b/crates/sargon-profile/src/mfa/security_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/src/mfa/security_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/src/mfa/security_structures/matrices/abstract_matrix_builder_or_built.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/matrices/abstract_matrix_builder_or_built.rs rename to crates/sargon-profile/src/mfa/security_structures/matrices/abstract_matrix_builder_or_built.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/matrices/builder/error.rs b/crates/sargon-profile/src/mfa/security_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/src/mfa/security_structures/matrices/builder/error.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/matrices/builder/matrix_builder.rs b/crates/sargon-profile/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_structures/matrices/builder/matrix_template.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/matrices/builder/mod.rs b/crates/sargon-profile/src/mfa/security_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/src/mfa/security_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/src/mfa/security_structures/matrices/matrix_of_factor_instances.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/matrices/matrix_of_factor_instances.rs rename to crates/sargon-profile/src/mfa/security_structures/matrices/matrix_of_factor_instances.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/matrices/matrix_of_factor_source_ids.rs b/crates/sargon-profile/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_structures/matrices/matrix_of_factor_sources.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/matrices/mod.rs b/crates/sargon-profile/src/mfa/security_structures/matrices/mod.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/matrices/mod.rs rename to crates/sargon-profile/src/mfa/security_structures/matrices/mod.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/mod.rs b/crates/sargon-profile/src/mfa/security_structures/mod.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/mod.rs rename to crates/sargon-profile/src/mfa/security_structures/mod.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/abstract_role_builder_or_built.rs b/crates/sargon-profile/src/mfa/security_structures/roles/abstract_role_builder_or_built.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/roles/abstract_role_builder_or_built.rs rename to crates/sargon-profile/src/mfa/security_structures/roles/abstract_role_builder_or_built.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/builder/confirmation_roles_builder_unit_tests.rs b/crates/sargon-profile/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_structures/roles/builder/roles_builder.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/roles/builder/roles_builder.rs rename to crates/sargon-profile/src/mfa/security_structures/roles/builder/roles_builder.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/builder/roles_builder_unit_tests.rs b/crates/sargon-profile/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_structures/roles/factor_levels/factor_instance_level/mod.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_instance_level/mod.rs rename to crates/sargon-profile/src/mfa/security_structures/roles/factor_levels/factor_instance_level/mod.rs 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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_structures/roles/factor_levels/factor_source_level/mod.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/roles/factor_levels/factor_source_level/mod.rs rename to crates/sargon-profile/src/mfa/security_structures/roles/factor_levels/factor_source_level/mod.rs 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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_structures/roles/factor_levels/mod.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/roles/mod.rs b/crates/sargon-profile/src/mfa/security_structures/roles/mod.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/roles/mod.rs rename to crates/sargon-profile/src/mfa/security_structures/roles/mod.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/security_shield_builder.rs b/crates/sargon-profile/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_structures/security_shield_prerequisites_status.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/security_structure_id.rs b/crates/sargon-profile/src/mfa/security_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/src/mfa/security_structures/security_structure_id.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/security_structure_metadata.rs b/crates/sargon-profile/src/mfa/security_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/src/mfa/security_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/src/mfa/security_structures/security_structure_of_factors/abstract_security_structure_of_factors.rs similarity index 100% rename from crates/sargon/src/profile/mfa/security_structures/security_structure_of_factors/abstract_security_structure_of_factors.rs rename to crates/sargon-profile/src/mfa/security_structures/security_structure_of_factors/abstract_security_structure_of_factors.rs diff --git a/crates/sargon/src/profile/mfa/security_structures/security_structure_of_factors/mod.rs b/crates/sargon-profile/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_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/src/mfa/security_structures/selected_factor_sources_status.rs 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..2076c7af0 100644 --- a/crates/sargon/src/profile/profilesnapshot_version.rs +++ b/crates/sargon-profile/src/profilesnapshot_version.rs @@ -55,12 +55,10 @@ impl HasSampleValues for ProfileSnapshotVersion { #[cfg(test)] mod tests { - use crate::{ - assert_json_value_eq_after_roundtrip, assert_json_value_fails, - }; + + use super::*; use serde_json::json; - use super::ProfileSnapshotVersion; #[test] fn json() { 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 100% rename from crates/sargon/src/profile/supporting_types/account_or_persona.rs rename to crates/sargon-profile/src/supporting_types/account_or_persona.rs 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/app_preferences/app_display_settings/app_display_settings.rs b/crates/sargon-profile/src/v100/app_preferences/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/src/v100/app_preferences/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/src/v100/app_preferences/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/src/v100/app_preferences/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/src/v100/app_preferences/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/src/v100/app_preferences/app_display_settings/mod.rs diff --git a/crates/sargon/src/profile/v100/app_preferences/app_preferences.rs b/crates/sargon-profile/src/v100/app_preferences/app_preferences.rs similarity index 100% rename from crates/sargon/src/profile/v100/app_preferences/app_preferences.rs rename to crates/sargon-profile/src/v100/app_preferences/app_preferences.rs diff --git a/crates/sargon/src/profile/v100/app_preferences/gateways/gateway.rs b/crates/sargon-profile/src/v100/app_preferences/gateways/gateway.rs similarity index 100% rename from crates/sargon/src/profile/v100/app_preferences/gateways/gateway.rs rename to crates/sargon-profile/src/v100/app_preferences/gateways/gateway.rs diff --git a/crates/sargon/src/profile/v100/app_preferences/gateways/mod.rs b/crates/sargon-profile/src/v100/app_preferences/gateways/mod.rs similarity index 100% rename from crates/sargon/src/profile/v100/app_preferences/gateways/mod.rs rename to crates/sargon-profile/src/v100/app_preferences/gateways/mod.rs diff --git a/crates/sargon/src/profile/v100/app_preferences/gateways/network_definition.rs b/crates/sargon-profile/src/v100/app_preferences/gateways/network_definition.rs similarity index 99% rename from crates/sargon/src/profile/v100/app_preferences/gateways/network_definition.rs rename to crates/sargon-profile/src/v100/app_preferences/gateways/network_definition.rs index 02f8571ce..7db5e39b5 100644 --- a/crates/sargon/src/profile/v100/app_preferences/gateways/network_definition.rs +++ b/crates/sargon-profile/src/v100/app_preferences/gateways/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,7 @@ impl NetworkDefinition { } } +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/src/v100/app_preferences/gateways/saved_gateways.rs similarity index 100% rename from crates/sargon/src/profile/v100/app_preferences/gateways/saved_gateways.rs rename to crates/sargon-profile/src/v100/app_preferences/gateways/saved_gateways.rs diff --git a/crates/sargon/src/profile/v100/app_preferences/mod.rs b/crates/sargon-profile/src/v100/app_preferences/mod.rs similarity index 100% rename from crates/sargon/src/profile/v100/app_preferences/mod.rs rename to crates/sargon-profile/src/v100/app_preferences/mod.rs diff --git a/crates/sargon/src/profile/v100/app_preferences/security.rs b/crates/sargon-profile/src/v100/app_preferences/security.rs similarity index 100% rename from crates/sargon/src/profile/v100/app_preferences/security.rs rename to crates/sargon-profile/src/v100/app_preferences/security.rs diff --git a/crates/sargon/src/profile/v100/app_preferences/transaction_preferences.rs b/crates/sargon-profile/src/v100/app_preferences/transaction_preferences.rs similarity index 100% rename from crates/sargon/src/profile/v100/app_preferences/transaction_preferences.rs rename to crates/sargon-profile/src/v100/app_preferences/transaction_preferences.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..7c91858e4 100644 --- a/crates/sargon/src/profile/v100/entity/account/account.rs +++ b/crates/sargon-profile/src/v100/entity/account/account.rs @@ -113,28 +113,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, 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 100% rename from crates/sargon/src/profile/v100/entity/has_security_state.rs rename to crates/sargon-profile/src/v100/entity/has_security_state.rs 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..d4b4c6995 100644 --- a/crates/sargon/src/profile/v100/entity/persona/persona.rs +++ b/crates/sargon-profile/src/v100/entity/persona/persona.rs @@ -114,28 +114,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, 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 100% 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 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 100% 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 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 100% 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 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 100% rename from crates/sargon/src/profile/v100/mod.rs rename to crates/sargon-profile/src/v100/mod.rs 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 100% 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 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 100% 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 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 100% 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 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 100% rename from crates/sargon/src/profile/v100/networks/network/authorized_dapps.rs rename to crates/sargon-profile/src/v100/networks/network/authorized_dapps.rs 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 100% rename from crates/sargon/src/profile/v100/networks/network/profile_network.rs rename to crates/sargon-profile/src/v100/networks/network/profile_network.rs 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..df517c12e 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,7 @@ mod tests { #[test] fn hidden_resources() { - use crate::ResourceIdentifier::*; + use 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 100% rename from crates/sargon/src/profile/v100/networks/profile_networks.rs rename to crates/sargon-profile/src/v100/networks/profile_networks.rs diff --git a/crates/sargon/src/profile/v100/profile.rs b/crates/sargon-profile/src/v100/profile.rs similarity index 100% rename from crates/sargon/src/profile/v100/profile.rs rename to crates/sargon-profile/src/v100/profile.rs 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/profile_legacy_state_bugs.rs b/crates/sargon-profile/src/v100/profile_legacy_state_bugs.rs similarity index 100% rename from crates/sargon/src/profile/v100/profile_legacy_state_bugs.rs rename to crates/sargon-profile/src/v100/profile_legacy_state_bugs.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-transaction-models/Cargo.toml b/crates/sargon-transaction-models/Cargo.toml new file mode 100644 index 000000000..c45aa420d --- /dev/null +++ b/crates/sargon-transaction-models/Cargo.toml @@ -0,0 +1,53 @@ +[package] +name = "sargon-transaction-models" +version = "1.2.1" +edition = "2021" +build = "build.rs" + +[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" } + +# == Radix dependencies == +sbor = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } +radix-rust = { workspace = true } +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 } +radix-engine-toolkit-common = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } +radix-transactions = { workspace = true } +radix-engine-toolkit = { workspace = true } + +# == External Dependencies == +zeroize = { workspace = true } +log = { workspace = true } +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 } +enum-iterator = { workspace = true } +rand = { workspace = true } +hex = { workspace = true } +delegate = { workspace = true } +itertools = { workspace = true } +enum-as-inner = { workspace = true } +iota-crypto = { workspace = true } +k256 = { workspace = true } +assert-json-diff = { workspace = true } +url = { workspace = true } +paste = { workspace = true } +async-trait = { workspace = true } +pretty_assertions = { 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..3e1eafec3 --- /dev/null +++ b/crates/sargon-transaction-models/build.rs @@ -0,0 +1,49 @@ +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_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.rtm b/crates/sargon-transaction-models/fixtures/transaction/account_locker_claim.rtm similarity index 100% rename from crates/sargon/fixtures/transaction/account_locker_claim.rtm rename to crates/sargon-transaction-models/fixtures/transaction/account_locker_claim.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/account_locker_claim_max_nft_items.rtm b/crates/sargon-transaction-models/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-transaction-models/fixtures/transaction/account_locker_claim_max_nft_items.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/fixtures/transaction/create_3_nft_collections.rtm b/crates/sargon-transaction-models/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-transaction-models/fixtures/transaction/create_3_nft_collections.rtm diff --git a/crates/sargon/fixtures/transaction/create_access_controller_for_account.rtm b/crates/sargon-transaction-models/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-transaction-models/fixtures/transaction/create_access_controller_for_account.rtm diff --git a/crates/sargon/fixtures/transaction/create_access_controller_for_persona.rtm b/crates/sargon-transaction-models/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-transaction-models/fixtures/transaction/create_access_controller_for_persona.rtm 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..b44e97b6c --- /dev/null +++ b/crates/sargon-transaction-models/src/lib.rs @@ -0,0 +1,254 @@ +mod is_intent_signing; +mod low_level; +mod metadata; +mod error_from; +mod profile_models; +mod assert_manifest; +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::is_intent_signing::*; + pub use crate::low_level::*; + pub use crate::metadata::*; + pub use crate::profile_models::*; + pub use crate::assert_manifest::*; + pub use crate::error_from::*; + 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, + TransactionReceiptV1 as ScryptoTransactionReceipt, + }, + }; + + 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_toolkit_common::receipt::RuntimeToolkitTransactionReceipt as ScryptoRuntimeToolkitTransactionReceipt; + + pub(crate) use radix_engine_toolkit_common::receipt::SerializableToolkitTransactionReceipt as ScryptoSerializableToolkitTransactionReceipt; + + 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 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::{ + 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_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, + }, + }; +} + +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 100% 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 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 100% 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 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 100% 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 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 100% 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 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 93% 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..169bbb3de 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,6 +20,7 @@ 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::*; 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 100% 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 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 100% 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 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 100% 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 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 100% 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 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 100% 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 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/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/execution_summary/mod.rs b/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/execution_summary/mod.rs similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v1/transaction_manifest/execution_summary/mod.rs rename to crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/execution_summary/mod.rs 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 100% 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 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 100% 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 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 100% 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 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 100% 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 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 100% 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 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 100% 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 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 100% 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 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/src/wrapped_radix_engine_toolkit/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 similarity index 100% rename from crates/sargon/src/wrapped_radix_engine_toolkit/low_level/v2/transaction_manifest_v2/execution_summary_v2/mod.rs rename to crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/execution_summary_v2/mod.rs 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 100% 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 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 100% 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 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 100% 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 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 100% 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 diff --git a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/metadata.rs b/crates/sargon-transaction-models/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-transaction-models/src/metadata.rs index 50a3f3409..7e7c48884 100644 --- a/crates/sargon/src/wrapped_radix_engine_toolkit/high_level/manifest_building/metadata.rs +++ b/crates/sargon-transaction-models/src/metadata.rs @@ -1,5 +1,4 @@ use crate::prelude::*; -use strum::*; #[derive( Debug, 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 100% 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 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/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 index 56dc18f6c..7bb60e0b2 100644 --- 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 @@ -1,26 +1,26 @@ use crate::prelude::*; -use sargon::AccountOrAddressOf as InternalAccountOrAddressOf; +use sargon::OwnedOrThirdPartyAccountAddress 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 }, +pub enum OwnedOrThirdPartyAccountAddress { + OwnedAccount { value: Account }, + ThirdPartyAccount { value: AccountAddress }, } #[uniffi::export] -pub fn new_account_or_address_of_sample() -> AccountOrAddressOf { +pub fn new_account_or_address_of_sample() -> OwnedOrThirdPartyAccountAddress { InternalAccountOrAddressOf::sample().into() } #[uniffi::export] -pub fn new_account_or_address_of_sample_other() -> AccountOrAddressOf { +pub fn new_account_or_address_of_sample_other() -> OwnedOrThirdPartyAccountAddress { InternalAccountOrAddressOf::sample_other().into() } #[uniffi::export] pub fn account_or_address_of_account_address( - recipient: &AccountOrAddressOf, + 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/mod.rs b/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/mod.rs index 2235168c5..8ca7d8704 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 @@ -2,7 +2,9 @@ mod account_or_address_of; mod per_asset; mod per_recipient; mod transfer_types; +mod owned_or_third_party_account_address; +pub use owned_or_third_party_account_address::*; pub use account_or_address_of::*; pub use per_asset::*; pub use per_recipient::*; 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..6c229c7e7 --- /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,10 @@ + +#[derive(Debug, Clone, Copy, PartialEq, Eq, InternalConversion, uniffi::enum)] +pub enum OwnedOrThirdPartyAccountAddress { + OwnedAccount { + value: AccountAddress, + }, + ThirdPartyAccount { + value: AccountAddress, + }, +} \ No newline at end of file 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/Cargo.toml b/crates/sargon/Cargo.toml index 46820b5b5..4d0e60932 100644 --- a/crates/sargon/Cargo.toml +++ b/crates/sargon/Cargo.toml @@ -18,6 +18,10 @@ sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-determinist 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-factor-instances-provider = { path = "../sargon-factor-instances-provider" } zeroize = { workspace = true } @@ -85,7 +89,7 @@ paste = { workspace = true } # camino = "1.0.8" camino = { git = "https://github.com/camino-rs/camino/", rev = "afa51b1b4c684b7e6698a6717ccda3affd0abd42", optional = true } -async-trait = { workspace = true } +async-trait = { workspace = true } pretty_assertions = { workspace = true } diff --git a/crates/sargon/build.rs b/crates/sargon/build.rs index 279ae309d..c076926af 100644 --- a/crates/sargon/build.rs +++ b/crates/sargon/build.rs @@ -1,63 +1,30 @@ -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/lib.rs b/crates/sargon/src/lib.rs index c754d6419..080ba4d28 100644 --- a/crates/sargon/src/lib.rs +++ b/crates/sargon/src/lib.rs @@ -11,37 +11,33 @@ #![feature(trivial_bounds)] #![allow(trivial_bounds)] -mod error_from; -mod factor_instances_provider; mod gateway_api; mod home_cards; -mod profile; 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_factor_instances_provider::prelude::*; pub use sargon_factors::prelude::*; pub use sargon_hierarchical_deterministic::prelude::*; pub use sargon_keys_collector::prelude::*; + pub use sargon_manifests::prelude::*; + pub use sargon_profile::prelude::*; + pub use sargon_transaction_models::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; @@ -94,6 +90,7 @@ pub mod prelude { 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, 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/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/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/system/drivers/event_bus_driver/support/event_profile_modified.rs b/crates/sargon/src/system/drivers/event_bus_driver/support/event_profile_modified.rs index 230667172..5b79e3f8b 100644 --- a/crates/sargon/src/system/drivers/event_bus_driver/support/event_profile_modified.rs +++ b/crates/sargon/src/system/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/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/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/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..acc03752e 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,14 +342,14 @@ 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 @@ -377,8 +377,8 @@ class TransactionManifestTest : SampleTestable { listOf( PerRecipientAssetTransfer( recipient = - AccountOrAddressOf - .AddressOfExternalAccount( + OwnedOrThirdPartyAccountAddress + .ThirdPartyAccount( value = AccountAddress( "account_rdx12xkzynhzgtpnnd02tudw2els2g9xl73yk54ppw8xekt2sdrlaer264" From d1515af020e347e198d845db6f1832e800820746 Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Mon, 30 Dec 2024 20:48:02 +0100 Subject: [PATCH 02/23] wip Profile split out logic. tricky since some ctors do validation using e.g. IndexAgnostic stuff. Maybe IndexAgnostic path into profile? --- Cargo.lock | 55 +- Cargo.toml | 126 +- crates/gateway-logic/Cargo.toml | 25 + crates/gateway-logic/build.rs | 20 + ...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 crates/gateway-logic/src/lib.rs | 23 + crates/gateway-logic/src/logic/mod.rs | 5 + .../src/logic/new_transaction_preview.rs} | 16 +- crates/gateway-logic/src/logic/request/mod.rs | 3 + ...ction_submit_request_from_notarized_tx.rs} | 10 +- crates/gateway-models/Cargo.toml | 19 + crates/gateway-models/build.rs | 14 + ...ity_details__single_account_no_assets.json | 27 + ...quest_entity_details__single_resource.json | 27 + .../request_entity_details__two_accounts.json | 28 + ...ingle_account_many_nfts_and_fungibles.json | 2980 +++++++++++++++++ ...ity_details__single_account_no_assets.json | 277 ++ ...ponse_entity_details__single_resource.json | 649 ++++ ..._details__single_resource_no_metadata.json | 398 +++ ...response_entity_details__two_accounts.json | 1025 ++++++ ...ty_details_details__fungible_resource.json | 347 ++ ...etails_details__non_fungible_resource.json | 344 ++ .../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 | 2 + .../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 | 24 +- .../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 | 2 +- .../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 | 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 | 75 + .../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 | 7 + .../transaction/subintent_status/mod.rs | 0 .../transaction/subintent_status/response.rs} | 17 +- .../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/identified-vec-of/Cargo.toml | 12 +- crates/sargon-addresses/Cargo.toml | 6 +- crates/sargon-core-assert-json/Cargo.toml | 7 +- crates/sargon-core-error/Cargo.toml | 9 +- crates/sargon-core-utils/Cargo.toml | 2 + crates/sargon-core/Cargo.toml | 29 +- crates/sargon-core/src/lib.rs | 7 + .../src/metadata.rs | 0 .../Cargo.toml | 30 +- crates/sargon-factors/Cargo.toml | 41 +- .../Cargo.toml | 36 +- crates/sargon-keys-collector/Cargo.toml | 5 + crates/sargon-manifests/Cargo.toml | 56 +- crates/sargon-manifests/build.rs | 38 +- .../transaction/account_locker_claim.rtm | 0 .../account_locker_claim_max_nft_items.rtm | 0 .../delete_account/manifest_delete_account.rs | 18 +- crates/sargon-manifests/src/lib.rs | 4 + .../src/manifest_account_locker.rs | 25 +- .../third_party_deposits_delta.rs | 28 - crates/sargon-profile-logic/Cargo.toml | 26 + crates/sargon-profile-logic/src/lib.rs | 8 + .../src/logic/account/account_visibility.rs | 0 .../src/logic/account/accounts_visibility.rs | 0 .../src/logic/account/create_account.rs | 0 .../src/logic/account/mod.rs | 0 .../src/logic/account/query_accounts.rs | 0 .../account/query_security_structures.rs | 0 .../src/logic/assert_has_entity_kind.rs | 63 + .../src/logic/create_entity.rs | 0 .../src/logic/diagnose_instance_duplicates.rs | 270 ++ .../src/logic/gateway/current_gateway.rs | 0 .../src/logic/gateway/mod.rs | 0 .../instances_deriving_with_factor_sources.rs | 77 + .../src/logic/mod.rs | 6 + .../src/logic/persona/create_persona.rs | 0 .../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 | 0 .../src/logic/profile_network/mod.rs | 0 .../profile_network_details.rs | 0 ...etwork_entities_linked_to_factor_source.rs | 0 .../profile_network_get_entities.rs | 0 .../src/logic/profile_networks.rs | 0 .../src/logic/query_factor_sources.rs | 0 ...trix_of_factor_instances_index_agnostic.rs | 70 + crates/sargon-profile-logic/src/tests/mod.rs | 1 + crates/sargon-profile/Cargo.toml | 119 +- crates/sargon-profile/src/lib.rs | 2 - crates/sargon-profile/src/mfa/mod.rs | 4 +- .../matrices/matrix_of_factor_instances.rs | 272 +- .../roles/abstract_role_builder_or_built.rs | 4 +- .../src/profilesnapshot_version.rs | 1 - .../src/v100/entity/account/account.rs | 1 - .../entity_security_state.rs | 1 + .../src/v100/profile_legacy_state_bugs.rs | 281 -- crates/sargon-transaction-models/Cargo.toml | 53 +- crates/sargon-transaction-models/build.rs | 35 - crates/sargon-transaction-models/src/lib.rs | 10 +- .../third_party_deposits/asset_exception.rs | 34 + crates/sargon-uniffi/Cargo.toml | 93 +- .../assets_transfers/account_or_address_of.rs | 3 +- .../assets_transfers/mod.rs | 4 +- .../owned_or_third_party_account_address.rs | 15 +- crates/sargon/Cargo.toml | 112 +- crates/sargon/build.rs | 8 +- crates/sargon/src/gateway_api/mod.rs | 2 - .../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 - 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_v2.rs | 47 - .../types/request/transaction/submit/mod.rs | 3 - .../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 - jvm/sargon-android/build.gradle.kts | 1 - scripts/ios/build-sargon.sh | 2 +- 249 files changed, 7786 insertions(+), 1595 deletions(-) create mode 100644 crates/gateway-logic/Cargo.toml create mode 100644 crates/gateway-logic/build.rs rename crates/{sargon/fixtures/models/gateway => gateway-logic/fixtures/models}/state/request_entity_details__single_account_no_assets.json (100%) rename crates/{sargon/fixtures/models/gateway => gateway-logic/fixtures/models}/state/request_entity_details__single_resource.json (100%) rename crates/{sargon/fixtures/models/gateway => gateway-logic/fixtures/models}/state/request_entity_details__two_accounts.json (100%) rename crates/{sargon/fixtures/models/gateway => gateway-logic/fixtures/models}/state/response_entity_details__single_account_many_nfts_and_fungibles.json (100%) rename crates/{sargon/fixtures/models/gateway => gateway-logic/fixtures/models}/state/response_entity_details__single_account_no_assets.json (100%) rename crates/{sargon/fixtures/models/gateway => gateway-logic/fixtures/models}/state/response_entity_details__single_resource.json (100%) rename crates/{sargon/fixtures/models/gateway => gateway-logic/fixtures/models}/state/response_entity_details__single_resource_no_metadata.json (100%) rename crates/{sargon/fixtures/models/gateway => gateway-logic/fixtures/models}/state/response_entity_details__two_accounts.json (100%) rename crates/{sargon/fixtures/models/gateway => gateway-logic/fixtures/models}/state/response_entity_details_details__fungible_resource.json (100%) rename crates/{sargon/fixtures/models/gateway => gateway-logic/fixtures/models}/state/response_entity_details_details__non_fungible_resource.json (100%) rename crates/{sargon/fixtures/models/gateway => gateway-logic/fixtures/models}/transaction/request_preview.json (100%) create mode 100644 crates/gateway-logic/src/lib.rs create mode 100644 crates/gateway-logic/src/logic/mod.rs rename crates/{sargon/src/gateway_api/models/logic/request/transaction/preview/transaction_preview.rs => gateway-logic/src/logic/new_transaction_preview.rs} (88%) create mode 100644 crates/gateway-logic/src/logic/request/mod.rs rename crates/{sargon/src/gateway_api/models/logic/request/transaction/submit/transaction_submit.rs => gateway-logic/src/logic/request/transaction_submit_request_from_notarized_tx.rs} (65%) create mode 100644 crates/gateway-models/Cargo.toml create mode 100644 crates/gateway-models/build.rs create mode 100644 crates/gateway-models/fixtures/models/state/request_entity_details__single_account_no_assets.json create mode 100644 crates/gateway-models/fixtures/models/state/request_entity_details__single_resource.json create mode 100644 crates/gateway-models/fixtures/models/state/request_entity_details__two_accounts.json create mode 100644 crates/gateway-models/fixtures/models/state/response_entity_details__single_account_many_nfts_and_fungibles.json create mode 100644 crates/gateway-models/fixtures/models/state/response_entity_details__single_account_no_assets.json create mode 100644 crates/gateway-models/fixtures/models/state/response_entity_details__single_resource.json create mode 100644 crates/gateway-models/fixtures/models/state/response_entity_details__single_resource_no_metadata.json create mode 100644 crates/gateway-models/fixtures/models/state/response_entity_details__two_accounts.json create mode 100644 crates/gateway-models/fixtures/models/state/response_entity_details_details__fungible_resource.json create mode 100644 crates/gateway-models/fixtures/models/state/response_entity_details_details__non_fungible_resource.json 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 (75%) 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 => gateway-models/src}/types/request/transaction/preview/transaction_preview.rs (65%) 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 => gateway-models/src}/types/request/transaction/submit/transaction_submit.rs (85%) 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 (100%) 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 (100%) 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 (93%) rename crates/{sargon/src/gateway_api/models => gateway-models/src}/types/response/transaction/subintent_status/mod.rs (100%) rename crates/{sargon/src/gateway_api/models/logic/response/transaction/subintent_status/subintent_status.rs => gateway-models/src/types/response/transaction/subintent_status/response.rs} (53%) 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%) rename crates/{sargon-transaction-models => sargon-core}/src/metadata.rs (100%) rename crates/{sargon-transaction-models => sargon-manifests}/fixtures/transaction/account_locker_claim.rtm (100%) rename crates/{sargon-transaction-models => sargon-manifests}/fixtures/transaction/account_locker_claim_max_nft_items.rtm (100%) create mode 100644 crates/sargon-profile-logic/Cargo.toml create mode 100644 crates/sargon-profile-logic/src/lib.rs rename crates/{sargon-profile => sargon-profile-logic}/src/logic/account/account_visibility.rs (100%) rename crates/{sargon-profile => sargon-profile-logic}/src/logic/account/accounts_visibility.rs (100%) rename crates/{sargon-profile => sargon-profile-logic}/src/logic/account/create_account.rs (100%) rename crates/{sargon-profile => sargon-profile-logic}/src/logic/account/mod.rs (100%) rename crates/{sargon-profile => sargon-profile-logic}/src/logic/account/query_accounts.rs (100%) rename crates/{sargon-profile => sargon-profile-logic}/src/logic/account/query_security_structures.rs (100%) create mode 100644 crates/sargon-profile-logic/src/logic/assert_has_entity_kind.rs rename crates/{sargon-profile => sargon-profile-logic}/src/logic/create_entity.rs (100%) create mode 100644 crates/sargon-profile-logic/src/logic/diagnose_instance_duplicates.rs rename crates/{sargon-profile => sargon-profile-logic}/src/logic/gateway/current_gateway.rs (100%) rename crates/{sargon-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-profile => sargon-profile-logic}/src/logic/mod.rs (60%) rename crates/{sargon-profile => sargon-profile-logic}/src/logic/persona/create_persona.rs (100%) rename crates/{sargon-profile => sargon-profile-logic}/src/logic/persona/mod.rs (100%) rename crates/{sargon-profile => sargon-profile-logic}/src/logic/persona/persona_data_ids.rs (100%) rename crates/{sargon-profile => sargon-profile-logic}/src/logic/persona/query_personas.rs (100%) rename crates/{sargon-profile => sargon-profile-logic}/src/logic/persona/shared_persona_data_ids.rs (100%) rename crates/{sargon-profile => sargon-profile-logic}/src/logic/profile_header.rs (100%) rename crates/{sargon-profile => sargon-profile-logic}/src/logic/profile_network/mod.rs (100%) rename crates/{sargon-profile => sargon-profile-logic}/src/logic/profile_network/profile_network_details.rs (100%) rename crates/{sargon-profile => sargon-profile-logic}/src/logic/profile_network/profile_network_entities_linked_to_factor_source.rs (100%) rename crates/{sargon-profile => sargon-profile-logic}/src/logic/profile_network/profile_network_get_entities.rs (100%) rename crates/{sargon-profile => sargon-profile-logic}/src/logic/profile_networks.rs (100%) rename crates/{sargon-profile => sargon-profile-logic}/src/logic/query_factor_sources.rs (100%) 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 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/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_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/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 diff --git a/Cargo.lock b/Cargo.lock index ba42e1db0..7e3e35f98 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1297,6 +1297,35 @@ dependencies = [ "slab", ] +[[package]] +name = "gateway-logic" +version = "1.2.1" +dependencies = [ + "derive_more", + "gateway-models", + "itertools 0.12.0", + "radix-engine-toolkit-common", + "radix-transactions", + "sargon-addresses", + "sargon-core", + "sargon-core-assert-json", + "sargon-transaction-models", + "serde", +] + +[[package]] +name = "gateway-models" +version = "1.2.1" +dependencies = [ + "derive_more", + "radix-engine-toolkit-common", + "radix-transactions", + "sargon-addresses", + "sargon-core", + "sargon-core-assert-json", + "serde", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -2779,6 +2808,7 @@ dependencies = [ "enum-as-inner", "enum-iterator", "futures", + "gateway-models", "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", "hkdf", "identified-vec-of", @@ -3071,6 +3101,7 @@ dependencies = [ "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", @@ -3094,6 +3125,7 @@ dependencies = [ "sargon-core", "sargon-factors", "sargon-hierarchical-deterministic", + "sargon-profile", "sargon-transaction-models", "sbor", "serde", @@ -3153,8 +3185,6 @@ dependencies = [ "sargon-keys-collector", "sargon-transaction-models", "sbor", - "security-framework", - "security-framework-sys", "serde", "serde_json 1.0.108", "serde_repr", @@ -3166,6 +3196,27 @@ dependencies = [ "zeroize 1.7.0", ] +[[package]] +name = "sargon-profile-logic" +version = "1.2.1" +dependencies = [ + "identified-vec-of", + "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", +] + [[package]] name = "sargon-transaction-models" version = "1.2.1" diff --git a/Cargo.toml b/Cargo.toml index 5cdab1649..d1f75d68c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,8 +16,12 @@ members = [ "crates/sargon-transaction-models", "crates/sargon-manifests", "crates/sargon-profile", + "crates/sargon-profile-logic", "crates/sargon-factor-instances-provider", + "crates/gateway-models", + "crates/gateway-logic", + "crates/sargon", # to be split "crates/sargon-uniffi-conversion-macros", @@ -40,31 +44,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", @@ -84,21 +119,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" @@ -108,26 +138,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"] } @@ -136,28 +191,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", @@ -169,6 +220,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/crates/gateway-logic/Cargo.toml b/crates/gateway-logic/Cargo.toml new file mode 100644 index 000000000..e482ef35a --- /dev/null +++ b/crates/gateway-logic/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "gateway-logic" +version = "1.2.1" +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" } +gateway-models = { path = "../gateway-models" } + +# hmm should maybe not do this, we only use NotarizedTransaction for a ctor, we can put +# it elsewhere... outside of gateway-logic crate +sargon-transaction-models = { path = "../sargon-transaction-models" } + +# === RADIX DEPENDENCIES === +radix-engine-toolkit-common = { workspace = true } +radix-transactions = { workspace = true } + +# === EXTERNAL DEPENDENCIES === +derive_more = { workspace = true } +itertools = { workspace = true } +serde = { workspace = true } diff --git a/crates/gateway-logic/build.rs b/crates/gateway-logic/build.rs new file mode 100644 index 000000000..4a040fa98 --- /dev/null +++ b/crates/gateway-logic/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_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_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-logic/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-logic/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-logic/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-logic/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-logic/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-logic/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-logic/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-logic/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-logic/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-logic/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-logic/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-logic/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-logic/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-logic/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-logic/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-logic/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-logic/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-logic/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-logic/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-logic/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-logic/fixtures/models/transaction/request_preview.json similarity index 100% rename from crates/sargon/fixtures/models/gateway/transaction/request_preview.json rename to crates/gateway-logic/fixtures/models/transaction/request_preview.json diff --git a/crates/gateway-logic/src/lib.rs b/crates/gateway-logic/src/lib.rs new file mode 100644 index 000000000..4a0a3dd94 --- /dev/null +++ b/crates/gateway-logic/src/lib.rs @@ -0,0 +1,23 @@ +mod logic; + +pub mod prelude { + pub use crate::logic::*; + + pub(crate) use gateway_models::prelude::*; + pub(crate) use sargon_addresses::prelude::*; + pub(crate) use sargon_core::prelude::*; + pub(crate) use sargon_transaction_models::prelude::*; + + pub(crate) use itertools::Itertools; + + pub(crate) use radix_transactions::{ + builder::TransactionV2Builder as ScryptoTransactionV2Builder, + model::{ + IntentHeaderV2 as ScryptoIntentHeaderV2, + TransactionHeaderV2 as ScryptoTransactionHeaderV2, + }, + prelude::TransactionManifestV2 as ScryptoTransactionManifestV2, + }; +} + +pub use prelude::*; diff --git a/crates/gateway-logic/src/logic/mod.rs b/crates/gateway-logic/src/logic/mod.rs new file mode 100644 index 000000000..bb8969a4c --- /dev/null +++ b/crates/gateway-logic/src/logic/mod.rs @@ -0,0 +1,5 @@ +mod new_transaction_preview; +mod request; + +pub use new_transaction_preview::*; +pub use request::*; diff --git a/crates/sargon/src/gateway_api/models/logic/request/transaction/preview/transaction_preview.rs b/crates/gateway-logic/src/logic/new_transaction_preview.rs similarity index 88% rename from crates/sargon/src/gateway_api/models/logic/request/transaction/preview/transaction_preview.rs rename to crates/gateway-logic/src/logic/new_transaction_preview.rs index c54df1c63..2c876d48b 100644 --- a/crates/sargon/src/gateway_api/models/logic/request/transaction/preview/transaction_preview.rs +++ b/crates/gateway-logic/src/logic/new_transaction_preview.rs @@ -1,7 +1,17 @@ -use crate::prelude::*; +pub use crate::prelude::*; -impl TransactionPreviewRequest { - pub fn new_transaction_analysis( +pub trait TransactionPreviewRequestFromManifest: Sized { + fn new_transaction_analysis( + manifest: TransactionManifest, + start_epoch_inclusive: Epoch, + signer_public_keys: impl IntoIterator, + notary_public_key: Option, + nonce: Nonce, + ) -> Self; +} + +impl TransactionPreviewRequestFromManifest for TransactionPreviewRequest { + fn new_transaction_analysis( manifest: TransactionManifest, start_epoch_inclusive: Epoch, signer_public_keys: impl IntoIterator, diff --git a/crates/gateway-logic/src/logic/request/mod.rs b/crates/gateway-logic/src/logic/request/mod.rs new file mode 100644 index 000000000..3c409be93 --- /dev/null +++ b/crates/gateway-logic/src/logic/request/mod.rs @@ -0,0 +1,3 @@ +mod transaction_submit_request_from_notarized_tx; + +pub use transaction_submit_request_from_notarized_tx::*; diff --git a/crates/sargon/src/gateway_api/models/logic/request/transaction/submit/transaction_submit.rs b/crates/gateway-logic/src/logic/request/transaction_submit_request_from_notarized_tx.rs similarity index 65% rename from crates/sargon/src/gateway_api/models/logic/request/transaction/submit/transaction_submit.rs rename to crates/gateway-logic/src/logic/request/transaction_submit_request_from_notarized_tx.rs index 30b6fe108..3159b0249 100644 --- a/crates/sargon/src/gateway_api/models/logic/request/transaction/submit/transaction_submit.rs +++ b/crates/gateway-logic/src/logic/request/transaction_submit_request_from_notarized_tx.rs @@ -1,7 +1,13 @@ use crate::prelude::*; -impl TransactionSubmitRequest { - pub fn new(notarized_transaction: NotarizedTransaction) -> Self { +pub trait TransactionSubmitRequestFromNotarizedTransaction { + fn new(notarized_transaction: NotarizedTransaction) -> Self; +} + +impl TransactionSubmitRequestFromNotarizedTransaction + for TransactionSubmitRequest +{ + fn new(notarized_transaction: NotarizedTransaction) -> Self { let compiled = notarized_transaction.compile(); Self { notarized_transaction_hex: compiled.to_string(), diff --git a/crates/gateway-models/Cargo.toml b/crates/gateway-models/Cargo.toml new file mode 100644 index 000000000..25b9d87a3 --- /dev/null +++ b/crates/gateway-models/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "gateway-models" +version = "1.2.1" +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" } + +# === RADIX DEPENDENCIES === +radix-engine-toolkit-common = { workspace = true } +radix-transactions = { 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/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 new file mode 100644 index 000000000..281b7679c --- /dev/null +++ b/crates/gateway-models/fixtures/models/state/request_entity_details__single_account_no_assets.json @@ -0,0 +1,27 @@ +{ + "addresses": + [ + "account_tdx_2_12ylv4l9tj9vx0myyge2s7mzmgnzjmk9fgu3h72dn62s8d9lcafxzds" + ], + "aggregation_level": "Vault", + "opt_ins": + { + "ancestor_identities": false, + "component_royalty_vault_balance": false, + "explicit_metadata": + [ + "dapp_definition", + "validator", + "dapp_definitions", + "tags", + "pool", + "description", + "account_type", + "name", + "symbol", + "icon_url" + ], + "non_fungible_include_nfids": false, + "package_royalty_vault_balance": false + } +} \ No newline at end of file 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 new file mode 100644 index 000000000..6ef342a63 --- /dev/null +++ b/crates/gateway-models/fixtures/models/state/request_entity_details__single_resource.json @@ -0,0 +1,27 @@ +{ + "addresses": + [ + "resource_tdx_2_1thkcveg0p2l35kvwlxasltvw0wjgsrpch6yfjct9qahze3wce8ukj8" + ], + "aggregation_level": "Vault", + "opt_ins": + { + "ancestor_identities": false, + "component_royalty_vault_balance": false, + "explicit_metadata": + [ + "symbol", + "dapp_definition", + "name", + "dapp_definitions", + "icon_url", + "tags", + "validator", + "description", + "account_type", + "pool" + ], + "non_fungible_include_nfids": false, + "package_royalty_vault_balance": false + } +} \ No newline at end of file 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 new file mode 100644 index 000000000..05b97db0e --- /dev/null +++ b/crates/gateway-models/fixtures/models/state/request_entity_details__two_accounts.json @@ -0,0 +1,28 @@ +{ + "addresses": + [ + "account_tdx_2_129vd0a8epu6wa46nh8fkcjhmxwtwet6mut8rgzef2ng68zh5t04t88", + "account_tdx_2_12xwjddwn7wp3tqgj353rur4c2jzjg7uvydfj7y8yaflymxnd9czd4c" + ], + "aggregation_level": "Vault", + "opt_ins": + { + "ancestor_identities": false, + "component_royalty_vault_balance": false, + "explicit_metadata": + [ + "pool", + "tags", + "validator", + "description", + "account_type", + "icon_url", + "symbol", + "name", + "dapp_definition", + "dapp_definitions" + ], + "non_fungible_include_nfids": false, + "package_royalty_vault_balance": false + } +} \ No newline at end of file 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 new file mode 100644 index 000000000..6105e827f --- /dev/null +++ b/crates/gateway-models/fixtures/models/state/response_entity_details__single_account_many_nfts_and_fungibles.json @@ -0,0 +1,2980 @@ +{ + "ledger_state": + { + "network": "stokenet", + "state_version": 73654157, + "proposer_round_timestamp": "2024-04-10T08:36:43.74Z", + "epoch": 51651, + "round": 411 + }, + "items": + [ + { + "address": "account_tdx_2_12ylv4l9tj9vx0myyge2s7mzmgnzjmk9fgu3h72dn62s8d9lcafxzds", + "fungible_resources": + { + "total_count": 11, + "items": + [ + { + "vaults": + { + "total_count": 1, + "items": + [ + { + "vault_address": "internal_vault_tdx_2_1trlp0h0jtkdzr5h79sp9c60wgrpznxlsx4j68djwht5tn6apzkx3m0", + "amount": "9991.09666653402", + "last_updated_at_state_version": 73654060 + } + ] + }, + "aggregation_level": "Vault", + "resource_address": "resource_tdx_2_1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxtfd2jc", + "explicit_metadata": + { + "total_count": 5, + "items": + [ + { + "key": "name", + "value": + { + "raw_hex": "5c2200010c055261646978", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Radix", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Radix", + "type": "String" + } + }, + "is_locked": true, + "last_updated_at_state_version": 2 + }, + { + "key": "icon_url", + "value": + { + "raw_hex": "5c220d010c3468747470733a2f2f6173736574732e7261646978646c742e636f6d2f69636f6e732f69636f6e2d7872642d33327833322e706e67", + "programmatic_json": + { + "variant_id": 13, + "fields": + [ + { + "value": "https://assets.radixdlt.com/icons/icon-xrd-32x32.png", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "https://assets.radixdlt.com/icons/icon-xrd-32x32.png", + "type": "Url" + } + }, + "is_locked": true, + "last_updated_at_state_version": 2 + }, + { + "key": "description", + "value": + { + "raw_hex": "5c2200010c9e01546865205261646978205075626c6963204e6574776f726b2773206e617469766520746f6b656e2c207573656420746f2070617920746865206e6574776f726b2773207265717569726564207472616e73616374696f6e206665657320616e6420746f2073656375726520746865206e6574776f726b207468726f756768207374616b696e6720746f206974732076616c696461746f72206e6f6465732e", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "The Radix Public Network's native token, used to pay the network's required transaction fees and to secure the network through staking to its validator nodes.", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "The Radix Public Network's native token, used to pay the network's required transaction fees and to secure the network through staking to its validator nodes.", + "type": "String" + } + }, + "is_locked": true, + "last_updated_at_state_version": 2 + }, + { + "key": "symbol", + "value": + { + "raw_hex": "5c2200010c03585244", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "XRD", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "XRD", + "type": "String" + } + }, + "is_locked": true, + "last_updated_at_state_version": 2 + }, + { + "key": "tags", + "value": + { + "raw_hex": "5c228001200c00", + "programmatic_json": + { + "variant_id": 128, + "fields": + [ + { + "element_kind": "String", + "elements": + [], + "kind": "Array" + } + ], + "kind": "Enum" + }, + "typed": + { + "values": + [], + "type": "StringArray" + } + }, + "is_locked": true, + "last_updated_at_state_version": 2 + } + ] + } + }, + { + "vaults": + { + "total_count": 1, + "items": + [ + { + "vault_address": "internal_vault_tdx_2_1trenve8ltw9lk2snmjng9fwu72d85xtanwyx47haln86dx3x5x4wlm", + "amount": "21000000", + "last_updated_at_state_version": 73654060 + } + ] + }, + "aggregation_level": "Vault", + "resource_address": "resource_tdx_2_1t5znvqz9uaqj4afa2xwuzxy6mum3u2406r5gx9fcjpepfauu25qwm7", + "explicit_metadata": + { + "total_count": 5, + "items": + [ + { + "key": "name", + "value": + { + "raw_hex": "5c2200010c0c5363726962626c65636f696e", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Scribblecoin", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Scribblecoin", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "icon_url", + "value": + { + "raw_hex": "5c220d010c5868747470733a2f2f757877696e672e636f6d2f77702d636f6e74656e742f7468656d65732f757877696e672f646f776e6c6f61642f65646974696e672d757365722d616374696f6e2f70656e63696c2d69636f6e2e706e67", + "programmatic_json": + { + "variant_id": 13, + "fields": + [ + { + "value": "https://uxwing.com/wp-content/themes/uxwing/download/editing-user-action/pencil-icon.png", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "https://uxwing.com/wp-content/themes/uxwing/download/editing-user-action/pencil-icon.png", + "type": "Url" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "description", + "value": + { + "raw_hex": "5c2200010c5b5363726962626c65636f696e202d206d616b696e6720697473206d61726b20696e2074686520776f726c64206f66206469676974616c2063757272656e63792c206f6e65207472616e73616374696f6e20617420612074696d6521", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Scribblecoin - making its mark in the world of digital currency, one transaction at a time!", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Scribblecoin - making its mark in the world of digital currency, one transaction at a time!", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "symbol", + "value": + { + "raw_hex": "5c2200010c055343524942", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "SCRIB", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "SCRIB", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "tags", + "value": + { + "raw_hex": "5c228001200c0206536172676f6e055275737479", + "programmatic_json": + { + "variant_id": 128, + "fields": + [ + { + "element_kind": "String", + "elements": + [ + { + "value": "Sargon", + "kind": "String" + }, + { + "value": "Rusty", + "kind": "String" + } + ], + "kind": "Array" + } + ], + "kind": "Enum" + }, + "typed": + { + "values": + [ + "Sargon", + "Rusty" + ], + "type": "StringArray" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + } + ] + } + }, + { + "vaults": + { + "total_count": 1, + "items": + [ + { + "vault_address": "internal_vault_tdx_2_1tq6fhk82u9r9t3473phmvh4h0cjw8n67zndnwr2qrmykvd3t65dt9w", + "amount": "21000000", + "last_updated_at_state_version": 73654060 + } + ] + }, + "aggregation_level": "Vault", + "resource_address": "resource_tdx_2_1t4s3vqdeasekxcqfudltsp65n4tlx6xy9z9mm440v79q53zfjsm8mm", + "explicit_metadata": + { + "total_count": 5, + "items": + [ + { + "key": "name", + "value": + { + "raw_hex": "5c2200010c08476c6f77636f696e", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Glowcoin", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Glowcoin", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "icon_url", + "value": + { + "raw_hex": "5c220d010c5c68747470733a2f2f757877696e672e636f6d2f77702d636f6e74656e742f7468656d65732f757877696e672f646f776e6c6f61642f617274732d677261706869632d7368617065732f676c6172652d737461722d69636f6e2e706e67", + "programmatic_json": + { + "variant_id": 13, + "fields": + [ + { + "value": "https://uxwing.com/wp-content/themes/uxwing/download/arts-graphic-shapes/glare-star-icon.png", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "https://uxwing.com/wp-content/themes/uxwing/download/arts-graphic-shapes/glare-star-icon.png", + "type": "Url" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "description", + "value": + { + "raw_hex": "5c2200010c54476c6f77636f696e202d20696c6c756d696e6174696e6720746865207061746820746f2066696e616e6369616c2066726565646f6d2077697468206974732072616469616e74207472616e73616374696f6e7321", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Glowcoin - illuminating the path to financial freedom with its radiant transactions!", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Glowcoin - illuminating the path to financial freedom with its radiant transactions!", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "symbol", + "value": + { + "raw_hex": "5c2200010c04474c4f57", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "GLOW", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "GLOW", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "tags", + "value": + { + "raw_hex": "5c228001200c0206536172676f6e055275737479", + "programmatic_json": + { + "variant_id": 128, + "fields": + [ + { + "element_kind": "String", + "elements": + [ + { + "value": "Sargon", + "kind": "String" + }, + { + "value": "Rusty", + "kind": "String" + } + ], + "kind": "Array" + } + ], + "kind": "Enum" + }, + "typed": + { + "values": + [ + "Sargon", + "Rusty" + ], + "type": "StringArray" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + } + ] + } + }, + { + "vaults": + { + "total_count": 1, + "items": + [ + { + "vault_address": "internal_vault_tdx_2_1tzcm7l58c0zvsh4cy9ptj4m36qrkj3m7x9wt3lj0gxj5r0u8cr6uj6", + "amount": "21000000", + "last_updated_at_state_version": 73654060 + } + ] + }, + "aggregation_level": "Vault", + "resource_address": "resource_tdx_2_1thkcveg0p2l35kvwlxasltvw0wjgsrpch6yfjct9qahze3wce8ukj8", + "explicit_metadata": + { + "total_count": 5, + "items": + [ + { + "key": "name", + "value": + { + "raw_hex": "5c2200010c09426c697373636f696e", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Blisscoin", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Blisscoin", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "icon_url", + "value": + { + "raw_hex": "5c220d010c5b68747470733a2f2f757877696e672e636f6d2f77702d636f6e74656e742f7468656d65732f757877696e672f646f776e6c6f61642f656d6f6a692d656d6f7469636f6e2f6c61756768696e672d626c61636b2d69636f6e2e706e67", + "programmatic_json": + { + "variant_id": 13, + "fields": + [ + { + "value": "https://uxwing.com/wp-content/themes/uxwing/download/emoji-emoticon/laughing-black-icon.png", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "https://uxwing.com/wp-content/themes/uxwing/download/emoji-emoticon/laughing-black-icon.png", + "type": "Url" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "description", + "value": + { + "raw_hex": "5c2200010c70426c697373636f696e202d20657870657269656e6365207075726520626c6973732077697468206576657279207472616e73616374696f6e212048617070696e6573732067756172616e7465656420696e2074686520776f726c64206f66206469676974616c2063757272656e63792e", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Blisscoin - experience pure bliss with every transaction! Happiness guaranteed in the world of digital currency.", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Blisscoin - experience pure bliss with every transaction! Happiness guaranteed in the world of digital currency.", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "symbol", + "value": + { + "raw_hex": "5c2200010c05424c495353", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "BLISS", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "BLISS", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "tags", + "value": + { + "raw_hex": "5c228001200c0206536172676f6e055275737479", + "programmatic_json": + { + "variant_id": 128, + "fields": + [ + { + "element_kind": "String", + "elements": + [ + { + "value": "Sargon", + "kind": "String" + }, + { + "value": "Rusty", + "kind": "String" + } + ], + "kind": "Array" + } + ], + "kind": "Enum" + }, + "typed": + { + "values": + [ + "Sargon", + "Rusty" + ], + "type": "StringArray" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + } + ] + } + }, + { + "vaults": + { + "total_count": 1, + "items": + [ + { + "vault_address": "internal_vault_tdx_2_1tqzsqja9g2jpccv5q02xp0nuw2gzr7z8sr9hm7j0uthzyj7yv9tac9", + "amount": "21000000", + "last_updated_at_state_version": 73654060 + } + ] + }, + "aggregation_level": "Vault", + "resource_address": "resource_tdx_2_1t4ljhq7gdhuklfpe2vvdrpy2uuf2ff9n7at20z7f3pmwshpjgvyv7r", + "explicit_metadata": + { + "total_count": 5, + "items": + [ + { + "key": "name", + "value": + { + "raw_hex": "5c2200010c0a526f636b65746675656c", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Rocketfuel", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Rocketfuel", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "icon_url", + "value": + { + "raw_hex": "5c220d010c6568747470733a2f2f757877696e672e636f6d2f77702d636f6e74656e742f7468656d65732f757877696e672f646f776e6c6f61642f7472616e73706f72746174696f6e2d6175746f6d6f746976652f726f636b65742d6c61756e63682d69636f6e2e706e67", + "programmatic_json": + { + "variant_id": 13, + "fields": + [ + { + "value": "https://uxwing.com/wp-content/themes/uxwing/download/transportation-automotive/rocket-launch-icon.png", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "https://uxwing.com/wp-content/themes/uxwing/download/transportation-automotive/rocket-launch-icon.png", + "type": "Url" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "description", + "value": + { + "raw_hex": "5c2200010c65526f636b65746675656c202d20706f776572696e6720796f757220696e766573746d656e747320746f206e657720686569676874732120537472617020696e20666f722061206a6f75726e657920746f20746865206d6f6f6e20616e64206265796f6e642e", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Rocketfuel - powering your investments to new heights! Strap in for a journey to the moon and beyond.", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Rocketfuel - powering your investments to new heights! Strap in for a journey to the moon and beyond.", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "symbol", + "value": + { + "raw_hex": "5c2200010c044655454c", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "FUEL", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "FUEL", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "tags", + "value": + { + "raw_hex": "5c228001200c0206536172676f6e055275737479", + "programmatic_json": + { + "variant_id": 128, + "fields": + [ + { + "element_kind": "String", + "elements": + [ + { + "value": "Sargon", + "kind": "String" + }, + { + "value": "Rusty", + "kind": "String" + } + ], + "kind": "Array" + } + ], + "kind": "Enum" + }, + "typed": + { + "values": + [ + "Sargon", + "Rusty" + ], + "type": "StringArray" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + } + ] + } + }, + { + "vaults": + { + "total_count": 1, + "items": + [ + { + "vault_address": "internal_vault_tdx_2_1tqr6uqrcae6eh9pvt7gfq0k5qzctsfujdsx8fk9gdympjks408s73d", + "amount": "21000000", + "last_updated_at_state_version": 73654060 + } + ] + }, + "aggregation_level": "Vault", + "resource_address": "resource_tdx_2_1tk40xeu6lfzgzwjyrkw6rvveeue9gs0wxspqutcyrktzjwc65hrh9l", + "explicit_metadata": + { + "total_count": 5, + "items": + [ + { + "key": "name", + "value": + { + "raw_hex": "5c2200010c094a656c6c79636f696e", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Jellycoin", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Jellycoin", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "icon_url", + "value": + { + "raw_hex": "5c220d010c5968747470733a2f2f757877696e672e636f6d2f77702d636f6e74656e742f7468656d65732f757877696e672f646f776e6c6f61642f616e696d616c732d616e642d62697264732f6a656c6c79666973682d69636f6e2e706e67", + "programmatic_json": + { + "variant_id": 13, + "fields": + [ + { + "value": "https://uxwing.com/wp-content/themes/uxwing/download/animals-and-birds/jellyfish-icon.png", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "https://uxwing.com/wp-content/themes/uxwing/download/animals-and-birds/jellyfish-icon.png", + "type": "Url" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "description", + "value": + { + "raw_hex": "5c2200010c5e4a656c6c79636f696e202d206d616b696e6720796f757220696e766573746d656e747320776f62626c652077697468206578636974656d656e7421204469766520696e746f206120706f6f6c206f662073776565742070726f666974732e", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Jellycoin - making your investments wobble with excitement! Dive into a pool of sweet profits.", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Jellycoin - making your investments wobble with excitement! Dive into a pool of sweet profits.", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "symbol", + "value": + { + "raw_hex": "5c2200010c054a454c4c59", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "JELLY", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "JELLY", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "tags", + "value": + { + "raw_hex": "5c228001200c0206536172676f6e055275737479", + "programmatic_json": + { + "variant_id": 128, + "fields": + [ + { + "element_kind": "String", + "elements": + [ + { + "value": "Sargon", + "kind": "String" + }, + { + "value": "Rusty", + "kind": "String" + } + ], + "kind": "Array" + } + ], + "kind": "Enum" + }, + "typed": + { + "values": + [ + "Sargon", + "Rusty" + ], + "type": "StringArray" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + } + ] + } + }, + { + "vaults": + { + "total_count": 1, + "items": + [ + { + "vault_address": "internal_vault_tdx_2_1trv245s7clmc8yjskr6n52x26vsxytpr6rert20udsvfjr33xg56q7", + "amount": "21000000", + "last_updated_at_state_version": 73654060 + } + ] + }, + "aggregation_level": "Vault", + "resource_address": "resource_tdx_2_1t4dr4f2xcxjfr0a5d9vxdz2h7pwz67z9mqamv9jtez38unwx7lvz92", + "explicit_metadata": + { + "total_count": 5, + "items": + [ + { + "key": "name", + "value": + { + "raw_hex": "5c2200010c0842697465636f696e", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Bitecoin", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Bitecoin", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "icon_url", + "value": + { + "raw_hex": "5c220d010c5568747470733a2f2f757877696e672e636f6d2f77702d636f6e74656e742f7468656d65732f757877696e672f646f776e6c6f61642f616e696d616c732d616e642d62697264732f736861726b2d69636f6e2e706e67", + "programmatic_json": + { + "variant_id": 13, + "fields": + [ + { + "value": "https://uxwing.com/wp-content/themes/uxwing/download/animals-and-birds/shark-icon.png", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "https://uxwing.com/wp-content/themes/uxwing/download/animals-and-birds/shark-icon.png", + "type": "Url" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "description", + "value": + { + "raw_hex": "5c2200010c7042697465636f696e202d2074616b696e672061206269672062697465206f7574206f66207468652063727970746f63757272656e6379206d61726b6574212053696e6b20796f757220746565746820696e746f2070726f6669747320776974682042697465636f696e20746f6461792e", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Bitecoin - taking a big bite out of the cryptocurrency market! Sink your teeth into profits with Bitecoin today.", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Bitecoin - taking a big bite out of the cryptocurrency market! Sink your teeth into profits with Bitecoin today.", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "symbol", + "value": + { + "raw_hex": "5c2200010c0442495445", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "BITE", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "BITE", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "tags", + "value": + { + "raw_hex": "5c228001200c0206536172676f6e055275737479", + "programmatic_json": + { + "variant_id": 128, + "fields": + [ + { + "element_kind": "String", + "elements": + [ + { + "value": "Sargon", + "kind": "String" + }, + { + "value": "Rusty", + "kind": "String" + } + ], + "kind": "Array" + } + ], + "kind": "Enum" + }, + "typed": + { + "values": + [ + "Sargon", + "Rusty" + ], + "type": "StringArray" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + } + ] + } + }, + { + "vaults": + { + "total_count": 1, + "items": + [ + { + "vault_address": "internal_vault_tdx_2_1tzf3zlvdt3m66yelvret4kdnymsy6pgyhl22q74vjn2w2pmpwt3hgs", + "amount": "21000000", + "last_updated_at_state_version": 73654060 + } + ] + }, + "aggregation_level": "Vault", + "resource_address": "resource_tdx_2_1t4skra7nnudarl50jp9uxgyh32tynjumnlcgkzlr6qm3k4f3hlx4g0", + "explicit_metadata": + { + "total_count": 5, + "items": + [ + { + "key": "name", + "value": + { + "raw_hex": "5c2200010c0850617773636f696e", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Pawscoin", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Pawscoin", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "icon_url", + "value": + { + "raw_hex": "5c220d010c5368747470733a2f2f757877696e672e636f6d2f77702d636f6e74656e742f7468656d65732f757877696e672f646f776e6c6f61642f616e696d616c732d616e642d62697264732f7061772d69636f6e2e706e67", + "programmatic_json": + { + "variant_id": 13, + "fields": + [ + { + "value": "https://uxwing.com/wp-content/themes/uxwing/download/animals-and-birds/paw-icon.png", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "https://uxwing.com/wp-content/themes/uxwing/download/animals-and-birds/paw-icon.png", + "type": "Url" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "description", + "value": + { + "raw_hex": "5c2200010c6150617773636f696e202d20746865207061772d736f6d65206469676974616c2063757272656e63792074686174206c65617665732061206c617374696e6720696d7072657373696f6e2077697468206576657279207472616e73616374696f6e21", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Pawscoin - the paw-some digital currency that leaves a lasting impression with every transaction!", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Pawscoin - the paw-some digital currency that leaves a lasting impression with every transaction!", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "symbol", + "value": + { + "raw_hex": "5c2200010c0450415753", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "PAWS", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "PAWS", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "tags", + "value": + { + "raw_hex": "5c228001200c0206536172676f6e055275737479", + "programmatic_json": + { + "variant_id": 128, + "fields": + [ + { + "element_kind": "String", + "elements": + [ + { + "value": "Sargon", + "kind": "String" + }, + { + "value": "Rusty", + "kind": "String" + } + ], + "kind": "Array" + } + ], + "kind": "Enum" + }, + "typed": + { + "values": + [ + "Sargon", + "Rusty" + ], + "type": "StringArray" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + } + ] + } + }, + { + "vaults": + { + "total_count": 1, + "items": + [ + { + "vault_address": "internal_vault_tdx_2_1tqwy89mkv68fjfnzzvpkf7n57tcd4jnrkqhayczqhysnvet7wrhq6c", + "amount": "21000000", + "last_updated_at_state_version": 73654060 + } + ] + }, + "aggregation_level": "Vault", + "resource_address": "resource_tdx_2_1t40c6yfuvau7t0w8rkeuqq97f3662y0d4dayxq8w2mym4965krp559", + "explicit_metadata": + { + "total_count": 5, + "items": + [ + { + "key": "name", + "value": + { + "raw_hex": "5c2200010c09537061636563616b65", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Spacecake", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Spacecake", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "icon_url", + "value": + { + "raw_hex": "5c220d010c5268747470733a2f2f757877696e672e636f6d2f77702d636f6e74656e742f7468656d65732f757877696e672f646f776e6c6f61642f666f6f642d616e642d6472696e6b732f63616b652d69636f6e2e706e67", + "programmatic_json": + { + "variant_id": 13, + "fields": + [ + { + "value": "https://uxwing.com/wp-content/themes/uxwing/download/food-and-drinks/cake-icon.png", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "https://uxwing.com/wp-content/themes/uxwing/download/food-and-drinks/cake-icon.png", + "type": "Url" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "description", + "value": + { + "raw_hex": "5c2200010c64537061636563616b65202d206675656c696e6720696e74657267616c6163746963207472616e73616374696f6e732077697468206120737072696e6b6c65206f662073776565746e657373212049742773206f7574206f66207468697320776f726c6421", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Spacecake - fueling intergalactic transactions with a sprinkle of sweetness! It's out of this world!", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Spacecake - fueling intergalactic transactions with a sprinkle of sweetness! It's out of this world!", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "symbol", + "value": + { + "raw_hex": "5c2200010c0443414b45", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "CAKE", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "CAKE", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "tags", + "value": + { + "raw_hex": "5c228001200c0206536172676f6e055275737479", + "programmatic_json": + { + "variant_id": 128, + "fields": + [ + { + "element_kind": "String", + "elements": + [ + { + "value": "Sargon", + "kind": "String" + }, + { + "value": "Rusty", + "kind": "String" + } + ], + "kind": "Array" + } + ], + "kind": "Enum" + }, + "typed": + { + "values": + [ + "Sargon", + "Rusty" + ], + "type": "StringArray" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + } + ] + } + }, + { + "vaults": + { + "total_count": 1, + "items": + [ + { + "vault_address": "internal_vault_tdx_2_1tpp0r7dq4wu9xalrdrlek3nsgtedzgmgdsyh36sf49h8fs7p8cuvft", + "amount": "21000000", + "last_updated_at_state_version": 73654060 + } + ] + }, + "aggregation_level": "Vault", + "resource_address": "resource_tdx_2_1t45vncjuyac0u65cscu44kvsxsrgqkpmvg9a0jquwwh6dy7kl33slp", + "explicit_metadata": + { + "total_count": 5, + "items": + [ + { + "key": "name", + "value": + { + "raw_hex": "5c2200010c09517561636b636f696e", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Quackcoin", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Quackcoin", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "icon_url", + "value": + { + "raw_hex": "5c220d010c5468747470733a2f2f757877696e672e636f6d2f77702d636f6e74656e742f7468656d65732f757877696e672f646f776e6c6f61642f616e696d616c732d616e642d62697264732f6475636b2d69636f6e2e706e67", + "programmatic_json": + { + "variant_id": 13, + "fields": + [ + { + "value": "https://uxwing.com/wp-content/themes/uxwing/download/animals-and-birds/duck-icon.png", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "https://uxwing.com/wp-content/themes/uxwing/download/animals-and-birds/duck-icon.png", + "type": "Url" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "description", + "value": + { + "raw_hex": "5c2200010c784469766520696e746f2074686520717561636b7920776f726c64206f662063727970746f207769746820517561636b636f696e212049742773206d616b696e6720776176657320616e64207475726e696e6720686561647320666173746572207468616e20796f752063616e2073617920276475636b2721", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Dive into the quacky world of crypto with Quackcoin! It's making waves and turning heads faster than you can say 'duck'!", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Dive into the quacky world of crypto with Quackcoin! It's making waves and turning heads faster than you can say 'duck'!", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "symbol", + "value": + { + "raw_hex": "5c2200010c05515541434b", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "QUACK", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "QUACK", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "tags", + "value": + { + "raw_hex": "5c228001200c0206536172676f6e055275737479", + "programmatic_json": + { + "variant_id": 128, + "fields": + [ + { + "element_kind": "String", + "elements": + [ + { + "value": "Sargon", + "kind": "String" + }, + { + "value": "Rusty", + "kind": "String" + } + ], + "kind": "Array" + } + ], + "kind": "Enum" + }, + "typed": + { + "values": + [ + "Sargon", + "Rusty" + ], + "type": "StringArray" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + } + ] + } + }, + { + "vaults": + { + "total_count": 1, + "items": + [ + { + "vault_address": "internal_vault_tdx_2_1tqd4clkva5lt0dg5sjd773fk5x2c68vavrkhw7qu2nh6cl0xrkfyvh", + "amount": "21000000", + "last_updated_at_state_version": 73654060 + } + ] + }, + "aggregation_level": "Vault", + "resource_address": "resource_tdx_2_1tklpwgg2gsfwl79rwdpe3gsn2xl24mf05pudtvvkqpqd3qlqtf8yef", + "explicit_metadata": + { + "total_count": 5, + "items": + [ + { + "key": "name", + "value": + { + "raw_hex": "5c2200010c0850757272636f696e", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Purrcoin", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Purrcoin", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "icon_url", + "value": + { + "raw_hex": "5c220d010c5868747470733a2f2f757877696e672e636f6d2f77702d636f6e74656e742f7468656d65732f757877696e672f646f776e6c6f61642f616e696d616c732d616e642d62697264732f6361742d666163652d69636f6e2e706e67", + "programmatic_json": + { + "variant_id": 13, + "fields": + [ + { + "value": "https://uxwing.com/wp-content/themes/uxwing/download/animals-and-birds/cat-face-icon.png", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "https://uxwing.com/wp-content/themes/uxwing/download/animals-and-birds/cat-face-icon.png", + "type": "Url" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "description", + "value": + { + "raw_hex": "5c2200010c704a6f696e2074686520707572722d66656374207265766f6c7574696f6e20696e206469676974616c2063757272656e637920776974682050757272636f696e21204974277320746865206361742773206d656f7720696e2074686520776f726c64206f6620626c6f636b636861696e2e", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Join the purr-fect revolution in digital currency with Purrcoin! It's the cat's meow in the world of blockchain.", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Join the purr-fect revolution in digital currency with Purrcoin! It's the cat's meow in the world of blockchain.", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "symbol", + "value": + { + "raw_hex": "5c2200010c0450555252", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "PURR", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "PURR", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "tags", + "value": + { + "raw_hex": "5c228001200c0206536172676f6e055275737479", + "programmatic_json": + { + "variant_id": 128, + "fields": + [ + { + "element_kind": "String", + "elements": + [ + { + "value": "Sargon", + "kind": "String" + }, + { + "value": "Rusty", + "kind": "String" + } + ], + "kind": "Array" + } + ], + "kind": "Enum" + }, + "typed": + { + "values": + [ + "Sargon", + "Rusty" + ], + "type": "StringArray" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + } + ] + } + } + ] + }, + "non_fungible_resources": + { + "total_count": 5, + "items": + [ + { + "vaults": + { + "total_count": 1, + "items": + [ + { + "total_count": 10, + "vault_address": "internal_vault_tdx_2_1nzqzqc0mg53pm4kwucdp6x3fjdt3534vwl8dlnkw7shl7nc9dkh8nk", + "last_updated_at_state_version": 73653987 + } + ] + }, + "aggregation_level": "Vault", + "resource_address": "resource_tdx_2_1ngv6vuxn03khftr9939pyvl7qrtt0v6csul5v2csqf6p50adkpjx64", + "explicit_metadata": + { + "total_count": 5, + "items": + [ + { + "key": "name", + "value": + { + "raw_hex": "5c2200010c0541626f7665", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Above", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Above", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73653987 + }, + { + "key": "icon_url", + "value": + { + "raw_hex": "5c220d010c6168747470733a2f2f696d6167652d736572766963652d746573742d696d616765732e73332e65752d776573742d322e616d617a6f6e6177732e636f6d2f77616c6c65745f746573745f696d616765732f4672616d652b362d6c617267652e706e67", + "programmatic_json": + { + "variant_id": 13, + "fields": + [ + { + "value": "https://image-service-test-images.s3.eu-west-2.amazonaws.com/wallet_test_images/Frame+6-large.png", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "https://image-service-test-images.s3.eu-west-2.amazonaws.com/wallet_test_images/Frame+6-large.png", + "type": "Url" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73653987 + }, + { + "key": "description", + "value": + { + "raw_hex": "5c2200010c3641626f76653a20416e20616d617a696e676c7920696e6e6f76617469766520616e642072617265204e465420636f6c6c656374696f6e", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Above: An amazingly innovative and rare NFT collection", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Above: An amazingly innovative and rare NFT collection", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73653987 + }, + { + "key": "symbol", + "value": + { + "raw_hex": "5c2200010c0541424f5645", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "ABOVE", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "ABOVE", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73653987 + }, + { + "key": "tags", + "value": + { + "raw_hex": "5c228001200c0306556e6971756504464f4d4f08416476616e636564", + "programmatic_json": + { + "variant_id": 128, + "fields": + [ + { + "element_kind": "String", + "elements": + [ + { + "value": "Unique", + "kind": "String" + }, + { + "value": "FOMO", + "kind": "String" + }, + { + "value": "Advanced", + "kind": "String" + } + ], + "kind": "Array" + } + ], + "kind": "Enum" + }, + "typed": + { + "values": + [ + "Unique", + "FOMO", + "Advanced" + ], + "type": "StringArray" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73653987 + } + ] + } + }, + { + "vaults": + { + "total_count": 1, + "items": + [ + { + "total_count": 10, + "vault_address": "internal_vault_tdx_2_1nq35lt8ezp4lfmp29vmgq8sk3tqg26aa77cf7mx8gqamnk9rn0exju", + "last_updated_at_state_version": 73653987 + } + ] + }, + "aggregation_level": "Vault", + "resource_address": "resource_tdx_2_1ng9qglheajmctgr3ahnnv3yvjhdkpm3rrgc45ujrz5a499hf5r02ym", + "explicit_metadata": + { + "total_count": 5, + "items": + [ + { + "key": "name", + "value": + { + "raw_hex": "5c2200010c0541626f7574", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "About", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "About", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73653987 + }, + { + "key": "icon_url", + "value": + { + "raw_hex": "5c220d010c7368747470733a2f2f696d6167652d736572766963652d746573742d696d616765732e73332e65752d776573742d322e616d617a6f6e6177732e636f6d2f77616c6c65745f746573745f696d616765732f46696c6c696e672b53746174696f6e2b427265616b666173742d736d616c6c2e6a7067", + "programmatic_json": + { + "variant_id": 13, + "fields": + [ + { + "value": "https://image-service-test-images.s3.eu-west-2.amazonaws.com/wallet_test_images/Filling+Station+Breakfast-small.jpg", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "https://image-service-test-images.s3.eu-west-2.amazonaws.com/wallet_test_images/Filling+Station+Breakfast-small.jpg", + "type": "Url" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73653987 + }, + { + "key": "description", + "value": + { + "raw_hex": "5c2200010c3641626f75743a20416e20616d617a696e676c7920696e6e6f76617469766520616e642072617265204e465420636f6c6c656374696f6e", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "About: An amazingly innovative and rare NFT collection", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "About: An amazingly innovative and rare NFT collection", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73653987 + }, + { + "key": "symbol", + "value": + { + "raw_hex": "5c2200010c0541424f5554", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "ABOUT", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "ABOUT", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73653987 + }, + { + "key": "tags", + "value": + { + "raw_hex": "5c228001200c0306556e6971756504464f4d4f08416476616e636564", + "programmatic_json": + { + "variant_id": 128, + "fields": + [ + { + "element_kind": "String", + "elements": + [ + { + "value": "Unique", + "kind": "String" + }, + { + "value": "FOMO", + "kind": "String" + }, + { + "value": "Advanced", + "kind": "String" + } + ], + "kind": "Array" + } + ], + "kind": "Enum" + }, + "typed": + { + "values": + [ + "Unique", + "FOMO", + "Advanced" + ], + "type": "StringArray" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73653987 + } + ] + } + }, + { + "vaults": + { + "total_count": 1, + "items": + [ + { + "total_count": 10, + "vault_address": "internal_vault_tdx_2_1npvlf6g9aqz25rt4c3la6zamwge83e96kyue5wvx7sc5fnwm6nwr0y", + "last_updated_at_state_version": 73653987 + } + ] + }, + "aggregation_level": "Vault", + "resource_address": "resource_tdx_2_1n24330848d0qdu2hz3jzfrq6rk6pxq9002eww0mv7mqtamcj6th5zr", + "explicit_metadata": + { + "total_count": 5, + "items": + [ + { + "key": "name", + "value": + { + "raw_hex": "5c2200010c0441626c65", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Able", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Able", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73653987 + }, + { + "key": "icon_url", + "value": + { + "raw_hex": "5c220d010c7468747470733a2f2f696d6167652d736572766963652d746573742d696d616765732e73332e65752d776573742d322e616d617a6f6e6177732e636f6d2f77616c6c65745f746573745f696d616765732f46696c6c696e672b53746174696f6e2b427265616b666173742d6d656469756d2e6a7067", + "programmatic_json": + { + "variant_id": 13, + "fields": + [ + { + "value": "https://image-service-test-images.s3.eu-west-2.amazonaws.com/wallet_test_images/Filling+Station+Breakfast-medium.jpg", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "https://image-service-test-images.s3.eu-west-2.amazonaws.com/wallet_test_images/Filling+Station+Breakfast-medium.jpg", + "type": "Url" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73653987 + }, + { + "key": "description", + "value": + { + "raw_hex": "5c2200010c3541626c653a20416e20616d617a696e676c7920696e6e6f76617469766520616e642072617265204e465420636f6c6c656374696f6e", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Able: An amazingly innovative and rare NFT collection", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Able: An amazingly innovative and rare NFT collection", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73653987 + }, + { + "key": "symbol", + "value": + { + "raw_hex": "5c2200010c0441424c45", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "ABLE", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "ABLE", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73653987 + }, + { + "key": "tags", + "value": + { + "raw_hex": "5c228001200c0306556e6971756504464f4d4f08416476616e636564", + "programmatic_json": + { + "variant_id": 128, + "fields": + [ + { + "element_kind": "String", + "elements": + [ + { + "value": "Unique", + "kind": "String" + }, + { + "value": "FOMO", + "kind": "String" + }, + { + "value": "Advanced", + "kind": "String" + } + ], + "kind": "Array" + } + ], + "kind": "Enum" + }, + "typed": + { + "values": + [ + "Unique", + "FOMO", + "Advanced" + ], + "type": "StringArray" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73653987 + } + ] + } + }, + { + "vaults": + { + "total_count": 1, + "items": + [ + { + "total_count": 10, + "vault_address": "internal_vault_tdx_2_1nrj0uh6jkhuefpjjwr78kerhm960ea29uleje7ewjkrjjmw0mjqk3f", + "last_updated_at_state_version": 73653987 + } + ] + }, + "aggregation_level": "Vault", + "resource_address": "resource_tdx_2_1ngya0vwrl2yjjuhquqymf2afjau6n2d7lynss4yu2ycavhha9mymgn", + "explicit_metadata": + { + "total_count": 5, + "items": + [ + { + "key": "name", + "value": + { + "raw_hex": "5c2200010c074162696c697479", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Ability", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Ability", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73653987 + }, + { + "key": "icon_url", + "value": + { + "raw_hex": "5c220d010c7368747470733a2f2f696d6167652d736572766963652d746573742d696d616765732e73332e65752d776573742d322e616d617a6f6e6177732e636f6d2f77616c6c65745f746573745f696d616765732f46696c6c696e672b53746174696f6e2b427265616b666173742d6c617267652e6a7067", + "programmatic_json": + { + "variant_id": 13, + "fields": + [ + { + "value": "https://image-service-test-images.s3.eu-west-2.amazonaws.com/wallet_test_images/Filling+Station+Breakfast-large.jpg", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "https://image-service-test-images.s3.eu-west-2.amazonaws.com/wallet_test_images/Filling+Station+Breakfast-large.jpg", + "type": "Url" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73653987 + }, + { + "key": "description", + "value": + { + "raw_hex": "5c2200010c384162696c6974793a20416e20616d617a696e676c7920696e6e6f76617469766520616e642072617265204e465420636f6c6c656374696f6e", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Ability: An amazingly innovative and rare NFT collection", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Ability: An amazingly innovative and rare NFT collection", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73653987 + }, + { + "key": "symbol", + "value": + { + "raw_hex": "5c2200010c074142494c495459", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "ABILITY", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "ABILITY", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73653987 + }, + { + "key": "tags", + "value": + { + "raw_hex": "5c228001200c0306556e6971756504464f4d4f08416476616e636564", + "programmatic_json": + { + "variant_id": 128, + "fields": + [ + { + "element_kind": "String", + "elements": + [ + { + "value": "Unique", + "kind": "String" + }, + { + "value": "FOMO", + "kind": "String" + }, + { + "value": "Advanced", + "kind": "String" + } + ], + "kind": "Array" + } + ], + "kind": "Enum" + }, + "typed": + { + "values": + [ + "Unique", + "FOMO", + "Advanced" + ], + "type": "StringArray" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73653987 + } + ] + } + }, + { + "vaults": + { + "total_count": 1, + "items": + [ + { + "total_count": 10, + "vault_address": "internal_vault_tdx_2_1np5lx6ea6fqljdw9x6rryjqap4zxkrp7ye8zg0a359r0pplj3sjjwy", + "last_updated_at_state_version": 73653987 + } + ] + }, + "aggregation_level": "Vault", + "resource_address": "resource_tdx_2_1ntkmxen44prp7w3svq7qfd4yypsvdd8n6nslwjhnls83dnprerwuxt", + "explicit_metadata": + { + "total_count": 5, + "items": + [ + { + "key": "name", + "value": + { + "raw_hex": "5c2200010c074162616e646f6e", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Abandon", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Abandon", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73653987 + }, + { + "key": "icon_url", + "value": + { + "raw_hex": "5c220d010c6568747470733a2f2f696d6167652d736572766963652d746573742d696d616765732e73332e65752d776573742d322e616d617a6f6e6177732e636f6d2f77616c6c65745f746573745f696d616765732f7363727970746f6e6175745f70617463682e737667", + "programmatic_json": + { + "variant_id": 13, + "fields": + [ + { + "value": "https://image-service-test-images.s3.eu-west-2.amazonaws.com/wallet_test_images/scryptonaut_patch.svg", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "https://image-service-test-images.s3.eu-west-2.amazonaws.com/wallet_test_images/scryptonaut_patch.svg", + "type": "Url" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73653987 + }, + { + "key": "description", + "value": + { + "raw_hex": "5c2200010c384162616e646f6e3a20416e20616d617a696e676c7920696e6e6f76617469766520616e642072617265204e465420636f6c6c656374696f6e", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Abandon: An amazingly innovative and rare NFT collection", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Abandon: An amazingly innovative and rare NFT collection", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73653987 + }, + { + "key": "symbol", + "value": + { + "raw_hex": "5c2200010c074142414e444f4e", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "ABANDON", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "ABANDON", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73653987 + }, + { + "key": "tags", + "value": + { + "raw_hex": "5c228001200c0306556e6971756504464f4d4f08416476616e636564", + "programmatic_json": + { + "variant_id": 128, + "fields": + [ + { + "element_kind": "String", + "elements": + [ + { + "value": "Unique", + "kind": "String" + }, + { + "value": "FOMO", + "kind": "String" + }, + { + "value": "Advanced", + "kind": "String" + } + ], + "kind": "Array" + } + ], + "kind": "Enum" + }, + "typed": + { + "values": + [ + "Unique", + "FOMO", + "Advanced" + ], + "type": "StringArray" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73653987 + } + ] + } + } + ] + }, + "metadata": + { + "total_count": 2, + "items": + [ + { + "key": "owner_keys", + "value": + { + "raw_hex": "5c228f01202201010120071d3ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8", + "programmatic_json": + { + "variant_id": 143, + "fields": + [ + { + "element_kind": "Enum", + "elements": + [ + { + "variant_id": 1, + "fields": + [ + { + "element_kind": "U8", + "hex": "3ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8", + "kind": "Bytes" + } + ], + "kind": "Enum" + } + ], + "kind": "Array" + } + ], + "kind": "Enum" + }, + "typed": + { + "values": + [ + { + "hash_hex": "3ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8", + "key_hash_type": "EddsaEd25519" + } + ], + "type": "PublicKeyHashArray" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73648065 + }, + { + "key": "owner_badge", + "value": + { + "raw_hex": "5c220b01c0021e513ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8", + "programmatic_json": + { + "variant_id": 11, + "fields": + [ + { + "value": "[513ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8]", + "kind": "NonFungibleLocalId" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "[513ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8]", + "type": "NonFungibleLocalId" + } + }, + "is_locked": true, + "last_updated_at_state_version": 73648065 + } + ] + }, + "explicit_metadata": + { + "total_count": 0, + "items": + [] + }, + "details": + { + "package_address": "package_tdx_2_1pkgxxxxxxxxxaccntxxxxxxxxxx000929625493xxxxxxxxx9jat20", + "blueprint_name": "Account", + "blueprint_version": "1.0.0", + "state": + { + "default_deposit_rule": "Accept" + }, + "role_assignments": + { + "owner": + { + "rule": + { + "type": "Protected", + "access_rule": + { + "type": "ProofRule", + "proof_rule": + { + "type": "Require", + "requirement": + { + "type": "NonFungible", + "non_fungible": + { + "local_id": + { + "id_type": "Bytes", + "sbor_hex": "5cc0021d3ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8", + "simple_rep": "[3ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8]" + }, + "resource_address": "resource_tdx_2_1nfxxxxxxxxxxed25sgxxxxxxxxx002236757237xxxxxxxxx3e2cpa" + } + } + } + } + }, + "updater": "Object" + }, + "entries": + [ + { + "role_key": + { + "module": "Main", + "name": "securify" + }, + "assignment": + { + "resolution": "Explicit", + "explicit_rule": + { + "type": "Protected", + "access_rule": + { + "type": "ProofRule", + "proof_rule": + { + "type": "Require", + "requirement": + { + "type": "NonFungible", + "non_fungible": + { + "local_id": + { + "id_type": "Bytes", + "sbor_hex": "5cc0021d3ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8", + "simple_rep": "[3ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8]" + }, + "resource_address": "resource_tdx_2_1nfxxxxxxxxxxed25sgxxxxxxxxx002236757237xxxxxxxxx3e2cpa" + } + } + } + } + } + }, + "updater_roles": + [ + { + "module": "Main", + "name": "_self_" + } + ] + }, + { + "role_key": + { + "module": "Metadata", + "name": "metadata_locker" + }, + "assignment": + { + "resolution": "Owner" + }, + "updater_roles": + [ + { + "module": "Metadata", + "name": "metadata_locker_updater" + } + ] + }, + { + "role_key": + { + "module": "Metadata", + "name": "metadata_locker_updater" + }, + "assignment": + { + "resolution": "Owner" + }, + "updater_roles": + [ + { + "module": "Metadata", + "name": "metadata_locker_updater" + } + ] + }, + { + "role_key": + { + "module": "Metadata", + "name": "metadata_setter" + }, + "assignment": + { + "resolution": "Owner" + }, + "updater_roles": + [ + { + "module": "Metadata", + "name": "metadata_setter_updater" + } + ] + }, + { + "role_key": + { + "module": "Metadata", + "name": "metadata_setter_updater" + }, + "assignment": + { + "resolution": "Owner" + }, + "updater_roles": + [ + { + "module": "Metadata", + "name": "metadata_setter_updater" + } + ] + } + ] + }, + "type": "Component" + } + } + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000..177755894 --- /dev/null +++ b/crates/gateway-models/fixtures/models/state/response_entity_details__single_account_no_assets.json @@ -0,0 +1,277 @@ +{ + "ledger_state": + { + "network": "stokenet", + "state_version": 73647248, + "proposer_round_timestamp": "2024-04-10T08:19:15.58Z", + "epoch": 51647, + "round": 1405 + }, + "items": + [ + { + "address": "account_tdx_2_12ylv4l9tj9vx0myyge2s7mzmgnzjmk9fgu3h72dn62s8d9lcafxzds", + "fungible_resources": + { + "total_count": 0, + "items": + [] + }, + "non_fungible_resources": + { + "total_count": 0, + "items": + [] + }, + "metadata": + { + "total_count": 2, + "items": + [ + { + "key": "owner_keys", + "value": + { + "raw_hex": "5c228f01202201010120071d3ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8", + "programmatic_json": + { + "variant_id": 143, + "fields": + [ + { + "element_kind": "Enum", + "elements": + [ + { + "variant_id": 1, + "fields": + [ + { + "element_kind": "U8", + "hex": "3ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8", + "kind": "Bytes" + } + ], + "kind": "Enum" + } + ], + "kind": "Array" + } + ], + "kind": "Enum" + }, + "typed": + { + "values": + [ + { + "hash_hex": "3ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8", + "key_hash_type": "EddsaEd25519" + } + ], + "type": "PublicKeyHashArray" + } + }, + "is_locked": false, + "last_updated_at_state_version": 0 + }, + { + "key": "owner_badge", + "value": + { + "raw_hex": "5c220b01c0021e513ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8", + "programmatic_json": + { + "variant_id": 11, + "fields": + [ + { + "value": "[513ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8]", + "kind": "NonFungibleLocalId" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "[513ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8]", + "type": "NonFungibleLocalId" + } + }, + "is_locked": true, + "last_updated_at_state_version": 0 + } + ] + }, + "explicit_metadata": + { + "total_count": 0, + "items": + [] + }, + "details": + { + "package_address": "package_tdx_2_1pkgxxxxxxxxxaccntxxxxxxxxxx000929625493xxxxxxxxx9jat20", + "blueprint_name": "Account", + "blueprint_version": "1.0.0", + "state": + { + "default_deposit_rule": "Accept" + }, + "role_assignments": + { + "owner": + { + "updater": "Object", + "rule": + { + "access_rule": + { + "proof_rule": + { + "requirement": + { + "non_fungible": + { + "resource_address": "resource_tdx_2_1nfxxxxxxxxxxed25sgxxxxxxxxx002236757237xxxxxxxxx3e2cpa", + "local_id": + { + "id_type": "Bytes", + "simple_rep": "[3ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8]", + "sbor_hex": "5cc0021d3ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8" + } + }, + "type": "NonFungible" + }, + "type": "Require" + }, + "type": "ProofRule" + }, + "type": "Protected" + } + }, + "entries": + [ + { + "role_key": + { + "module": "Main", + "name": "securify" + }, + "assignment": + { + "resolution": "Explicit", + "explicit_rule": + { + "access_rule": + { + "proof_rule": + { + "requirement": + { + "non_fungible": + { + "resource_address": "resource_tdx_2_1nfxxxxxxxxxxed25sgxxxxxxxxx002236757237xxxxxxxxx3e2cpa", + "local_id": + { + "id_type": "Bytes", + "simple_rep": "[3ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8]", + "sbor_hex": "5cc0021d3ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8" + } + }, + "type": "NonFungible" + }, + "type": "Require" + }, + "type": "ProofRule" + }, + "type": "Protected" + } + }, + "updater_roles": + [ + { + "module": "Main", + "name": "_self_" + } + ] + }, + { + "role_key": + { + "module": "Metadata", + "name": "metadata_locker" + }, + "assignment": + { + "resolution": "Owner" + }, + "updater_roles": + [ + { + "module": "Metadata", + "name": "metadata_locker_updater" + } + ] + }, + { + "role_key": + { + "module": "Metadata", + "name": "metadata_locker_updater" + }, + "assignment": + { + "resolution": "Owner" + }, + "updater_roles": + [ + { + "module": "Metadata", + "name": "metadata_locker_updater" + } + ] + }, + { + "role_key": + { + "module": "Metadata", + "name": "metadata_setter" + }, + "assignment": + { + "resolution": "Owner" + }, + "updater_roles": + [ + { + "module": "Metadata", + "name": "metadata_setter_updater" + } + ] + }, + { + "role_key": + { + "module": "Metadata", + "name": "metadata_setter_updater" + }, + "assignment": + { + "resolution": "Owner" + }, + "updater_roles": + [ + { + "module": "Metadata", + "name": "metadata_setter_updater" + } + ] + } + ] + }, + "type": "Component" + } + } + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000..6272a41e8 --- /dev/null +++ b/crates/gateway-models/fixtures/models/state/response_entity_details__single_resource.json @@ -0,0 +1,649 @@ +{ + "ledger_state": + { + "network": "stokenet", + "state_version": 73657313, + "proposer_round_timestamp": "2024-04-10T08:44:37.403Z", + "epoch": 51652, + "round": 1559 + }, + "items": + [ + { + "address": "resource_tdx_2_1thkcveg0p2l35kvwlxasltvw0wjgsrpch6yfjct9qahze3wce8ukj8", + "fungible_resources": + { + "total_count": 0, + "items": + [] + }, + "non_fungible_resources": + { + "total_count": 0, + "items": + [] + }, + "metadata": + { + "total_count": 4, + "items": + [ + { + "key": "icon_url", + "value": + { + "raw_hex": "5c220d010c5b68747470733a2f2f757877696e672e636f6d2f77702d636f6e74656e742f7468656d65732f757877696e672f646f776e6c6f61642f656d6f6a692d656d6f7469636f6e2f6c61756768696e672d626c61636b2d69636f6e2e706e67", + "programmatic_json": + { + "variant_id": 13, + "fields": + [ + { + "value": "https://uxwing.com/wp-content/themes/uxwing/download/emoji-emoticon/laughing-black-icon.png", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "https://uxwing.com/wp-content/themes/uxwing/download/emoji-emoticon/laughing-black-icon.png", + "type": "Url" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "symbol", + "value": + { + "raw_hex": "5c2200010c05424c495353", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "BLISS", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "BLISS", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "description", + "value": + { + "raw_hex": "5c2200010c70426c697373636f696e202d20657870657269656e6365207075726520626c6973732077697468206576657279207472616e73616374696f6e212048617070696e6573732067756172616e7465656420696e2074686520776f726c64206f66206469676974616c2063757272656e63792e", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Blisscoin - experience pure bliss with every transaction! Happiness guaranteed in the world of digital currency.", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Blisscoin - experience pure bliss with every transaction! Happiness guaranteed in the world of digital currency.", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "name", + "value": + { + "raw_hex": "5c2200010c09426c697373636f696e", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Blisscoin", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Blisscoin", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + } + ] + }, + "explicit_metadata": + { + "total_count": 5, + "items": + [ + { + "key": "symbol", + "value": + { + "raw_hex": "5c2200010c05424c495353", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "BLISS", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "BLISS", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "name", + "value": + { + "raw_hex": "5c2200010c09426c697373636f696e", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Blisscoin", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Blisscoin", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "icon_url", + "value": + { + "raw_hex": "5c220d010c5b68747470733a2f2f757877696e672e636f6d2f77702d636f6e74656e742f7468656d65732f757877696e672f646f776e6c6f61642f656d6f6a692d656d6f7469636f6e2f6c61756768696e672d626c61636b2d69636f6e2e706e67", + "programmatic_json": + { + "variant_id": 13, + "fields": + [ + { + "value": "https://uxwing.com/wp-content/themes/uxwing/download/emoji-emoticon/laughing-black-icon.png", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "https://uxwing.com/wp-content/themes/uxwing/download/emoji-emoticon/laughing-black-icon.png", + "type": "Url" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "tags", + "value": + { + "raw_hex": "5c228001200c0206536172676f6e055275737479", + "programmatic_json": + { + "variant_id": 128, + "fields": + [ + { + "element_kind": "String", + "elements": + [ + { + "value": "Sargon", + "kind": "String" + }, + { + "value": "Rusty", + "kind": "String" + } + ], + "kind": "Array" + } + ], + "kind": "Enum" + }, + "typed": + { + "values": + [ + "Sargon", + "Rusty" + ], + "type": "StringArray" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + }, + { + "key": "description", + "value": + { + "raw_hex": "5c2200010c70426c697373636f696e202d20657870657269656e6365207075726520626c6973732077697468206576657279207472616e73616374696f6e212048617070696e6573732067756172616e7465656420696e2074686520776f726c64206f66206469676974616c2063757272656e63792e", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Blisscoin - experience pure bliss with every transaction! Happiness guaranteed in the world of digital currency.", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Blisscoin - experience pure bliss with every transaction! Happiness guaranteed in the world of digital currency.", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73654060 + } + ] + }, + "details": + { + "role_assignments": + { + "owner": + { + "rule": + { + "type": "AllowAll" + }, + "updater": "Owner" + }, + "entries": + [ + { + "role_key": + { + "module": "Main", + "name": "burner" + }, + "assignment": + { + "resolution": "Explicit", + "explicit_rule": + { + "type": "AllowAll" + } + }, + "updater_roles": + [ + { + "module": "Main", + "name": "burner_updater" + } + ] + }, + { + "role_key": + { + "module": "Main", + "name": "minter" + }, + "assignment": + { + "resolution": "Explicit", + "explicit_rule": + { + "type": "AllowAll" + } + }, + "updater_roles": + [ + { + "module": "Main", + "name": "minter_updater" + } + ] + }, + { + "role_key": + { + "module": "Main", + "name": "freezer" + }, + "assignment": + { + "resolution": "Explicit", + "explicit_rule": + { + "type": "AllowAll" + } + }, + "updater_roles": + [ + { + "module": "Main", + "name": "freezer_updater" + } + ] + }, + { + "role_key": + { + "module": "Main", + "name": "recaller" + }, + "assignment": + { + "resolution": "Explicit", + "explicit_rule": + { + "type": "AllowAll" + } + }, + "updater_roles": + [ + { + "module": "Main", + "name": "recaller_updater" + } + ] + }, + { + "role_key": + { + "module": "Main", + "name": "depositor" + }, + "assignment": + { + "resolution": "Explicit", + "explicit_rule": + { + "type": "AllowAll" + } + }, + "updater_roles": + [ + { + "module": "Main", + "name": "depositor_updater" + } + ] + }, + { + "role_key": + { + "module": "Main", + "name": "withdrawer" + }, + "assignment": + { + "resolution": "Explicit", + "explicit_rule": + { + "type": "AllowAll" + } + }, + "updater_roles": + [ + { + "module": "Main", + "name": "withdrawer_updater" + } + ] + }, + { + "role_key": + { + "module": "Main", + "name": "burner_updater" + }, + "assignment": + { + "resolution": "Explicit", + "explicit_rule": + { + "type": "DenyAll" + } + }, + "updater_roles": + [ + { + "module": "Main", + "name": "burner_updater" + } + ] + }, + { + "role_key": + { + "module": "Main", + "name": "minter_updater" + }, + "assignment": + { + "resolution": "Explicit", + "explicit_rule": + { + "type": "DenyAll" + } + }, + "updater_roles": + [ + { + "module": "Main", + "name": "minter_updater" + } + ] + }, + { + "role_key": + { + "module": "Main", + "name": "freezer_updater" + }, + "assignment": + { + "resolution": "Explicit", + "explicit_rule": + { + "type": "DenyAll" + } + }, + "updater_roles": + [ + { + "module": "Main", + "name": "freezer_updater" + } + ] + }, + { + "role_key": + { + "module": "Main", + "name": "recaller_updater" + }, + "assignment": + { + "resolution": "Explicit", + "explicit_rule": + { + "type": "DenyAll" + } + }, + "updater_roles": + [ + { + "module": "Main", + "name": "recaller_updater" + } + ] + }, + { + "role_key": + { + "module": "Main", + "name": "depositor_updater" + }, + "assignment": + { + "resolution": "Explicit", + "explicit_rule": + { + "type": "DenyAll" + } + }, + "updater_roles": + [ + { + "module": "Main", + "name": "depositor_updater" + } + ] + }, + { + "role_key": + { + "module": "Main", + "name": "withdrawer_updater" + }, + "assignment": + { + "resolution": "Explicit", + "explicit_rule": + { + "type": "DenyAll" + } + }, + "updater_roles": + [ + { + "module": "Main", + "name": "withdrawer_updater" + } + ] + }, + { + "role_key": + { + "module": "Metadata", + "name": "metadata_locker" + }, + "assignment": + { + "resolution": "Owner" + }, + "updater_roles": + [ + { + "module": "Metadata", + "name": "metadata_locker_updater" + } + ] + }, + { + "role_key": + { + "module": "Metadata", + "name": "metadata_locker_updater" + }, + "assignment": + { + "resolution": "Owner" + }, + "updater_roles": + [ + { + "module": "Metadata", + "name": "metadata_locker_updater" + } + ] + }, + { + "role_key": + { + "module": "Metadata", + "name": "metadata_setter" + }, + "assignment": + { + "resolution": "Owner" + }, + "updater_roles": + [ + { + "module": "Metadata", + "name": "metadata_setter_updater" + } + ] + }, + { + "role_key": + { + "module": "Metadata", + "name": "metadata_setter_updater" + }, + "assignment": + { + "resolution": "Owner" + }, + "updater_roles": + [ + { + "module": "Metadata", + "name": "metadata_setter_updater" + } + ] + } + ] + }, + "divisibility": 10, + "total_supply": "21000000", + "total_minted": "21000000", + "total_burned": "0", + "type": "FungibleResource" + } + } + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000..35bb59826 --- /dev/null +++ b/crates/gateway-models/fixtures/models/state/response_entity_details__single_resource_no_metadata.json @@ -0,0 +1,398 @@ +{ + "ledger_state": + { + "network": "stokenet", + "state_version": 73657313, + "proposer_round_timestamp": "2024-04-10T08:44:37.403Z", + "epoch": 51652, + "round": 1559 + }, + "items": + [ + { + "address": "resource_tdx_2_1thkcveg0p2l35kvwlxasltvw0wjgsrpch6yfjct9qahze3wce8ukj8", + "fungible_resources": + { + "total_count": 0, + "items": + [] + }, + "non_fungible_resources": + { + "total_count": 0, + "items": + [] + }, + "metadata": + { + "total_count": 0, + "items": + [] + }, + "explicit_metadata": + { + "total_count": 0, + "items": + [] + }, + "details": + { + "role_assignments": + { + "owner": + { + "rule": + { + "type": "AllowAll" + }, + "updater": "Owner" + }, + "entries": + [ + { + "role_key": + { + "module": "Main", + "name": "burner" + }, + "assignment": + { + "resolution": "Explicit", + "explicit_rule": + { + "type": "AllowAll" + } + }, + "updater_roles": + [ + { + "module": "Main", + "name": "burner_updater" + } + ] + }, + { + "role_key": + { + "module": "Main", + "name": "minter" + }, + "assignment": + { + "resolution": "Explicit", + "explicit_rule": + { + "type": "AllowAll" + } + }, + "updater_roles": + [ + { + "module": "Main", + "name": "minter_updater" + } + ] + }, + { + "role_key": + { + "module": "Main", + "name": "freezer" + }, + "assignment": + { + "resolution": "Explicit", + "explicit_rule": + { + "type": "AllowAll" + } + }, + "updater_roles": + [ + { + "module": "Main", + "name": "freezer_updater" + } + ] + }, + { + "role_key": + { + "module": "Main", + "name": "recaller" + }, + "assignment": + { + "resolution": "Explicit", + "explicit_rule": + { + "type": "AllowAll" + } + }, + "updater_roles": + [ + { + "module": "Main", + "name": "recaller_updater" + } + ] + }, + { + "role_key": + { + "module": "Main", + "name": "depositor" + }, + "assignment": + { + "resolution": "Explicit", + "explicit_rule": + { + "type": "AllowAll" + } + }, + "updater_roles": + [ + { + "module": "Main", + "name": "depositor_updater" + } + ] + }, + { + "role_key": + { + "module": "Main", + "name": "withdrawer" + }, + "assignment": + { + "resolution": "Explicit", + "explicit_rule": + { + "type": "AllowAll" + } + }, + "updater_roles": + [ + { + "module": "Main", + "name": "withdrawer_updater" + } + ] + }, + { + "role_key": + { + "module": "Main", + "name": "burner_updater" + }, + "assignment": + { + "resolution": "Explicit", + "explicit_rule": + { + "type": "DenyAll" + } + }, + "updater_roles": + [ + { + "module": "Main", + "name": "burner_updater" + } + ] + }, + { + "role_key": + { + "module": "Main", + "name": "minter_updater" + }, + "assignment": + { + "resolution": "Explicit", + "explicit_rule": + { + "type": "DenyAll" + } + }, + "updater_roles": + [ + { + "module": "Main", + "name": "minter_updater" + } + ] + }, + { + "role_key": + { + "module": "Main", + "name": "freezer_updater" + }, + "assignment": + { + "resolution": "Explicit", + "explicit_rule": + { + "type": "DenyAll" + } + }, + "updater_roles": + [ + { + "module": "Main", + "name": "freezer_updater" + } + ] + }, + { + "role_key": + { + "module": "Main", + "name": "recaller_updater" + }, + "assignment": + { + "resolution": "Explicit", + "explicit_rule": + { + "type": "DenyAll" + } + }, + "updater_roles": + [ + { + "module": "Main", + "name": "recaller_updater" + } + ] + }, + { + "role_key": + { + "module": "Main", + "name": "depositor_updater" + }, + "assignment": + { + "resolution": "Explicit", + "explicit_rule": + { + "type": "DenyAll" + } + }, + "updater_roles": + [ + { + "module": "Main", + "name": "depositor_updater" + } + ] + }, + { + "role_key": + { + "module": "Main", + "name": "withdrawer_updater" + }, + "assignment": + { + "resolution": "Explicit", + "explicit_rule": + { + "type": "DenyAll" + } + }, + "updater_roles": + [ + { + "module": "Main", + "name": "withdrawer_updater" + } + ] + }, + { + "role_key": + { + "module": "Metadata", + "name": "metadata_locker" + }, + "assignment": + { + "resolution": "Owner" + }, + "updater_roles": + [ + { + "module": "Metadata", + "name": "metadata_locker_updater" + } + ] + }, + { + "role_key": + { + "module": "Metadata", + "name": "metadata_locker_updater" + }, + "assignment": + { + "resolution": "Owner" + }, + "updater_roles": + [ + { + "module": "Metadata", + "name": "metadata_locker_updater" + } + ] + }, + { + "role_key": + { + "module": "Metadata", + "name": "metadata_setter" + }, + "assignment": + { + "resolution": "Owner" + }, + "updater_roles": + [ + { + "module": "Metadata", + "name": "metadata_setter_updater" + } + ] + }, + { + "role_key": + { + "module": "Metadata", + "name": "metadata_setter_updater" + }, + "assignment": + { + "resolution": "Owner" + }, + "updater_roles": + [ + { + "module": "Metadata", + "name": "metadata_setter_updater" + } + ] + } + ] + }, + "divisibility": 10, + "total_supply": "21000000", + "total_minted": "21000000", + "total_burned": "0", + "type": "FungibleResource" + } + } + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000..c4d742007 --- /dev/null +++ b/crates/gateway-models/fixtures/models/state/response_entity_details__two_accounts.json @@ -0,0 +1,1025 @@ +{ + "ledger_state": + { + "network": "stokenet", + "state_version": 73659327, + "proposer_round_timestamp": "2024-04-10T08:49:40.926Z", + "epoch": 51653, + "round": 1594 + }, + "items": + [ + { + "address": "account_tdx_2_129vd0a8epu6wa46nh8fkcjhmxwtwet6mut8rgzef2ng68zh5t04t88", + "fungible_resources": + { + "total_count": 1, + "items": + [ + { + "vaults": + { + "total_count": 1, + "items": + [ + { + "vault_address": "internal_vault_tdx_2_1tr9dv2wt2av5u9juks9x276x5qphccswqgq0g9lgpm00rzs7kzclz4", + "amount": "21000000", + "last_updated_at_state_version": 73659244 + } + ] + }, + "aggregation_level": "Vault", + "resource_address": "resource_tdx_2_1tk3rduua8eyy64zcnaanvnkc8558qh5fuz797khrpx20p0a60ev86e", + "explicit_metadata": + { + "total_count": 5, + "items": + [ + { + "key": "tags", + "value": + { + "raw_hex": "5c228001200c0106427269676874", + "programmatic_json": + { + "variant_id": 128, + "fields": + [ + { + "element_kind": "String", + "elements": + [ + { + "value": "Bright", + "kind": "String" + } + ], + "kind": "Array" + } + ], + "kind": "Enum" + }, + "typed": + { + "values": + [ + "Bright" + ], + "type": "StringArray" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73659101 + }, + { + "key": "description", + "value": + { + "raw_hex": "5c2200010c2f5468652062726967687465737420636f6d706f6e656e7420696e207468652052616469782065636f73797374656d2e", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "The brightest component in the Radix ecosystem.", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "The brightest component in the Radix ecosystem.", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73659101 + }, + { + "key": "icon_url", + "value": + { + "raw_hex": "5c220d010c5b68747470733a2f2f757877696e672e636f6d2f77702d636f6e74656e742f7468656d65732f757877696e672f646f776e6c6f61642f617274732d677261706869632d7368617065732f737461722d66756c6c2d69636f6e2e706e67", + "programmatic_json": + { + "variant_id": 13, + "fields": + [ + { + "value": "https://uxwing.com/wp-content/themes/uxwing/download/arts-graphic-shapes/star-full-icon.png", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "https://uxwing.com/wp-content/themes/uxwing/download/arts-graphic-shapes/star-full-icon.png", + "type": "Url" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73659101 + }, + { + "key": "symbol", + "value": + { + "raw_hex": "5c2200010c0453544152", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "STAR", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "STAR", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73659101 + }, + { + "key": "name", + "value": + { + "raw_hex": "5c2200010c065374656c6c61", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Stella", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Stella", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73659101 + } + ] + } + } + ] + }, + "non_fungible_resources": + { + "total_count": 0, + "items": + [] + }, + "metadata": + { + "total_count": 2, + "items": + [ + { + "key": "owner_keys", + "value": + { + "raw_hex": "5c228f01202201010120071d58d7f4f90f34eed753b9d36c4afb3396ecaf5be2ce340b2954d1a38af4", + "programmatic_json": + { + "variant_id": 143, + "fields": + [ + { + "element_kind": "Enum", + "elements": + [ + { + "variant_id": 1, + "fields": + [ + { + "element_kind": "U8", + "hex": "58d7f4f90f34eed753b9d36c4afb3396ecaf5be2ce340b2954d1a38af4", + "kind": "Bytes" + } + ], + "kind": "Enum" + } + ], + "kind": "Array" + } + ], + "kind": "Enum" + }, + "typed": + { + "values": + [ + { + "hash_hex": "58d7f4f90f34eed753b9d36c4afb3396ecaf5be2ce340b2954d1a38af4", + "key_hash_type": "EddsaEd25519" + } + ], + "type": "PublicKeyHashArray" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73659244 + }, + { + "key": "owner_badge", + "value": + { + "raw_hex": "5c220b01c0021e5158d7f4f90f34eed753b9d36c4afb3396ecaf5be2ce340b2954d1a38af4", + "programmatic_json": + { + "variant_id": 11, + "fields": + [ + { + "value": "[5158d7f4f90f34eed753b9d36c4afb3396ecaf5be2ce340b2954d1a38af4]", + "kind": "NonFungibleLocalId" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "[5158d7f4f90f34eed753b9d36c4afb3396ecaf5be2ce340b2954d1a38af4]", + "type": "NonFungibleLocalId" + } + }, + "is_locked": true, + "last_updated_at_state_version": 73659244 + } + ] + }, + "explicit_metadata": + { + "total_count": 0, + "items": + [] + }, + "details": + { + "package_address": "package_tdx_2_1pkgxxxxxxxxxaccntxxxxxxxxxx000929625493xxxxxxxxx9jat20", + "blueprint_name": "Account", + "blueprint_version": "1.0.0", + "state": + { + "default_deposit_rule": "Accept" + }, + "role_assignments": + { + "owner": + { + "rule": + { + "type": "Protected", + "access_rule": + { + "type": "ProofRule", + "proof_rule": + { + "type": "Require", + "requirement": + { + "type": "NonFungible", + "non_fungible": + { + "local_id": + { + "id_type": "Bytes", + "sbor_hex": "5cc0021d58d7f4f90f34eed753b9d36c4afb3396ecaf5be2ce340b2954d1a38af4", + "simple_rep": "[58d7f4f90f34eed753b9d36c4afb3396ecaf5be2ce340b2954d1a38af4]" + }, + "resource_address": "resource_tdx_2_1nfxxxxxxxxxxed25sgxxxxxxxxx002236757237xxxxxxxxx3e2cpa" + } + } + } + } + }, + "updater": "Object" + }, + "entries": + [ + { + "role_key": + { + "module": "Main", + "name": "securify" + }, + "assignment": + { + "resolution": "Explicit", + "explicit_rule": + { + "type": "Protected", + "access_rule": + { + "type": "ProofRule", + "proof_rule": + { + "type": "Require", + "requirement": + { + "type": "NonFungible", + "non_fungible": + { + "local_id": + { + "id_type": "Bytes", + "sbor_hex": "5cc0021d58d7f4f90f34eed753b9d36c4afb3396ecaf5be2ce340b2954d1a38af4", + "simple_rep": "[58d7f4f90f34eed753b9d36c4afb3396ecaf5be2ce340b2954d1a38af4]" + }, + "resource_address": "resource_tdx_2_1nfxxxxxxxxxxed25sgxxxxxxxxx002236757237xxxxxxxxx3e2cpa" + } + } + } + } + } + }, + "updater_roles": + [ + { + "module": "Main", + "name": "_self_" + } + ] + }, + { + "role_key": + { + "module": "Metadata", + "name": "metadata_locker" + }, + "assignment": + { + "resolution": "Owner" + }, + "updater_roles": + [ + { + "module": "Metadata", + "name": "metadata_locker_updater" + } + ] + }, + { + "role_key": + { + "module": "Metadata", + "name": "metadata_locker_updater" + }, + "assignment": + { + "resolution": "Owner" + }, + "updater_roles": + [ + { + "module": "Metadata", + "name": "metadata_locker_updater" + } + ] + }, + { + "role_key": + { + "module": "Metadata", + "name": "metadata_setter" + }, + "assignment": + { + "resolution": "Owner" + }, + "updater_roles": + [ + { + "module": "Metadata", + "name": "metadata_setter_updater" + } + ] + }, + { + "role_key": + { + "module": "Metadata", + "name": "metadata_setter_updater" + }, + "assignment": + { + "resolution": "Owner" + }, + "updater_roles": + [ + { + "module": "Metadata", + "name": "metadata_setter_updater" + } + ] + } + ] + }, + "type": "Component" + } + }, + { + "address": "account_tdx_2_12xwjddwn7wp3tqgj353rur4c2jzjg7uvydfj7y8yaflymxnd9czd4c", + "fungible_resources": + { + "total_count": 2, + "items": + [ + { + "vaults": + { + "total_count": 1, + "items": + [ + { + "vault_address": "internal_vault_tdx_2_1tppjldluq7xd09w67hhlnpclreq7ksep5alqyf9ep7d50xc3dnrgju", + "amount": "0", + "last_updated_at_state_version": 73659244 + } + ] + }, + "aggregation_level": "Vault", + "resource_address": "resource_tdx_2_1tk3rduua8eyy64zcnaanvnkc8558qh5fuz797khrpx20p0a60ev86e", + "explicit_metadata": + { + "total_count": 5, + "items": + [ + { + "key": "tags", + "value": + { + "raw_hex": "5c228001200c0106427269676874", + "programmatic_json": + { + "variant_id": 128, + "fields": + [ + { + "element_kind": "String", + "elements": + [ + { + "value": "Bright", + "kind": "String" + } + ], + "kind": "Array" + } + ], + "kind": "Enum" + }, + "typed": + { + "values": + [ + "Bright" + ], + "type": "StringArray" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73659101 + }, + { + "key": "description", + "value": + { + "raw_hex": "5c2200010c2f5468652062726967687465737420636f6d706f6e656e7420696e207468652052616469782065636f73797374656d2e", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "The brightest component in the Radix ecosystem.", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "The brightest component in the Radix ecosystem.", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73659101 + }, + { + "key": "icon_url", + "value": + { + "raw_hex": "5c220d010c5b68747470733a2f2f757877696e672e636f6d2f77702d636f6e74656e742f7468656d65732f757877696e672f646f776e6c6f61642f617274732d677261706869632d7368617065732f737461722d66756c6c2d69636f6e2e706e67", + "programmatic_json": + { + "variant_id": 13, + "fields": + [ + { + "value": "https://uxwing.com/wp-content/themes/uxwing/download/arts-graphic-shapes/star-full-icon.png", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "https://uxwing.com/wp-content/themes/uxwing/download/arts-graphic-shapes/star-full-icon.png", + "type": "Url" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73659101 + }, + { + "key": "symbol", + "value": + { + "raw_hex": "5c2200010c0453544152", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "STAR", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "STAR", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73659101 + }, + { + "key": "name", + "value": + { + "raw_hex": "5c2200010c065374656c6c61", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Stella", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Stella", + "type": "String" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73659101 + } + ] + } + }, + { + "vaults": + { + "total_count": 1, + "items": + [ + { + "vault_address": "internal_vault_tdx_2_1tze65r2ttle267qztjj2ysyqmp3mfusm87ujllqgx7ynyny5wm60z0", + "amount": "9998.87481552813", + "last_updated_at_state_version": 73659244 + } + ] + }, + "aggregation_level": "Vault", + "resource_address": "resource_tdx_2_1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxtfd2jc", + "explicit_metadata": + { + "total_count": 5, + "items": + [ + { + "key": "tags", + "value": + { + "raw_hex": "5c228001200c00", + "programmatic_json": + { + "variant_id": 128, + "fields": + [ + { + "element_kind": "String", + "elements": + [], + "kind": "Array" + } + ], + "kind": "Enum" + }, + "typed": + { + "values": + [], + "type": "StringArray" + } + }, + "is_locked": true, + "last_updated_at_state_version": 2 + }, + { + "key": "description", + "value": + { + "raw_hex": "5c2200010c9e01546865205261646978205075626c6963204e6574776f726b2773206e617469766520746f6b656e2c207573656420746f2070617920746865206e6574776f726b2773207265717569726564207472616e73616374696f6e206665657320616e6420746f2073656375726520746865206e6574776f726b207468726f756768207374616b696e6720746f206974732076616c696461746f72206e6f6465732e", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "The Radix Public Network's native token, used to pay the network's required transaction fees and to secure the network through staking to its validator nodes.", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "The Radix Public Network's native token, used to pay the network's required transaction fees and to secure the network through staking to its validator nodes.", + "type": "String" + } + }, + "is_locked": true, + "last_updated_at_state_version": 2 + }, + { + "key": "icon_url", + "value": + { + "raw_hex": "5c220d010c3468747470733a2f2f6173736574732e7261646978646c742e636f6d2f69636f6e732f69636f6e2d7872642d33327833322e706e67", + "programmatic_json": + { + "variant_id": 13, + "fields": + [ + { + "value": "https://assets.radixdlt.com/icons/icon-xrd-32x32.png", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "https://assets.radixdlt.com/icons/icon-xrd-32x32.png", + "type": "Url" + } + }, + "is_locked": true, + "last_updated_at_state_version": 2 + }, + { + "key": "symbol", + "value": + { + "raw_hex": "5c2200010c03585244", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "XRD", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "XRD", + "type": "String" + } + }, + "is_locked": true, + "last_updated_at_state_version": 2 + }, + { + "key": "name", + "value": + { + "raw_hex": "5c2200010c055261646978", + "programmatic_json": + { + "variant_id": 0, + "fields": + [ + { + "value": "Radix", + "kind": "String" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "Radix", + "type": "String" + } + }, + "is_locked": true, + "last_updated_at_state_version": 2 + } + ] + } + } + ] + }, + "non_fungible_resources": + { + "total_count": 0, + "items": + [] + }, + "metadata": + { + "total_count": 2, + "items": + [ + { + "key": "owner_keys", + "value": + { + "raw_hex": "5c228f01202201010120071d9d26b5d3f3831581128d223e0eb85485247b8c23532f10e4ea7e4d9a6d", + "programmatic_json": + { + "variant_id": 143, + "fields": + [ + { + "element_kind": "Enum", + "elements": + [ + { + "variant_id": 1, + "fields": + [ + { + "element_kind": "U8", + "hex": "9d26b5d3f3831581128d223e0eb85485247b8c23532f10e4ea7e4d9a6d", + "kind": "Bytes" + } + ], + "kind": "Enum" + } + ], + "kind": "Array" + } + ], + "kind": "Enum" + }, + "typed": + { + "values": + [ + { + "hash_hex": "9d26b5d3f3831581128d223e0eb85485247b8c23532f10e4ea7e4d9a6d", + "key_hash_type": "EddsaEd25519" + } + ], + "type": "PublicKeyHashArray" + } + }, + "is_locked": false, + "last_updated_at_state_version": 73658898 + }, + { + "key": "owner_badge", + "value": + { + "raw_hex": "5c220b01c0021e519d26b5d3f3831581128d223e0eb85485247b8c23532f10e4ea7e4d9a6d", + "programmatic_json": + { + "variant_id": 11, + "fields": + [ + { + "value": "[519d26b5d3f3831581128d223e0eb85485247b8c23532f10e4ea7e4d9a6d]", + "kind": "NonFungibleLocalId" + } + ], + "kind": "Enum" + }, + "typed": + { + "value": "[519d26b5d3f3831581128d223e0eb85485247b8c23532f10e4ea7e4d9a6d]", + "type": "NonFungibleLocalId" + } + }, + "is_locked": true, + "last_updated_at_state_version": 73658898 + } + ] + }, + "explicit_metadata": + { + "total_count": 0, + "items": + [] + }, + "details": + { + "package_address": "package_tdx_2_1pkgxxxxxxxxxaccntxxxxxxxxxx000929625493xxxxxxxxx9jat20", + "blueprint_name": "Account", + "blueprint_version": "1.0.0", + "state": + { + "default_deposit_rule": "Accept" + }, + "role_assignments": + { + "owner": + { + "rule": + { + "type": "Protected", + "access_rule": + { + "type": "ProofRule", + "proof_rule": + { + "type": "Require", + "requirement": + { + "type": "NonFungible", + "non_fungible": + { + "local_id": + { + "id_type": "Bytes", + "sbor_hex": "5cc0021d9d26b5d3f3831581128d223e0eb85485247b8c23532f10e4ea7e4d9a6d", + "simple_rep": "[9d26b5d3f3831581128d223e0eb85485247b8c23532f10e4ea7e4d9a6d]" + }, + "resource_address": "resource_tdx_2_1nfxxxxxxxxxxed25sgxxxxxxxxx002236757237xxxxxxxxx3e2cpa" + } + } + } + } + }, + "updater": "Object" + }, + "entries": + [ + { + "role_key": + { + "module": "Main", + "name": "securify" + }, + "assignment": + { + "resolution": "Explicit", + "explicit_rule": + { + "type": "Protected", + "access_rule": + { + "type": "ProofRule", + "proof_rule": + { + "type": "Require", + "requirement": + { + "type": "NonFungible", + "non_fungible": + { + "local_id": + { + "id_type": "Bytes", + "sbor_hex": "5cc0021d9d26b5d3f3831581128d223e0eb85485247b8c23532f10e4ea7e4d9a6d", + "simple_rep": "[9d26b5d3f3831581128d223e0eb85485247b8c23532f10e4ea7e4d9a6d]" + }, + "resource_address": "resource_tdx_2_1nfxxxxxxxxxxed25sgxxxxxxxxx002236757237xxxxxxxxx3e2cpa" + } + } + } + } + } + }, + "updater_roles": + [ + { + "module": "Main", + "name": "_self_" + } + ] + }, + { + "role_key": + { + "module": "Metadata", + "name": "metadata_locker" + }, + "assignment": + { + "resolution": "Owner" + }, + "updater_roles": + [ + { + "module": "Metadata", + "name": "metadata_locker_updater" + } + ] + }, + { + "role_key": + { + "module": "Metadata", + "name": "metadata_locker_updater" + }, + "assignment": + { + "resolution": "Owner" + }, + "updater_roles": + [ + { + "module": "Metadata", + "name": "metadata_locker_updater" + } + ] + }, + { + "role_key": + { + "module": "Metadata", + "name": "metadata_setter" + }, + "assignment": + { + "resolution": "Owner" + }, + "updater_roles": + [ + { + "module": "Metadata", + "name": "metadata_setter_updater" + } + ] + }, + { + "role_key": + { + "module": "Metadata", + "name": "metadata_setter_updater" + }, + "assignment": + { + "resolution": "Owner" + }, + "updater_roles": + [ + { + "module": "Metadata", + "name": "metadata_setter_updater" + } + ] + } + ] + }, + "type": "Component" + } + } + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000..ba60d09e4 --- /dev/null +++ b/crates/gateway-models/fixtures/models/state/response_entity_details_details__fungible_resource.json @@ -0,0 +1,347 @@ +{ + "role_assignments": { + "owner": { + "rule": { + "type": "Protected", + "access_rule": { + "type": "ProofRule", + "proof_rule": { + "type": "Require", + "requirement": { + "type": "NonFungible", + "non_fungible": { + "local_id": { + "id_type": "Integer", + "sbor_hex": "5cc0010000000000000000", + "simple_rep": "#0#" + }, + "resource_address": "resource_tdx_2_1nfxxxxxxxxxxsystxnxxxxxxxxx002683325037xxxxxxxxxcss8hx" + } + } + } + } + }, + "updater": "None" + }, + "entries": [ + { + "role_key": { + "module": "Main", + "name": "burner" + }, + "assignment": { + "resolution": "Explicit", + "explicit_rule": { + "type": "Protected", + "access_rule": { + "type": "ProofRule", + "proof_rule": { + "type": "Require", + "requirement": { + "type": "NonFungible", + "non_fungible": { + "local_id": { + "id_type": "Bytes", + "sbor_hex": "5cc0022068c44e9d432e71c51e2a2ac285897b372328d8b31374ff29131bc6b25b6bd070", + "simple_rep": "[68c44e9d432e71c51e2a2ac285897b372328d8b31374ff29131bc6b25b6bd070]" + }, + "resource_address": "resource_tdx_2_1nfxxxxxxxxxxglcllrxxxxxxxxx002350006550xxxxxxxxxqtcnwk" + } + } + } + } + } + }, + "updater_roles": [ + { + "module": "Main", + "name": "burner_updater" + } + ] + }, + { + "role_key": { + "module": "Main", + "name": "minter" + }, + "assignment": { + "resolution": "Explicit", + "explicit_rule": { + "type": "Protected", + "access_rule": { + "type": "ProofRule", + "proof_rule": { + "type": "Require", + "requirement": { + "type": "NonFungible", + "non_fungible": { + "local_id": { + "id_type": "Bytes", + "sbor_hex": "5cc0022068c44e9d432e71c51e2a2ac285897b372328d8b31374ff29131bc6b25b6bd070", + "simple_rep": "[68c44e9d432e71c51e2a2ac285897b372328d8b31374ff29131bc6b25b6bd070]" + }, + "resource_address": "resource_tdx_2_1nfxxxxxxxxxxglcllrxxxxxxxxx002350006550xxxxxxxxxqtcnwk" + } + } + } + } + } + }, + "updater_roles": [ + { + "module": "Main", + "name": "minter_updater" + } + ] + }, + { + "role_key": { + "module": "Main", + "name": "freezer" + }, + "assignment": { + "resolution": "Explicit", + "explicit_rule": { + "type": "DenyAll" + } + }, + "updater_roles": [ + { + "module": "Main", + "name": "freezer_updater" + } + ] + }, + { + "role_key": { + "module": "Main", + "name": "recaller" + }, + "assignment": { + "resolution": "Explicit", + "explicit_rule": { + "type": "DenyAll" + } + }, + "updater_roles": [ + { + "module": "Main", + "name": "recaller_updater" + } + ] + }, + { + "role_key": { + "module": "Main", + "name": "depositor" + }, + "assignment": { + "resolution": "Explicit", + "explicit_rule": { + "type": "AllowAll" + } + }, + "updater_roles": [ + { + "module": "Main", + "name": "depositor_updater" + } + ] + }, + { + "role_key": { + "module": "Main", + "name": "withdrawer" + }, + "assignment": { + "resolution": "Explicit", + "explicit_rule": { + "type": "AllowAll" + } + }, + "updater_roles": [ + { + "module": "Main", + "name": "withdrawer_updater" + } + ] + }, + { + "role_key": { + "module": "Main", + "name": "burner_updater" + }, + "assignment": { + "resolution": "Explicit", + "explicit_rule": { + "type": "DenyAll" + } + }, + "updater_roles": [ + { + "module": "Main", + "name": "burner_updater" + } + ] + }, + { + "role_key": { + "module": "Main", + "name": "minter_updater" + }, + "assignment": { + "resolution": "Explicit", + "explicit_rule": { + "type": "DenyAll" + } + }, + "updater_roles": [ + { + "module": "Main", + "name": "minter_updater" + } + ] + }, + { + "role_key": { + "module": "Main", + "name": "freezer_updater" + }, + "assignment": { + "resolution": "Explicit", + "explicit_rule": { + "type": "DenyAll" + } + }, + "updater_roles": [ + { + "module": "Main", + "name": "freezer_updater" + } + ] + }, + { + "role_key": { + "module": "Main", + "name": "recaller_updater" + }, + "assignment": { + "resolution": "Explicit", + "explicit_rule": { + "type": "DenyAll" + } + }, + "updater_roles": [ + { + "module": "Main", + "name": "recaller_updater" + } + ] + }, + { + "role_key": { + "module": "Main", + "name": "depositor_updater" + }, + "assignment": { + "resolution": "Explicit", + "explicit_rule": { + "type": "DenyAll" + } + }, + "updater_roles": [ + { + "module": "Main", + "name": "depositor_updater" + } + ] + }, + { + "role_key": { + "module": "Main", + "name": "withdrawer_updater" + }, + "assignment": { + "resolution": "Explicit", + "explicit_rule": { + "type": "DenyAll" + } + }, + "updater_roles": [ + { + "module": "Main", + "name": "withdrawer_updater" + } + ] + }, + { + "role_key": { + "module": "Metadata", + "name": "metadata_locker" + }, + "assignment": { + "resolution": "Owner" + }, + "updater_roles": [ + { + "module": "Metadata", + "name": "metadata_locker_updater" + } + ] + }, + { + "role_key": { + "module": "Metadata", + "name": "metadata_locker_updater" + }, + "assignment": { + "resolution": "Owner" + }, + "updater_roles": [ + { + "module": "Metadata", + "name": "metadata_locker_updater" + } + ] + }, + { + "role_key": { + "module": "Metadata", + "name": "metadata_setter" + }, + "assignment": { + "resolution": "Owner" + }, + "updater_roles": [ + { + "module": "Metadata", + "name": "metadata_setter_updater" + } + ] + }, + { + "role_key": { + "module": "Metadata", + "name": "metadata_setter_updater" + }, + "assignment": { + "resolution": "Owner" + }, + "updater_roles": [ + { + "module": "Metadata", + "name": "metadata_setter_updater" + } + ] + } + ] + }, + "divisibility": 18, + "total_supply": "1704148276154.93015940148695633", + "total_minted": "1704148839860.06441597855528793", + "total_burned": "563705.1342565770683316", + "native_resource_details": { + "kind": "Xrd" + }, + "type": "FungibleResource" +} \ No newline at end of file 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 new file mode 100644 index 000000000..d5cc2012e --- /dev/null +++ b/crates/gateway-models/fixtures/models/state/response_entity_details_details__non_fungible_resource.json @@ -0,0 +1,344 @@ +{ + "non_fungible_id_type": "String", + "role_assignments": { + "owner": { + "rule": { + "type": "Protected", + "access_rule": { + "type": "ProofRule", + "proof_rule": { + "type": "Require", + "requirement": { + "type": "Resource", + "resource": "resource_tdx_2_1thwucrt37ajfknluwmj9s483qxz7cqcwlvf9xaun9wx5yxn3r8zh7v" + } + } + } + }, + "updater": "None" + }, + "entries": [ + { + "role_key": { + "module": "Main", + "name": "burner" + }, + "assignment": { + "resolution": "Owner" + }, + "updater_roles": [ + { + "module": "Main", + "name": "burner_updater" + } + ] + }, + { + "role_key": { + "module": "Main", + "name": "minter" + }, + "assignment": { + "resolution": "Explicit", + "explicit_rule": { + "type": "Protected", + "access_rule": { + "type": "ProofRule", + "proof_rule": { + "type": "Require", + "requirement": { + "type": "Resource", + "resource": "resource_tdx_2_1tkewy5e4cgwr6qztyum8zch85fgccfjpujkp3jx45ag9qzwev3ud49" + } + } + } + } + }, + "updater_roles": [ + { + "module": "Main", + "name": "minter_updater" + } + ] + }, + { + "role_key": { + "module": "Main", + "name": "freezer" + }, + "assignment": { + "resolution": "Explicit", + "explicit_rule": { + "type": "DenyAll" + } + }, + "updater_roles": [ + { + "module": "Main", + "name": "freezer_updater" + } + ] + }, + { + "role_key": { + "module": "Main", + "name": "recaller" + }, + "assignment": { + "resolution": "Owner" + }, + "updater_roles": [ + { + "module": "Main", + "name": "recaller_updater" + } + ] + }, + { + "role_key": { + "module": "Main", + "name": "depositor" + }, + "assignment": { + "resolution": "Explicit", + "explicit_rule": { + "type": "AllowAll" + } + }, + "updater_roles": [ + { + "module": "Main", + "name": "depositor_updater" + } + ] + }, + { + "role_key": { + "module": "Main", + "name": "withdrawer" + }, + "assignment": { + "resolution": "Explicit", + "explicit_rule": { + "type": "DenyAll" + } + }, + "updater_roles": [ + { + "module": "Main", + "name": "withdrawer_updater" + } + ] + }, + { + "role_key": { + "module": "Main", + "name": "burner_updater" + }, + "assignment": { + "resolution": "Owner" + }, + "updater_roles": [ + { + "module": "Main", + "name": "burner_updater" + } + ] + }, + { + "role_key": { + "module": "Main", + "name": "minter_updater" + }, + "assignment": { + "resolution": "Owner" + }, + "updater_roles": [ + { + "module": "Main", + "name": "minter_updater" + } + ] + }, + { + "role_key": { + "module": "Main", + "name": "freezer_updater" + }, + "assignment": { + "resolution": "Explicit", + "explicit_rule": { + "type": "DenyAll" + } + }, + "updater_roles": [ + { + "module": "Main", + "name": "freezer_updater" + } + ] + }, + { + "role_key": { + "module": "Main", + "name": "recaller_updater" + }, + "assignment": { + "resolution": "Owner" + }, + "updater_roles": [ + { + "module": "Main", + "name": "recaller_updater" + } + ] + }, + { + "role_key": { + "module": "Main", + "name": "depositor_updater" + }, + "assignment": { + "resolution": "Explicit", + "explicit_rule": { + "type": "DenyAll" + } + }, + "updater_roles": [ + { + "module": "Main", + "name": "depositor_updater" + } + ] + }, + { + "role_key": { + "module": "Main", + "name": "withdrawer_updater" + }, + "assignment": { + "resolution": "Owner" + }, + "updater_roles": [ + { + "module": "Main", + "name": "withdrawer_updater" + } + ] + }, + { + "role_key": { + "module": "Main", + "name": "non_fungible_data_updater" + }, + "assignment": { + "resolution": "Explicit", + "explicit_rule": { + "type": "Protected", + "access_rule": { + "type": "ProofRule", + "proof_rule": { + "type": "Require", + "requirement": { + "type": "Resource", + "resource": "resource_tdx_2_1tkewy5e4cgwr6qztyum8zch85fgccfjpujkp3jx45ag9qzwev3ud49" + } + } + } + } + }, + "updater_roles": [ + { + "module": "Main", + "name": "non_fungible_data_updater_updater" + } + ] + }, + { + "role_key": { + "module": "Main", + "name": "non_fungible_data_updater_updater" + }, + "assignment": { + "resolution": "Owner" + }, + "updater_roles": [ + { + "module": "Main", + "name": "non_fungible_data_updater_updater" + } + ] + }, + { + "role_key": { + "module": "Metadata", + "name": "metadata_locker" + }, + "assignment": { + "resolution": "Owner" + }, + "updater_roles": [ + { + "module": "Metadata", + "name": "metadata_locker_updater" + } + ] + }, + { + "role_key": { + "module": "Metadata", + "name": "metadata_locker_updater" + }, + "assignment": { + "resolution": "Owner" + }, + "updater_roles": [ + { + "module": "Metadata", + "name": "metadata_locker_updater" + } + ] + }, + { + "role_key": { + "module": "Metadata", + "name": "metadata_setter" + }, + "assignment": { + "resolution": "Owner" + }, + "updater_roles": [ + { + "module": "Metadata", + "name": "metadata_setter_updater" + } + ] + }, + { + "role_key": { + "module": "Metadata", + "name": "metadata_setter_updater" + }, + "assignment": { + "resolution": "Owner" + }, + "updater_roles": [ + { + "module": "Metadata", + "name": "metadata_setter_updater" + } + ] + } + ] + }, + "total_supply": "3100", + "total_minted": "3100", + "total_burned": "0", + "non_fungible_data_mutable_fields": [ + "description", + "key_image_url", + "quests_completed", + "quest_counter" + ], + "type": "NonFungibleResource" +} \ No newline at end of file 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..72bdcd2eb --- /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 use sargon_core_assert_json::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 75% rename from crates/sargon/src/gateway_api/models/types/request/mod.rs rename to crates/gateway-models/src/types/request/mod.rs index 15f9db821..8250c653d 100644 --- a/crates/sargon/src/gateway_api/models/types/request/mod.rs +++ b/crates/gateway-models/src/types/request/mod.rs @@ -1,9 +1,11 @@ mod gw_public_key; +mod gw_public_key_serde; mod ledger_state_selector; mod state; mod transaction; pub use gw_public_key::*; +pub use gw_public_key_serde::*; pub use ledger_state_selector::*; pub use state::*; pub use 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/types/request/transaction/preview/transaction_preview.rs b/crates/gateway-models/src/types/request/transaction/preview/transaction_preview.rs similarity index 65% rename from crates/sargon/src/gateway_api/models/types/request/transaction/preview/transaction_preview.rs rename to crates/gateway-models/src/types/request/transaction/preview/transaction_preview.rs index 6d4769e66..a477db0de 100644 --- a/crates/sargon/src/gateway_api/models/types/request/transaction/preview/transaction_preview.rs +++ b/crates/gateway-models/src/types/request/transaction/preview/transaction_preview.rs @@ -8,35 +8,35 @@ use crate::prelude::*; PartialEq, Eq, )] -pub(crate) struct TransactionPreviewRequest { +pub struct TransactionPreviewRequest { /** A text-representation of a transaction manifest */ - pub(crate) manifest: String, + pub manifest: String, /** An array of hex-encoded blob data (optional) */ - pub(crate) blobs_hex: Option>, + pub 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, + pub 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 end_epoch_exclusive: u64, - pub(crate) notary_public_key: Option, + pub notary_public_key: Option, /** Whether the notary should count as a signatory (optional, default false) */ - pub(crate) notary_is_signatory: bool, + 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(crate) tip_percentage: u16, + pub 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, + pub nonce: u32, /** A list of public keys to be used as transaction signers */ - pub(crate) signer_public_keys: Vec, + pub signer_public_keys: Vec, - pub(crate) flags: TransactionPreviewRequestFlags, + pub flags: TransactionPreviewRequestFlags, /** A set of flags to configure the response of the transaction preview. */ - pub(crate) opt_ins: TransactionPreviewRequestOptIns, + pub opt_ins: TransactionPreviewRequestOptIns, } 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/types/request/transaction/submit/transaction_submit.rs b/crates/gateway-models/src/types/request/transaction/submit/transaction_submit.rs similarity index 85% rename from crates/sargon/src/gateway_api/models/types/request/transaction/submit/transaction_submit.rs rename to crates/gateway-models/src/types/request/transaction/submit/transaction_submit.rs index 61f833c6e..c294c8b1a 100644 --- a/crates/sargon/src/gateway_api/models/types/request/transaction/submit/transaction_submit.rs +++ b/crates/gateway-models/src/types/request/transaction/submit/transaction_submit.rs @@ -10,5 +10,5 @@ use crate::prelude::*; )] pub struct TransactionSubmitRequest { /** Hex-encoded notarized transaction payload which can be submitted. */ - pub(crate) notarized_transaction_hex: String, + pub notarized_transaction_hex: String, } 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..a520084b4 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, } +#[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, + } + } +} + 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 100% 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 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 100% 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 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..e748dd4ee --- /dev/null +++ b/crates/gateway-models/src/types/response/state/entity/details/fungible/collection_item.rs @@ -0,0 +1,75 @@ +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()] + // ); + todo!() // FIXME + } +} 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 93% 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..2e0895e5e 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< 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/sargon/src/gateway_api/models/logic/response/transaction/subintent_status/subintent_status.rs b/crates/gateway-models/src/types/response/transaction/subintent_status/response.rs similarity index 53% rename from crates/sargon/src/gateway_api/models/logic/response/transaction/subintent_status/subintent_status.rs rename to crates/gateway-models/src/types/response/transaction/subintent_status/response.rs index 97d95290f..40f2e14e5 100644 --- a/crates/sargon/src/gateway_api/models/logic/response/transaction/subintent_status/subintent_status.rs +++ b/crates/gateway-models/src/types/response/transaction/subintent_status/response.rs @@ -1,5 +1,20 @@ 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, @@ -27,7 +42,7 @@ impl SubintentStatusResponse { } pub fn sample_committed_success() -> Self { - Self::committed_success(TransactionIntentHash::sample().to_string()) + Self::committed_success("txid_rdx1frcm6zzyfd08z0deu9x24sh64eccxeux4j2dv3dsqeuh9qsz4y6szm3ltd".to_owned()) } pub fn committed_success( 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/identified-vec-of/Cargo.toml b/crates/identified-vec-of/Cargo.toml index 6dd5614fd..667d85027 100644 --- a/crates/identified-vec-of/Cargo.toml +++ b/crates/identified-vec-of/Cargo.toml @@ -4,14 +4,16 @@ version = "1.2.1" 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/sargon-addresses/Cargo.toml b/crates/sargon-addresses/Cargo.toml index 4722d7b2b..b5d643125 100644 --- a/crates/sargon-addresses/Cargo.toml +++ b/crates/sargon-addresses/Cargo.toml @@ -4,19 +4,19 @@ version = "1.2.1" 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-core-assert-json/Cargo.toml b/crates/sargon-core-assert-json/Cargo.toml index 522554d38..3ec7c3504 100644 --- a/crates/sargon-core-assert-json/Cargo.toml +++ b/crates/sargon-core-assert-json/Cargo.toml @@ -4,11 +4,16 @@ version = "1.2.1" 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..d408b95c0 100644 --- a/crates/sargon-core-error/Cargo.toml +++ b/crates/sargon-core-error/Cargo.toml @@ -4,7 +4,12 @@ version = "1.2.1" 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 } \ No newline at end of file diff --git a/crates/sargon-core-utils/Cargo.toml b/crates/sargon-core-utils/Cargo.toml index c2a9b2943..771b72bc8 100644 --- a/crates/sargon-core-utils/Cargo.toml +++ b/crates/sargon-core-utils/Cargo.toml @@ -4,8 +4,10 @@ version = "1.2.1" 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..76230cd14 100644 --- a/crates/sargon-core/Cargo.toml +++ b/crates/sargon-core/Cargo.toml @@ -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-core/src/lib.rs b/crates/sargon-core/src/lib.rs index 911522c88..8e72d5a7c 100644 --- a/crates/sargon-core/src/lib.rs +++ b/crates/sargon-core/src/lib.rs @@ -8,6 +8,7 @@ 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; @@ -29,6 +30,7 @@ pub mod prelude { 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 +96,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-transaction-models/src/metadata.rs b/crates/sargon-core/src/metadata.rs similarity index 100% rename from crates/sargon-transaction-models/src/metadata.rs rename to crates/sargon-core/src/metadata.rs diff --git a/crates/sargon-factor-instances-provider/Cargo.toml b/crates/sargon-factor-instances-provider/Cargo.toml index 4765841c5..564eefa14 100644 --- a/crates/sargon-factor-instances-provider/Cargo.toml +++ b/crates/sargon-factor-instances-provider/Cargo.toml @@ -4,6 +4,7 @@ version = "1.2.1" 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" } @@ -21,37 +22,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-factors/Cargo.toml b/crates/sargon-factors/Cargo.toml index 00a4d8a64..7ad1e0f6e 100644 --- a/crates/sargon-factors/Cargo.toml +++ b/crates/sargon-factors/Cargo.toml @@ -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-hierarchical-deterministic/Cargo.toml b/crates/sargon-hierarchical-deterministic/Cargo.toml index d32008ca3..e3594495f 100644 --- a/crates/sargon-hierarchical-deterministic/Cargo.toml +++ b/crates/sargon-hierarchical-deterministic/Cargo.toml @@ -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 } \ No newline at end of file diff --git a/crates/sargon-keys-collector/Cargo.toml b/crates/sargon-keys-collector/Cargo.toml index c1cf8ffcc..cbf00f9eb 100644 --- a/crates/sargon-keys-collector/Cargo.toml +++ b/crates/sargon-keys-collector/Cargo.toml @@ -4,11 +4,16 @@ version = "1.2.1" 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" } +# === RADIX DEPENDENCIES === +# None + +# === EXTERNAL DEPENDENCIES === actix-rt = { workspace = true } async-trait = { workspace = true } derive_more = { workspace = true } diff --git a/crates/sargon-manifests/Cargo.toml b/crates/sargon-manifests/Cargo.toml index 92ea01263..2aa4ba27d 100644 --- a/crates/sargon-manifests/Cargo.toml +++ b/crates/sargon-manifests/Cargo.toml @@ -5,50 +5,54 @@ 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" } sargon-transaction-models = { path = "../sargon-transaction-models" } +gateway-models = { path = "../gateway-models" } +sargon-profile = { path = "../sargon-profile" } -# == Radix dependencies == -sbor = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } -radix-rust = { workspace = true } -radix-engine = { workspace = true } +# === RADIX DEPENDENCIES === 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 = { 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-rust = { workspace = true } +radix-transactions = { workspace = true } +sbor = { workspace = true } -# == External Dependencies == -zeroize = { workspace = true } -log = { workspace = true } +# === EXTERNAL DEPENDENCIES === +assert-json-diff = { workspace = true } +async-trait = { workspace = true } +cargo_toml = { workspace = true } +delegate = { workspace = true } 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 } +enum-as-inner = { workspace = true } enum-iterator = { workspace = true } -rand = { workspace = true } hex = { workspace = true } -delegate = { workspace = true } -itertools = { workspace = true } -enum-as-inner = { workspace = true } iota-crypto = { workspace = true } +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 } -async-trait = { 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 index ee4998cdd..ed5052f36 100644 --- a/crates/sargon-manifests/build.rs +++ b/crates/sargon-manifests/build.rs @@ -1,3 +1,4 @@ +use cargo_toml::{Dependency, Manifest}; use std::env; use std::path::Path; @@ -11,4 +12,39 @@ pub fn main() { "cargo:rustc-env=FIXTURES_TX={}/", fixtures_tx_path.display() ); -} \ No newline at end of file + + 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-transaction-models/fixtures/transaction/account_locker_claim.rtm b/crates/sargon-manifests/fixtures/transaction/account_locker_claim.rtm similarity index 100% rename from crates/sargon-transaction-models/fixtures/transaction/account_locker_claim.rtm rename to crates/sargon-manifests/fixtures/transaction/account_locker_claim.rtm diff --git a/crates/sargon-transaction-models/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-transaction-models/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-manifests/src/delete_account/manifest_delete_account.rs b/crates/sargon-manifests/src/delete_account/manifest_delete_account.rs index f5f548329..6e0430f17 100644 --- a/crates/sargon-manifests/src/delete_account/manifest_delete_account.rs +++ b/crates/sargon-manifests/src/delete_account/manifest_delete_account.rs @@ -3,15 +3,27 @@ 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-manifests/src/lib.rs b/crates/sargon-manifests/src/lib.rs index 1929374d7..9afd3ea99 100644 --- a/crates/sargon-manifests/src/lib.rs +++ b/crates/sargon-manifests/src/lib.rs @@ -1,6 +1,7 @@ mod bucket; mod bucket_factory; mod delete_account; +mod high_level; mod manifest_account_locker; mod manifest_assets_transfers; mod manifests; @@ -10,16 +11,19 @@ mod modify_manifest; mod third_party_deposit_update; pub mod prelude { + pub use gateway_models::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::prelude::*; pub use sargon_transaction_models::prelude::*; pub use crate::bucket::*; pub 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::*; diff --git a/crates/sargon-manifests/src/manifest_account_locker.rs b/crates/sargon-manifests/src/manifest_account_locker.rs index bef36f393..549ea6afa 100644 --- a/crates/sargon-manifests/src/manifest_account_locker.rs +++ b/crates/sargon-manifests/src/manifest_account_locker.rs @@ -1,12 +1,21 @@ 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 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-manifests/src/third_party_deposit_update/third_party_deposits_delta.rs b/crates/sargon-manifests/src/third_party_deposit_update/third_party_deposits_delta.rs index d37e3e042..70b42ffd3 100644 --- a/crates/sargon-manifests/src/third_party_deposit_update/third_party_deposits_delta.rs +++ b/crates/sargon-manifests/src/third_party_deposit_update/third_party_deposits_delta.rs @@ -99,34 +99,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( diff --git a/crates/sargon-profile-logic/Cargo.toml b/crates/sargon-profile-logic/Cargo.toml new file mode 100644 index 000000000..e9a449b0e --- /dev/null +++ b/crates/sargon-profile-logic/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "sargon-profile-logic" +version = "1.2.1" +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 === \ No newline at end of file diff --git a/crates/sargon-profile-logic/src/lib.rs b/crates/sargon-profile-logic/src/lib.rs new file mode 100644 index 000000000..d8e0e6d05 --- /dev/null +++ b/crates/sargon-profile-logic/src/lib.rs @@ -0,0 +1,8 @@ +mod logic; +mod tests; + +pub mod prelude { + pub use crate::logic::*; +} + +pub use prelude::*; diff --git a/crates/sargon-profile/src/logic/account/account_visibility.rs b/crates/sargon-profile-logic/src/logic/account/account_visibility.rs similarity index 100% rename from crates/sargon-profile/src/logic/account/account_visibility.rs rename to crates/sargon-profile-logic/src/logic/account/account_visibility.rs diff --git a/crates/sargon-profile/src/logic/account/accounts_visibility.rs b/crates/sargon-profile-logic/src/logic/account/accounts_visibility.rs similarity index 100% rename from crates/sargon-profile/src/logic/account/accounts_visibility.rs rename to crates/sargon-profile-logic/src/logic/account/accounts_visibility.rs diff --git a/crates/sargon-profile/src/logic/account/create_account.rs b/crates/sargon-profile-logic/src/logic/account/create_account.rs similarity index 100% rename from crates/sargon-profile/src/logic/account/create_account.rs rename to crates/sargon-profile-logic/src/logic/account/create_account.rs diff --git a/crates/sargon-profile/src/logic/account/mod.rs b/crates/sargon-profile-logic/src/logic/account/mod.rs similarity index 100% rename from crates/sargon-profile/src/logic/account/mod.rs rename to crates/sargon-profile-logic/src/logic/account/mod.rs diff --git a/crates/sargon-profile/src/logic/account/query_accounts.rs b/crates/sargon-profile-logic/src/logic/account/query_accounts.rs similarity index 100% rename from crates/sargon-profile/src/logic/account/query_accounts.rs rename to crates/sargon-profile-logic/src/logic/account/query_accounts.rs diff --git a/crates/sargon-profile/src/logic/account/query_security_structures.rs b/crates/sargon-profile-logic/src/logic/account/query_security_structures.rs similarity index 100% rename from crates/sargon-profile/src/logic/account/query_security_structures.rs rename to crates/sargon-profile-logic/src/logic/account/query_security_structures.rs diff --git a/crates/sargon-profile-logic/src/logic/assert_has_entity_kind.rs b/crates/sargon-profile-logic/src/logic/assert_has_entity_kind.rs new file mode 100644 index 000000000..92ec986cf --- /dev/null +++ b/crates/sargon-profile-logic/src/logic/assert_has_entity_kind.rs @@ -0,0 +1,63 @@ +pub trait AssertHasEntityKind: HasFactorInstances { + fn assert_has_entity_kind( + &self, + entity_kind_of_entity: CAP26EntityKind, + ) -> Result<()> { + let entity_kind_of_factor_instances = + 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_entity.to_string(), entity_kind_of_factor_instances: entity_kind_of_factor_instances.to_string() }); + } + + Ok(()) + } + + fn entity_kind_of_all_factors(&self) -> Result { + let index_agnostic_path = + self.index_agnostic_path_of_all_tx_signing_factor_instances()?; + Ok(index_agnostic_path.entity_kind) + } + + fn index_agnostic_path_of_all_tx_signing_factor_instances( + &self, + ) -> Result { + let factors = self + .unique_tx_signing_factor_instances() + .into_iter() + .filter_map(|f| f.try_as_hd_factor_instances().ok()) + .collect_vec(); + + if factors.is_empty() { + return Err(CommonError::NoTransactionSigningFactorInstance); + } + + let index_agnostic_path = + factors.first().unwrap().derivation_path().agnostic(); + + if factors + .iter() + .any(|f| f.get_entity_kind() != index_agnostic_path.entity_kind) + { + return Err(CommonError::WrongEntityKindOfInFactorInstancesPath); + } + + if factors + .iter() + .any(|f| f.get_key_kind() != CAP26KeyKind::TransactionSigning) + { + return Err( + CommonError::WrongKeyKindOfTransactionSigningFactorInstance, + ); + } + + Ok(index_agnostic_path) + } + + /// 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| { + factor.factor_source_id == factor_source.factor_source_id() + }) + } +} diff --git a/crates/sargon-profile/src/logic/create_entity.rs b/crates/sargon-profile-logic/src/logic/create_entity.rs similarity index 100% rename from crates/sargon-profile/src/logic/create_entity.rs rename to crates/sargon-profile-logic/src/logic/create_entity.rs diff --git a/crates/sargon-profile-logic/src/logic/diagnose_instance_duplicates.rs b/crates/sargon-profile-logic/src/logic/diagnose_instance_duplicates.rs new file mode 100644 index 000000000..7bc2b1e70 --- /dev/null +++ b/crates/sargon-profile-logic/src/logic/diagnose_instance_duplicates.rs @@ -0,0 +1,270 @@ +#[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 +} + +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 +} + +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 +} + +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-profile/src/logic/gateway/current_gateway.rs b/crates/sargon-profile-logic/src/logic/gateway/current_gateway.rs similarity index 100% rename from crates/sargon-profile/src/logic/gateway/current_gateway.rs rename to crates/sargon-profile-logic/src/logic/gateway/current_gateway.rs diff --git a/crates/sargon-profile/src/logic/gateway/mod.rs b/crates/sargon-profile-logic/src/logic/gateway/mod.rs similarity index 100% rename from crates/sargon-profile/src/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..a432222ef --- /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-profile/src/logic/mod.rs b/crates/sargon-profile-logic/src/logic/mod.rs similarity index 60% rename from crates/sargon-profile/src/logic/mod.rs rename to crates/sargon-profile-logic/src/logic/mod.rs index 226511858..4fc8176e2 100644 --- a/crates/sargon-profile/src/logic/mod.rs +++ b/crates/sargon-profile-logic/src/logic/mod.rs @@ -1,6 +1,9 @@ mod account; +mod assert_has_entity_kind; mod create_entity; +mod diagnose_instance_duplicates; mod gateway; +mod instances_deriving_with_factor_sources; mod persona; mod profile_header; mod profile_network; @@ -8,8 +11,11 @@ mod profile_networks; mod query_factor_sources; pub use account::*; +pub use assert_has_entity_kind::*; pub use create_entity::*; +pub use diagnose_instance_duplicates::*; pub use gateway::*; +pub use instances_deriving_with_factor_sources::*; pub use persona::*; pub use profile_header::*; pub use profile_network::*; diff --git a/crates/sargon-profile/src/logic/persona/create_persona.rs b/crates/sargon-profile-logic/src/logic/persona/create_persona.rs similarity index 100% rename from crates/sargon-profile/src/logic/persona/create_persona.rs rename to crates/sargon-profile-logic/src/logic/persona/create_persona.rs diff --git a/crates/sargon-profile/src/logic/persona/mod.rs b/crates/sargon-profile-logic/src/logic/persona/mod.rs similarity index 100% rename from crates/sargon-profile/src/logic/persona/mod.rs rename to crates/sargon-profile-logic/src/logic/persona/mod.rs diff --git a/crates/sargon-profile/src/logic/persona/persona_data_ids.rs b/crates/sargon-profile-logic/src/logic/persona/persona_data_ids.rs similarity index 100% rename from crates/sargon-profile/src/logic/persona/persona_data_ids.rs rename to crates/sargon-profile-logic/src/logic/persona/persona_data_ids.rs diff --git a/crates/sargon-profile/src/logic/persona/query_personas.rs b/crates/sargon-profile-logic/src/logic/persona/query_personas.rs similarity index 100% rename from crates/sargon-profile/src/logic/persona/query_personas.rs rename to crates/sargon-profile-logic/src/logic/persona/query_personas.rs diff --git a/crates/sargon-profile/src/logic/persona/shared_persona_data_ids.rs b/crates/sargon-profile-logic/src/logic/persona/shared_persona_data_ids.rs similarity index 100% rename from crates/sargon-profile/src/logic/persona/shared_persona_data_ids.rs rename to crates/sargon-profile-logic/src/logic/persona/shared_persona_data_ids.rs diff --git a/crates/sargon-profile/src/logic/profile_header.rs b/crates/sargon-profile-logic/src/logic/profile_header.rs similarity index 100% rename from crates/sargon-profile/src/logic/profile_header.rs rename to crates/sargon-profile-logic/src/logic/profile_header.rs diff --git a/crates/sargon-profile/src/logic/profile_network/mod.rs b/crates/sargon-profile-logic/src/logic/profile_network/mod.rs similarity index 100% rename from crates/sargon-profile/src/logic/profile_network/mod.rs rename to crates/sargon-profile-logic/src/logic/profile_network/mod.rs diff --git a/crates/sargon-profile/src/logic/profile_network/profile_network_details.rs b/crates/sargon-profile-logic/src/logic/profile_network/profile_network_details.rs similarity index 100% rename from crates/sargon-profile/src/logic/profile_network/profile_network_details.rs rename to crates/sargon-profile-logic/src/logic/profile_network/profile_network_details.rs diff --git a/crates/sargon-profile/src/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 100% rename from crates/sargon-profile/src/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 diff --git a/crates/sargon-profile/src/logic/profile_network/profile_network_get_entities.rs b/crates/sargon-profile-logic/src/logic/profile_network/profile_network_get_entities.rs similarity index 100% rename from crates/sargon-profile/src/logic/profile_network/profile_network_get_entities.rs rename to crates/sargon-profile-logic/src/logic/profile_network/profile_network_get_entities.rs diff --git a/crates/sargon-profile/src/logic/profile_networks.rs b/crates/sargon-profile-logic/src/logic/profile_networks.rs similarity index 100% rename from crates/sargon-profile/src/logic/profile_networks.rs rename to crates/sargon-profile-logic/src/logic/profile_networks.rs diff --git a/crates/sargon-profile/src/logic/query_factor_sources.rs b/crates/sargon-profile-logic/src/logic/query_factor_sources.rs similarity index 100% rename from crates/sargon-profile/src/logic/query_factor_sources.rs rename to crates/sargon-profile-logic/src/logic/query_factor_sources.rs 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..acf89b9a4 --- /dev/null +++ b/crates/sargon-profile-logic/src/tests/matrix_of_factor_instances_index_agnostic.rs @@ -0,0 +1,70 @@ +#![cfg(test)] + +use crate::prelude::*; + +#[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/Cargo.toml b/crates/sargon-profile/Cargo.toml index 7e8410579..4c62deda5 100644 --- a/crates/sargon-profile/Cargo.toml +++ b/crates/sargon-profile/Cargo.toml @@ -5,6 +5,7 @@ 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" } @@ -13,104 +14,56 @@ sargon-keys-collector = { path = "../sargon-keys-collector" } sargon-addresses = { path = "../sargon-addresses" } sargon-transaction-models = { path = "../sargon-transaction-models" } -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 } -radix-engine = { workspace = true } +# === RADIX DEPENDENCIES === 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 = { 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-rust = { workspace = true } +radix-transactions = { 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" - -# 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" +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] diff --git a/crates/sargon-profile/src/lib.rs b/crates/sargon-profile/src/lib.rs index 5c0794002..27997a943 100644 --- a/crates/sargon-profile/src/lib.rs +++ b/crates/sargon-profile/src/lib.rs @@ -5,7 +5,6 @@ #![feature(generic_const_exprs)] mod encrypted; -mod logic; mod mfa; mod profilesnapshot_version; mod supporting_types; @@ -21,7 +20,6 @@ pub mod prelude { pub use sargon_transaction_models::prelude::*; pub use crate::encrypted::*; - pub use crate::logic::*; pub use crate::mfa::*; pub use crate::profilesnapshot_version::*; pub use crate::supporting_types::*; diff --git a/crates/sargon-profile/src/mfa/mod.rs b/crates/sargon-profile/src/mfa/mod.rs index e03c06672..484b01f4a 100644 --- a/crates/sargon-profile/src/mfa/mod.rs +++ b/crates/sargon-profile/src/mfa/mod.rs @@ -1,9 +1,9 @@ +mod factor_list_kind; mod role_kind; mod secured_entity_control; mod security_structures; -mod factor_list_kind; -pub use role_kind::*; pub use factor_list_kind::*; +pub use role_kind::*; pub use secured_entity_control::*; pub use security_structures::*; diff --git a/crates/sargon-profile/src/mfa/security_structures/matrices/matrix_of_factor_instances.rs b/crates/sargon-profile/src/mfa/security_structures/matrices/matrix_of_factor_instances.rs index e0e877a58..0a9b20cbf 100644 --- a/crates/sargon-profile/src/mfa/security_structures/matrices/matrix_of_factor_instances.rs +++ b/crates/sargon-profile/src/mfa/security_structures/matrices/matrix_of_factor_instances.rs @@ -9,77 +9,6 @@ impl MatrixOfFactorInstances { MINUTES_PER_DAY * timed_recovery_in_days } } -pub trait HasFactorInstances { - fn assert_has_entity_kind( - &self, - entity_kind_of_entity: CAP26EntityKind, - ) -> Result<()> { - let entity_kind_of_factor_instances = - 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_entity.to_string(), entity_kind_of_factor_instances: entity_kind_of_factor_instances.to_string() }); - } - - Ok(()) - } - - fn entity_kind_of_all_factors(&self) -> Result { - let index_agnostic_path = - self.index_agnostic_path_of_all_tx_signing_factor_instances()?; - Ok(index_agnostic_path.entity_kind) - } - - fn index_agnostic_path_of_all_tx_signing_factor_instances( - &self, - ) -> Result { - let factors = self - .unique_tx_signing_factor_instances() - .into_iter() - .filter_map(|f| f.try_as_hd_factor_instances().ok()) - .collect_vec(); - - if factors.is_empty() { - return Err(CommonError::NoTransactionSigningFactorInstance); - } - - let index_agnostic_path = - factors.first().unwrap().derivation_path().agnostic(); - - if factors - .iter() - .any(|f| f.get_entity_kind() != index_agnostic_path.entity_kind) - { - return Err(CommonError::WrongEntityKindOfInFactorInstancesPath); - } - - if factors - .iter() - .any(|f| f.get_key_kind() != CAP26KeyKind::TransactionSigning) - { - return Err( - CommonError::WrongKeyKindOfTransactionSigningFactorInstance, - ); - } - - 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| { - factor.factor_source_id == factor_source.factor_source_id() - }) - } -} impl HasFactorInstances for MatrixOfFactorInstances { fn unique_tx_signing_factor_instances(&self) -> IndexSet { @@ -91,79 +20,13 @@ impl HasFactorInstances for MatrixOfFactorInstances { } } -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::(); +pub trait HasFactorInstances { + fn unique_tx_signing_factor_instances(&self) -> IndexSet; - (fsid, instances) - }) - .collect::>() + /// 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() } } @@ -172,41 +35,44 @@ impl MatrixOfFactorInstances { 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() + // 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() + todo!() // FIXME } } impl HasSampleValues for MatrixOfFactorInstances { /// Account fn sample() -> Self { - Self::sample_from_matrix_of_sources( - MatrixOfFactorSources::sample(), - CAP26EntityKind::Account, - ) + // Self::sample_from_matrix_of_sources( + // MatrixOfFactorSources::sample(), + // CAP26EntityKind::Account, + // ) + todo!() } /// Persona fn sample_other() -> Self { - Self::sample_from_matrix_of_sources( - MatrixOfFactorSources::sample_other(), - CAP26EntityKind::Identity, - ) + // Self::sample_from_matrix_of_sources( + // MatrixOfFactorSources::sample_other(), + // CAP26EntityKind::Identity, + // ) + todo!() } } @@ -388,76 +254,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-profile/src/mfa/security_structures/roles/abstract_role_builder_or_built.rs b/crates/sargon-profile/src/mfa/security_structures/roles/abstract_role_builder_or_built.rs index 70008c2d6..545f6ede1 100644 --- a/crates/sargon-profile/src/mfa/security_structures/roles/abstract_role_builder_or_built.rs +++ b/crates/sargon-profile/src/mfa/security_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(()) diff --git a/crates/sargon-profile/src/profilesnapshot_version.rs b/crates/sargon-profile/src/profilesnapshot_version.rs index 2076c7af0..88eebd5c3 100644 --- a/crates/sargon-profile/src/profilesnapshot_version.rs +++ b/crates/sargon-profile/src/profilesnapshot_version.rs @@ -59,7 +59,6 @@ mod tests { use super::*; use serde_json::json; - #[test] fn json() { assert_json_value_eq_after_roundtrip( diff --git a/crates/sargon-profile/src/v100/entity/account/account.rs b/crates/sargon-profile/src/v100/entity/account/account.rs index 7c91858e4..2ca523059 100644 --- a/crates/sargon-profile/src/v100/entity/account/account.rs +++ b/crates/sargon-profile/src/v100/entity/account/account.rs @@ -113,7 +113,6 @@ impl IsBaseEntity for Account { impl IsEntity for Account { type Path = AccountPath; - fn with_veci_and_name( veci: HDFactorInstanceTransactionSigning, name: DisplayName, diff --git a/crates/sargon-profile/src/v100/entity_security_state/entity_security_state.rs b/crates/sargon-profile/src/v100/entity_security_state/entity_security_state.rs index 1bab332e7..ca6f21651 100644 --- a/crates/sargon-profile/src/v100/entity_security_state/entity_security_state.rs +++ b/crates/sargon-profile/src/v100/entity_security_state/entity_security_state.rs @@ -125,6 +125,7 @@ impl HasFactorInstances for EntitySecurityState { } } } + fn unique_all_factor_instances(&self) -> IndexSet { match self { EntitySecurityState::Unsecured { value } => { diff --git a/crates/sargon-profile/src/v100/profile_legacy_state_bugs.rs b/crates/sargon-profile/src/v100/profile_legacy_state_bugs.rs index ea3fa8367..2744c4fde 100644 --- a/crates/sargon-profile/src/v100/profile_legacy_state_bugs.rs +++ b/crates/sargon-profile/src/v100/profile_legacy_state_bugs.rs @@ -26,284 +26,3 @@ impl Profile { 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-transaction-models/Cargo.toml b/crates/sargon-transaction-models/Cargo.toml index c45aa420d..d1be78d88 100644 --- a/crates/sargon-transaction-models/Cargo.toml +++ b/crates/sargon-transaction-models/Cargo.toml @@ -5,49 +5,50 @@ 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 == -sbor = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.3.0" } -radix-rust = { workspace = true } -radix-engine = { workspace = true } +# === RADIX DEPENDENCIES === 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 = { 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-rust = { workspace = true } +radix-transactions = { workspace = true } +sbor = { workspace = true } -# == External Dependencies == -zeroize = { workspace = true } -log = { workspace = true } +# === EXTERNAL DEPENDENCIES === +assert-json-diff = { workspace = true } +async-trait = { workspace = true } +delegate = { workspace = true } 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 } +enum-as-inner = { workspace = true } enum-iterator = { workspace = true } -rand = { workspace = true } hex = { workspace = true } -delegate = { workspace = true } -itertools = { workspace = true } -enum-as-inner = { workspace = true } iota-crypto = { workspace = true } +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 } -async-trait = { 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 index 3e1eafec3..50acb5395 100644 --- a/crates/sargon-transaction-models/build.rs +++ b/crates/sargon-transaction-models/build.rs @@ -1,4 +1,3 @@ -use cargo_toml::{Dependency, Manifest}; use std::env; use std::path::Path; @@ -12,38 +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/sargon-transaction-models/src/lib.rs b/crates/sargon-transaction-models/src/lib.rs index b44e97b6c..8bd0bd201 100644 --- a/crates/sargon-transaction-models/src/lib.rs +++ b/crates/sargon-transaction-models/src/lib.rs @@ -1,9 +1,8 @@ +mod assert_manifest; +mod error_from; mod is_intent_signing; mod low_level; -mod metadata; -mod error_from; mod profile_models; -mod assert_manifest; mod unvalidated_transaction_manifest; pub mod prelude { @@ -13,12 +12,11 @@ pub mod 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::metadata::*; pub use crate::profile_models::*; - pub use crate::assert_manifest::*; - pub use crate::error_from::*; pub use crate::unvalidated_transaction_manifest::*; pub(crate) use radix_engine::{ diff --git a/crates/sargon-transaction-models/src/profile_models/third_party_deposits/asset_exception.rs b/crates/sargon-transaction-models/src/profile_models/third_party_deposits/asset_exception.rs index f76b3a36b..e1c8367b3 100644 --- a/crates/sargon-transaction-models/src/profile_models/third_party_deposits/asset_exception.rs +++ b/crates/sargon-transaction-models/src/profile_models/third_party_deposits/asset_exception.rs @@ -1,5 +1,11 @@ use crate::prelude::*; +use radix_engine_interface::blueprints::account::{ + AccountRemoveAuthorizedDepositorInput as ScryptoAccountRemoveAuthorizedDepositorInput, + AccountRemoveResourcePreferenceInput as ScryptoAccountRemoveResourcePreferenceInput, + AccountSetResourcePreferenceInput as ScryptoAccountSetResourcePreferenceInput, +}; + /// The specific Asset exception rule, which overrides the general /// `deposit_rule` of a `ThirdPartyDeposits` settings. #[derive( @@ -23,6 +29,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-uniffi/Cargo.toml b/crates/sargon-uniffi/Cargo.toml index 3d85ca5ad..888e60a20 100644 --- a/crates/sargon-uniffi/Cargo.toml +++ b/crates/sargon-uniffi/Cargo.toml @@ -14,91 +14,50 @@ 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" } 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/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 index 7bb60e0b2..c4edd1a84 100644 --- 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 @@ -14,7 +14,8 @@ pub fn new_account_or_address_of_sample() -> OwnedOrThirdPartyAccountAddress { } #[uniffi::export] -pub fn new_account_or_address_of_sample_other() -> OwnedOrThirdPartyAccountAddress { +pub fn new_account_or_address_of_sample_other( +) -> OwnedOrThirdPartyAccountAddress { InternalAccountOrAddressOf::sample_other().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 8ca7d8704..8e0ce4492 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,11 +1,11 @@ mod account_or_address_of; +mod owned_or_third_party_account_address; mod per_asset; mod per_recipient; mod transfer_types; -mod owned_or_third_party_account_address; -pub use owned_or_third_party_account_address::*; 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 index 6c229c7e7..0afc40f03 100644 --- 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 @@ -1,10 +1,7 @@ - -#[derive(Debug, Clone, Copy, PartialEq, Eq, InternalConversion, uniffi::enum)] +#[derive( + Debug, Clone, Copy, PartialEq, Eq, InternalConversion, uniffi::enum, +)] pub enum OwnedOrThirdPartyAccountAddress { - OwnedAccount { - value: AccountAddress, - }, - ThirdPartyAccount { - value: AccountAddress, - }, -} \ No newline at end of file + OwnedAccount { value: AccountAddress }, + ThirdPartyAccount { value: AccountAddress }, +} diff --git a/crates/sargon/Cargo.toml b/crates/sargon/Cargo.toml index 4d0e60932..0c88ce0c8 100644 --- a/crates/sargon/Cargo.toml +++ b/crates/sargon/Cargo.toml @@ -1,6 +1,5 @@ [package] name = "sargon" -# Don't forget to update version in crates/sargon-uniffi/Cargo.toml version = "1.2.1" edition = "2021" build = "build.rs" @@ -12,6 +11,7 @@ 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" } @@ -22,91 +22,53 @@ sargon-transaction-models = { path = "../sargon-transaction-models" } sargon-manifests = { path = "../sargon-manifests" } sargon-profile = { path = "../sargon-profile" } sargon-factor-instances-provider = { path = "../sargon-factor-instances-provider" } +gateway-models = { path = "../gateway-models" } -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 } +# === 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 @@ -116,11 +78,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 c076926af..1ac47b6d9 100644 --- a/crates/sargon/build.rs +++ b/crates/sargon/build.rs @@ -2,29 +2,25 @@ 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() ); - + 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/src/gateway_api/mod.rs b/crates/sargon/src/gateway_api/mod.rs index ed1795d26..0c84bf330 100644 --- a/crates/sargon/src/gateway_api/mod.rs +++ b/crates/sargon/src/gateway_api/mod.rs @@ -2,10 +2,8 @@ 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/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_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/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/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/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 a1bda7ac72ad9953648cef20ceea93fcc37af06b Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Tue, 31 Dec 2024 09:41:49 +0100 Subject: [PATCH 03/23] wip --- Cargo.lock | 4 + .../src/lib.rs | 2 - .../src/types/mod.rs | 16 - crates/sargon-profile-logic/Cargo.toml | 6 +- crates/sargon-profile-logic/src/lib.rs | 6 + .../src/logic/account/account_visibility.rs | 11 +- .../src/logic/account/create_account.rs | 179 ------ .../src/logic/account/mod.rs | 2 - .../src/logic/account/query_accounts.rs | 89 +-- .../src/logic/assert_has_entity_kind.rs | 63 --- .../src/logic/authorized_dapps_logic.rs | 29 + .../src/logic/create_entity.rs | 81 --- .../src/logic/gateway/current_gateway.rs | 148 ++++- .../instances_deriving_with_factor_sources.rs | 136 ++--- crates/sargon-profile-logic/src/logic/mod.rs | 10 +- .../src/logic/persona/create_persona.rs | 70 --- .../src/logic/persona/mod.rs | 2 - .../src/logic/profile_header.rs | 23 +- .../src/logic/profile_networks.rs | 370 ++++++++++++- .../src/logic/profile_update.rs | 518 ++++++++++++++++++ .../src/logic/query_factor_sources.rs | 77 +-- .../abstract_securified_entity.rs | 0 .../any_securified_entity.rs | 0 .../assert_derivation_path.rs | 14 +- .../supporting_types}/is_securified_entity.rs | 0 .../src/supporting_types/mod.rs | 17 + .../supporting_types}/securified_account.rs | 0 .../supporting_types}/securified_persona.rs | 0 .../supporting_types}/unsecurified_entity.rs | 0 .../src/supporting_types}/veci.rs | 0 crates/sargon-profile/src/lib.rs | 2 + .../matrices/matrix_of_factor_instances.rs | 62 +++ .../access_controller_address_samples.rs | 5 +- .../src}/samples/account_address_samples.rs | 1 - .../src}/samples/account_samples.rs | 3 +- ...al_role_with_hd_factor_instance_samples.rs | 0 .../src}/samples/identity_address_samples.rs | 0 .../src}/samples/mod.rs | 0 .../src}/samples/persona_samples.rs | 4 +- .../src}/samples/profile_samples.rs | 0 .../agnostic_paths/derivation_preset.rs | 0 .../agnostic_paths/index_agnostic_path.rs | 0 .../supporting_types}/agnostic_paths/mod.rs | 0 .../quantified_derivation_preset.rs | 0 .../agnostic_paths/quantities.rs | 0 .../src/supporting_types/mod.rs | 2 + .../gateways/saved_gateways.rs | 83 +-- .../authorized_dapp/authorized_dapp.rs | 12 - .../authorized_persona_simple.rs | 2 +- .../v100/networks/network/authorized_dapps.rs | 12 - .../v100/networks/network/profile_network.rs | 88 --- .../src/v100/networks/profile_networks.rs | 193 +------ crates/sargon-profile/src/v100/profile.rs | 448 +-------------- .../src/v100/profile_legacy_state_bugs.rs | 27 - crates/sargon/src/lib.rs | 2 + .../diagnose_instance_duplicates.rs | 2 + .../needs_a_new_home_dumping_ground/mod.rs | 3 + ...th_factor_source_and_derivation_outcome.rs | 343 ++++++++++++ crates/sargon/src/system/sargon_os/mod.rs | 2 + 59 files changed, 1723 insertions(+), 1446 deletions(-) delete mode 100644 crates/sargon-profile-logic/src/logic/account/create_account.rs delete mode 100644 crates/sargon-profile-logic/src/logic/assert_has_entity_kind.rs create mode 100644 crates/sargon-profile-logic/src/logic/authorized_dapps_logic.rs delete mode 100644 crates/sargon-profile-logic/src/logic/create_entity.rs delete mode 100644 crates/sargon-profile-logic/src/logic/persona/create_persona.rs create mode 100644 crates/sargon-profile-logic/src/logic/profile_update.rs rename crates/{sargon-factor-instances-provider/src/types => sargon-profile-logic/src/supporting_types}/abstract_securified_entity.rs (100%) rename crates/{sargon-factor-instances-provider/src/types => sargon-profile-logic/src/supporting_types}/any_securified_entity.rs (100%) rename crates/{sargon-factor-instances-provider/src/types => sargon-profile-logic/src/supporting_types}/assert_derivation_path.rs (78%) rename crates/{sargon-factor-instances-provider/src/types => sargon-profile-logic/src/supporting_types}/is_securified_entity.rs (100%) create mode 100644 crates/sargon-profile-logic/src/supporting_types/mod.rs rename crates/{sargon-factor-instances-provider/src/types => sargon-profile-logic/src/supporting_types}/securified_account.rs (100%) rename crates/{sargon-factor-instances-provider/src/types => sargon-profile-logic/src/supporting_types}/securified_persona.rs (100%) rename crates/{sargon-factor-instances-provider/src/types => sargon-profile-logic/src/supporting_types}/unsecurified_entity.rs (100%) rename crates/{sargon-factor-instances-provider/src/types => sargon-profile-logic/src/supporting_types}/veci.rs (100%) 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 (98%) rename crates/{sargon/src/types => sargon-profile/src}/samples/general_role_with_hd_factor_instance_samples.rs (100%) 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 (100%) rename crates/{sargon/src/types => sargon-profile/src}/samples/persona_samples.rs (98%) rename crates/{sargon/src/types => sargon-profile/src}/samples/profile_samples.rs (100%) rename crates/{sargon-factor-instances-provider/src => sargon-profile/src/supporting_types}/agnostic_paths/derivation_preset.rs (100%) rename crates/{sargon-factor-instances-provider/src => sargon-profile/src/supporting_types}/agnostic_paths/index_agnostic_path.rs (100%) rename crates/{sargon-factor-instances-provider/src => sargon-profile/src/supporting_types}/agnostic_paths/mod.rs (100%) rename crates/{sargon-factor-instances-provider/src => sargon-profile/src/supporting_types}/agnostic_paths/quantified_derivation_preset.rs (100%) rename crates/{sargon-factor-instances-provider/src => sargon-profile/src/supporting_types}/agnostic_paths/quantities.rs (100%) rename crates/{sargon-profile-logic/src/logic => sargon/src/needs_a_new_home_dumping_ground}/diagnose_instance_duplicates.rs (99%) create mode 100644 crates/sargon/src/needs_a_new_home_dumping_ground/mod.rs create mode 100644 crates/sargon/src/system/sargon_os/entity_creating_with_factor_source_and_derivation_outcome.rs diff --git a/Cargo.lock b/Cargo.lock index 7e3e35f98..1277cb863 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3200,7 +3200,9 @@ dependencies = [ name = "sargon-profile-logic" version = "1.2.1" dependencies = [ + "derive_more", "identified-vec-of", + "itertools 0.12.0", "radix-common", "radix-common-derive", "radix-engine", @@ -3215,6 +3217,8 @@ dependencies = [ "sargon-hierarchical-deterministic", "sargon-profile", "sbor", + "serde", + "serde_json 1.0.108", ] [[package]] diff --git a/crates/sargon-factor-instances-provider/src/lib.rs b/crates/sargon-factor-instances-provider/src/lib.rs index 9b190613c..280fbc09d 100644 --- a/crates/sargon-factor-instances-provider/src/lib.rs +++ b/crates/sargon-factor-instances-provider/src/lib.rs @@ -1,4 +1,3 @@ -mod agnostic_paths; mod factor_instances_cache; mod next_index_assigner; mod provider; @@ -13,7 +12,6 @@ pub mod prelude { pub(crate) use sargon_keys_collector::prelude::*; pub(crate) use sargon_profile::prelude::*; - pub use crate::agnostic_paths::*; pub use crate::factor_instances_cache::*; pub use crate::next_index_assigner::*; pub use crate::provider::*; diff --git a/crates/sargon-factor-instances-provider/src/types/mod.rs b/crates/sargon-factor-instances-provider/src/types/mod.rs index cfe91737f..cc520ebb6 100644 --- a/crates/sargon-factor-instances-provider/src/types/mod.rs +++ b/crates/sargon-factor-instances-provider/src/types/mod.rs @@ -1,19 +1,3 @@ -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-profile-logic/Cargo.toml b/crates/sargon-profile-logic/Cargo.toml index e9a449b0e..dfaca3e85 100644 --- a/crates/sargon-profile-logic/Cargo.toml +++ b/crates/sargon-profile-logic/Cargo.toml @@ -23,4 +23,8 @@ radix-rust = { workspace = true } radix-transactions = { workspace = true } sbor = { workspace = true } -# === EXTERNAL DEPENDENCIES === \ No newline at end of file +# === EXTERNAL DEPENDENCIES === +derive_more = { workspace = true } +itertools = { 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 index d8e0e6d05..0e566e75c 100644 --- a/crates/sargon-profile-logic/src/lib.rs +++ b/crates/sargon-profile-logic/src/lib.rs @@ -1,8 +1,14 @@ mod logic; +mod supporting_types; mod tests; pub mod prelude { pub use crate::logic::*; + pub use crate::supporting_types::*; + + pub use sargon_profile::prelude::*; + + pub use itertools::Itertools; } pub use prelude::*; diff --git a/crates/sargon-profile-logic/src/logic/account/account_visibility.rs b/crates/sargon-profile-logic/src/logic/account/account_visibility.rs index 9b116bd87..905a4ea6e 100644 --- a/crates/sargon-profile-logic/src/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-profile-logic/src/logic/account/create_account.rs b/crates/sargon-profile-logic/src/logic/account/create_account.rs deleted file mode 100644 index 5b49285eb..000000000 --- a/crates/sargon-profile-logic/src/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-profile-logic/src/logic/account/mod.rs b/crates/sargon-profile-logic/src/logic/account/mod.rs index c19bc7be8..342a81de5 100644 --- a/crates/sargon-profile-logic/src/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-profile-logic/src/logic/account/query_accounts.rs b/crates/sargon-profile-logic/src/logic/account/query_accounts.rs index 37e244ff7..0a49bb8c1 100644 --- a/crates/sargon-profile-logic/src/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,7 +115,7 @@ impl Profile { .collect() } - pub fn securified_accounts_on_network( + fn securified_accounts_on_network( &self, network_id: NetworkID, ) -> IndexSet { @@ -136,6 +123,22 @@ impl Profile { } } +impl ProfileEntitiesOfKindOnNetworkInKeySpace for Profile { + 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)] mod tests { diff --git a/crates/sargon-profile-logic/src/logic/assert_has_entity_kind.rs b/crates/sargon-profile-logic/src/logic/assert_has_entity_kind.rs deleted file mode 100644 index 92ec986cf..000000000 --- a/crates/sargon-profile-logic/src/logic/assert_has_entity_kind.rs +++ /dev/null @@ -1,63 +0,0 @@ -pub trait AssertHasEntityKind: HasFactorInstances { - fn assert_has_entity_kind( - &self, - entity_kind_of_entity: CAP26EntityKind, - ) -> Result<()> { - let entity_kind_of_factor_instances = - 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_entity.to_string(), entity_kind_of_factor_instances: entity_kind_of_factor_instances.to_string() }); - } - - Ok(()) - } - - fn entity_kind_of_all_factors(&self) -> Result { - let index_agnostic_path = - self.index_agnostic_path_of_all_tx_signing_factor_instances()?; - Ok(index_agnostic_path.entity_kind) - } - - fn index_agnostic_path_of_all_tx_signing_factor_instances( - &self, - ) -> Result { - let factors = self - .unique_tx_signing_factor_instances() - .into_iter() - .filter_map(|f| f.try_as_hd_factor_instances().ok()) - .collect_vec(); - - if factors.is_empty() { - return Err(CommonError::NoTransactionSigningFactorInstance); - } - - let index_agnostic_path = - factors.first().unwrap().derivation_path().agnostic(); - - if factors - .iter() - .any(|f| f.get_entity_kind() != index_agnostic_path.entity_kind) - { - return Err(CommonError::WrongEntityKindOfInFactorInstancesPath); - } - - if factors - .iter() - .any(|f| f.get_key_kind() != CAP26KeyKind::TransactionSigning) - { - return Err( - CommonError::WrongKeyKindOfTransactionSigningFactorInstance, - ); - } - - Ok(index_agnostic_path) - } - - /// 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| { - factor.factor_source_id == factor_source.factor_source_id() - }) - } -} 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-profile-logic/src/logic/create_entity.rs b/crates/sargon-profile-logic/src/logic/create_entity.rs deleted file mode 100644 index 25838fc9f..000000000 --- a/crates/sargon-profile-logic/src/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-profile-logic/src/logic/gateway/current_gateway.rs b/crates/sargon-profile-logic/src/logic/gateway/current_gateway.rs index 6dad37b51..47b80b45d 100644 --- a/crates/sargon-profile-logic/src/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-profile-logic/src/logic/instances_deriving_with_factor_sources.rs b/crates/sargon-profile-logic/src/logic/instances_deriving_with_factor_sources.rs index a432222ef..cc8c28e1c 100644 --- 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 @@ -1,77 +1,77 @@ -use crate::prelude::*; +// 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; -} +// 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(), - ); +// 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::>(); +// 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(); +// 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 = 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); +// 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::>(); +// 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::(); +// let instances = mwp +// .derive_public_keys(paths) +// .into_iter() +// .map(|public_key| { +// HierarchicalDeterministicFactorInstance::new( +// fsid, public_key, +// ) +// }) +// .collect::(); - (fsid, instances) - }) - .collect::>() - } -} +// (fsid, instances) +// }) +// .collect::>() +// } +// } diff --git a/crates/sargon-profile-logic/src/logic/mod.rs b/crates/sargon-profile-logic/src/logic/mod.rs index 4fc8176e2..bd9480f89 100644 --- a/crates/sargon-profile-logic/src/logic/mod.rs +++ b/crates/sargon-profile-logic/src/logic/mod.rs @@ -1,23 +1,21 @@ mod account; -mod assert_has_entity_kind; -mod create_entity; -mod diagnose_instance_duplicates; +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 assert_has_entity_kind::*; -pub use create_entity::*; -pub use diagnose_instance_duplicates::*; +pub use authorized_dapps_logic::*; pub use gateway::*; pub use instances_deriving_with_factor_sources::*; 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-profile-logic/src/logic/persona/create_persona.rs b/crates/sargon-profile-logic/src/logic/persona/create_persona.rs deleted file mode 100644 index c5fac1585..000000000 --- a/crates/sargon-profile-logic/src/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-profile-logic/src/logic/persona/mod.rs b/crates/sargon-profile-logic/src/logic/persona/mod.rs index 7d3338368..48b18bbe2 100644 --- a/crates/sargon-profile-logic/src/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-profile-logic/src/logic/profile_header.rs b/crates/sargon-profile-logic/src/logic/profile_header.rs index f019da25b..806877d8b 100644 --- a/crates/sargon-profile-logic/src/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-profile-logic/src/logic/profile_networks.rs b/crates/sargon-profile-logic/src/logic/profile_networks.rs index 85aedbabf..282506f5b 100644 --- a/crates/sargon-profile-logic/src/logic/profile_networks.rs +++ b/crates/sargon-profile-logic/src/logic/profile_networks.rs @@ -1,6 +1,6 @@ use crate::prelude::*; -impl Profile { +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 @@ -8,10 +8,27 @@ impl Profile { /// 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 { + 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()) } - pub fn contains_entity_by_address( + + fn contains_entity_by_address( &self, entity_address: &AddressOfAccountOrPersona, ) -> bool { @@ -20,9 +37,339 @@ impl Profile { }) } } +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 tests { +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)] @@ -40,4 +387,19 @@ mod tests { 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-profile-logic/src/logic/query_factor_sources.rs b/crates/sargon-profile-logic/src/logic/query_factor_sources.rs index 3bdf51960..76b6845e5 100644 --- a/crates/sargon-profile-logic/src/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-factor-instances-provider/src/types/abstract_securified_entity.rs b/crates/sargon-profile-logic/src/supporting_types/abstract_securified_entity.rs similarity index 100% rename from crates/sargon-factor-instances-provider/src/types/abstract_securified_entity.rs rename to crates/sargon-profile-logic/src/supporting_types/abstract_securified_entity.rs diff --git a/crates/sargon-factor-instances-provider/src/types/any_securified_entity.rs b/crates/sargon-profile-logic/src/supporting_types/any_securified_entity.rs similarity index 100% rename from crates/sargon-factor-instances-provider/src/types/any_securified_entity.rs rename to crates/sargon-profile-logic/src/supporting_types/any_securified_entity.rs diff --git a/crates/sargon-factor-instances-provider/src/types/assert_derivation_path.rs b/crates/sargon-profile-logic/src/supporting_types/assert_derivation_path.rs similarity index 78% rename from crates/sargon-factor-instances-provider/src/types/assert_derivation_path.rs rename to crates/sargon-profile-logic/src/supporting_types/assert_derivation_path.rs index c241143a6..e3429b3de 100644 --- a/crates/sargon-factor-instances-provider/src/types/assert_derivation_path.rs +++ b/crates/sargon-profile-logic/src/supporting_types/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-factor-instances-provider/src/types/is_securified_entity.rs b/crates/sargon-profile-logic/src/supporting_types/is_securified_entity.rs similarity index 100% rename from crates/sargon-factor-instances-provider/src/types/is_securified_entity.rs rename to crates/sargon-profile-logic/src/supporting_types/is_securified_entity.rs diff --git a/crates/sargon-profile-logic/src/supporting_types/mod.rs b/crates/sargon-profile-logic/src/supporting_types/mod.rs new file mode 100644 index 000000000..9b0828c07 --- /dev/null +++ b/crates/sargon-profile-logic/src/supporting_types/mod.rs @@ -0,0 +1,17 @@ +mod abstract_securified_entity; +mod any_securified_entity; +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 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-factor-instances-provider/src/types/securified_account.rs b/crates/sargon-profile-logic/src/supporting_types/securified_account.rs similarity index 100% rename from crates/sargon-factor-instances-provider/src/types/securified_account.rs rename to crates/sargon-profile-logic/src/supporting_types/securified_account.rs diff --git a/crates/sargon-factor-instances-provider/src/types/securified_persona.rs b/crates/sargon-profile-logic/src/supporting_types/securified_persona.rs similarity index 100% rename from crates/sargon-factor-instances-provider/src/types/securified_persona.rs rename to crates/sargon-profile-logic/src/supporting_types/securified_persona.rs diff --git a/crates/sargon-factor-instances-provider/src/types/unsecurified_entity.rs b/crates/sargon-profile-logic/src/supporting_types/unsecurified_entity.rs similarity index 100% rename from crates/sargon-factor-instances-provider/src/types/unsecurified_entity.rs rename to crates/sargon-profile-logic/src/supporting_types/unsecurified_entity.rs diff --git a/crates/sargon-factor-instances-provider/src/types/veci.rs b/crates/sargon-profile-logic/src/supporting_types/veci.rs similarity index 100% rename from crates/sargon-factor-instances-provider/src/types/veci.rs rename to crates/sargon-profile-logic/src/supporting_types/veci.rs diff --git a/crates/sargon-profile/src/lib.rs b/crates/sargon-profile/src/lib.rs index 27997a943..e28fbead6 100644 --- a/crates/sargon-profile/src/lib.rs +++ b/crates/sargon-profile/src/lib.rs @@ -7,6 +7,7 @@ mod encrypted; mod mfa; mod profilesnapshot_version; +mod samples; mod supporting_types; mod v100; @@ -22,6 +23,7 @@ pub mod prelude { pub use crate::encrypted::*; pub use crate::mfa::*; pub use crate::profilesnapshot_version::*; + pub use crate::samples::*; pub use crate::supporting_types::*; pub use crate::v100::*; diff --git a/crates/sargon-profile/src/mfa/security_structures/matrices/matrix_of_factor_instances.rs b/crates/sargon-profile/src/mfa/security_structures/matrices/matrix_of_factor_instances.rs index 0a9b20cbf..46a75fa88 100644 --- a/crates/sargon-profile/src/mfa/security_structures/matrices/matrix_of_factor_instances.rs +++ b/crates/sargon-profile/src/mfa/security_structures/matrices/matrix_of_factor_instances.rs @@ -28,6 +28,68 @@ pub trait HasFactorInstances { fn unique_all_factor_instances(&self) -> IndexSet { self.unique_tx_signing_factor_instances() } + + fn assert_has_entity_kind( + &self, + entity_kind_of_entity: CAP26EntityKind, + ) -> Result<()> { + let entity_kind_of_factor_instances = + 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_entity.to_string(), entity_kind_of_factor_instances: entity_kind_of_factor_instances.to_string() }); + } + + Ok(()) + } + + fn entity_kind_of_all_factors(&self) -> Result { + let index_agnostic_path = + self.index_agnostic_path_of_all_tx_signing_factor_instances()?; + Ok(index_agnostic_path.entity_kind) + } + + fn index_agnostic_path_of_all_tx_signing_factor_instances( + &self, + ) -> Result { + let factors = self + .unique_tx_signing_factor_instances() + .into_iter() + .filter_map(|f| f.try_as_hd_factor_instances().ok()) + .collect_vec(); + + if factors.is_empty() { + return Err(CommonError::NoTransactionSigningFactorInstance); + } + + let index_agnostic_path = + factors.first().unwrap().derivation_path().agnostic(); + + if factors + .iter() + .any(|f| f.get_entity_kind() != index_agnostic_path.entity_kind) + { + return Err(CommonError::WrongEntityKindOfInFactorInstancesPath); + } + + if factors + .iter() + .any(|f| f.get_key_kind() != CAP26KeyKind::TransactionSigning) + { + return Err( + CommonError::WrongKeyKindOfTransactionSigningFactorInstance, + ); + } + + Ok(index_agnostic_path) + } + + /// 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| { + factor.factor_source_id == factor_source.factor_source_id() + }) + } } impl MatrixOfFactorInstances { 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 98% rename from crates/sargon/src/types/samples/account_samples.rs rename to crates/sargon-profile/src/samples/account_samples.rs index f50e37e77..4d862dfae 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(|| { [ diff --git a/crates/sargon/src/types/samples/general_role_with_hd_factor_instance_samples.rs b/crates/sargon-profile/src/samples/general_role_with_hd_factor_instance_samples.rs similarity index 100% rename from crates/sargon/src/types/samples/general_role_with_hd_factor_instance_samples.rs rename to crates/sargon-profile/src/samples/general_role_with_hd_factor_instance_samples.rs 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 100% rename from crates/sargon/src/types/samples/mod.rs rename to crates/sargon-profile/src/samples/mod.rs diff --git a/crates/sargon/src/types/samples/persona_samples.rs b/crates/sargon-profile/src/samples/persona_samples.rs similarity index 98% rename from crates/sargon/src/types/samples/persona_samples.rs rename to crates/sargon-profile/src/samples/persona_samples.rs index 13c172620..33be10e10 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.clone(), HierarchicalDeterministicPublicKey::new( self.public_key(), self.derivation_path().as_persona(), 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-factor-instances-provider/src/agnostic_paths/derivation_preset.rs b/crates/sargon-profile/src/supporting_types/agnostic_paths/derivation_preset.rs similarity index 100% rename from crates/sargon-factor-instances-provider/src/agnostic_paths/derivation_preset.rs rename to crates/sargon-profile/src/supporting_types/agnostic_paths/derivation_preset.rs diff --git a/crates/sargon-factor-instances-provider/src/agnostic_paths/index_agnostic_path.rs b/crates/sargon-profile/src/supporting_types/agnostic_paths/index_agnostic_path.rs similarity index 100% rename from crates/sargon-factor-instances-provider/src/agnostic_paths/index_agnostic_path.rs rename to crates/sargon-profile/src/supporting_types/agnostic_paths/index_agnostic_path.rs diff --git a/crates/sargon-factor-instances-provider/src/agnostic_paths/mod.rs b/crates/sargon-profile/src/supporting_types/agnostic_paths/mod.rs similarity index 100% rename from crates/sargon-factor-instances-provider/src/agnostic_paths/mod.rs rename to crates/sargon-profile/src/supporting_types/agnostic_paths/mod.rs diff --git a/crates/sargon-factor-instances-provider/src/agnostic_paths/quantified_derivation_preset.rs b/crates/sargon-profile/src/supporting_types/agnostic_paths/quantified_derivation_preset.rs similarity index 100% rename from crates/sargon-factor-instances-provider/src/agnostic_paths/quantified_derivation_preset.rs rename to crates/sargon-profile/src/supporting_types/agnostic_paths/quantified_derivation_preset.rs diff --git a/crates/sargon-factor-instances-provider/src/agnostic_paths/quantities.rs b/crates/sargon-profile/src/supporting_types/agnostic_paths/quantities.rs similarity index 100% rename from crates/sargon-factor-instances-provider/src/agnostic_paths/quantities.rs rename to crates/sargon-profile/src/supporting_types/agnostic_paths/quantities.rs diff --git a/crates/sargon-profile/src/supporting_types/mod.rs b/crates/sargon-profile/src/supporting_types/mod.rs index a2da50a39..98a1bc241 100644 --- a/crates/sargon-profile/src/supporting_types/mod.rs +++ b/crates/sargon-profile/src/supporting_types/mod.rs @@ -6,7 +6,9 @@ mod authorized_dapp_detailed; mod authorized_persona_detailed; mod detailed_authorized_personas; mod on_same_network_validating; +mod agnostic_paths; +pub use agnostic_paths::*; pub use account_for_display::*; pub use account_or_persona::*; pub use accounts_for_display::*; diff --git a/crates/sargon-profile/src/v100/app_preferences/gateways/saved_gateways.rs b/crates/sargon-profile/src/v100/app_preferences/gateways/saved_gateways.rs index 427e225e8..abd442eb3 100644 --- a/crates/sargon-profile/src/v100/app_preferences/gateways/saved_gateways.rs +++ b/crates/sargon-profile/src/v100/app_preferences/gateways/saved_gateways.rs @@ -163,22 +163,7 @@ 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() { @@ -188,17 +173,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 +218,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/src/v100/networks/network/authorized_dapp/authorized_dapp.rs b/crates/sargon-profile/src/v100/networks/network/authorized_dapp/authorized_dapp.rs index 49bd58589..9c8036cba 100644 --- a/crates/sargon-profile/src/v100/networks/network/authorized_dapp/authorized_dapp.rs +++ b/crates/sargon-profile/src/v100/networks/network/authorized_dapp/authorized_dapp.rs @@ -40,18 +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 { diff --git a/crates/sargon-profile/src/v100/networks/network/authorized_dapp/authorized_persona_simple.rs b/crates/sargon-profile/src/v100/networks/network/authorized_dapp/authorized_persona_simple.rs index d8a611588..8a1e5e0b3 100644 --- a/crates/sargon-profile/src/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-profile/src/v100/networks/network/authorized_dapps.rs b/crates/sargon-profile/src/v100/networks/network/authorized_dapps.rs index 407423ec3..0d7f303d5 100644 --- a/crates/sargon-profile/src/v100/networks/network/authorized_dapps.rs +++ b/crates/sargon-profile/src/v100/networks/network/authorized_dapps.rs @@ -5,18 +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. diff --git a/crates/sargon-profile/src/v100/networks/network/profile_network.rs b/crates/sargon-profile/src/v100/networks/network/profile_network.rs index dc0551206..2ca38157c 100644 --- a/crates/sargon-profile/src/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-profile/src/v100/networks/profile_networks.rs b/crates/sargon-profile/src/v100/networks/profile_networks.rs index b54e37420..fc5454572 100644 --- a/crates/sargon-profile/src/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,77 +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() { diff --git a/crates/sargon-profile/src/v100/profile.rs b/crates/sargon-profile/src/v100/profile.rs index 2a1eab412..418b0c1bb 100644 --- a/crates/sargon-profile/src/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-profile/src/v100/profile_legacy_state_bugs.rs b/crates/sargon-profile/src/v100/profile_legacy_state_bugs.rs index 2744c4fde..3616db216 100644 --- a/crates/sargon-profile/src/v100/profile_legacy_state_bugs.rs +++ b/crates/sargon-profile/src/v100/profile_legacy_state_bugs.rs @@ -1,28 +1 @@ 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); - } -} diff --git a/crates/sargon/src/lib.rs b/crates/sargon/src/lib.rs index 080ba4d28..1769b897d 100644 --- a/crates/sargon/src/lib.rs +++ b/crates/sargon/src/lib.rs @@ -13,6 +13,7 @@ mod gateway_api; mod home_cards; +mod needs_a_new_home_dumping_ground; mod radix_connect; mod security_center; mod signing; @@ -33,6 +34,7 @@ pub mod prelude { pub use crate::gateway_api::*; pub use crate::home_cards::*; + pub use crate::needs_a_new_home_dumping_ground::*; pub use crate::radix_connect::*; pub use crate::security_center::*; pub use crate::signing::*; diff --git a/crates/sargon-profile-logic/src/logic/diagnose_instance_duplicates.rs b/crates/sargon/src/needs_a_new_home_dumping_ground/diagnose_instance_duplicates.rs similarity index 99% rename from crates/sargon-profile-logic/src/logic/diagnose_instance_duplicates.rs rename to crates/sargon/src/needs_a_new_home_dumping_ground/diagnose_instance_duplicates.rs index 7bc2b1e70..8acbb4d76 100644 --- a/crates/sargon-profile-logic/src/logic/diagnose_instance_duplicates.rs +++ b/crates/sargon/src/needs_a_new_home_dumping_ground/diagnose_instance_duplicates.rs @@ -1,3 +1,5 @@ +use crate::prelude::*; + #[cfg(test)] fn with_android_bug_with_shared_pubkey_between_account_and_persona() -> Profile { 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..d8a9e9fd9 --- /dev/null +++ b/crates/sargon/src/needs_a_new_home_dumping_ground/mod.rs @@ -0,0 +1,3 @@ +mod diagnose_instance_duplicates; + +pub use diagnose_instance_duplicates::*; \ No newline at end of file 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..3894044cd --- /dev/null +++ b/crates/sargon/src/system/sargon_os/entity_creating_with_factor_source_and_derivation_outcome.rs @@ -0,0 +1,343 @@ +use crate::prelude::*; +use std::{future::Future, pin::Pin}; + +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( + &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_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, + )) + } + + 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 { + /// 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/system/sargon_os/mod.rs b/crates/sargon/src/system/sargon_os/mod.rs index 70aa35a50..88282c377 100644 --- a/crates/sargon/src/system/sargon_os/mod.rs +++ b/crates/sargon/src/system/sargon_os/mod.rs @@ -2,6 +2,7 @@ mod delete_account; mod pre_authorization; mod profile_state_holder; mod sargon_os; +mod entity_creating_with_factor_source_and_derivation_outcome; mod sargon_os_accounts; mod sargon_os_entities_linked_to_factor_source; mod sargon_os_factors; @@ -14,6 +15,7 @@ mod sargon_os_signing; mod sargon_os_sync_accounts; mod transactions; +pub use entity_creating_with_factor_source_and_derivation_outcome::*; pub use delete_account::*; pub use pre_authorization::*; pub use profile_state_holder::*; From abb8924aa32a415c0a63742584700a26beda1259 Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Tue, 31 Dec 2024 16:00:06 +0100 Subject: [PATCH 04/23] wip --- Cargo.lock | 132 ++ Cargo.toml | 3 + crates/gateway-models/Cargo.toml | 1 + .../account/page/authorized_depositor.rs | 45 + .../state/account/page/resource_preference.rs | 15 + crates/sargon-clients/Cargo.toml | 54 + .../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 .../client/factor_instances_cache_client.rs | 0 .../file_system_client/file_system_client.rs | 0 .../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/client/http_client/http_client.rs | 0 .../src}/clients/client/http_client/mod.rs | 0 .../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 .../src}/clients/clients.rs | 0 .../src}/clients/mod.rs | 0 crates/sargon-clients/src/lib.rs | 9 + crates/sargon-drivers/Cargo.toml | 54 + .../src}/drivers/README.md | 0 .../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 | 0 .../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 | 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 | 0 .../support/network_method.rs | 0 .../support/network_request.rs | 0 .../support/network_response.rs | 0 .../support/test/mock_networking_driver.rs | 0 .../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 .../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 crates/sargon-drivers/src/lib.rs | 9 + .../Cargo.toml | 3 + .../src/lib.rs | 4 + .../src/provider/factor_instances_provider.rs | 1 - .../src/provider/mod.rs | 3 - crates/sargon-manifests/Cargo.toml | 1 + .../transaction/create_3_nft_collections.rtm | 1506 +++++++++++++++++ .../create_access_controller_for_account.rtm | 98 ++ .../create_access_controller_for_persona.rtm | 92 + .../per_recipient_asset_transfers.rs | 35 +- crates/sargon-manifests/src/lib.rs | 4 + .../src/manifest_assets_transfers.rs | 17 +- crates/sargon-manifests/src/manifests.rs | 109 +- .../src/manifests_access_controller.rs | 13 +- .../src/manifests_create_tokens.rs | 117 +- .../sargon-manifests/src/modify_manifest.rs | 61 +- .../manifest_third_party_deposit_update.rs | 17 +- crates/sargon-profile-logic/Cargo.toml | 4 +- crates/sargon-profile-logic/src/lib.rs | 5 +- .../src/logic/account/query_accounts.rs | 63 + .../account/query_security_structures.rs | 20 +- .../src/logic/persona/persona_data_ids.rs | 8 +- .../src/logic/persona/query_personas.rs | 53 - .../logic/persona/shared_persona_data_ids.rs | 8 +- .../profile_network_details.rs | 35 +- ...etwork_entities_linked_to_factor_source.rs | 12 +- .../profile_network_get_entities.rs | 83 +- .../src/supporting_types/mod.rs | 17 - ...trix_of_factor_instances_index_agnostic.rs | 2 + .../Cargo.toml | 31 + .../src}/abstract_securified_entity.rs | 0 .../src}/any_securified_entity.rs | 0 .../src}/assert_derivation_path.rs | 0 .../src}/is_securified_entity.rs | 0 .../src/lib.rs | 25 + .../src}/securified_account.rs | 0 .../src}/securified_persona.rs | 0 .../src}/unsecurified_entity.rs | 0 .../src}/veci.rs | 0 .../abstract_security_structure_of_factors.rs | 3 +- .../transaction_manifest.rs | 4 +- crates/sargon/Cargo.toml | 1 + crates/sargon/src/lib.rs | 1 + .../sargon_os_delete_account.rs | 48 - .../factor_instances_provider_unit_tests.rs | 0 crates/sargon/src/system/sargon_os/mod.rs | 7 +- 138 files changed, 2525 insertions(+), 308 deletions(-) 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/system => sargon-clients/src}/clients/client/factor_instances_cache_client.rs (100%) rename crates/{sargon/src/system => sargon-clients/src}/clients/client/file_system_client/file_system_client.rs (100%) 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 (100%) 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/http_client/http_client.rs (100%) rename crates/{sargon/src/system => sargon-clients/src}/clients/client/http_client/mod.rs (100%) rename crates/{sargon/src/system => sargon-clients/src}/clients/client/mod.rs (100%) 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 (100%) 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 (100%) rename crates/{sargon/src/system => sargon-clients/src}/clients/mod.rs (100%) create mode 100644 crates/sargon-clients/src/lib.rs 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 (100%) 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 (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/event_bus_driver/support/event_kind.rs (100%) 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 (100%) 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 (100%) 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 (100%) 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 (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/networking_driver/support/test/mod.rs (100%) 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 (100%) 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 (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/secure_storage_driver/support/test/ephemeral_secure_storage.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/secure_storage_driver/support/test/fail_secure_storage.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/secure_storage_driver/support/test/mod.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/unsafe_storage_driver/mod.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/unsafe_storage_driver/support/mod.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/unsafe_storage_driver/support/test/ephemeral_unsafe_storage.rs (100%) rename crates/{sargon/src/system => sargon-drivers/src}/drivers/unsafe_storage_driver/support/test/mod.rs (100%) 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-manifests/fixtures/transaction/create_3_nft_collections.rtm create mode 100644 crates/sargon-manifests/fixtures/transaction/create_access_controller_for_account.rtm create mode 100644 crates/sargon-manifests/fixtures/transaction/create_access_controller_for_persona.rtm delete mode 100644 crates/sargon-profile-logic/src/supporting_types/mod.rs create mode 100644 crates/sargon-profile-supporting-types/Cargo.toml rename crates/{sargon-profile-logic/src/supporting_types => sargon-profile-supporting-types/src}/abstract_securified_entity.rs (100%) rename crates/{sargon-profile-logic/src/supporting_types => sargon-profile-supporting-types/src}/any_securified_entity.rs (100%) rename crates/{sargon-profile-logic/src/supporting_types => sargon-profile-supporting-types/src}/assert_derivation_path.rs (100%) rename crates/{sargon-profile-logic/src/supporting_types => sargon-profile-supporting-types/src}/is_securified_entity.rs (100%) create mode 100644 crates/sargon-profile-supporting-types/src/lib.rs rename crates/{sargon-profile-logic/src/supporting_types => sargon-profile-supporting-types/src}/securified_account.rs (100%) rename crates/{sargon-profile-logic/src/supporting_types => sargon-profile-supporting-types/src}/securified_persona.rs (100%) rename crates/{sargon-profile-logic/src/supporting_types => sargon-profile-supporting-types/src}/unsecurified_entity.rs (100%) rename crates/{sargon-profile-logic/src/supporting_types => sargon-profile-supporting-types/src}/veci.rs (100%) rename crates/{sargon-factor-instances-provider/src/provider => sargon/src/system/sargon_os}/factor_instances_provider_unit_tests.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 1277cb863..d4a52ad11 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1318,6 +1318,7 @@ name = "gateway-models" version = "1.2.1" dependencies = [ "derive_more", + "radix-engine-interface", "radix-engine-toolkit-common", "radix-transactions", "sargon-addresses", @@ -2832,6 +2833,7 @@ dependencies = [ "rand", "reqwest", "sargon-addresses", + "sargon-clients", "sargon-core", "sargon-factor-instances-provider", "sargon-factors", @@ -2876,6 +2878,55 @@ dependencies = [ "serde_with 3.4.0", ] +[[package]] +name = "sargon-clients" +version = "1.2.1" +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", + "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-drivers", + "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" @@ -2952,6 +3003,55 @@ dependencies = [ "uuid 1.6.1", ] +[[package]] +name = "sargon-drivers" +version = "1.2.1" +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", + "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", + "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.2.1" @@ -2963,6 +3063,7 @@ dependencies = [ "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", @@ -2979,6 +3080,7 @@ dependencies = [ "radix-transactions", "rand", "sargon-addresses", + "sargon-clients", "sargon-core", "sargon-core-assert-json", "sargon-core-error", @@ -2987,6 +3089,7 @@ dependencies = [ "sargon-hierarchical-deterministic", "sargon-keys-collector", "sargon-profile", + "sargon-profile-supporting-types", "serde", "serde_json 1.0.108", "serde_repr", @@ -3123,6 +3226,7 @@ dependencies = [ "rand", "sargon-addresses", "sargon-core", + "sargon-core-utils", "sargon-factors", "sargon-hierarchical-deterministic", "sargon-profile", @@ -3203,6 +3307,34 @@ 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-supporting-types" +version = "1.2.1" +dependencies = [ + "derive_more", + "identified-vec-of", + "itertools 0.12.0", + "pretty_assertions", "radix-common", "radix-common-derive", "radix-engine", diff --git a/Cargo.toml b/Cargo.toml index d1f75d68c..f56487548 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,9 @@ members = [ "crates/sargon-keys-collector", "crates/sargon-transaction-models", "crates/sargon-manifests", + "crates/sargon-profile-supporting-types", + "crates/sargon-drivers", + "crates/sargon-clients", "crates/sargon-profile", "crates/sargon-profile-logic", "crates/sargon-factor-instances-provider", diff --git a/crates/gateway-models/Cargo.toml b/crates/gateway-models/Cargo.toml index 25b9d87a3..80d3c3be1 100644 --- a/crates/gateway-models/Cargo.toml +++ b/crates/gateway-models/Cargo.toml @@ -13,6 +13,7 @@ sargon-addresses = { path = "../sargon-addresses" } # === RADIX DEPENDENCIES === radix-engine-toolkit-common = { workspace = true } radix-transactions = { workspace = true } +radix-engine-interface = { workspace = true } # === EXTERNAL DEPENDENCIES === derive_more = { workspace = true } 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 index 17631a051..dbf17b4ac 100644 --- 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 @@ -1,5 +1,10 @@ use crate::prelude::*; +use radix_engine_interface::blueprints::account::{ + AccountRemoveAuthorizedDepositorInput as ScryptoAccountRemoveAuthorizedDepositorInput, + AccountRemoveResourcePreferenceInput as ScryptoAccountRemoveResourcePreferenceInput, +}; + #[derive(Deserialize, Serialize, Clone, PartialEq, Eq, Debug)] #[serde(tag = "badge_type")] pub enum AccountAuthorizedDepositor { @@ -12,6 +17,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/gateway-models/src/types/response/state/account/page/resource_preference.rs b/crates/gateway-models/src/types/response/state/account/page/resource_preference.rs index 9943146b7..649f51b72 100644 --- 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 @@ -1,5 +1,10 @@ use crate::prelude::*; +use radix_engine_interface::blueprints::account::{ + AccountRemoveAuthorizedDepositorInput as ScryptoAccountRemoveAuthorizedDepositorInput, + AccountRemoveResourcePreferenceInput as ScryptoAccountRemoveResourcePreferenceInput, +}; + #[derive(Deserialize, Serialize, Clone, PartialEq, Eq, Debug)] pub struct AccountResourcePreference { pub resource_address: ResourceAddress, @@ -7,6 +12,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-clients/Cargo.toml b/crates/sargon-clients/Cargo.toml new file mode 100644 index 000000000..22b48a9ff --- /dev/null +++ b/crates/sargon-clients/Cargo.toml @@ -0,0 +1,54 @@ +[package] +name = "sargon-clients" +version = "1.2.1" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +sargon-drivers = { path = "../sargon-drivers" } + +# === 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 } \ No newline at end of file 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/system/clients/client/factor_instances_cache_client.rs b/crates/sargon-clients/src/clients/client/factor_instances_cache_client.rs similarity index 100% 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.rs 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 100% 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 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 100% 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 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/http_client/http_client.rs b/crates/sargon-clients/src/clients/client/http_client/http_client.rs similarity index 100% rename from crates/sargon/src/system/clients/client/http_client/http_client.rs rename to crates/sargon-clients/src/clients/client/http_client/http_client.rs diff --git a/crates/sargon/src/system/clients/client/http_client/mod.rs b/crates/sargon-clients/src/clients/client/http_client/mod.rs similarity index 100% rename from crates/sargon/src/system/clients/client/http_client/mod.rs rename to crates/sargon-clients/src/clients/client/http_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 100% rename from crates/sargon/src/system/clients/client/mod.rs rename to crates/sargon-clients/src/clients/client/mod.rs 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 100% 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 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 100% rename from crates/sargon/src/system/clients/clients.rs rename to crates/sargon-clients/src/clients/clients.rs 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..0d63103c7 --- /dev/null +++ b/crates/sargon-clients/src/lib.rs @@ -0,0 +1,9 @@ +mod clients; + +pub mod prelude { + pub use sargon_drivers::prelude::*; + + pub use crate::clients::*; +} + +pub use prelude::*; diff --git a/crates/sargon-drivers/Cargo.toml b/crates/sargon-drivers/Cargo.toml new file mode 100644 index 000000000..106b2a0eb --- /dev/null +++ b/crates/sargon-drivers/Cargo.toml @@ -0,0 +1,54 @@ +[package] +name = "sargon-drivers" +version = "1.2.1" +edition = "2021" + +[dependencies] +# === SARGON CRATES === +sargon-core = { path = "../sargon-core" } + +# === 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 } \ No newline at end of file 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 100% rename from crates/sargon/src/system/drivers/drivers.rs rename to crates/sargon-drivers/src/drivers/drivers.rs 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 100% 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 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 100% 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 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 100% 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 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 100% 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 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 100% rename from crates/sargon/src/system/drivers/networking_driver/support/mod.rs rename to crates/sargon-drivers/src/drivers/networking_driver/support/mod.rs 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 100% 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 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 100% 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 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 100% 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 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 100% 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 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 100% 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 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 100% 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 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 100% 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 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/mod.rs b/crates/sargon-drivers/src/drivers/unsafe_storage_driver/support/mod.rs similarity index 100% rename from crates/sargon/src/system/drivers/unsafe_storage_driver/support/mod.rs rename to crates/sargon-drivers/src/drivers/unsafe_storage_driver/support/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/test/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/test/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/test/mod.rs similarity index 100% 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/test/mod.rs 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..c6de44d88 --- /dev/null +++ b/crates/sargon-drivers/src/lib.rs @@ -0,0 +1,9 @@ +mod drivers; + +pub mod prelude { + pub(crate) use sargon_core::prelude::*; + + pub use crate::drivers::*; +} + +pub use prelude::*; diff --git a/crates/sargon-factor-instances-provider/Cargo.toml b/crates/sargon-factor-instances-provider/Cargo.toml index 564eefa14..4f19c590a 100644 --- a/crates/sargon-factor-instances-provider/Cargo.toml +++ b/crates/sargon-factor-instances-provider/Cargo.toml @@ -15,6 +15,8 @@ sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-determinist sargon-keys-collector = { path = "../sargon-keys-collector" } sargon-addresses = { path = "../sargon-addresses" } sargon-profile = { path = "../sargon-profile" } +sargon-clients = { path = "../sargon-clients" } +sargon-profile-supporting-types = { path = "../sargon-profile-supporting-types" } # ==== RADIX DEPENDENCIES ==== radix-common = { workspace = true } @@ -30,6 +32,7 @@ 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 } diff --git a/crates/sargon-factor-instances-provider/src/lib.rs b/crates/sargon-factor-instances-provider/src/lib.rs index 280fbc09d..d96da67dd 100644 --- a/crates/sargon-factor-instances-provider/src/lib.rs +++ b/crates/sargon-factor-instances-provider/src/lib.rs @@ -6,14 +6,18 @@ 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_core::prelude::*; pub(crate) use sargon_factors::prelude::*; pub(crate) use sargon_hierarchical_deterministic::prelude::*; pub(crate) use sargon_keys_collector::prelude::*; pub(crate) use sargon_profile::prelude::*; + pub(crate) use sargon_profile_supporting_types::prelude::*; pub use crate::factor_instances_cache::*; pub use crate::next_index_assigner::*; pub use crate::provider::*; pub use crate::types::*; } + +pub use prelude::*; diff --git a/crates/sargon-factor-instances-provider/src/provider/factor_instances_provider.rs b/crates/sargon-factor-instances-provider/src/provider/factor_instances_provider.rs index 47e6f9195..d6502dad8 100644 --- a/crates/sargon-factor-instances-provider/src/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-factor-instances-provider/src/provider/mod.rs b/crates/sargon-factor-instances-provider/src/provider/mod.rs index 56fd8aa8a..0e5b42020 100644 --- a/crates/sargon-factor-instances-provider/src/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-manifests/Cargo.toml b/crates/sargon-manifests/Cargo.toml index 2aa4ba27d..d56021b36 100644 --- a/crates/sargon-manifests/Cargo.toml +++ b/crates/sargon-manifests/Cargo.toml @@ -7,6 +7,7 @@ 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" } diff --git a/crates/sargon-manifests/fixtures/transaction/create_3_nft_collections.rtm b/crates/sargon-manifests/fixtures/transaction/create_3_nft_collections.rtm new file mode 100644 index 000000000..bc0c04ddf --- /dev/null +++ b/crates/sargon-manifests/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-manifests/fixtures/transaction/create_access_controller_for_account.rtm b/crates/sargon-manifests/fixtures/transaction/create_access_controller_for_account.rtm new file mode 100644 index 000000000..feecabe59 --- /dev/null +++ b/crates/sargon-manifests/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-manifests/fixtures/transaction/create_access_controller_for_persona.rtm b/crates/sargon-manifests/fixtures/transaction/create_access_controller_for_persona.rtm new file mode 100644 index 000000000..c4809655d --- /dev/null +++ b/crates/sargon-manifests/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-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 7058f9f37..0c6378cb5 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 @@ -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-manifests/src/lib.rs b/crates/sargon-manifests/src/lib.rs index 9afd3ea99..f198e0814 100644 --- a/crates/sargon-manifests/src/lib.rs +++ b/crates/sargon-manifests/src/lib.rs @@ -14,7 +14,9 @@ pub mod prelude { pub use gateway_models::prelude::*; pub use identified_vec_of::prelude::*; pub use sargon_addresses::prelude::*; + pub use sargon_addresses::prelude::*; pub use sargon_core::prelude::*; + pub use sargon_core_utils::prelude::*; pub use sargon_factors::prelude::*; pub use sargon_hierarchical_deterministic::prelude::*; pub use sargon_profile::prelude::*; @@ -32,6 +34,8 @@ pub mod prelude { pub use crate::modify_manifest::*; pub use crate::third_party_deposit_update::*; + pub use std::str::FromStr; + pub(crate) use radix_engine::{ blueprints::consensus_manager::UnstakeData as ScryptoUnstakeData, system::system_modules::execution_trace::ResourceSpecifier as ScryptoResourceSpecifier, diff --git a/crates/sargon-manifests/src/manifest_assets_transfers.rs b/crates/sargon-manifests/src/manifest_assets_transfers.rs index 9c1f10acb..7fdd463b1 100644 --- a/crates/sargon-manifests/src/manifest_assets_transfers.rs +++ b/crates/sargon-manifests/src/manifest_assets_transfers.rs @@ -1,17 +1,22 @@ 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 +94,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-manifests/src/manifests.rs b/crates/sargon-manifests/src/manifests.rs index 3c2c04596..04cc2a874 100644 --- a/crates/sargon-manifests/src/manifests.rs +++ b/crates/sargon-manifests/src/manifests.rs @@ -1,10 +1,17 @@ use crate::prelude::*; -impl TransactionManifest { - pub fn faucet( +pub trait TransactionManifestFaucet: Sized { + fn faucet( include_lock_fee_instruction: bool, address_of_receiving_account: &AccountAddress, - ) -> Self { + ) -> TransactionManifest; +} + +impl TransactionManifestFaucet for TransactionManifest { + fn faucet( + include_lock_fee_instruction: bool, + address_of_receiving_account: &AccountAddress, + ) -> TransactionManifest { let mut builder = ScryptoTransactionManifestBuilder::new(); if include_lock_fee_instruction { @@ -23,10 +30,32 @@ impl TransactionManifest { address_of_receiving_account.network_id(), ) } +} - pub fn marking_account_as_dapp_definition_type( +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) + } + + fn marking_account_as_dapp_definition_type( account_address: &AccountAddress, - ) -> Self { + ) -> TransactionManifest { Self::set_metadata( account_address, MetadataKey::AccountType, @@ -34,10 +63,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 +78,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 +108,39 @@ impl TransactionManifest { .map(ScryptoNonFungibleLocalId::from), ) } +} + +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; +} - pub fn stake_claims( +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 +191,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-manifests/src/manifests_access_controller.rs b/crates/sargon-manifests/src/manifests_access_controller.rs index 54a0dee25..86e8a9143 100644 --- a/crates/sargon-manifests/src/manifests_access_controller.rs +++ b/crates/sargon-manifests/src/manifests_access_controller.rs @@ -2,11 +2,16 @@ use radix_engine_interface::blueprints::access_controller::AccessControllerCreat 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-manifests/src/manifests_create_tokens.rs b/crates/sargon-manifests/src/manifests_create_tokens.rs index eeb3fd195..2c24bd2ce 100644 --- a/crates/sargon-manifests/src/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/"; diff --git a/crates/sargon-manifests/src/modify_manifest.rs b/crates/sargon-manifests/src/modify_manifest.rs index 3e8e1e48e..e0e8fbd5e 100644 --- a/crates/sargon-manifests/src/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, diff --git a/crates/sargon-manifests/src/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 index 938169401..b0c92cc7e 100644 --- a/crates/sargon-manifests/src/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-profile-logic/Cargo.toml b/crates/sargon-profile-logic/Cargo.toml index dfaca3e85..2cd3925c4 100644 --- a/crates/sargon-profile-logic/Cargo.toml +++ b/crates/sargon-profile-logic/Cargo.toml @@ -11,6 +11,7 @@ sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-determinist 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 } @@ -25,6 +26,7 @@ sbor = { workspace = true } # === EXTERNAL DEPENDENCIES === derive_more = { workspace = true } -itertools = { 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 index 0e566e75c..fd9201baf 100644 --- a/crates/sargon-profile-logic/src/lib.rs +++ b/crates/sargon-profile-logic/src/lib.rs @@ -1,14 +1,13 @@ mod logic; -mod supporting_types; mod tests; pub mod prelude { pub use crate::logic::*; - pub use crate::supporting_types::*; pub use sargon_profile::prelude::*; + pub use sargon_profile_supporting_types::prelude::*; - pub use itertools::Itertools; + pub use itertools::*; } pub use prelude::*; diff --git a/crates/sargon-profile-logic/src/logic/account/query_accounts.rs b/crates/sargon-profile-logic/src/logic/account/query_accounts.rs index 0a49bb8c1..ea05aaabc 100644 --- a/crates/sargon-profile-logic/src/logic/account/query_accounts.rs +++ b/crates/sargon-profile-logic/src/logic/account/query_accounts.rs @@ -121,9 +121,72 @@ pub trait ProfileEntitiesOfKindOnNetworkInKeySpace { ) -> 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, diff --git a/crates/sargon-profile-logic/src/logic/account/query_security_structures.rs b/crates/sargon-profile-logic/src/logic/account/query_security_structures.rs index 04b96c3d7..363d32585 100644 --- a/crates/sargon-profile-logic/src/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/persona/persona_data_ids.rs b/crates/sargon-profile-logic/src/logic/persona/persona_data_ids.rs index 1a69b0be8..88f8899b4 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 @@ -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-profile-logic/src/logic/persona/query_personas.rs b/crates/sargon-profile-logic/src/logic/persona/query_personas.rs index 209c8d707..4ed4395f7 100644 --- a/crates/sargon-profile-logic/src/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-profile-logic/src/logic/persona/shared_persona_data_ids.rs b/crates/sargon-profile-logic/src/logic/persona/shared_persona_data_ids.rs index 79fa17eab..a2c45d83f 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,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-profile-logic/src/logic/profile_network/profile_network_details.rs b/crates/sargon-profile-logic/src/logic/profile_network/profile_network_details.rs index ff40b9aa0..f98154353 100644 --- a/crates/sargon-profile-logic/src/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-profile-logic/src/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 index 974174be0..364050f89 100644 --- a/crates/sargon-profile-logic/src/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-profile-logic/src/logic/profile_network/profile_network_get_entities.rs b/crates/sargon-profile-logic/src/logic/profile_network/profile_network_get_entities.rs index 844d3889b..449ceb6dd 100644 --- a/crates/sargon-profile-logic/src/logic/profile_network/profile_network_get_entities.rs +++ b/crates/sargon-profile-logic/src/logic/profile_network/profile_network_get_entities.rs @@ -1,23 +1,65 @@ use crate::prelude::*; -impl ProfileNetwork { - pub fn accounts_non_hidden(&self) -> Accounts { +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; + + fn get_entities_of_kind_in_key_space( + &self, + entity_kind: CAP26EntityKind, + key_space: KeySpace, + ) -> IndexSet { + self.get_entities_erased(entity_kind) + .into_iter() + .filter(|e| e.matches_key_space(key_space)) + .collect() + } + + fn entity_by_address( + &self, + entity_address: &AddressOfAccountOrPersona, + ) -> Option { + let entities = self + .get_entities_erased(entity_address.get_entity_kind()) + .into_iter() + .filter(|e| e.address() == *entity_address) + .collect_vec(); + assert!(entities.len() <= 1); + entities.first().cloned() + } + + fn contains_entity_by_address( + &self, + entity_address: &AddressOfAccountOrPersona, + ) -> bool { + self.entity_by_address(entity_address).is_some() + } +} + +impl ProfileNetworkEntitiesQuerying for ProfileNetwork { + fn accounts_non_hidden(&self) -> Accounts { self.accounts.visible() } - pub fn accounts_hidden(&self) -> Accounts { + fn accounts_hidden(&self) -> Accounts { self.accounts.hidden() } - pub fn personas_non_hidden(&self) -> Personas { + fn personas_non_hidden(&self) -> Personas { self.personas.non_hidden() } - pub fn personas_hidden(&self) -> Personas { + fn personas_hidden(&self) -> Personas { self.personas.hidden() } - pub fn get_entities_erased( + fn get_entities_erased( &self, entity_kind: CAP26EntityKind, ) -> IndexSet { @@ -37,36 +79,9 @@ impl ProfileNetwork { } } - pub fn get_entities_of_kind_in_key_space( - &self, - entity_kind: CAP26EntityKind, - key_space: KeySpace, - ) -> IndexSet { - self.get_entities_erased(entity_kind) - .into_iter() - .filter(|e| e.matches_key_space(key_space)) - .collect() - } - pub fn entity_by_address( - &self, - entity_address: &AddressOfAccountOrPersona, - ) -> Option { - let entities = self - .get_entities_erased(entity_address.get_entity_kind()) - .into_iter() - .filter(|e| e.address() == *entity_address) - .collect_vec(); - assert!(entities.len() <= 1); - entities.first().cloned() - } - pub fn contains_entity_by_address( - &self, - entity_address: &AddressOfAccountOrPersona, - ) -> bool { - self.entity_by_address(entity_address).is_some() - } + } #[cfg(test)] diff --git a/crates/sargon-profile-logic/src/supporting_types/mod.rs b/crates/sargon-profile-logic/src/supporting_types/mod.rs deleted file mode 100644 index 9b0828c07..000000000 --- a/crates/sargon-profile-logic/src/supporting_types/mod.rs +++ /dev/null @@ -1,17 +0,0 @@ -mod abstract_securified_entity; -mod any_securified_entity; -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 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-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 index acf89b9a4..126e6bc3a 100644 --- 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 @@ -2,6 +2,8 @@ use crate::prelude::*; +type SUT = MatrixOfFactorInstances; + #[test] fn wrong_entity_kind() { let invalid = unsafe { diff --git a/crates/sargon-profile-supporting-types/Cargo.toml b/crates/sargon-profile-supporting-types/Cargo.toml new file mode 100644 index 000000000..d94b2dd09 --- /dev/null +++ b/crates/sargon-profile-supporting-types/Cargo.toml @@ -0,0 +1,31 @@ +[package] +name = "sargon-profile-supporting-types" +version = "1.2.1" +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-profile-logic/src/supporting_types/abstract_securified_entity.rs b/crates/sargon-profile-supporting-types/src/abstract_securified_entity.rs similarity index 100% rename from crates/sargon-profile-logic/src/supporting_types/abstract_securified_entity.rs rename to crates/sargon-profile-supporting-types/src/abstract_securified_entity.rs diff --git a/crates/sargon-profile-logic/src/supporting_types/any_securified_entity.rs b/crates/sargon-profile-supporting-types/src/any_securified_entity.rs similarity index 100% rename from crates/sargon-profile-logic/src/supporting_types/any_securified_entity.rs rename to crates/sargon-profile-supporting-types/src/any_securified_entity.rs diff --git a/crates/sargon-profile-logic/src/supporting_types/assert_derivation_path.rs b/crates/sargon-profile-supporting-types/src/assert_derivation_path.rs similarity index 100% rename from crates/sargon-profile-logic/src/supporting_types/assert_derivation_path.rs rename to crates/sargon-profile-supporting-types/src/assert_derivation_path.rs diff --git a/crates/sargon-profile-logic/src/supporting_types/is_securified_entity.rs b/crates/sargon-profile-supporting-types/src/is_securified_entity.rs similarity index 100% rename from crates/sargon-profile-logic/src/supporting_types/is_securified_entity.rs rename to crates/sargon-profile-supporting-types/src/is_securified_entity.rs 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..3f31765ec --- /dev/null +++ b/crates/sargon-profile-supporting-types/src/lib.rs @@ -0,0 +1,25 @@ +mod abstract_securified_entity; +mod any_securified_entity; +mod assert_derivation_path; +mod is_securified_entity; +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::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-logic/src/supporting_types/securified_account.rs b/crates/sargon-profile-supporting-types/src/securified_account.rs similarity index 100% rename from crates/sargon-profile-logic/src/supporting_types/securified_account.rs rename to crates/sargon-profile-supporting-types/src/securified_account.rs diff --git a/crates/sargon-profile-logic/src/supporting_types/securified_persona.rs b/crates/sargon-profile-supporting-types/src/securified_persona.rs similarity index 100% rename from crates/sargon-profile-logic/src/supporting_types/securified_persona.rs rename to crates/sargon-profile-supporting-types/src/securified_persona.rs diff --git a/crates/sargon-profile-logic/src/supporting_types/unsecurified_entity.rs b/crates/sargon-profile-supporting-types/src/unsecurified_entity.rs similarity index 100% rename from crates/sargon-profile-logic/src/supporting_types/unsecurified_entity.rs rename to crates/sargon-profile-supporting-types/src/unsecurified_entity.rs diff --git a/crates/sargon-profile-logic/src/supporting_types/veci.rs b/crates/sargon-profile-supporting-types/src/veci.rs similarity index 100% rename from crates/sargon-profile-logic/src/supporting_types/veci.rs rename to crates/sargon-profile-supporting-types/src/veci.rs diff --git a/crates/sargon-profile/src/mfa/security_structures/security_structure_of_factors/abstract_security_structure_of_factors.rs b/crates/sargon-profile/src/mfa/security_structures/security_structure_of_factors/abstract_security_structure_of_factors.rs index 5e4ff10fb..e0a82ad52 100644 --- a/crates/sargon-profile/src/mfa/security_structures/security_structure_of_factors/abstract_security_structure_of_factors.rs +++ b/crates/sargon-profile/src/mfa/security_structures/security_structure_of_factors/abstract_security_structure_of_factors.rs @@ -1,7 +1,8 @@ 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-transaction-models/src/low_level/v1/transaction_manifest/transaction_manifest.rs b/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/transaction_manifest.rs index 8b66a77b9..a3640313c 100644 --- a/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/transaction_manifest.rs +++ b/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/transaction_manifest.rs @@ -44,7 +44,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 +200,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()) } diff --git a/crates/sargon/Cargo.toml b/crates/sargon/Cargo.toml index 0c88ce0c8..2ac1a2379 100644 --- a/crates/sargon/Cargo.toml +++ b/crates/sargon/Cargo.toml @@ -23,6 +23,7 @@ sargon-manifests = { path = "../sargon-manifests" } sargon-profile = { path = "../sargon-profile" } sargon-factor-instances-provider = { path = "../sargon-factor-instances-provider" } gateway-models = { path = "../gateway-models" } +sargon-clients = { path = "../sargon-clients" } # === RADIX DEPENDENCIES === radix-engine = { workspace = true } diff --git a/crates/sargon/src/lib.rs b/crates/sargon/src/lib.rs index 1769b897d..549d47fb9 100644 --- a/crates/sargon/src/lib.rs +++ b/crates/sargon/src/lib.rs @@ -23,6 +23,7 @@ mod types; pub mod prelude { pub use identified_vec_of::prelude::*; pub use sargon_addresses::prelude::*; + pub use sargon_clients::prelude::*; pub use sargon_core::prelude::*; pub use sargon_factor_instances_provider::prelude::*; pub use sargon_factors::prelude::*; 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..d238a37cf 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 @@ -135,55 +135,7 @@ 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 { diff --git a/crates/sargon-factor-instances-provider/src/provider/factor_instances_provider_unit_tests.rs b/crates/sargon/src/system/sargon_os/factor_instances_provider_unit_tests.rs similarity index 100% rename from crates/sargon-factor-instances-provider/src/provider/factor_instances_provider_unit_tests.rs rename to crates/sargon/src/system/sargon_os/factor_instances_provider_unit_tests.rs diff --git a/crates/sargon/src/system/sargon_os/mod.rs b/crates/sargon/src/system/sargon_os/mod.rs index 88282c377..ca1bce324 100644 --- a/crates/sargon/src/system/sargon_os/mod.rs +++ b/crates/sargon/src/system/sargon_os/mod.rs @@ -1,8 +1,8 @@ mod delete_account; +mod entity_creating_with_factor_source_and_derivation_outcome; mod pre_authorization; mod profile_state_holder; mod sargon_os; -mod entity_creating_with_factor_source_and_derivation_outcome; mod sargon_os_accounts; mod sargon_os_entities_linked_to_factor_source; mod sargon_os_factors; @@ -15,8 +15,11 @@ mod sargon_os_signing; mod sargon_os_sync_accounts; mod transactions; -pub use entity_creating_with_factor_source_and_derivation_outcome::*; +#[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::*; From 402cabe91a31a121a6eb2dc2dd8c599f8333a1c4 Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Tue, 31 Dec 2024 16:00:30 +0100 Subject: [PATCH 05/23] fixes --- .../profile_network/profile_network_get_entities.rs | 4 ---- .../src/logic/profile_networks.rs | 2 -- .../abstract_security_structure_of_factors.rs | 11 ++++++++++- crates/sargon-profile/src/supporting_types/mod.rs | 4 ++-- .../v100/app_preferences/gateways/saved_gateways.rs | 2 -- .../network/authorized_dapp/authorized_dapp.rs | 1 - .../src/v100/networks/network/authorized_dapps.rs | 1 - .../src/v100/networks/profile_networks.rs | 1 - 8 files changed, 12 insertions(+), 14 deletions(-) diff --git a/crates/sargon-profile-logic/src/logic/profile_network/profile_network_get_entities.rs b/crates/sargon-profile-logic/src/logic/profile_network/profile_network_get_entities.rs index 449ceb6dd..60dda83dd 100644 --- a/crates/sargon-profile-logic/src/logic/profile_network/profile_network_get_entities.rs +++ b/crates/sargon-profile-logic/src/logic/profile_network/profile_network_get_entities.rs @@ -78,10 +78,6 @@ impl ProfileNetworkEntitiesQuerying for ProfileNetwork { .collect::>(), } } - - - - } #[cfg(test)] diff --git a/crates/sargon-profile-logic/src/logic/profile_networks.rs b/crates/sargon-profile-logic/src/logic/profile_networks.rs index 282506f5b..e9f0087a8 100644 --- a/crates/sargon-profile-logic/src/logic/profile_networks.rs +++ b/crates/sargon-profile-logic/src/logic/profile_networks.rs @@ -401,5 +401,3 @@ mod profile_tests { assert!(profile.has_any_account_on_any_network()) } } - - diff --git a/crates/sargon-profile/src/mfa/security_structures/security_structure_of_factors/abstract_security_structure_of_factors.rs b/crates/sargon-profile/src/mfa/security_structures/security_structure_of_factors/abstract_security_structure_of_factors.rs index e0a82ad52..1a18cafe8 100644 --- a/crates/sargon-profile/src/mfa/security_structures/security_structure_of_factors/abstract_security_structure_of_factors.rs +++ b/crates/sargon-profile/src/mfa/security_structures/security_structure_of_factors/abstract_security_structure_of_factors.rs @@ -1,6 +1,15 @@ use crate::prelude::*; -#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, derive_more::Display)] +#[derive( + Debug, + Clone, + PartialEq, + Eq, + Hash, + Serialize, + Deserialize, + derive_more::Display, +)] #[serde(rename_all = "camelCase")] #[display("{}", self.metadata.display_name)] pub struct AbstractSecurityStructure { diff --git a/crates/sargon-profile/src/supporting_types/mod.rs b/crates/sargon-profile/src/supporting_types/mod.rs index 98a1bc241..ebba4cba9 100644 --- a/crates/sargon-profile/src/supporting_types/mod.rs +++ b/crates/sargon-profile/src/supporting_types/mod.rs @@ -2,17 +2,17 @@ mod account_for_display; mod account_or_persona; mod accounts_for_display; mod accounts_or_personas; +mod agnostic_paths; mod authorized_dapp_detailed; mod authorized_persona_detailed; mod detailed_authorized_personas; mod on_same_network_validating; -mod agnostic_paths; -pub use agnostic_paths::*; pub use account_for_display::*; pub use account_or_persona::*; pub use accounts_for_display::*; pub use accounts_or_personas::*; +pub use agnostic_paths::*; pub use authorized_dapp_detailed::*; pub use authorized_persona_detailed::*; pub use detailed_authorized_personas::*; diff --git a/crates/sargon-profile/src/v100/app_preferences/gateways/saved_gateways.rs b/crates/sargon-profile/src/v100/app_preferences/gateways/saved_gateways.rs index abd442eb3..d225f8000 100644 --- a/crates/sargon-profile/src/v100/app_preferences/gateways/saved_gateways.rs +++ b/crates/sargon-profile/src/v100/app_preferences/gateways/saved_gateways.rs @@ -163,8 +163,6 @@ mod tests { assert_ne!(SUT::sample(), SUT::sample_other()); } - - #[test] fn new_throw_gateways_discrepancy_other_should_not_contain_current() { assert_eq!( diff --git a/crates/sargon-profile/src/v100/networks/network/authorized_dapp/authorized_dapp.rs b/crates/sargon-profile/src/v100/networks/network/authorized_dapp/authorized_dapp.rs index 9c8036cba..9dcfd82e7 100644 --- a/crates/sargon-profile/src/v100/networks/network/authorized_dapp/authorized_dapp.rs +++ b/crates/sargon-profile/src/v100/networks/network/authorized_dapp/authorized_dapp.rs @@ -40,7 +40,6 @@ pub struct AuthorizedDapp { pub preferences: AuthorizedDappPreferences, } - impl IsNetworkAware for AuthorizedDapp { fn network_id(&self) -> NetworkID { self.network_id diff --git a/crates/sargon-profile/src/v100/networks/network/authorized_dapps.rs b/crates/sargon-profile/src/v100/networks/network/authorized_dapps.rs index 0d7f303d5..e760a010a 100644 --- a/crates/sargon-profile/src/v100/networks/network/authorized_dapps.rs +++ b/crates/sargon-profile/src/v100/networks/network/authorized_dapps.rs @@ -5,7 +5,6 @@ decl_identified_vec_of!( AuthorizedDapp ); - impl HasSampleValues for AuthorizedDapps { /// A sample used to facilitate unit tests. fn sample() -> Self { diff --git a/crates/sargon-profile/src/v100/networks/profile_networks.rs b/crates/sargon-profile/src/v100/networks/profile_networks.rs index fc5454572..db1ecc6ba 100644 --- a/crates/sargon-profile/src/v100/networks/profile_networks.rs +++ b/crates/sargon-profile/src/v100/networks/profile_networks.rs @@ -113,7 +113,6 @@ mod tests { ); } - #[test] fn with_network() { let network = ProfileNetwork::new( From ad1daff97854c346bd40fa69141943d73bba6572 Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Wed, 1 Jan 2025 08:00:17 +0100 Subject: [PATCH 06/23] wip --- Cargo.lock | 1 + crates/sargon-factor-instances-provider/Cargo.toml | 1 + crates/sargon-factor-instances-provider/src/lib.rs | 1 + .../hierarchical_deterministic_factor_instance.rs | 13 +++++++++++++ .../factor_source_referencing.rs | 13 ------------- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d4a52ad11..448c0b1a8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3089,6 +3089,7 @@ dependencies = [ "sargon-hierarchical-deterministic", "sargon-keys-collector", "sargon-profile", + "sargon-profile-logic", "sargon-profile-supporting-types", "serde", "serde_json 1.0.108", diff --git a/crates/sargon-factor-instances-provider/Cargo.toml b/crates/sargon-factor-instances-provider/Cargo.toml index 4f19c590a..cbe2de366 100644 --- a/crates/sargon-factor-instances-provider/Cargo.toml +++ b/crates/sargon-factor-instances-provider/Cargo.toml @@ -15,6 +15,7 @@ sargon-hierarchical-deterministic = { path = "../sargon-hierarchical-determinist 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" } diff --git a/crates/sargon-factor-instances-provider/src/lib.rs b/crates/sargon-factor-instances-provider/src/lib.rs index d96da67dd..0fc683595 100644 --- a/crates/sargon-factor-instances-provider/src/lib.rs +++ b/crates/sargon-factor-instances-provider/src/lib.rs @@ -12,6 +12,7 @@ pub mod prelude { pub(crate) use sargon_hierarchical_deterministic::prelude::*; pub(crate) use sargon_keys_collector::prelude::*; pub(crate) use sargon_profile::prelude::*; + pub(crate) use sargon_profile_logic::prelude::*; pub(crate) use sargon_profile_supporting_types::prelude::*; pub use crate::factor_instances_cache::*; 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/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() From a82e9c1144222b2512eef2da6434580d6171b539 Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Wed, 1 Jan 2025 08:01:20 +0100 Subject: [PATCH 07/23] wip --- crates/sargon/src/needs_a_new_home_dumping_ground/mod.rs | 2 +- crates/sargon/src/system/mod.rs | 4 ---- .../sargon_os/delete_account/sargon_os_delete_account.rs | 2 -- crates/sargon/src/types/mod.rs | 4 ---- 4 files changed, 1 insertion(+), 11 deletions(-) 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 index d8a9e9fd9..fa55db22e 100644 --- a/crates/sargon/src/needs_a_new_home_dumping_ground/mod.rs +++ b/crates/sargon/src/needs_a_new_home_dumping_ground/mod.rs @@ -1,3 +1,3 @@ mod diagnose_instance_duplicates; -pub use diagnose_instance_duplicates::*; \ No newline at end of file +pub use diagnose_instance_duplicates::*; 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/sargon_os_delete_account.rs b/crates/sargon/src/system/sargon_os/delete_account/sargon_os_delete_account.rs index d238a37cf..31ce12d0f 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 @@ -135,8 +135,6 @@ impl SargonOS { } } - - #[cfg(test)] mod tests { use crate::prelude::*; 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::*; From f8f7ab93d0c0a75efb07fdac4625fd7d992939c5 Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Wed, 1 Jan 2025 16:51:31 +0100 Subject: [PATCH 08/23] wip --- Cargo.lock | 229 ++++++++++++++++++ Cargo.toml | 6 + Package.resolved | 50 ---- codecov.yml | 22 -- crates/gateway-client-and-api/Cargo.toml | 31 +++ .../src}/assert_network_request.rs | 0 .../src/client/gateway_client.rs} | 117 ++++----- .../client/gateway_client_dispatch_request.rs | 8 +- .../src}/client/mod.rs | 0 .../src}/endpoints/mod.rs | 0 .../src}/endpoints/state_endpoints.rs | 0 .../src}/endpoints/status_endpoints.rs | 0 .../src}/endpoints/transaction_endpoints.rs | 0 crates/gateway-client-and-api/src/lib.rs | 24 ++ .../src}/methods/mod.rs | 0 .../src}/methods/page_methods.rs | 0 .../src}/methods/state_methods.rs | 2 + .../src}/methods/transaction_methods.rs | 0 crates/http-client/Cargo.toml | 19 ++ crates/http-client/src/http_client.rs | 76 ++++++ crates/http-client/src/lib.rs | 10 + crates/sargon-clients/Cargo.toml | 12 +- .../host_info_client/host_info_client.rs | 4 +- .../src/clients/client/http_client/mod.rs | 3 - .../sargon-clients/src/clients/client/mod.rs | 2 - .../secure_storage_client.rs | 39 +-- crates/sargon-clients/src/clients/clients.rs | 6 +- crates/sargon-clients/src/lib.rs | 9 + crates/sargon-drivers/Cargo.toml | 9 +- .../support/event_profile_modified.rs | 3 + .../test/in_memory_file_system_driver.rs | 2 - .../drivers/networking_driver/support/mod.rs | 2 - .../support/test/mock_networking_driver.rs | 2 - .../networking_driver/support/test/mod.rs | 7 +- .../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 +- crates/sargon-drivers/src/lib.rs | 8 + .../src/types/mod.rs | 2 + ...n_interactor_from_secure_storage_client.rs | 30 +++ .../Cargo.toml | 18 ++ .../src/lib.rs | 11 + .../src/mnemonic_loading.rs | 22 ++ crates/sargon-keys-collector/Cargo.toml | 1 + .../test_derivation_interactor.rs | 21 -- crates/sargon-keys-collector/src/lib.rs | 1 + .../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 | 0 .../src}/saved_gateways.rs | 2 - .../Cargo.toml | 58 +++++ .../src}/agnostic_paths/derivation_preset.rs | 0 .../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}/factor_list_kind.rs | 0 .../src/lib.rs | 33 +++ .../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 | 0 .../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 | 0 .../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 | 2 + .../roles/abstract_role_builder_or_built.rs | 2 +- .../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 | 0 .../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 | 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 | 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 | 0 .../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 .../src/lib.rs | 2 + .../src/profile_state.rs | 17 ++ crates/sargon-profile/Cargo.toml | 2 + .../password_based_key_derivation_scheme.rs | 2 - crates/sargon-profile/src/lib.rs | 4 +- crates/sargon-profile/src/mfa/mod.rs | 9 - .../src/samples/account_samples.rs | 26 +- crates/sargon-profile/src/samples/mod.rs | 2 - .../src/samples/persona_samples.rs | 35 +-- .../src/supporting_types/mod.rs | 2 - .../src/v100/app_preferences/gateways/mod.rs | 7 - .../src/v100/app_preferences/mod.rs | 11 - .../src/v100/entity/has_security_state.rs | 12 +- .../src/v100/entity/persona/persona.rs | 2 - .../entity_security_state.rs | 2 - .../unsecured_entity_control.rs | 1 - crates/sargon-profile/src/v100/mod.rs | 4 +- .../authorized_dapp/authorized_dapp.rs | 4 +- .../secured_entity_control/mod.rs | 0 .../secured_entity_control.rs | 0 .../low_level/compiled_notarized_intent.rs | 4 + .../resource_indicator/predicted.rs | 2 +- .../account_deposit/account_deposits.rs | 1 - .../simple_non_fungible_resource_bounds.rs | 2 - .../src/low_level/sbor_depth_validation.rs | 2 + .../detailed_manifest_class.rs | 2 +- .../transaction_manifest_execution_summary.rs | 3 - .../instructions/instructions.rs | 11 +- .../transaction_manifest.rs | 4 - .../src/low_level/v2/subintent.rs | 4 - .../instructions_v2/instructions_v2.rs | 2 + .../subintent_manifest.rs | 2 - .../transaction_manifest_v2.rs | 3 - crates/sargon/Cargo.toml | 1 + .../src/gateway_api/client/gateway_client.rs | 72 ------ crates/sargon/src/gateway_api/mod.rs | 9 - crates/sargon/src/lib.rs | 3 +- .../pre_authorization/subintent_response.rs | 1 - .../transaction/transaction.rs | 2 - .../system/sargon_os/profile_state_holder.rs | 16 -- .../sargon/src/system/sargon_os/sargon_os.rs | 9 + .../support/signable_manifest_summary.rs | 3 - 169 files changed, 978 insertions(+), 455 deletions(-) delete mode 100644 Package.resolved delete mode 100644 codecov.yml 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-clients/src/clients/client/http_client/http_client.rs => gateway-client-and-api/src/client/gateway_client.rs} (60%) rename crates/{sargon/src/gateway_api => gateway-client-and-api/src}/client/gateway_client_dispatch_request.rs (90%) rename crates/{sargon/src/gateway_api => gateway-client-and-api/src}/client/mod.rs (100%) rename crates/{sargon/src/gateway_api => gateway-client-and-api/src}/endpoints/mod.rs (100%) rename crates/{sargon/src/gateway_api => gateway-client-and-api/src}/endpoints/state_endpoints.rs (100%) rename crates/{sargon/src/gateway_api => gateway-client-and-api/src}/endpoints/status_endpoints.rs (100%) rename crates/{sargon/src/gateway_api => gateway-client-and-api/src}/endpoints/transaction_endpoints.rs (100%) 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 (100%) rename crates/{sargon/src/gateway_api => gateway-client-and-api/src}/methods/page_methods.rs (100%) 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 (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 delete mode 100644 crates/sargon-clients/src/clients/client/http_client/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-profile-app-preferences/Cargo.toml rename crates/{sargon-profile/src/v100/app_preferences => sargon-profile-app-preferences/src}/app_display_settings/app_display_settings.rs (100%) rename crates/{sargon-profile/src/v100/app_preferences => sargon-profile-app-preferences/src}/app_display_settings/fiat_currency.rs (100%) rename crates/{sargon-profile/src/v100/app_preferences => sargon-profile-app-preferences/src}/app_display_settings/mod.rs (100%) rename crates/{sargon-profile/src/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-profile/src/v100/app_preferences => sargon-profile-app-preferences/src}/security.rs (100%) rename crates/{sargon-profile/src/v100/app_preferences => sargon-profile-app-preferences/src}/transaction_preferences.rs (100%) create mode 100644 crates/sargon-profile-gateway/Cargo.toml rename crates/{sargon-profile/src/v100/app_preferences/gateways => sargon-profile-gateway/src}/gateway.rs (98%) create mode 100644 crates/sargon-profile-gateway/src/lib.rs rename crates/{sargon-profile/src/v100/app_preferences/gateways => sargon-profile-gateway/src}/network_definition.rs (100%) rename crates/{sargon-profile/src/v100/app_preferences/gateways => sargon-profile-gateway/src}/saved_gateways.rs (98%) create mode 100644 crates/sargon-profile-security-structures/Cargo.toml rename crates/{sargon-profile/src/supporting_types => sargon-profile-security-structures/src}/agnostic_paths/derivation_preset.rs (100%) rename crates/{sargon-profile/src/supporting_types => sargon-profile-security-structures/src}/agnostic_paths/index_agnostic_path.rs (100%) rename crates/{sargon-profile/src/supporting_types => sargon-profile-security-structures/src}/agnostic_paths/mod.rs (100%) rename crates/{sargon-profile/src/supporting_types => sargon-profile-security-structures/src}/agnostic_paths/quantified_derivation_preset.rs (100%) rename crates/{sargon-profile/src/supporting_types => sargon-profile-security-structures/src}/agnostic_paths/quantities.rs (100%) rename crates/{sargon-profile/src/mfa => sargon-profile-security-structures/src}/factor_list_kind.rs (100%) create mode 100644 crates/sargon-profile-security-structures/src/lib.rs rename crates/{sargon-profile/src/mfa => sargon-profile-security-structures/src}/role_kind.rs (100%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/automatic_shield_builder/auto_build_outcome_for_testing.rs (100%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/automatic_shield_builder/automatic_shield_builder.rs (99%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/automatic_shield_builder/factor_selector.rs (100%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/automatic_shield_builder/mod.rs (100%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/automatic_shield_builder/proto_shield.rs (100%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/automatic_shield_builder/quantity.rs (100%) rename crates/{sargon-profile/src/samples => sargon-profile-security-structures/src/roles_matrices_structures}/general_role_with_hd_factor_instance_samples.rs (91%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/has_role_kind.rs (100%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/matrices/abstract_matrix_builder_or_built.rs (76%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/matrices/builder/error.rs (100%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/matrices/builder/matrix_builder.rs (100%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/matrices/builder/matrix_builder_unit_tests.rs (100%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/matrices/builder/matrix_template.rs (100%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/matrices/builder/mod.rs (100%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/matrices/matrix_of_factor_instances.rs (100%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/matrices/matrix_of_factor_source_ids.rs (100%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/matrices/matrix_of_factor_sources.rs (100%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/matrices/mod.rs (100%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/mod.rs (87%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/abstract_role_builder_or_built.rs (99%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/builder/confirmation_roles_builder_unit_tests.rs (100%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/builder/mod.rs (100%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/builder/primary_roles_builder_unit_tests.rs (100%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/builder/recovery_roles_builder_unit_tests.rs (100%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/builder/roles_builder.rs (99%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/builder/roles_builder_unit_tests.rs (100%) rename crates/{sargon-profile/src/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-profile/src/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-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/factor_levels/factor_instance_level/mod.rs (100%) rename crates/{sargon-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/factor_levels/factor_source_id_level/mod.rs (100%) rename crates/{sargon-profile/src/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-profile/src/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-profile/src/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-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/factor_levels/factor_source_kind_level/mod.rs (100%) rename crates/{sargon-profile/src/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-profile/src/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-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/factor_levels/factor_source_level/mod.rs (100%) rename crates/{sargon-profile/src/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-profile/src/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-profile/src/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-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/factor_levels/mod.rs (100%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/roles/mod.rs (100%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/security_shield_builder.rs (100%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/security_shield_builder_invalid_reason.rs (100%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/security_shield_prerequisites_status.rs (100%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/security_structure_id.rs (100%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/security_structure_metadata.rs (100%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/security_structure_of_factors/abstract_security_structure_of_factors.rs (100%) rename crates/{sargon-profile/src/mfa/security_structures => sargon-profile-security-structures/src/roles_matrices_structures}/security_structure_of_factors/mod.rs (100%) rename crates/{sargon-profile/src/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-profile/src/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-profile/src/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-profile/src/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/src/profile_state.rs delete mode 100644 crates/sargon-profile/src/mfa/mod.rs delete mode 100644 crates/sargon-profile/src/v100/app_preferences/gateways/mod.rs delete mode 100644 crates/sargon-profile/src/v100/app_preferences/mod.rs rename crates/sargon-profile/src/{mfa => v100}/secured_entity_control/mod.rs (100%) rename crates/sargon-profile/src/{mfa => v100}/secured_entity_control/secured_entity_control.rs (100%) delete mode 100644 crates/sargon/src/gateway_api/client/gateway_client.rs delete mode 100644 crates/sargon/src/gateway_api/mod.rs diff --git a/Cargo.lock b/Cargo.lock index 448c0b1a8..022797213 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1297,6 +1297,30 @@ dependencies = [ "slab", ] +[[package]] +name = "gateway-client-and-api" +version = "1.2.1" +dependencies = [ + "actix-rt", + "derive_more", + "gateway-logic", + "gateway-models", + "http-client", + "itertools 0.12.0", + "radix-common", + "radix-engine-toolkit-common", + "radix-transactions", + "reqwest", + "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-logic" version = "1.2.1" @@ -1525,6 +1549,18 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "http-client" +version = "1.2.1" +dependencies = [ + "actix-rt", + "reqwest", + "sargon-core", + "sargon-drivers", + "serde", + "serde_json 1.0.108", +] + [[package]] name = "httparse" version = "1.9.5" @@ -2809,6 +2845,7 @@ 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", @@ -2882,6 +2919,7 @@ dependencies = [ name = "sargon-clients" version = "1.2.1" dependencies = [ + "actix-rt", "aes-gcm", "assert-json-diff", "async-std", @@ -2893,8 +2931,10 @@ dependencies = [ "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", @@ -2914,7 +2954,12 @@ dependencies = [ "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", @@ -3007,6 +3052,7 @@ dependencies = [ name = "sargon-drivers" version = "1.2.1" dependencies = [ + "actix-rt", "aes-gcm", "assert-json-diff", "async-std", @@ -3039,7 +3085,11 @@ dependencies = [ "radix-transactions", "rand", "reqwest", + "sargon-addresses", "sargon-core", + "sargon-hierarchical-deterministic", + "sargon-profile", + "sargon-profile-supporting-types", "sbor", "serde", "serde_json 1.0.108", @@ -3143,6 +3193,17 @@ dependencies = [ "zeroize 1.7.0", ] +[[package]] +name = "sargon-factors-supporting-types" +version = "1.2.1" +dependencies = [ + "async-trait", + "identified-vec-of", + "sargon-core", + "sargon-factors", + "sargon-hierarchical-deterministic", +] + [[package]] name = "sargon-hierarchical-deterministic" version = "1.2.1" @@ -3191,6 +3252,7 @@ dependencies = [ "sargon-addresses", "sargon-core", "sargon-factors", + "sargon-factors-supporting-types", "sargon-hierarchical-deterministic", ] @@ -3288,6 +3350,120 @@ dependencies = [ "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.2.1" +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.2.1" +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", @@ -3328,6 +3504,59 @@ dependencies = [ "serde_json 1.0.108", ] +[[package]] +name = "sargon-profile-security-structures" +version = "1.2.1" +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", + "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.2.1" diff --git a/Cargo.toml b/Cargo.toml index f56487548..9808b3728 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,19 +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/gateway-models", "crates/gateway-logic", + "crates/gateway-client-and-api", "crates/sargon", # to be split diff --git a/Package.resolved b/Package.resolved deleted file mode 100644 index af565dc0a..000000000 --- a/Package.resolved +++ /dev/null @@ -1,50 +0,0 @@ -{ - "pins" : [ - { - "identity" : "asyncextensions", - "kind" : "remoteSourceControl", - "location" : "https://github.com/sideeffect-io/AsyncExtensions", - "state" : { - "revision" : "3442d3d046800f1974bda096faaf0ac510b21154", - "version" : "0.5.3" - } - }, - { - "identity" : "swift-collections", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-collections.git", - "state" : { - "revision" : "94cf62b3ba8d4bed62680a282d4c25f9c63c2efb", - "version" : "1.1.0" - } - }, - { - "identity" : "swift-custom-dump", - "kind" : "remoteSourceControl", - "location" : "https://github.com/pointfreeco/swift-custom-dump", - "state" : { - "revision" : "f01efb26f3a192a0e88dcdb7c3c391ec2fc25d9c", - "version" : "1.3.0" - } - }, - { - "identity" : "swiftyjson", - "kind" : "remoteSourceControl", - "location" : "https://github.com/SwiftyJSON/SwiftyJSON", - "state" : { - "revision" : "af76cf3ef710b6ca5f8c05f3a31307d44a3c5828", - "version" : "5.0.2" - } - }, - { - "identity" : "xctest-dynamic-overlay", - "kind" : "remoteSourceControl", - "location" : "https://github.com/pointfreeco/xctest-dynamic-overlay", - "state" : { - "revision" : "6f30bdba373bbd7fbfe241dddd732651f2fbd1e2", - "version" : "1.1.2" - } - } - ], - "version" : 2 -} 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/gateway-client-and-api/Cargo.toml b/crates/gateway-client-and-api/Cargo.toml new file mode 100644 index 000000000..302d5ed79 --- /dev/null +++ b/crates/gateway-client-and-api/Cargo.toml @@ -0,0 +1,31 @@ +[package] +name = "gateway-client-and-api" +version = "1.2.1" +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" } +gateway-logic = { path = "../gateway-logic" } +sargon-profile-gateway = { path = "../sargon-profile-gateway" } + +# === RADIX DEPENDENCIES === +radix-engine-toolkit-common = { workspace = true } +radix-transactions = { workspace = true } +radix-common = { workspace = true } + +# === EXTERNAL DEPENDENCIES === +derive_more = { workspace = true } +itertools = { workspace = true } +reqwest = { workspace = true } +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-clients/src/clients/client/http_client/http_client.rs b/crates/gateway-client-and-api/src/client/gateway_client.rs similarity index 60% rename from crates/sargon-clients/src/clients/client/http_client/http_client.rs rename to crates/gateway-client-and-api/src/client/gateway_client.rs index 213284da0..20ec11b7a 100644 --- a/crates/sargon-clients/src/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::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)) } } @@ -87,6 +58,20 @@ 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: "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 90% 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..cbd86f1ac 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 @@ -58,8 +58,12 @@ pub(crate) 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/sargon/src/gateway_api/endpoints/mod.rs b/crates/gateway-client-and-api/src/endpoints/mod.rs similarity index 100% rename from crates/sargon/src/gateway_api/endpoints/mod.rs rename to crates/gateway-client-and-api/src/endpoints/mod.rs 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 100% rename from crates/sargon/src/gateway_api/endpoints/state_endpoints.rs rename to crates/gateway-client-and-api/src/endpoints/state_endpoints.rs 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 100% rename from crates/sargon/src/gateway_api/endpoints/status_endpoints.rs rename to crates/gateway-client-and-api/src/endpoints/status_endpoints.rs 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 100% rename from crates/sargon/src/gateway_api/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 new file mode 100644 index 000000000..1b491d40a --- /dev/null +++ b/crates/gateway-client-and-api/src/lib.rs @@ -0,0 +1,24 @@ +mod assert_network_request; +mod client; +mod endpoints; +mod methods; + +pub mod prelude { + pub(crate) use crate::assert_network_request::*; + pub use crate::client::*; + pub use crate::endpoints::*; + pub use crate::methods::*; + + pub(crate) use gateway_logic::prelude::*; + pub(crate) use gateway_models::prelude::*; + pub(crate) use http_client::prelude::*; + pub(crate) use sargon_core::prelude::*; + pub(crate) use sargon_drivers::prelude::*; + pub(crate) use sargon_transaction_models::prelude::*; + + pub(crate) use radix_common::prelude::ACCOUNT_OWNER_BADGE as SCRYPTO_ACCOUNT_OWNER_BADGE; + + pub(crate) use serde_json::*; +} + +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 100% rename from crates/sargon/src/gateway_api/methods/mod.rs rename to crates/gateway-client-and-api/src/methods/mod.rs 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 100% rename from crates/sargon/src/gateway_api/methods/page_methods.rs rename to crates/gateway-client-and-api/src/methods/page_methods.rs 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..12ca03b67 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::*; +pub type DappDefinitionAddress = AccountAddress; + impl GatewayClient { /// Fetched the XRD balance of account of `address`, returns `None` if /// it has no balance. 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 100% rename from crates/sargon/src/gateway_api/methods/transaction_methods.rs rename to crates/gateway-client-and-api/src/methods/transaction_methods.rs diff --git a/crates/http-client/Cargo.toml b/crates/http-client/Cargo.toml new file mode 100644 index 000000000..01c589366 --- /dev/null +++ b/crates/http-client/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "http-client" +version = "1.2.1" +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..16924cdc5 --- /dev/null +++ b/crates/http-client/src/http_client.rs @@ -0,0 +1,76 @@ +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, +} + +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/sargon-clients/Cargo.toml b/crates/sargon-clients/Cargo.toml index 22b48a9ff..76dc862b9 100644 --- a/crates/sargon-clients/Cargo.toml +++ b/crates/sargon-clients/Cargo.toml @@ -5,7 +5,14 @@ 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 } @@ -51,4 +58,7 @@ strum = { workspace = true } thiserror = { workspace = true } url = { workspace = true } uuid = { workspace = true } -zeroize = { workspace = true } \ No newline at end of file +zeroize = { workspace = true } + +[dev-dependencies] +actix-rt = { workspace = true } diff --git a/crates/sargon-clients/src/clients/client/host_info_client/host_info_client.rs b/crates/sargon-clients/src/clients/client/host_info_client/host_info_client.rs index 9e0db3fce..748b6e793 100644 --- a/crates/sargon-clients/src/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; diff --git a/crates/sargon-clients/src/clients/client/http_client/mod.rs b/crates/sargon-clients/src/clients/client/http_client/mod.rs deleted file mode 100644 index 73bcdca8d..000000000 --- a/crates/sargon-clients/src/clients/client/http_client/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -mod http_client; - -pub use http_client::*; diff --git a/crates/sargon-clients/src/clients/client/mod.rs b/crates/sargon-clients/src/clients/client/mod.rs index c47198918..7a954989d 100644 --- a/crates/sargon-clients/src/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-clients/src/clients/client/secure_storage_client/secure_storage_client.rs b/crates/sargon-clients/src/clients/client/secure_storage_client/secure_storage_client.rs index 8498f1d0a..8d0411932 100644 --- a/crates/sargon-clients/src/clients/client/secure_storage_client/secure_storage_client.rs +++ b/crates/sargon-clients/src/clients/client/secure_storage_client/secure_storage_client.rs @@ -17,7 +17,7 @@ pub struct SecureStorageClient { 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 +229,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-clients/src/clients/clients.rs b/crates/sargon-clients/src/clients/clients.rs index bc705b186..333b34677 100644 --- a/crates/sargon-clients/src/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-clients/src/lib.rs b/crates/sargon-clients/src/lib.rs index 0d63103c7..08225189e 100644 --- a/crates/sargon-clients/src/lib.rs +++ b/crates/sargon-clients/src/lib.rs @@ -1,9 +1,18 @@ mod clients; pub mod prelude { + pub use gateway_client_and_api::prelude::*; + pub use http_client::prelude::*; + pub use sargon_core::prelude::*; pub use sargon_drivers::prelude::*; + pub use sargon_factors_supporting_types::prelude::*; + pub(crate) use sargon_hierarchical_deterministic::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-drivers/Cargo.toml b/crates/sargon-drivers/Cargo.toml index 106b2a0eb..373003a25 100644 --- a/crates/sargon-drivers/Cargo.toml +++ b/crates/sargon-drivers/Cargo.toml @@ -6,6 +6,10 @@ 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 } @@ -51,4 +55,7 @@ strum = { workspace = true } thiserror = { workspace = true } url = { workspace = true } uuid = { workspace = true } -zeroize = { workspace = true } \ No newline at end of file +zeroize = { workspace = true } + +[dev-dependencies] +actix-rt = { workspace = true } \ No newline at end of file diff --git a/crates/sargon-drivers/src/drivers/event_bus_driver/support/event_profile_modified.rs b/crates/sargon-drivers/src/drivers/event_bus_driver/support/event_profile_modified.rs index 5b79e3f8b..d64b69aa7 100644 --- a/crates/sargon-drivers/src/drivers/event_bus_driver/support/event_profile_modified.rs +++ b/crates/sargon-drivers/src/drivers/event_bus_driver/support/event_profile_modified.rs @@ -70,6 +70,7 @@ impl HasEventKind for EventProfileModified { } pub trait IsProfileModifiedEvent { + type Address: Clone + Eq + StdHash; fn profile_modified_event( is_update: bool, addresses: IndexSet, @@ -77,6 +78,7 @@ pub trait IsProfileModifiedEvent { } impl IsProfileModifiedEvent for Account { + type Address = AccountAddress; fn profile_modified_event( is_update: bool, addresses: IndexSet, @@ -102,6 +104,7 @@ impl IsProfileModifiedEvent for Account { } impl IsProfileModifiedEvent for Persona { + type Address = IdentityAddress; fn profile_modified_event( is_update: bool, addresses: IndexSet, diff --git a/crates/sargon-drivers/src/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 index 4bf47bd7e..93561dab6 100644 --- a/crates/sargon-drivers/src/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-drivers/src/drivers/networking_driver/support/mod.rs b/crates/sargon-drivers/src/drivers/networking_driver/support/mod.rs index 554824921..62815b4ba 100644 --- a/crates/sargon-drivers/src/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-drivers/src/drivers/networking_driver/support/test/mock_networking_driver.rs b/crates/sargon-drivers/src/drivers/networking_driver/support/test/mock_networking_driver.rs index 7ab6e88f8..34dedcc4c 100644 --- a/crates/sargon-drivers/src/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-drivers/src/drivers/networking_driver/support/test/mod.rs b/crates/sargon-drivers/src/drivers/networking_driver/support/test/mod.rs index b795e08c1..52cf972cf 100644 --- a/crates/sargon-drivers/src/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-drivers/src/drivers/secure_storage_driver/support/secure_storage_key.rs b/crates/sargon-drivers/src/drivers/secure_storage_driver/support/secure_storage_key.rs index 563a8b821..4ea830816 100644 --- a/crates/sargon-drivers/src/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-drivers/src/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 index c457e9664..4a65b3af2 100644 --- a/crates/sargon-drivers/src/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-drivers/src/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 index 003738e41..adddc2f65 100644 --- a/crates/sargon-drivers/src/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-drivers/src/drivers/secure_storage_driver/support/test/mod.rs b/crates/sargon-drivers/src/drivers/secure_storage_driver/support/test/mod.rs index 547109293..0b89f41bb 100644 --- a/crates/sargon-drivers/src/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-drivers/src/lib.rs b/crates/sargon-drivers/src/lib.rs index c6de44d88..3644e690e 100644 --- a/crates/sargon-drivers/src/lib.rs +++ b/crates/sargon-drivers/src/lib.rs @@ -1,9 +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/src/types/mod.rs b/crates/sargon-factor-instances-provider/src/types/mod.rs index cc520ebb6..b688a5eef 100644 --- a/crates/sargon-factor-instances-provider/src/types/mod.rs +++ b/crates/sargon-factor-instances-provider/src/types/mod.rs @@ -1,3 +1,5 @@ mod appendable_collection; +mod test_derivation_interactor_from_secure_storage_client; pub use appendable_collection::*; +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..8929ea010 --- /dev/null +++ b/crates/sargon-factor-instances-provider/src/types/test_derivation_interactor_from_secure_storage_client.rs @@ -0,0 +1,30 @@ +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, + ) + } +} diff --git a/crates/sargon-factors-supporting-types/Cargo.toml b/crates/sargon-factors-supporting-types/Cargo.toml new file mode 100644 index 000000000..774d76c24 --- /dev/null +++ b/crates/sargon-factors-supporting-types/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "sargon-factors-supporting-types" +version = "1.2.1" +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-keys-collector/Cargo.toml b/crates/sargon-keys-collector/Cargo.toml index cbf00f9eb..be2c936bf 100644 --- a/crates/sargon-keys-collector/Cargo.toml +++ b/crates/sargon-keys-collector/Cargo.toml @@ -9,6 +9,7 @@ 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 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-profile-app-preferences/Cargo.toml b/crates/sargon-profile-app-preferences/Cargo.toml new file mode 100644 index 000000000..1c9d21748 --- /dev/null +++ b/crates/sargon-profile-app-preferences/Cargo.toml @@ -0,0 +1,62 @@ +[package] +name = "sargon-profile-app-preferences" +version = "1.2.1" +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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/v100/app_preferences/app_preferences.rs b/crates/sargon-profile-app-preferences/src/app_preferences.rs similarity index 100% rename from crates/sargon-profile/src/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-profile/src/v100/app_preferences/security.rs b/crates/sargon-profile-app-preferences/src/security.rs similarity index 100% rename from crates/sargon-profile/src/v100/app_preferences/security.rs rename to crates/sargon-profile-app-preferences/src/security.rs diff --git a/crates/sargon-profile/src/v100/app_preferences/transaction_preferences.rs b/crates/sargon-profile-app-preferences/src/transaction_preferences.rs similarity index 100% rename from crates/sargon-profile/src/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..d9f37085f --- /dev/null +++ b/crates/sargon-profile-gateway/Cargo.toml @@ -0,0 +1,60 @@ +[package] +name = "sargon-profile-gateway" +version = "1.2.1" +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-profile/src/v100/app_preferences/gateways/gateway.rs b/crates/sargon-profile-gateway/src/gateway.rs similarity index 98% rename from crates/sargon-profile/src/v100/app_preferences/gateways/gateway.rs rename to crates/sargon-profile-gateway/src/gateway.rs index 07bdc181c..60c1690ff 100644 --- a/crates/sargon-profile/src/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..3decdb862 --- /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 use sargon_core::prelude::*; + + pub(crate) use serde::*; +} diff --git a/crates/sargon-profile/src/v100/app_preferences/gateways/network_definition.rs b/crates/sargon-profile-gateway/src/network_definition.rs similarity index 100% rename from crates/sargon-profile/src/v100/app_preferences/gateways/network_definition.rs rename to crates/sargon-profile-gateway/src/network_definition.rs diff --git a/crates/sargon-profile/src/v100/app_preferences/gateways/saved_gateways.rs b/crates/sargon-profile-gateway/src/saved_gateways.rs similarity index 98% rename from crates/sargon-profile/src/v100/app_preferences/gateways/saved_gateways.rs rename to crates/sargon-profile-gateway/src/saved_gateways.rs index d225f8000..a58e51496 100644 --- a/crates/sargon-profile/src/v100/app_preferences/gateways/saved_gateways.rs +++ b/crates/sargon-profile-gateway/src/saved_gateways.rs @@ -40,7 +40,6 @@ impl SavedGateways { } impl Serialize for SavedGateways { - #[cfg(not(tarpaulin_include))] // false negative fn serialize( &self, serializer: S, @@ -56,7 +55,6 @@ impl Serialize for SavedGateways { } impl<'de> Deserialize<'de> for SavedGateways { - #[cfg(not(tarpaulin_include))] // false negative fn deserialize>( deserializer: D, ) -> Result { diff --git a/crates/sargon-profile-security-structures/Cargo.toml b/crates/sargon-profile-security-structures/Cargo.toml new file mode 100644 index 000000000..8929e1691 --- /dev/null +++ b/crates/sargon-profile-security-structures/Cargo.toml @@ -0,0 +1,58 @@ +[package] +name = "sargon-profile-security-structures" +version = "1.2.1" +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" } + +# === 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-profile/src/supporting_types/agnostic_paths/derivation_preset.rs b/crates/sargon-profile-security-structures/src/agnostic_paths/derivation_preset.rs similarity index 100% rename from crates/sargon-profile/src/supporting_types/agnostic_paths/derivation_preset.rs rename to crates/sargon-profile-security-structures/src/agnostic_paths/derivation_preset.rs diff --git a/crates/sargon-profile/src/supporting_types/agnostic_paths/index_agnostic_path.rs b/crates/sargon-profile-security-structures/src/agnostic_paths/index_agnostic_path.rs similarity index 100% rename from crates/sargon-profile/src/supporting_types/agnostic_paths/index_agnostic_path.rs rename to crates/sargon-profile-security-structures/src/agnostic_paths/index_agnostic_path.rs diff --git a/crates/sargon-profile/src/supporting_types/agnostic_paths/mod.rs b/crates/sargon-profile-security-structures/src/agnostic_paths/mod.rs similarity index 100% rename from crates/sargon-profile/src/supporting_types/agnostic_paths/mod.rs rename to crates/sargon-profile-security-structures/src/agnostic_paths/mod.rs diff --git a/crates/sargon-profile/src/supporting_types/agnostic_paths/quantified_derivation_preset.rs b/crates/sargon-profile-security-structures/src/agnostic_paths/quantified_derivation_preset.rs similarity index 100% rename from crates/sargon-profile/src/supporting_types/agnostic_paths/quantified_derivation_preset.rs rename to crates/sargon-profile-security-structures/src/agnostic_paths/quantified_derivation_preset.rs diff --git a/crates/sargon-profile/src/supporting_types/agnostic_paths/quantities.rs b/crates/sargon-profile-security-structures/src/agnostic_paths/quantities.rs similarity index 100% rename from crates/sargon-profile/src/supporting_types/agnostic_paths/quantities.rs rename to crates/sargon-profile-security-structures/src/agnostic_paths/quantities.rs diff --git a/crates/sargon-profile/src/mfa/factor_list_kind.rs b/crates/sargon-profile-security-structures/src/factor_list_kind.rs similarity index 100% rename from crates/sargon-profile/src/mfa/factor_list_kind.rs rename to crates/sargon-profile-security-structures/src/factor_list_kind.rs 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..822a25c45 --- /dev/null +++ b/crates/sargon-profile-security-structures/src/lib.rs @@ -0,0 +1,33 @@ +#![allow(incomplete_features)] +#![feature(generic_const_exprs)] +#![feature(let_chains)] + +mod agnostic_paths; +mod factor_list_kind; +mod role_kind; +mod roles_matrices_structures; + +pub mod prelude { + pub use crate::agnostic_paths::*; + pub use crate::factor_list_kind::*; + pub use crate::role_kind::*; + pub use crate::roles_matrices_structures::*; + + pub use sargon_addresses::prelude::*; + pub use sargon_core::prelude::*; + pub use sargon_factors::prelude::*; + pub use sargon_hierarchical_deterministic::prelude::*; + + pub(crate) use serde::*; + + 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-profile/src/mfa/role_kind.rs b/crates/sargon-profile-security-structures/src/role_kind.rs similarity index 100% rename from crates/sargon-profile/src/mfa/role_kind.rs rename to crates/sargon-profile-security-structures/src/role_kind.rs diff --git a/crates/sargon-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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 100% rename from crates/sargon-profile/src/mfa/security_structures/automatic_shield_builder/mod.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/automatic_shield_builder/mod.rs diff --git a/crates/sargon-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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 100% rename from crates/sargon-profile/src/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 diff --git a/crates/sargon-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/mfa/security_structures/mod.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/mod.rs similarity index 87% rename from crates/sargon-profile/src/mfa/security_structures/mod.rs rename to crates/sargon-profile-security-structures/src/roles_matrices_structures/mod.rs index b915d8b26..73b8167d7 100644 --- a/crates/sargon-profile/src/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; @@ -11,6 +12,7 @@ mod security_structure_of_factors; mod selected_factor_sources_status; pub use automatic_shield_builder::*; +pub use general_role_with_hd_factor_instance_samples::*; pub use has_role_kind::*; pub use matrices::*; pub use roles::*; diff --git a/crates/sargon-profile/src/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 99% rename from crates/sargon-profile/src/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 545f6ede1..bb066f0a1 100644 --- a/crates/sargon-profile/src/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 @@ -104,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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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 100% rename from crates/sargon-profile/src/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 diff --git a/crates/sargon-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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 100% rename from crates/sargon-profile/src/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 diff --git a/crates/sargon-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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 100% rename from crates/sargon-profile/src/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 diff --git a/crates/sargon-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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-profile/src/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/src/lib.rs b/crates/sargon-profile-supporting-types/src/lib.rs index 3f31765ec..69b54f035 100644 --- a/crates/sargon-profile-supporting-types/src/lib.rs +++ b/crates/sargon-profile-supporting-types/src/lib.rs @@ -2,6 +2,7 @@ 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; @@ -12,6 +13,7 @@ pub mod prelude { 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::*; 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-profile/Cargo.toml b/crates/sargon-profile/Cargo.toml index 4c62deda5..433207240 100644 --- a/crates/sargon-profile/Cargo.toml +++ b/crates/sargon-profile/Cargo.toml @@ -13,6 +13,8 @@ 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 } diff --git a/crates/sargon-profile/src/encrypted/key_derivation/password_based_key_derivation_scheme.rs b/crates/sargon-profile/src/encrypted/key_derivation/password_based_key_derivation_scheme.rs index 9f72402e4..7044fd6e1 100644 --- a/crates/sargon-profile/src/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-profile/src/lib.rs b/crates/sargon-profile/src/lib.rs index e28fbead6..8d1bcba62 100644 --- a/crates/sargon-profile/src/lib.rs +++ b/crates/sargon-profile/src/lib.rs @@ -5,7 +5,6 @@ #![feature(generic_const_exprs)] mod encrypted; -mod mfa; mod profilesnapshot_version; mod samples; mod supporting_types; @@ -18,10 +17,11 @@ pub mod 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_profile_security_structures::prelude::*; pub use sargon_transaction_models::prelude::*; pub use crate::encrypted::*; - pub use crate::mfa::*; pub use crate::profilesnapshot_version::*; pub use crate::samples::*; pub use crate::supporting_types::*; diff --git a/crates/sargon-profile/src/mfa/mod.rs b/crates/sargon-profile/src/mfa/mod.rs deleted file mode 100644 index 484b01f4a..000000000 --- a/crates/sargon-profile/src/mfa/mod.rs +++ /dev/null @@ -1,9 +0,0 @@ -mod factor_list_kind; -mod role_kind; -mod secured_entity_control; -mod security_structures; - -pub use factor_list_kind::*; -pub use role_kind::*; -pub use secured_entity_control::*; -pub use security_structures::*; diff --git a/crates/sargon-profile/src/samples/account_samples.rs b/crates/sargon-profile/src/samples/account_samples.rs index 4d862dfae..f11e2bbe4 100644 --- a/crates/sargon-profile/src/samples/account_samples.rs +++ b/crates/sargon-profile/src/samples/account_samples.rs @@ -166,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-profile/src/samples/mod.rs b/crates/sargon-profile/src/samples/mod.rs index 0681ba86f..0fd5ca9ec 100644 --- a/crates/sargon-profile/src/samples/mod.rs +++ b/crates/sargon-profile/src/samples/mod.rs @@ -1,7 +1,6 @@ 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; @@ -9,7 +8,6 @@ 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-profile/src/samples/persona_samples.rs b/crates/sargon-profile/src/samples/persona_samples.rs index 33be10e10..8d2bc35b4 100644 --- a/crates/sargon-profile/src/samples/persona_samples.rs +++ b/crates/sargon-profile/src/samples/persona_samples.rs @@ -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-profile/src/supporting_types/mod.rs b/crates/sargon-profile/src/supporting_types/mod.rs index ebba4cba9..a2da50a39 100644 --- a/crates/sargon-profile/src/supporting_types/mod.rs +++ b/crates/sargon-profile/src/supporting_types/mod.rs @@ -2,7 +2,6 @@ mod account_for_display; mod account_or_persona; mod accounts_for_display; mod accounts_or_personas; -mod agnostic_paths; mod authorized_dapp_detailed; mod authorized_persona_detailed; mod detailed_authorized_personas; @@ -12,7 +11,6 @@ pub use account_for_display::*; pub use account_or_persona::*; pub use accounts_for_display::*; pub use accounts_or_personas::*; -pub use agnostic_paths::*; pub use authorized_dapp_detailed::*; pub use authorized_persona_detailed::*; pub use detailed_authorized_personas::*; diff --git a/crates/sargon-profile/src/v100/app_preferences/gateways/mod.rs b/crates/sargon-profile/src/v100/app_preferences/gateways/mod.rs deleted file mode 100644 index 6eb8be907..000000000 --- a/crates/sargon-profile/src/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-profile/src/v100/app_preferences/mod.rs b/crates/sargon-profile/src/v100/app_preferences/mod.rs deleted file mode 100644 index 233c4b05c..000000000 --- a/crates/sargon-profile/src/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-profile/src/v100/entity/has_security_state.rs b/crates/sargon-profile/src/v100/entity/has_security_state.rs index 2f79b4df2..a3e68871f 100644 --- a/crates/sargon-profile/src/v100/entity/has_security_state.rs +++ b/crates/sargon-profile/src/v100/entity/has_security_state.rs @@ -1,5 +1,11 @@ use crate::prelude::*; +impl HasFactorInstances for T { + fn unique_tx_signing_factor_instances(&self) -> IndexSet { + self.security_state().unique_tx_signing_factor_instances() + } +} + pub trait HasSecurityState: HasFactorInstances + IsSecurityStateAware { fn security_state(&self) -> EntitySecurityState; fn set_security_state_unchecked(&mut self, new_state: EntitySecurityState); @@ -54,12 +60,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-profile/src/v100/entity/persona/persona.rs b/crates/sargon-profile/src/v100/entity/persona/persona.rs index d4b4c6995..3c97572ba 100644 --- a/crates/sargon-profile/src/v100/entity/persona/persona.rs +++ b/crates/sargon-profile/src/v100/entity/persona/persona.rs @@ -156,7 +156,6 @@ impl Persona { } impl Persona { - #[cfg(not(tarpaulin_include))] // false negative fn sample_at_index_name_network( network_id: NetworkID, index: u32, @@ -213,7 +212,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-profile/src/v100/entity_security_state/entity_security_state.rs b/crates/sargon-profile/src/v100/entity_security_state/entity_security_state.rs index ca6f21651..e901e2f9a 100644 --- a/crates/sargon-profile/src/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, diff --git a/crates/sargon-profile/src/v100/entity_security_state/unsecured_entity_control.rs b/crates/sargon-profile/src/v100/entity_security_state/unsecured_entity_control.rs index 481ac357b..77700d8df 100644 --- a/crates/sargon-profile/src/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-profile/src/v100/mod.rs b/crates/sargon-profile/src/v100/mod.rs index 8c5fd0258..0e5a86f9e 100644 --- a/crates/sargon-profile/src/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; @@ -8,8 +7,8 @@ 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::*; @@ -19,3 +18,4 @@ 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-profile/src/v100/networks/network/authorized_dapp/authorized_dapp.rs b/crates/sargon-profile/src/v100/networks/network/authorized_dapp/authorized_dapp.rs index 9dcfd82e7..f403f6543 100644 --- a/crates/sargon-profile/src/v100/networks/network/authorized_dapp/authorized_dapp.rs +++ b/crates/sargon-profile/src/v100/networks/network/authorized_dapp/authorized_dapp.rs @@ -1,5 +1,7 @@ use crate::prelude::*; +pub type DappDefinitionAddress = AccountAddress; + /// A connection made between a Radix Dapp and the user. #[derive( Serialize, @@ -91,8 +93,6 @@ impl Identifiable for AuthorizedDapp { } } -pub type DappDefinitionAddress = AccountAddress; - impl AuthorizedDapp { pub fn sample_mainnet_dashboard() -> Self { Self::new( diff --git a/crates/sargon-profile/src/mfa/secured_entity_control/mod.rs b/crates/sargon-profile/src/v100/secured_entity_control/mod.rs similarity index 100% rename from crates/sargon-profile/src/mfa/secured_entity_control/mod.rs rename to crates/sargon-profile/src/v100/secured_entity_control/mod.rs diff --git a/crates/sargon-profile/src/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-profile/src/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/src/low_level/compiled_notarized_intent.rs b/crates/sargon-transaction-models/src/low_level/compiled_notarized_intent.rs index c31d0da85..622d40e2f 100644 --- a/crates/sargon-transaction-models/src/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-transaction-models/src/low_level/execution_summary/resource_indicator/predicted.rs b/crates/sargon-transaction-models/src/low_level/execution_summary/resource_indicator/predicted.rs index 5e41ad57d..a5f607e2b 100644 --- a/crates/sargon-transaction-models/src/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-transaction-models/src/low_level/manifest_summary/account_deposit/account_deposits.rs b/crates/sargon-transaction-models/src/low_level/manifest_summary/account_deposit/account_deposits.rs index bdb657b59..2c5a6bc06 100644 --- a/crates/sargon-transaction-models/src/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-transaction-models/src/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 index 8d9757dd6..79ee754c7 100644 --- a/crates/sargon-transaction-models/src/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-transaction-models/src/low_level/sbor_depth_validation.rs b/crates/sargon-transaction-models/src/low_level/sbor_depth_validation.rs index ffc60a4be..c6b10e98e 100644 --- a/crates/sargon-transaction-models/src/low_level/sbor_depth_validation.rs +++ b/crates/sargon-transaction-models/src/low_level/sbor_depth_validation.rs @@ -1,10 +1,12 @@ 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, diff --git a/crates/sargon-transaction-models/src/low_level/transaction_classes/detailed_manifest_class.rs b/crates/sargon-transaction-models/src/low_level/transaction_classes/detailed_manifest_class.rs index 78dbcc92e..014e8c74d 100644 --- a/crates/sargon-transaction-models/src/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-transaction-models/src/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 index 40b0ca07f..55726594b 100644 --- a/crates/sargon-transaction-models/src/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 @@ -29,9 +29,6 @@ impl DynamicallyAnalyzableManifest for TransactionManifest { #[cfg(test)] mod tests { - use radix_engine::transaction::{ - AbortReason, AbortResult, TransactionResult, - }; use super::*; diff --git a/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/instructions/instructions.rs b/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/instructions/instructions.rs index 94dd64fe3..01e07a759 100644 --- a/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/instructions/instructions.rs +++ b/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/instructions/instructions.rs @@ -1,9 +1,5 @@ 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; - #[derive(Clone, Debug, PartialEq, Eq, derive_more::Display)] #[display("{}", self.instructions_string())] pub struct Instructions { @@ -177,6 +173,13 @@ impl Instructions { } } +#[cfg(test)] +use radix_common::prelude::MANIFEST_SBOR_V1_MAX_DEPTH; +#[cfg(test)] +use radix_engine_toolkit::functions::address::decode as RET_decode_address; +#[cfg(test)] +use radix_transactions::manifest::CallMethod; + #[cfg(test)] impl Instructions { /// Utility function which uses `Instructions::new(, )` diff --git a/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/transaction_manifest.rs b/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/transaction_manifest.rs index a3640313c..145391090 100644 --- a/crates/sargon-transaction-models/src/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 @@ -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-transaction-models/src/low_level/v2/subintent.rs b/crates/sargon-transaction-models/src/low_level/v2/subintent.rs index f04ad375d..1100f8361 100644 --- a/crates/sargon-transaction-models/src/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)] @@ -141,11 +140,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-transaction-models/src/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 index 512bff84c..52a242d92 100644 --- a/crates/sargon-transaction-models/src/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)] diff --git a/crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/subintent_manifest.rs b/crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/subintent_manifest.rs index cc143fe7d..daba8852e 100644 --- a/crates/sargon-transaction-models/src/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-transaction-models/src/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 index 08ec33355..ed201ae4b 100644 --- a/crates/sargon-transaction-models/src/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/Cargo.toml b/crates/sargon/Cargo.toml index 2ac1a2379..8d3697844 100644 --- a/crates/sargon/Cargo.toml +++ b/crates/sargon/Cargo.toml @@ -24,6 +24,7 @@ sargon-profile = { path = "../sargon-profile" } sargon-factor-instances-provider = { path = "../sargon-factor-instances-provider" } gateway-models = { path = "../gateway-models" } sargon-clients = { path = "../sargon-clients" } +gateway-client-and-api = { path = "../gateway-client-and-api" } # === RADIX DEPENDENCIES === radix-engine = { workspace = true } 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/mod.rs b/crates/sargon/src/gateway_api/mod.rs deleted file mode 100644 index 0c84bf330..000000000 --- a/crates/sargon/src/gateway_api/mod.rs +++ /dev/null @@ -1,9 +0,0 @@ -mod assert_network_request; -mod client; -mod endpoints; -mod methods; - -pub use assert_network_request::*; -pub use client::*; -pub use endpoints::*; -pub use methods::*; diff --git a/crates/sargon/src/lib.rs b/crates/sargon/src/lib.rs index 549d47fb9..5da134617 100644 --- a/crates/sargon/src/lib.rs +++ b/crates/sargon/src/lib.rs @@ -11,7 +11,6 @@ #![feature(trivial_bounds)] #![allow(trivial_bounds)] -mod gateway_api; mod home_cards; mod needs_a_new_home_dumping_ground; mod radix_connect; @@ -21,6 +20,7 @@ mod system; mod types; pub mod prelude { + pub use gateway_client_and_api::prelude::*; pub use identified_vec_of::prelude::*; pub use sargon_addresses::prelude::*; pub use sargon_clients::prelude::*; @@ -33,7 +33,6 @@ pub mod prelude { pub use sargon_profile::prelude::*; pub use sargon_transaction_models::prelude::*; - pub use crate::gateway_api::*; pub use crate::home_cards::*; pub use crate::needs_a_new_home_dumping_ground::*; pub use crate::radix_connect::*; 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..01f8295f9 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 @@ -70,7 +70,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/system/sargon_os/profile_state_holder.rs b/crates/sargon/src/system/sargon_os/profile_state_holder.rs index 78cd5cbe3..0c010dab6 100644 --- a/crates/sargon/src/system/sargon_os/profile_state_holder.rs +++ b/crates/sargon/src/system/sargon_os/profile_state_holder.rs @@ -3,22 +3,6 @@ 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), -} - #[derive(Debug)] pub struct ProfileStateHolder { // This is pub(crate) for testing purposes only, i.e. causing the RwLock to be poisoned. diff --git a/crates/sargon/src/system/sargon_os/sargon_os.rs b/crates/sargon/src/system/sargon_os/sargon_os.rs index a9f0ee7a6..8cd2502cf 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os.rs +++ b/crates/sargon/src/system/sargon_os/sargon_os.rs @@ -17,6 +17,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 { 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< From f6628d13bd60b91919835c52eae65164e6fcb860 Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Wed, 1 Jan 2025 17:22:51 +0100 Subject: [PATCH 09/23] wip --- Cargo.lock | 2 + .../src/client/gateway_client.rs | 2 +- crates/gateway-client-and-api/src/lib.rs | 2 +- .../src/methods/page_methods.rs | 3 +- .../src/methods/state_methods.rs | 2 + .../cache}/factor_instances_cache.rs | 96 +-- .../cache}/keyed_instances.rs | 0 .../cache}/mod.rs | 0 .../factor_instances_cache_snapshot.rs | 2 +- .../factor_source_id_from_hash_dense_key.rs | 0 .../cache}/serializable_cache/mod.rs | 0 .../client.rs} | 3 +- .../factor_instances_cache_client/mod.rs | 7 + .../models/mod.rs | 3 + .../models/outcome.rs | 92 +++ .../file_system_client/file_system_client.rs | 1 - .../secure_storage_client.rs | 10 + .../src}/appendable_collection.rs | 8 - crates/sargon-core/src/lib.rs | 2 + .../{test => }/ephemeral_unsafe_storage.rs | 0 .../unsafe_storage_driver/support/mod.rs | 4 +- .../unsafe_storage_driver/support/test/mod.rs | 4 - .../Cargo.toml | 4 + .../src/lib.rs | 2 - ...curify_entity_factor_instances_provider.rs | 86 +-- .../src/types/mod.rs | 2 - ...n_interactor_from_secure_storage_client.rs | 11 +- .../src/factor_instance/factor_instances.rs | 9 + .../supporting_types/account_or_persona.rs | 5 + .../src/v100/entity/account/account.rs | 6 + .../src/v100/entity/has_security_state.rs | 6 - .../src/v100/entity/persona/persona.rs | 7 + .../factor_instances_provider_unit_tests.rs | 688 ++++++++++-------- 33 files changed, 533 insertions(+), 536 deletions(-) rename crates/{sargon-factor-instances-provider/src/factor_instances_cache => sargon-clients/src/clients/client/factor_instances_cache_client/cache}/factor_instances_cache.rs (92%) rename crates/{sargon-factor-instances-provider/src/factor_instances_cache => sargon-clients/src/clients/client/factor_instances_cache_client/cache}/keyed_instances.rs (100%) rename crates/{sargon-factor-instances-provider/src/factor_instances_cache => sargon-clients/src/clients/client/factor_instances_cache_client/cache}/mod.rs (100%) rename crates/{sargon-factor-instances-provider/src/factor_instances_cache => sargon-clients/src/clients/client/factor_instances_cache_client/cache}/serializable_cache/factor_instances_cache_snapshot.rs (97%) rename crates/{sargon-factor-instances-provider/src/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-factor-instances-provider/src/factor_instances_cache => sargon-clients/src/clients/client/factor_instances_cache_client/cache}/serializable_cache/mod.rs (100%) rename crates/sargon-clients/src/clients/client/{factor_instances_cache_client.rs => 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-factor-instances-provider/src/types => sargon-core/src}/appendable_collection.rs (92%) rename crates/sargon-drivers/src/drivers/unsafe_storage_driver/support/{test => }/ephemeral_unsafe_storage.rs (100%) delete mode 100644 crates/sargon-drivers/src/drivers/unsafe_storage_driver/support/test/mod.rs diff --git a/Cargo.lock b/Cargo.lock index 022797213..2e253864f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3106,9 +3106,11 @@ dependencies = [ name = "sargon-factor-instances-provider" version = "1.2.1" dependencies = [ + "actix-rt", "aes-gcm", "arraystring", "assert-json-diff", + "async-trait", "delegate", "derive_more", "enum-as-inner", diff --git a/crates/gateway-client-and-api/src/client/gateway_client.rs b/crates/gateway-client-and-api/src/client/gateway_client.rs index 20ec11b7a..27335727b 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::prelude::Gateway; +use sargon_profile_gateway::prelude::Gateway; use crate::prelude::*; diff --git a/crates/gateway-client-and-api/src/lib.rs b/crates/gateway-client-and-api/src/lib.rs index 1b491d40a..7b7879ee2 100644 --- a/crates/gateway-client-and-api/src/lib.rs +++ b/crates/gateway-client-and-api/src/lib.rs @@ -18,7 +18,7 @@ pub mod prelude { pub(crate) use radix_common::prelude::ACCOUNT_OWNER_BADGE as SCRYPTO_ACCOUNT_OWNER_BADGE; - pub(crate) use serde_json::*; + pub(crate) use serde::{Deserialize, Serialize}; } pub use prelude::*; diff --git a/crates/gateway-client-and-api/src/methods/page_methods.rs b/crates/gateway-client-and-api/src/methods/page_methods.rs index 9b2efb344..bdb8659da 100644 --- a/crates/gateway-client-and-api/src/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/gateway-client-and-api/src/methods/state_methods.rs b/crates/gateway-client-and-api/src/methods/state_methods.rs index 12ca03b67..a8af52b06 100644 --- a/crates/gateway-client-and-api/src/methods/state_methods.rs +++ b/crates/gateway-client-and-api/src/methods/state_methods.rs @@ -413,6 +413,7 @@ impl GatewayClient { 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; @@ -684,6 +685,7 @@ mod fetch_all_resources_tests { 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-factor-instances-provider/src/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-factor-instances-provider/src/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 1867da3a1..f6ba80cb0 100644 --- a/crates/sargon-factor-instances-provider/src/factor_instances_cache/factor_instances_cache.rs +++ b/crates/sargon-clients/src/clients/client/factor_instances_cache_client/cache/factor_instances_cache.rs @@ -97,7 +97,7 @@ pub struct FactorInstancesCache { map: RwLock, } -pub(super) type FICStorage = IndexMap< +pub type FICStorage = IndexMap< FactorSourceIDFromHash, IndexMap, >; @@ -395,97 +395,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 +513,6 @@ impl FactorInstancesCache { } } -#[cfg(test)] impl FactorInstancesCache { pub fn get_poly_factor_with_quantities( &self, @@ -659,8 +567,6 @@ impl FactorInstancesCache { #[cfg(test)] mod tests { - use crate::next_index_assigner; - use super::*; #[allow(clippy::upper_case_acronyms)] diff --git a/crates/sargon-factor-instances-provider/src/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-factor-instances-provider/src/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-factor-instances-provider/src/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-factor-instances-provider/src/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-factor-instances-provider/src/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 97% rename from crates/sargon-factor-instances-provider/src/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 34a6a35c6..e6c90d36d 100644 --- a/crates/sargon-factor-instances-provider/src/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,4 +1,4 @@ -use crate::{factor_instances_cache::FICStorage, prelude::*}; +use crate::prelude::*; pub type DenseKeyStorage = IndexMap< FactorSourceIDFromHashDenseKey, diff --git a/crates/sargon-factor-instances-provider/src/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-factor-instances-provider/src/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-factor-instances-provider/src/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-factor-instances-provider/src/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-clients/src/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-clients/src/clients/client/factor_instances_cache_client.rs rename to crates/sargon-clients/src/clients/client/factor_instances_cache_client/client.rs index 63f3bda03..5507d90ab 100644 --- a/crates/sargon-clients/src/clients/client/factor_instances_cache_client.rs +++ b/crates/sargon-clients/src/clients/client/factor_instances_cache_client/client.rs @@ -196,13 +196,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-clients/src/clients/client/file_system_client/file_system_client.rs b/crates/sargon-clients/src/clients/client/file_system_client/file_system_client.rs index b6f2c6a02..153fd423f 100644 --- a/crates/sargon-clients/src/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-clients/src/clients/client/secure_storage_client/secure_storage_client.rs b/crates/sargon-clients/src/clients/client/secure_storage_client/secure_storage_client.rs index 8d0411932..a367bf952 100644 --- a/crates/sargon-clients/src/clients/client/secure_storage_client/secure_storage_client.rs +++ b/crates/sargon-clients/src/clients/client/secure_storage_client/secure_storage_client.rs @@ -14,6 +14,16 @@ 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`. diff --git a/crates/sargon-factor-instances-provider/src/types/appendable_collection.rs b/crates/sargon-core/src/appendable_collection.rs similarity index 92% rename from crates/sargon-factor-instances-provider/src/types/appendable_collection.rs rename to crates/sargon-core/src/appendable_collection.rs index 117169660..4bb34a9d1 100644 --- a/crates/sargon-factor-instances-provider/src/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 8e72d5a7c..5c4fc19aa 100644 --- a/crates/sargon-core/src/lib.rs +++ b/crates/sargon-core/src/lib.rs @@ -12,6 +12,7 @@ mod metadata; mod network_id; mod secure_random_bytes; mod types; +mod appendable_collection; mod unsafe_id_stepper; mod unsigned_ints; @@ -28,6 +29,7 @@ pub mod prelude { pub use crate::encryption::*; pub use crate::has_sample_values::*; pub use crate::hash::*; + pub use crate::appendable_collection::*; pub use crate::image_url_utils::*; pub use crate::is_network_aware::*; pub use crate::metadata::*; diff --git a/crates/sargon-drivers/src/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-drivers/src/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-drivers/src/drivers/unsafe_storage_driver/support/mod.rs b/crates/sargon-drivers/src/drivers/unsafe_storage_driver/support/mod.rs index 25fb683bc..5c1a7cf02 100644 --- a/crates/sargon-drivers/src/drivers/unsafe_storage_driver/support/mod.rs +++ b/crates/sargon-drivers/src/drivers/unsafe_storage_driver/support/mod.rs @@ -1,5 +1,5 @@ -mod test; +mod ephemeral_unsafe_storage; mod unsafe_storage_key; -pub use test::*; +pub use ephemeral_unsafe_storage::*; pub use unsafe_storage_key::*; diff --git a/crates/sargon-drivers/src/drivers/unsafe_storage_driver/support/test/mod.rs b/crates/sargon-drivers/src/drivers/unsafe_storage_driver/support/test/mod.rs deleted file mode 100644 index a10d68eed..000000000 --- a/crates/sargon-drivers/src/drivers/unsafe_storage_driver/support/test/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[cfg(test)] -mod ephemeral_unsafe_storage; -#[cfg(test)] -pub use ephemeral_unsafe_storage::*; diff --git a/crates/sargon-factor-instances-provider/Cargo.toml b/crates/sargon-factor-instances-provider/Cargo.toml index cbe2de366..da2b7b657 100644 --- a/crates/sargon-factor-instances-provider/Cargo.toml +++ b/crates/sargon-factor-instances-provider/Cargo.toml @@ -29,6 +29,7 @@ radix-transactions = { workspace = true } 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 } @@ -53,3 +54,6 @@ 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 index 0fc683595..1ffc2022c 100644 --- a/crates/sargon-factor-instances-provider/src/lib.rs +++ b/crates/sargon-factor-instances-provider/src/lib.rs @@ -1,4 +1,3 @@ -mod factor_instances_cache; mod next_index_assigner; mod provider; mod types; @@ -15,7 +14,6 @@ pub mod prelude { pub(crate) use sargon_profile_logic::prelude::*; pub(crate) use sargon_profile_supporting_types::prelude::*; - pub use crate::factor_instances_cache::*; pub use crate::next_index_assigner::*; pub use crate::provider::*; pub use crate::types::*; diff --git a/crates/sargon-factor-instances-provider/src/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 index 513b7b750..94c3d6359 100644 --- a/crates/sargon-factor-instances-provider/src/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; @@ -274,87 +272,5 @@ mod tests { .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-factor-instances-provider/src/types/mod.rs b/crates/sargon-factor-instances-provider/src/types/mod.rs index b688a5eef..dbd16a90f 100644 --- a/crates/sargon-factor-instances-provider/src/types/mod.rs +++ b/crates/sargon-factor-instances-provider/src/types/mod.rs @@ -1,5 +1,3 @@ -mod appendable_collection; mod test_derivation_interactor_from_secure_storage_client; -pub use appendable_collection::*; 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 index 8929ea010..917819eb1 100644 --- 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 @@ -1,3 +1,5 @@ +use crate::prelude::*; + pub trait TestDerivationInteractorFromSecureStorageClient: Sized { fn new( always_fail: bool, @@ -5,15 +7,6 @@ pub trait TestDerivationInteractorFromSecureStorageClient: Sized { ) -> 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 diff --git a/crates/sargon-factors/src/factor_instance/factor_instances.rs b/crates/sargon-factors/src/factor_instance/factor_instances.rs index 17f90edc7..aa0c890b5 100644 --- a/crates/sargon-factors/src/factor_instance/factor_instances.rs +++ b/crates/sargon-factors/src/factor_instance/factor_instances.rs @@ -15,6 +15,15 @@ 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-profile/src/supporting_types/account_or_persona.rs b/crates/sargon-profile/src/supporting_types/account_or_persona.rs index ecadf2e5d..21025b226 100644 --- a/crates/sargon-profile/src/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-profile/src/v100/entity/account/account.rs b/crates/sargon-profile/src/v100/entity/account/account.rs index 2ca523059..ef0510cb2 100644 --- a/crates/sargon-profile/src/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() diff --git a/crates/sargon-profile/src/v100/entity/has_security_state.rs b/crates/sargon-profile/src/v100/entity/has_security_state.rs index a3e68871f..6c47dbb39 100644 --- a/crates/sargon-profile/src/v100/entity/has_security_state.rs +++ b/crates/sargon-profile/src/v100/entity/has_security_state.rs @@ -1,11 +1,5 @@ use crate::prelude::*; -impl HasFactorInstances for T { - fn unique_tx_signing_factor_instances(&self) -> IndexSet { - self.security_state().unique_tx_signing_factor_instances() - } -} - pub trait HasSecurityState: HasFactorInstances + IsSecurityStateAware { fn security_state(&self) -> EntitySecurityState; fn set_security_state_unchecked(&mut self, new_state: EntitySecurityState); diff --git a/crates/sargon-profile/src/v100/entity/persona/persona.rs b/crates/sargon-profile/src/v100/entity/persona/persona.rs index 3c97572ba..b6be8e40e 100644 --- a/crates/sargon-profile/src/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() 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 411bf52db..e5740cf1f 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 @@ -434,11 +434,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 +452,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 +465,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 +500,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 +563,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 +651,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 +986,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 +1038,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 +1051,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 +1079,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 +1092,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 +1129,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 +1172,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 +1185,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 +1223,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 +1232,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 +1273,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 +1333,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 +1371,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 +1419,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 +1505,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 +1520,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 +1535,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 +1606,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 +1621,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 +1636,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 +1663,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 +1726,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 +1748,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 +1761,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 +1795,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 +1837,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 +1846,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 +1882,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 +1934,7 @@ async fn securified_personas() { assert_eq!( batman_matrix - .primary_role + .primary() .all_factors() .into_iter() .map(|f| f.factor_source_id) @@ -1971,9 +1947,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 +1975,7 @@ async fn securified_personas() { assert_eq!( satoshi_matrix - .primary_role + .primary() .all_factors() .into_iter() .map(|f| f.factor_source_id) @@ -2012,9 +1988,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 +2028,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 +2076,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 +2089,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 +2126,7 @@ async fn securified_personas() { assert_eq!( batman_matrix - .primary_role + .primary() .all_factors() .into_iter() .map(|f| f.factor_source_id) @@ -2157,9 +2135,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 +2200,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 +2335,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 +2408,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 +2531,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 +2577,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 +2601,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 +2647,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 +2686,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 +2713,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 +2759,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 +2860,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())) @@ -2917,4 +2889,88 @@ async fn securified_accounts_and_personas_mixed_asymmetric_indices() { .collect::>() ); } + + #[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); + } } From 4574035b6d3cb36ebaf2017b0ebe90d9dd5bf3e8 Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Wed, 1 Jan 2025 21:18:11 +0100 Subject: [PATCH 10/23] disabled sargon-uniffi for now --- Cargo.lock | 556 +----------------- Cargo.toml | 2 +- .../client/gateway_client_dispatch_request.rs | 6 +- .../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/state_methods.rs | 2 - .../src/address/account_address.rs | 2 + crates/sargon-core/src/lib.rs | 4 +- .../support/event_profile_modified.rs | 15 +- ...curify_entity_factor_instances_provider.rs | 2 - ...n_interactor_from_secure_storage_client.rs | 1 - .../src/factor_instance/factor_instances.rs | 1 - .../assets_transfers/mod.rs | 4 +- ...> owned_or_third_party_account_address.rs} | 0 .../authorized_dapp/authorized_dapp.rs | 2 - .../src/low_level/signed_intent.rs | 14 + .../src/low_level/v1/transaction_intent.rs | 6 + .../src/low_level/v2/signed_subintent.rs | 14 + .../src/low_level/v2/subintent.rs | 6 + crates/sargon-uniffi/Cargo.toml | 1 + crates/sargon-uniffi/src/lib.rs | 2 +- .../assets_transfers/account_or_address_of.rs | 27 - .../assets_transfers/mod.rs | 2 - .../owned_or_third_party_account_address.rs | 26 +- crates/sargon/Cargo.toml | 3 + crates/sargon/src/lib.rs | 2 + .../mobile/relay_service/service.rs | 15 +- .../radix_connect/well_known_client/client.rs | 10 +- .../signatures_collector_preprocessor.rs | 2 +- .../signing/signables/signable_subintent.rs | 20 - .../signables/signable_transaction_intent.rs | 20 - ...th_factor_source_and_derivation_outcome.rs | 121 ++-- .../system/sargon_os/sargon_os_accounts.rs | 17 +- .../src/system/sargon_os/sargon_os_factors.rs | 2 +- 36 files changed, 227 insertions(+), 728 deletions(-) rename crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/{account_or_address_of.rs => owned_or_third_party_account_address.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 diff --git a/Cargo.lock b/Cargo.lock index 2e253864f..f48ba3799 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -124,55 +124,12 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "anstream" -version = "0.6.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - [[package]] name = "anstyle" version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" -[[package]] -name = "anstyle-parse" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" -dependencies = [ - "anstyle", - "windows-sys 0.52.0", -] - [[package]] name = "anyhow" version = "1.0.91" @@ -381,30 +338,12 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" -[[package]] -name = "basic-toml" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "823388e228f614e9558c6804262db37960ec8821856535f5c3f59913140558f8" -dependencies = [ - "serde", -] - [[package]] name = "bech32" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - [[package]] name = "bip39" version = "2.0.0" @@ -547,20 +486,6 @@ dependencies = [ "serde_json 1.0.132", ] -[[package]] -name = "cargo_metadata" -version = "0.15.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" -dependencies = [ - "camino 1.1.9", - "cargo-platform", - "semver", - "serde", - "serde_json 1.0.132", - "thiserror 1.0.65", -] - [[package]] name = "cargo_toml" version = "0.15.3" @@ -568,7 +493,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "599aa35200ffff8f04c1925aa1acc92fa2e08874379ef42e210a80e527e60838" dependencies = [ "serde", - "toml 0.7.8", + "toml", ] [[package]] @@ -577,7 +502,7 @@ version = "0.15.3" source = "git+https://gitlab.com/lib.rs/cargo_toml?rev=e498c94fc42a660c1ca1a28999ce1d757cfe77fe#e498c94fc42a660c1ca1a28999ce1d757cfe77fe" dependencies = [ "serde", - "toml 0.7.8", + "toml", ] [[package]] @@ -618,86 +543,6 @@ dependencies = [ "inout", ] -[[package]] -name = "clap" -version = "4.5.1" -source = "git+https://github.com/clap-rs/clap/?rev=8a7a13a5618cfdc4ff328624a5266e7b4d88649a#8a7a13a5618cfdc4ff328624a5266e7b4d88649a" -dependencies = [ - "clap_builder 4.5.1", - "clap_derive 4.5.0", -] - -[[package]] -name = "clap" -version = "4.5.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" -dependencies = [ - "clap_builder 4.5.20", - "clap_derive 4.5.18", -] - -[[package]] -name = "clap_builder" -version = "4.5.1" -source = "git+https://github.com/clap-rs/clap/?rev=8a7a13a5618cfdc4ff328624a5266e7b4d88649a#8a7a13a5618cfdc4ff328624a5266e7b4d88649a" -dependencies = [ - "anstyle", - "clap_lex 0.7.0", -] - -[[package]] -name = "clap_builder" -version = "4.5.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" -dependencies = [ - "anstream", - "anstyle", - "clap_lex 0.7.2", - "strsim", -] - -[[package]] -name = "clap_derive" -version = "4.5.0" -source = "git+https://github.com/clap-rs/clap/?rev=8a7a13a5618cfdc4ff328624a5266e7b4d88649a#8a7a13a5618cfdc4ff328624a5266e7b4d88649a" -dependencies = [ - "heck 0.4.1", - "proc-macro2", - "quote", - "syn 2.0.85", -] - -[[package]] -name = "clap_derive" -version = "4.5.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" -dependencies = [ - "heck 0.5.0", - "proc-macro2", - "quote", - "syn 2.0.85", -] - -[[package]] -name = "clap_lex" -version = "0.7.0" -source = "git+https://github.com/clap-rs/clap/?rev=8a7a13a5618cfdc4ff328624a5266e7b4d88649a#8a7a13a5618cfdc4ff328624a5266e7b4d88649a" - -[[package]] -name = "clap_lex" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" - -[[package]] -name = "colorchoice" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" - [[package]] name = "colored" version = "2.1.0" @@ -1028,7 +873,7 @@ name = "enum-as-inner" version = "0.6.0" source = "git+https://github.com/bluejekyll/enum-as-inner/?rev=c15f6e5c4f98ec865e181ae1fff9fc13a1a2e4e2#c15f6e5c4f98ec865e181ae1fff9fc13a1a2e4e2" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro2", "quote", "syn 2.0.85", @@ -1061,7 +906,7 @@ dependencies = [ "humantime", "is-terminal", "log", - "regex 1.9.3 (registry+https://github.com/rust-lang/crates.io-index)", + "regex", "termcolor", ] @@ -1186,15 +1031,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "fs-err" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" -dependencies = [ - "autocfg", -] - [[package]] name = "futures" version = "0.3.31" @@ -1416,17 +1252,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "goblin" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b363a30c165f666402fe6a3024d3bec7ebc898f96a4a23bd1c99f8dbf3f4f47" -dependencies = [ - "log", - "plain", - "scroll", -] - [[package]] name = "group" version = "0.13.0" @@ -1466,12 +1291,6 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -1750,12 +1569,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "is_terminal_polyfill" -version = "1.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" - [[package]] name = "iso8601-timestamp" version = "0.2.17" @@ -1902,22 +1715,6 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" -[[package]] -name = "mime_guess" -version = "2.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" -dependencies = [ - "mime", - "unicase", -] - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - [[package]] name = "miniz_oxide" version = "0.8.0" @@ -1984,16 +1781,6 @@ dependencies = [ "tempfile", ] -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - [[package]] name = "num-bigint" version = "0.4.6" @@ -2203,12 +1990,6 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" -[[package]] -name = "plain" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" - [[package]] name = "polling" version = "3.7.4" @@ -2251,15 +2032,6 @@ dependencies = [ "zerocopy", ] -[[package]] -name = "preinterpret" -version = "0.2.0" -source = "git+https://github.com/dhedey/preinterpret?rev=6754b92bdead0ddd6f69fbee7d782180d6351605#6754b92bdead0ddd6f69fbee7d782180d6351605" -dependencies = [ - "proc-macro2", - "syn 2.0.85", -] - [[package]] name = "pretty_assertions" version = "1.4.0" @@ -2401,7 +2173,7 @@ dependencies = [ "radix-common", "radix-common-derive", "radix-rust", - "regex 1.9.3 (registry+https://github.com/rust-lang/crates.io-index)", + "regex", "sbor", "serde", "serde_json 1.0.132", @@ -2445,7 +2217,7 @@ dependencies = [ "radix-substate-store-interface", "radix-substate-store-queries", "radix-transactions", - "regex 1.9.3 (registry+https://github.com/rust-lang/crates.io-index)", + "regex", "sbor", "sbor-json", "scrypto", @@ -2624,29 +2396,8 @@ checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.9", - "regex-syntax 0.7.5", -] - -[[package]] -name = "regex" -version = "1.9.3" -source = "git+https://github.com/rust-lang/regex/?rev=72f889ef3cca59ebac6a026f3646e8d92f056d88#72f889ef3cca59ebac6a026f3646e8d92f056d88" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata 0.3.6", - "regex-syntax 0.7.4", -] - -[[package]] -name = "regex-automata" -version = "0.3.6" -source = "git+https://github.com/rust-lang/regex/?rev=72f889ef3cca59ebac6a026f3646e8d92f056d88#72f889ef3cca59ebac6a026f3646e8d92f056d88" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.7.4", + "regex-automata", + "regex-syntax", ] [[package]] @@ -2657,14 +2408,9 @@ checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.5", + "regex-syntax", ] -[[package]] -name = "regex-syntax" -version = "0.7.4" -source = "git+https://github.com/rust-lang/regex/?rev=72f889ef3cca59ebac6a026f3646e8d92f056d88#72f889ef3cca59ebac6a026f3646e8d92f056d88" - [[package]] name = "regex-syntax" version = "0.7.5" @@ -2719,57 +2465,12 @@ dependencies = [ "subtle", ] -[[package]] -name = "rinja" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dc4940d00595430b3d7d5a01f6222b5e5b51395d1120bdb28d854bb8abb17a5" -dependencies = [ - "itoa", - "rinja_derive", -] - -[[package]] -name = "rinja_derive" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d9ed0146aef6e2825f1b1515f074510549efba38d71f4554eec32eb36ba18b" -dependencies = [ - "basic-toml", - "memchr", - "mime", - "mime_guess", - "proc-macro2", - "quote", - "rinja_parser", - "rustc-hash", - "serde", - "syn 2.0.85", -] - -[[package]] -name = "rinja_parser" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f9a866e2e00a7a1fb27e46e9e324a6f7c0e7edc4543cae1d38f4e4a100c610" -dependencies = [ - "memchr", - "nom", - "serde", -] - [[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" @@ -2872,12 +2573,15 @@ dependencies = [ "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", @@ -3631,42 +3335,6 @@ dependencies = [ "zeroize 1.7.0", ] -[[package]] -name = "sargon-uniffi" -version = "1.2.1" -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", - "hex 0.4.3 (git+https://github.com/KokaKiwi/rust-hex/?rev=b2b4370b5bf021b98ee7adc92233e8de3f2de792)", - "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-core", - "sargon-uniffi-conversion-macros", - "strum 0.26.1", - "thiserror 1.0.50", - "uniffi", - "url", - "uuid 1.6.1", - "zeroize 1.7.0", -] - [[package]] name = "sargon-uniffi-conversion-macros" version = "0.1.0" @@ -3721,7 +3389,7 @@ dependencies = [ "bech32", "radix-common", "radix-engine-interface", - "regex 1.9.3 (registry+https://github.com/rust-lang/crates.io-index)", + "regex", "sbor", "serde", "serde_json 1.0.132", @@ -3752,26 +3420,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "scroll" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ab8598aa408498679922eff7fa985c25d58a90771bd6be794434c5277eab1a6" -dependencies = [ - "scroll_derive", -] - -[[package]] -name = "scroll_derive" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f81c2fde025af7e69b1d1420531c8a8811ca898919db177141a85313b1cb932" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.85", -] - [[package]] name = "scrypto" version = "1.3.0" @@ -3802,7 +3450,7 @@ dependencies = [ "quote", "radix-blueprint-schema-init", "radix-common", - "regex 1.9.3 (registry+https://github.com/rust-lang/crates.io-index)", + "regex", "sbor", "serde", "serde_json 1.0.132", @@ -4051,12 +3699,6 @@ dependencies = [ "rand_core 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "siphasher" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" - [[package]] name = "skeptic" version = "0.13.7" @@ -4064,7 +3706,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16d23b015676c90a0f01c197bfdc786c20342c73a0afdda9025adb0bc42940a8" dependencies = [ "bytecount", - "cargo_metadata 0.14.2", + "cargo_metadata", "error-chain", "glob", "pulldown-cmark", @@ -4087,12 +3729,6 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" -[[package]] -name = "smawk" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" - [[package]] name = "socket2" version = "0.5.7" @@ -4119,12 +3755,6 @@ dependencies = [ "der", ] -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - [[package]] name = "string-interner" version = "0.17.0" @@ -4165,7 +3795,7 @@ version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro2", "quote", "rustversion", @@ -4177,7 +3807,7 @@ name = "strum_macros" version = "0.26.1" source = "git+https://github.com/Peternator7/strum/?rev=f746c3699acf150112e26c00e6c8ca666d8d068d#f746c3699acf150112e26c00e6c8ca666d8d068d" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro2", "quote", "rustversion", @@ -4246,15 +3876,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "textwrap" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" -dependencies = [ - "smawk", -] - [[package]] name = "thiserror" version = "1.0.50" @@ -4375,15 +3996,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "toml" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde", -] - [[package]] name = "toml" version = "0.7.8" @@ -4500,126 +4112,6 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" -[[package]] -name = "uniffi" -version = "0.28.3" -source = "git+https://github.com/mozilla/uniffi-rs/?rev=9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d#9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d" -dependencies = [ - "anyhow", - "camino 1.1.9", - "cargo_metadata 0.15.4", - "clap 4.5.20", - "uniffi_bindgen", - "uniffi_build", - "uniffi_core", - "uniffi_macros", -] - -[[package]] -name = "uniffi_bindgen" -version = "0.28.3" -source = "git+https://github.com/mozilla/uniffi-rs/?rev=9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d#9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d" -dependencies = [ - "anyhow", - "camino 1.1.9", - "cargo_metadata 0.15.4", - "fs-err", - "glob", - "goblin", - "heck 0.5.0", - "once_cell 1.20.2", - "paste 1.0.15", - "rinja", - "serde", - "textwrap", - "toml 0.5.11", - "uniffi_meta", - "uniffi_testing", - "uniffi_udl", -] - -[[package]] -name = "uniffi_build" -version = "0.28.3" -source = "git+https://github.com/mozilla/uniffi-rs/?rev=9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d#9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d" -dependencies = [ - "anyhow", - "camino 1.1.9", - "uniffi_bindgen", -] - -[[package]] -name = "uniffi_checksum_derive" -version = "0.28.3" -source = "git+https://github.com/mozilla/uniffi-rs/?rev=9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d#9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d" -dependencies = [ - "quote", - "syn 2.0.85", -] - -[[package]] -name = "uniffi_core" -version = "0.28.3" -source = "git+https://github.com/mozilla/uniffi-rs/?rev=9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d#9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d" -dependencies = [ - "anyhow", - "bytes", - "once_cell 1.20.2", - "paste 1.0.15", - "static_assertions", -] - -[[package]] -name = "uniffi_macros" -version = "0.28.3" -source = "git+https://github.com/mozilla/uniffi-rs/?rev=9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d#9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d" -dependencies = [ - "bincode", - "camino 1.1.9", - "fs-err", - "once_cell 1.20.2", - "proc-macro2", - "quote", - "serde", - "syn 2.0.85", - "toml 0.5.11", - "uniffi_meta", -] - -[[package]] -name = "uniffi_meta" -version = "0.28.3" -source = "git+https://github.com/mozilla/uniffi-rs/?rev=9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d#9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d" -dependencies = [ - "anyhow", - "bytes", - "siphasher", - "uniffi_checksum_derive", -] - -[[package]] -name = "uniffi_testing" -version = "0.28.3" -source = "git+https://github.com/mozilla/uniffi-rs/?rev=9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d#9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d" -dependencies = [ - "anyhow", - "camino 1.1.9", - "cargo_metadata 0.15.4", - "fs-err", - "once_cell 1.20.2", -] - -[[package]] -name = "uniffi_udl" -version = "0.28.3" -source = "git+https://github.com/mozilla/uniffi-rs/?rev=9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d#9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d" -dependencies = [ - "anyhow", - "textwrap", - "uniffi_meta", - "weedle2", -] - [[package]] name = "universal-hash" version = "0.5.1" @@ -4642,12 +4134,6 @@ dependencies = [ "serde", ] -[[package]] -name = "utf8parse" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" - [[package]] name = "uuid" version = "1.6.1" @@ -4879,14 +4365,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "weedle2" -version = "5.0.0" -source = "git+https://github.com/mozilla/uniffi-rs/?rev=9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d#9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d" -dependencies = [ - "nom", -] - [[package]] name = "winapi-util" version = "0.1.9" diff --git a/Cargo.toml b/Cargo.toml index 9808b3728..6bff98ab8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,7 +34,7 @@ members = [ "crates/sargon", # to be split "crates/sargon-uniffi-conversion-macros", - "crates/sargon-uniffi", + # "crates/sargon-uniffi", ] [profile.release] 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 index cbd86f1ac..35b825030 100644 --- 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 @@ -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,7 +54,7 @@ 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)) } diff --git a/crates/gateway-client-and-api/src/endpoints/state_endpoints.rs b/crates/gateway-client-and-api/src/endpoints/state_endpoints.rs index 1d9b84c68..def9cf49d 100644 --- a/crates/gateway-client-and-api/src/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/gateway-client-and-api/src/endpoints/status_endpoints.rs b/crates/gateway-client-and-api/src/endpoints/status_endpoints.rs index fcddffc0f..4dcf19297 100644 --- a/crates/gateway-client-and-api/src/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/gateway-client-and-api/src/endpoints/transaction_endpoints.rs b/crates/gateway-client-and-api/src/endpoints/transaction_endpoints.rs index caa52ff68..28b97d88c 100644 --- a/crates/gateway-client-and-api/src/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 index 7b7879ee2..085cbf367 100644 --- a/crates/gateway-client-and-api/src/lib.rs +++ b/crates/gateway-client-and-api/src/lib.rs @@ -4,21 +4,21 @@ mod endpoints; mod methods; pub mod prelude { - pub(crate) use crate::assert_network_request::*; + pub use crate::assert_network_request::*; pub use crate::client::*; pub use crate::endpoints::*; pub use crate::methods::*; - pub(crate) use gateway_logic::prelude::*; - pub(crate) use gateway_models::prelude::*; - pub(crate) use http_client::prelude::*; - pub(crate) use sargon_core::prelude::*; - pub(crate) use sargon_drivers::prelude::*; - pub(crate) use sargon_transaction_models::prelude::*; + pub use gateway_logic::prelude::*; + pub use gateway_models::prelude::*; + pub use http_client::prelude::*; + pub use sargon_core::prelude::*; + pub use sargon_drivers::prelude::*; + pub use sargon_transaction_models::prelude::*; - pub(crate) use radix_common::prelude::ACCOUNT_OWNER_BADGE as SCRYPTO_ACCOUNT_OWNER_BADGE; + pub use radix_common::prelude::ACCOUNT_OWNER_BADGE as SCRYPTO_ACCOUNT_OWNER_BADGE; - pub(crate) use serde::{Deserialize, Serialize}; + pub use serde::{Deserialize, Serialize}; } pub use 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 index a8af52b06..73a4ac3c5 100644 --- a/crates/gateway-client-and-api/src/methods/state_methods.rs +++ b/crates/gateway-client-and-api/src/methods/state_methods.rs @@ -1,7 +1,5 @@ use crate::prelude::*; -pub type DappDefinitionAddress = AccountAddress; - impl GatewayClient { /// Fetched the XRD balance of account of `address`, returns `None` if /// it has no balance. 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-core/src/lib.rs b/crates/sargon-core/src/lib.rs index 5c4fc19aa..e0c8b2e95 100644 --- a/crates/sargon-core/src/lib.rs +++ b/crates/sargon-core/src/lib.rs @@ -3,6 +3,7 @@ #![feature(trivial_bounds)] #![allow(trivial_bounds)] +mod appendable_collection; mod encryption; mod has_sample_values; mod hash; @@ -12,7 +13,6 @@ mod metadata; mod network_id; mod secure_random_bytes; mod types; -mod appendable_collection; mod unsafe_id_stepper; mod unsigned_ints; @@ -26,10 +26,10 @@ 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::appendable_collection::*; pub use crate::image_url_utils::*; pub use crate::is_network_aware::*; pub use crate::metadata::*; diff --git a/crates/sargon-drivers/src/drivers/event_bus_driver/support/event_profile_modified.rs b/crates/sargon-drivers/src/drivers/event_bus_driver/support/event_profile_modified.rs index d64b69aa7..ebb669832 100644 --- a/crates/sargon-drivers/src/drivers/event_bus_driver/support/event_profile_modified.rs +++ b/crates/sargon-drivers/src/drivers/event_bus_driver/support/event_profile_modified.rs @@ -69,19 +69,17 @@ impl HasEventKind for EventProfileModified { } } -pub trait IsProfileModifiedEvent { - type Address: Clone + Eq + StdHash; +pub trait IsProfileModifiedEvent { fn profile_modified_event( is_update: bool, - addresses: IndexSet, + addresses: IndexSet
, ) -> Option; } -impl IsProfileModifiedEvent for Account { - type Address = AccountAddress; +impl IsProfileModifiedEvent for Account { fn profile_modified_event( is_update: bool, - addresses: IndexSet, + addresses: IndexSet, ) -> Option { let address = addresses.iter().last().cloned()?; let addresses = addresses.clone().into_iter().collect_vec(); @@ -103,11 +101,10 @@ impl IsProfileModifiedEvent for Account { } } -impl IsProfileModifiedEvent for Persona { - type Address = IdentityAddress; +impl IsProfileModifiedEvent for Persona { fn profile_modified_event( is_update: bool, - addresses: IndexSet, + addresses: IndexSet, ) -> Option { let address = addresses.iter().last().cloned()?; let addresses = addresses.clone().into_iter().collect_vec(); diff --git a/crates/sargon-factor-instances-provider/src/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 index 94c3d6359..fa92c3d0c 100644 --- a/crates/sargon-factor-instances-provider/src/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 @@ -271,6 +271,4 @@ mod tests { .await .unwrap(); } - - } 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 index 917819eb1..939bd147a 100644 --- 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 @@ -7,7 +7,6 @@ pub trait TestDerivationInteractorFromSecureStorageClient: Sized { ) -> Self; } - impl TestDerivationInteractorFromSecureStorageClient for TestDerivationInteractor { diff --git a/crates/sargon-factors/src/factor_instance/factor_instances.rs b/crates/sargon-factors/src/factor_instance/factor_instances.rs index aa0c890b5..ea1c2bdb1 100644 --- a/crates/sargon-factors/src/factor_instance/factor_instances.rs +++ b/crates/sargon-factors/src/factor_instance/factor_instances.rs @@ -23,7 +23,6 @@ impl AppendableCollection for FactorInstances { } } - impl FactorInstances { pub fn extend( &mut self, diff --git a/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/mod.rs b/crates/sargon-manifests/src/high_level/sargon_specific_types/assets_transfers/mod.rs index 2235168c5..1abd5ac33 100644 --- a/crates/sargon-manifests/src/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-manifests/src/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 100% rename from crates/sargon-manifests/src/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 diff --git a/crates/sargon-profile/src/v100/networks/network/authorized_dapp/authorized_dapp.rs b/crates/sargon-profile/src/v100/networks/network/authorized_dapp/authorized_dapp.rs index f403f6543..bca80141f 100644 --- a/crates/sargon-profile/src/v100/networks/network/authorized_dapp/authorized_dapp.rs +++ b/crates/sargon-profile/src/v100/networks/network/authorized_dapp/authorized_dapp.rs @@ -1,7 +1,5 @@ use crate::prelude::*; -pub type DappDefinitionAddress = AccountAddress; - /// A connection made between a Radix Dapp and the user. #[derive( Serialize, diff --git a/crates/sargon-transaction-models/src/low_level/signed_intent.rs b/crates/sargon-transaction-models/src/low_level/signed_intent.rs index 5989cfb56..1b5e14428 100644 --- a/crates/sargon-transaction-models/src/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-transaction-models/src/low_level/v1/transaction_intent.rs b/crates/sargon-transaction-models/src/low_level/v1/transaction_intent.rs index 9957d8285..f28b5a7c6 100644 --- a/crates/sargon-transaction-models/src/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-transaction-models/src/low_level/v2/signed_subintent.rs b/crates/sargon-transaction-models/src/low_level/v2/signed_subintent.rs index 2bc6c57ea..5c23ca40a 100644 --- a/crates/sargon-transaction-models/src/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-transaction-models/src/low_level/v2/subintent.rs b/crates/sargon-transaction-models/src/low_level/v2/subintent.rs index 1100f8361..2a7160553 100644 --- a/crates/sargon-transaction-models/src/low_level/v2/subintent.rs +++ b/crates/sargon-transaction-models/src/low_level/v2/subintent.rs @@ -9,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, diff --git a/crates/sargon-uniffi/Cargo.toml b/crates/sargon-uniffi/Cargo.toml index 888e60a20..a9a9d33b1 100644 --- a/crates/sargon-uniffi/Cargo.toml +++ b/crates/sargon-uniffi/Cargo.toml @@ -20,6 +20,7 @@ path = "src/bindgen/bin.rs" # === SARGON CRATES === sargon-core = { path = "../sargon-core" } sargon = { path = "../sargon" } +sargon-manifests = { path = "../sargon-manifests" } sargon-uniffi-conversion-macros = { path = "../sargon-uniffi-conversion-macros" } # === RADIX DEPENDENCIES === diff --git a/crates/sargon-uniffi/src/lib.rs b/crates/sargon-uniffi/src/lib.rs index 9d8cbc3c5..3069ae47a 100644 --- a/crates/sargon-uniffi/src/lib.rs +++ b/crates/sargon-uniffi/src/lib.rs @@ -48,7 +48,7 @@ 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, SerializeToBytes, SerializeToString, 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 c4edd1a84..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,27 +0,0 @@ -use crate::prelude::*; -use sargon::OwnedOrThirdPartyAccountAddress 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 OwnedOrThirdPartyAccountAddress { - OwnedAccount { value: Account }, - ThirdPartyAccount { value: AccountAddress }, -} - -#[uniffi::export] -pub fn new_account_or_address_of_sample() -> OwnedOrThirdPartyAccountAddress { - InternalAccountOrAddressOf::sample().into() -} - -#[uniffi::export] -pub fn new_account_or_address_of_sample_other( -) -> OwnedOrThirdPartyAccountAddress { - InternalAccountOrAddressOf::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/mod.rs b/crates/sargon-uniffi/src/wrapped_radix_engine_toolkit/high_level/sargon_specific_types/assets_transfers/mod.rs index 8e0ce4492..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,10 +1,8 @@ -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::*; 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 index 0afc40f03..5caef3d1d 100644 --- 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 @@ -1,7 +1,27 @@ -#[derive( - Debug, Clone, Copy, PartialEq, Eq, InternalConversion, uniffi::enum, -)] +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/Cargo.toml b/crates/sargon/Cargo.toml index 8d3697844..984f8ba3a 100644 --- a/crates/sargon/Cargo.toml +++ b/crates/sargon/Cargo.toml @@ -21,9 +21,12 @@ 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" } # === RADIX DEPENDENCIES === diff --git a/crates/sargon/src/lib.rs b/crates/sargon/src/lib.rs index 5da134617..e6456844a 100644 --- a/crates/sargon/src/lib.rs +++ b/crates/sargon/src/lib.rs @@ -31,6 +31,8 @@ pub mod prelude { pub use sargon_keys_collector::prelude::*; pub use sargon_manifests::prelude::*; pub use sargon_profile::prelude::*; + pub use sargon_profile_logic::prelude::*; + pub use sargon_profile_security_structures::prelude::*; pub use sargon_transaction_models::prelude::*; pub use crate::home_cards::*; 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..0b0c2a207 100644 --- a/crates/sargon/src/radix_connect/mobile/relay_service/service.rs +++ b/crates/sargon/src/radix_connect/mobile/relay_service/service.rs @@ -38,18 +38,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( 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/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/signables/signable_subintent.rs b/crates/sargon/src/signing/signables/signable_subintent.rs index 78db57555..41cf5e34c 100644 --- a/crates/sargon/src/signing/signables/signable_subintent.rs +++ b/crates/sargon/src/signing/signables/signable_subintent.rs @@ -33,26 +33,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/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 index 3894044cd..4eb98e9bf 100644 --- 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 @@ -61,6 +61,21 @@ pub trait EntityCreatingWithFactorSourceAndDerivationOutcome { )) } + 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, @@ -82,59 +97,6 @@ pub trait EntityCreatingWithFactorSourceAndDerivationOutcome { .map(|(x, y, z, _)| (x, y, z)) } - 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, - )) - } - async fn create_unsaved_persona_with_factor_source_with_derivation_outcome( &self, factor_source: FactorSource, @@ -204,6 +166,59 @@ pub trait EntityCreatingWithFactorSourceAndDerivationOutcome { } 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. 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..8facac78a 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os_accounts.rs +++ b/crates/sargon/src/system/sargon_os/sargon_os_accounts.rs @@ -553,7 +553,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 +753,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 +848,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)) 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..aec3c4dce 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. From 45be88f6c6c5ede8e7f5a1cd2eada18296defc1d Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Wed, 1 Jan 2025 21:37:14 +0100 Subject: [PATCH 11/23] test compiles --- .../src/types/response/ledger_state.rs | 2 +- .../transaction/status/transaction_status.rs | 9 +- .../transaction/subintent_status/response.rs | 7 +- .../factor_instances_cache_client/client.rs | 3 +- crates/sargon-drivers/src/drivers/drivers.rs | 1 - .../profile_change_driver/support/test/mod.rs | 2 - .../factor_instances_provider_outcome.rs | 7 +- ...r_instances_provider_outcome_for_factor.rs | 11 - .../transaction_manifest_execution_summary.rs | 12 +- ...rsion_100_patch_after_app_version_120.json | 1448 +++++++++++++++++ ...laintext_profile_snapshot_version_100.json | 1229 ++++++++++++++ .../signing/collector/signatures_collector.rs | 8 +- .../factor_instances_provider_unit_tests.rs | 144 +- crates/sargon/tests/integration/main.rs | 4 +- 14 files changed, 2784 insertions(+), 103 deletions(-) create mode 100644 crates/sargon/fixtures/vector/multi_profile_snapshots_test_version_100_patch_after_app_version_120.json create mode 100644 crates/sargon/fixtures/vector/only_plaintext_profile_snapshot_version_100.json diff --git a/crates/gateway-models/src/types/response/ledger_state.rs b/crates/gateway-models/src/types/response/ledger_state.rs index a520084b4..a771fae77 100644 --- a/crates/gateway-models/src/types/response/ledger_state.rs +++ b/crates/gateway-models/src/types/response/ledger_state.rs @@ -26,8 +26,8 @@ pub struct LedgerState { pub round: u64, } -#[cfg(test)] impl LedgerState { + /// For tests /// A sample used to facilitate unit tests. pub fn sample_stokenet() -> Self { Self { 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 index 2e0895e5e..723abb5f5 100644 --- a/crates/gateway-models/src/types/response/transaction/status/transaction_status.rs +++ b/crates/gateway-models/src/types/response/transaction/status/transaction_status.rs @@ -23,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( [ @@ -59,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/gateway-models/src/types/response/transaction/subintent_status/response.rs b/crates/gateway-models/src/types/response/transaction/subintent_status/response.rs index 40f2e14e5..d2edb91d8 100644 --- a/crates/gateway-models/src/types/response/transaction/subintent_status/response.rs +++ b/crates/gateway-models/src/types/response/transaction/subintent_status/response.rs @@ -29,10 +29,9 @@ impl SubintentStatusResponse { } } -#[cfg(test)] +/// === Helper functions to create sample responses === impl SubintentStatusResponse { - // Helper functions to create sample responses - + /// For tests pub fn sample_unknown() -> Self { Self::new( LedgerState::sample_stokenet(), @@ -41,10 +40,12 @@ impl SubintentStatusResponse { ) } + /// 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 { 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 5507d90ab..3dd543fcc 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 @@ -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, diff --git a/crates/sargon-drivers/src/drivers/drivers.rs b/crates/sargon-drivers/src/drivers/drivers.rs index 7e3ddd253..ff60a0694 100644 --- a/crates/sargon-drivers/src/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-drivers/src/drivers/profile_change_driver/support/test/mod.rs b/crates/sargon-drivers/src/drivers/profile_change_driver/support/test/mod.rs index 977e16559..cea09a871 100644 --- a/crates/sargon-drivers/src/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-factor-instances-provider/src/provider/outcome/factor_instances_provider_outcome.rs b/crates/sargon-factor-instances-provider/src/provider/outcome/factor_instances_provider_outcome.rs index 5bcac12a2..bd0a834d1 100644 --- a/crates/sargon-factor-instances-provider/src/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-factor-instances-provider/src/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 index 0fb61992a..886cb7982 100644 --- a/crates/sargon-factor-instances-provider/src/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,7 +79,6 @@ impl From for FactorInstancesProviderOutcomeForFactor { fn from(value: InternalFactorInstancesProviderOutcomeForFactor) -> Self { - #[cfg(test)] let _self = Self { hidden: HiddenConstructor, factor_source_id: value.factor_source_id, @@ -92,13 +88,6 @@ impl From 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-transaction-models/src/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 index 55726594b..0cd465091 100644 --- a/crates/sargon-transaction-models/src/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,6 +27,12 @@ impl DynamicallyAnalyzableManifest for TransactionManifest { } } +impl Default for FeeLocks { + fn default() -> Self { + Self::new(0, 0) + } +} + #[cfg(test)] mod tests { @@ -50,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/fixtures/vector/multi_profile_snapshots_test_version_100_patch_after_app_version_120.json b/crates/sargon/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/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/fixtures/vector/only_plaintext_profile_snapshot_version_100.json b/crates/sargon/fixtures/vector/only_plaintext_profile_snapshot_version_100.json new file mode 100644 index 000000000..d7ab5f8af --- /dev/null +++ b/crates/sargon/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/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/system/sargon_os/factor_instances_provider_unit_tests.rs b/crates/sargon/src/system/sargon_os/factor_instances_provider_unit_tests.rs index e5740cf1f..c6bfb9e6c 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 @@ -2889,88 +2889,84 @@ async fn securified_accounts_and_personas_mixed_asymmetric_indices() { .collect::>() ); } +} - #[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()); +#[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 (alice, derivation_outcome) = os - .create_and_save_new_mainnet_account_with_derivation_outcome( - "alice", - ) - .await - .unwrap(); - assert!(derivation_outcome.debug_was_derived.is_empty()); + 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()); - 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 (alice, derivation_outcome) = os + .create_and_save_new_mainnet_account_with_derivation_outcome("alice") + .await + .unwrap(); + assert!(derivation_outcome.debug_was_derived.is_empty()); - let matrix_0 = - MatrixOfFactorSources::new(matrix_ids, factor_sources).unwrap(); + 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 shield_0 = SecurityStructureOfFactorSources::new( - DisplayName::sample(), - matrix_0, - bdfs.clone(), - ); + let matrix_0 = + MatrixOfFactorSources::new(matrix_ids, factor_sources).unwrap(); - 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(); + 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); + assert_eq!(outcome.per_derivation_preset.len(), 4); - // don't forget to consume - instances_in_cache_consumer.consume().await.unwrap(); + // 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 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); - } + 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/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, )], From e19fcaf853f88f7016daca630c5bd37be9eb5aca Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Wed, 1 Jan 2025 22:04:47 +0100 Subject: [PATCH 12/23] resurrect and fix sargon-uniffi --- Cargo.lock | 568 +++++++++++++++++- Cargo.toml | 2 +- crates/sargon-uniffi/Cargo.toml | 17 +- crates/sargon-uniffi/src/lib.rs | 4 +- .../gateways/saved_gateways.rs | 1 + .../v100/networks/network/profile_network.rs | 1 + .../high_level/ret_api.rs | 12 + 7 files changed, 587 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f48ba3799..d99c62071 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -124,12 +124,55 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "anstream" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + [[package]] name = "anstyle" version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +[[package]] +name = "anstyle-parse" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" +dependencies = [ + "anstyle", + "windows-sys 0.59.0", +] + [[package]] name = "anyhow" version = "1.0.91" @@ -338,12 +381,30 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +[[package]] +name = "basic-toml" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "823388e228f614e9558c6804262db37960ec8821856535f5c3f59913140558f8" +dependencies = [ + "serde", +] + [[package]] name = "bech32" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + [[package]] name = "bip39" version = "2.0.0" @@ -486,6 +547,20 @@ dependencies = [ "serde_json 1.0.132", ] +[[package]] +name = "cargo_metadata" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" +dependencies = [ + "camino 1.1.9", + "cargo-platform", + "semver", + "serde", + "serde_json 1.0.132", + "thiserror 1.0.65", +] + [[package]] name = "cargo_toml" version = "0.15.3" @@ -493,7 +568,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "599aa35200ffff8f04c1925aa1acc92fa2e08874379ef42e210a80e527e60838" dependencies = [ "serde", - "toml", + "toml 0.7.8", ] [[package]] @@ -502,7 +577,7 @@ version = "0.15.3" source = "git+https://gitlab.com/lib.rs/cargo_toml?rev=e498c94fc42a660c1ca1a28999ce1d757cfe77fe#e498c94fc42a660c1ca1a28999ce1d757cfe77fe" dependencies = [ "serde", - "toml", + "toml 0.7.8", ] [[package]] @@ -543,6 +618,86 @@ dependencies = [ "inout", ] +[[package]] +name = "clap" +version = "4.5.1" +source = "git+https://github.com/clap-rs/clap/?rev=8a7a13a5618cfdc4ff328624a5266e7b4d88649a#8a7a13a5618cfdc4ff328624a5266e7b4d88649a" +dependencies = [ + "clap_builder 4.5.1", + "clap_derive 4.5.0", +] + +[[package]] +name = "clap" +version = "4.5.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84" +dependencies = [ + "clap_builder 4.5.23", + "clap_derive 4.5.18", +] + +[[package]] +name = "clap_builder" +version = "4.5.1" +source = "git+https://github.com/clap-rs/clap/?rev=8a7a13a5618cfdc4ff328624a5266e7b4d88649a#8a7a13a5618cfdc4ff328624a5266e7b4d88649a" +dependencies = [ + "anstyle", + "clap_lex 0.7.0", +] + +[[package]] +name = "clap_builder" +version = "4.5.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838" +dependencies = [ + "anstream", + "anstyle", + "clap_lex 0.7.4", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.0" +source = "git+https://github.com/clap-rs/clap/?rev=8a7a13a5618cfdc4ff328624a5266e7b4d88649a#8a7a13a5618cfdc4ff328624a5266e7b4d88649a" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "syn 2.0.85", +] + +[[package]] +name = "clap_derive" +version = "4.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.85", +] + +[[package]] +name = "clap_lex" +version = "0.7.0" +source = "git+https://github.com/clap-rs/clap/?rev=8a7a13a5618cfdc4ff328624a5266e7b4d88649a#8a7a13a5618cfdc4ff328624a5266e7b4d88649a" + +[[package]] +name = "clap_lex" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" + +[[package]] +name = "colorchoice" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" + [[package]] name = "colored" version = "2.1.0" @@ -873,7 +1028,7 @@ name = "enum-as-inner" version = "0.6.0" source = "git+https://github.com/bluejekyll/enum-as-inner/?rev=c15f6e5c4f98ec865e181ae1fff9fc13a1a2e4e2#c15f6e5c4f98ec865e181ae1fff9fc13a1a2e4e2" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "syn 2.0.85", @@ -906,7 +1061,7 @@ dependencies = [ "humantime", "is-terminal", "log", - "regex", + "regex 1.9.3 (registry+https://github.com/rust-lang/crates.io-index)", "termcolor", ] @@ -1031,6 +1186,15 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fs-err" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" +dependencies = [ + "autocfg", +] + [[package]] name = "futures" version = "0.3.31" @@ -1252,6 +1416,17 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "goblin" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b363a30c165f666402fe6a3024d3bec7ebc898f96a4a23bd1c99f8dbf3f4f47" +dependencies = [ + "log", + "plain", + "scroll", +] + [[package]] name = "group" version = "0.13.0" @@ -1291,6 +1466,12 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" version = "0.3.9" @@ -1569,6 +1750,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + [[package]] name = "iso8601-timestamp" version = "0.2.17" @@ -1715,6 +1902,22 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.8.0" @@ -1781,6 +1984,16 @@ dependencies = [ "tempfile", ] +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "num-bigint" version = "0.4.6" @@ -1990,6 +2203,12 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + [[package]] name = "polling" version = "3.7.4" @@ -2032,6 +2251,15 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "preinterpret" +version = "0.2.0" +source = "git+https://github.com/dhedey/preinterpret?rev=6754b92bdead0ddd6f69fbee7d782180d6351605#6754b92bdead0ddd6f69fbee7d782180d6351605" +dependencies = [ + "proc-macro2", + "syn 2.0.85", +] + [[package]] name = "pretty_assertions" version = "1.4.0" @@ -2173,7 +2401,7 @@ dependencies = [ "radix-common", "radix-common-derive", "radix-rust", - "regex", + "regex 1.9.3 (registry+https://github.com/rust-lang/crates.io-index)", "sbor", "serde", "serde_json 1.0.132", @@ -2217,7 +2445,7 @@ dependencies = [ "radix-substate-store-interface", "radix-substate-store-queries", "radix-transactions", - "regex", + "regex 1.9.3 (registry+https://github.com/rust-lang/crates.io-index)", "sbor", "sbor-json", "scrypto", @@ -2396,8 +2624,29 @@ checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a" dependencies = [ "aho-corasick", "memchr", - "regex-automata", - "regex-syntax", + "regex-automata 0.3.9", + "regex-syntax 0.7.5", +] + +[[package]] +name = "regex" +version = "1.9.3" +source = "git+https://github.com/rust-lang/regex/?rev=72f889ef3cca59ebac6a026f3646e8d92f056d88#72f889ef3cca59ebac6a026f3646e8d92f056d88" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.3.6", + "regex-syntax 0.7.4", +] + +[[package]] +name = "regex-automata" +version = "0.3.6" +source = "git+https://github.com/rust-lang/regex/?rev=72f889ef3cca59ebac6a026f3646e8d92f056d88#72f889ef3cca59ebac6a026f3646e8d92f056d88" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.7.4", ] [[package]] @@ -2408,9 +2657,14 @@ checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.7.5", ] +[[package]] +name = "regex-syntax" +version = "0.7.4" +source = "git+https://github.com/rust-lang/regex/?rev=72f889ef3cca59ebac6a026f3646e8d92f056d88#72f889ef3cca59ebac6a026f3646e8d92f056d88" + [[package]] name = "regex-syntax" version = "0.7.5" @@ -2465,12 +2719,57 @@ dependencies = [ "subtle", ] +[[package]] +name = "rinja" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dc4940d00595430b3d7d5a01f6222b5e5b51395d1120bdb28d854bb8abb17a5" +dependencies = [ + "itoa", + "rinja_derive", +] + +[[package]] +name = "rinja_derive" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d9ed0146aef6e2825f1b1515f074510549efba38d71f4554eec32eb36ba18b" +dependencies = [ + "basic-toml", + "memchr", + "mime", + "mime_guess", + "proc-macro2", + "quote", + "rinja_parser", + "rustc-hash", + "serde", + "syn 2.0.85", +] + +[[package]] +name = "rinja_parser" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f9a866e2e00a7a1fb27e46e9e324a6f7c0e7edc4543cae1d38f4e4a100c610" +dependencies = [ + "memchr", + "nom", + "serde", +] + [[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" @@ -3335,6 +3634,57 @@ dependencies = [ "zeroize 1.7.0", ] +[[package]] +name = "sargon-uniffi" +version = "1.2.1" +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", + "uniffi", + "url", + "uuid 1.6.1", + "zeroize 1.7.0", +] + [[package]] name = "sargon-uniffi-conversion-macros" version = "0.1.0" @@ -3389,7 +3739,7 @@ dependencies = [ "bech32", "radix-common", "radix-engine-interface", - "regex", + "regex 1.9.3 (registry+https://github.com/rust-lang/crates.io-index)", "sbor", "serde", "serde_json 1.0.132", @@ -3420,6 +3770,26 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "scroll" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ab8598aa408498679922eff7fa985c25d58a90771bd6be794434c5277eab1a6" +dependencies = [ + "scroll_derive", +] + +[[package]] +name = "scroll_derive" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f81c2fde025af7e69b1d1420531c8a8811ca898919db177141a85313b1cb932" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.85", +] + [[package]] name = "scrypto" version = "1.3.0" @@ -3450,7 +3820,7 @@ dependencies = [ "quote", "radix-blueprint-schema-init", "radix-common", - "regex", + "regex 1.9.3 (registry+https://github.com/rust-lang/crates.io-index)", "sbor", "serde", "serde_json 1.0.132", @@ -3699,6 +4069,12 @@ dependencies = [ "rand_core 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + [[package]] name = "skeptic" version = "0.13.7" @@ -3706,7 +4082,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16d23b015676c90a0f01c197bfdc786c20342c73a0afdda9025adb0bc42940a8" dependencies = [ "bytecount", - "cargo_metadata", + "cargo_metadata 0.14.2", "error-chain", "glob", "pulldown-cmark", @@ -3729,6 +4105,12 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +[[package]] +name = "smawk" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" + [[package]] name = "socket2" version = "0.5.7" @@ -3755,6 +4137,12 @@ dependencies = [ "der", ] +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "string-interner" version = "0.17.0" @@ -3795,7 +4183,7 @@ version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "rustversion", @@ -3807,7 +4195,7 @@ name = "strum_macros" version = "0.26.1" source = "git+https://github.com/Peternator7/strum/?rev=f746c3699acf150112e26c00e6c8ca666d8d068d#f746c3699acf150112e26c00e6c8ca666d8d068d" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "rustversion", @@ -3876,6 +4264,15 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "textwrap" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" +dependencies = [ + "smawk", +] + [[package]] name = "thiserror" version = "1.0.50" @@ -3996,6 +4393,15 @@ dependencies = [ "tokio", ] +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + [[package]] name = "toml" version = "0.7.8" @@ -4112,6 +4518,126 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" +[[package]] +name = "uniffi" +version = "0.28.3" +source = "git+https://github.com/mozilla/uniffi-rs/?rev=9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d#9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d" +dependencies = [ + "anyhow", + "camino 1.1.9", + "cargo_metadata 0.15.4", + "clap 4.5.23", + "uniffi_bindgen", + "uniffi_build", + "uniffi_core", + "uniffi_macros", +] + +[[package]] +name = "uniffi_bindgen" +version = "0.28.3" +source = "git+https://github.com/mozilla/uniffi-rs/?rev=9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d#9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d" +dependencies = [ + "anyhow", + "camino 1.1.9", + "cargo_metadata 0.15.4", + "fs-err", + "glob", + "goblin", + "heck 0.5.0", + "once_cell 1.20.2", + "paste 1.0.15", + "rinja", + "serde", + "textwrap", + "toml 0.5.11", + "uniffi_meta", + "uniffi_testing", + "uniffi_udl", +] + +[[package]] +name = "uniffi_build" +version = "0.28.3" +source = "git+https://github.com/mozilla/uniffi-rs/?rev=9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d#9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d" +dependencies = [ + "anyhow", + "camino 1.1.9", + "uniffi_bindgen", +] + +[[package]] +name = "uniffi_checksum_derive" +version = "0.28.3" +source = "git+https://github.com/mozilla/uniffi-rs/?rev=9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d#9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d" +dependencies = [ + "quote", + "syn 2.0.85", +] + +[[package]] +name = "uniffi_core" +version = "0.28.3" +source = "git+https://github.com/mozilla/uniffi-rs/?rev=9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d#9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d" +dependencies = [ + "anyhow", + "bytes", + "once_cell 1.20.2", + "paste 1.0.15", + "static_assertions", +] + +[[package]] +name = "uniffi_macros" +version = "0.28.3" +source = "git+https://github.com/mozilla/uniffi-rs/?rev=9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d#9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d" +dependencies = [ + "bincode", + "camino 1.1.9", + "fs-err", + "once_cell 1.20.2", + "proc-macro2", + "quote", + "serde", + "syn 2.0.85", + "toml 0.5.11", + "uniffi_meta", +] + +[[package]] +name = "uniffi_meta" +version = "0.28.3" +source = "git+https://github.com/mozilla/uniffi-rs/?rev=9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d#9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d" +dependencies = [ + "anyhow", + "bytes", + "siphasher", + "uniffi_checksum_derive", +] + +[[package]] +name = "uniffi_testing" +version = "0.28.3" +source = "git+https://github.com/mozilla/uniffi-rs/?rev=9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d#9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d" +dependencies = [ + "anyhow", + "camino 1.1.9", + "cargo_metadata 0.15.4", + "fs-err", + "once_cell 1.20.2", +] + +[[package]] +name = "uniffi_udl" +version = "0.28.3" +source = "git+https://github.com/mozilla/uniffi-rs/?rev=9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d#9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d" +dependencies = [ + "anyhow", + "textwrap", + "uniffi_meta", + "weedle2", +] + [[package]] name = "universal-hash" version = "0.5.1" @@ -4134,6 +4660,12 @@ dependencies = [ "serde", ] +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + [[package]] name = "uuid" version = "1.6.1" @@ -4365,6 +4897,14 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "weedle2" +version = "5.0.0" +source = "git+https://github.com/mozilla/uniffi-rs/?rev=9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d#9127d4d9cfb8ff8372e70f2e4e0eb36bc06f146d" +dependencies = [ + "nom", +] + [[package]] name = "winapi-util" version = "0.1.9" diff --git a/Cargo.toml b/Cargo.toml index 6bff98ab8..9808b3728 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,7 +34,7 @@ members = [ "crates/sargon", # to be split "crates/sargon-uniffi-conversion-macros", - # "crates/sargon-uniffi", + "crates/sargon-uniffi", ] [profile.release] diff --git a/crates/sargon-uniffi/Cargo.toml b/crates/sargon-uniffi/Cargo.toml index a9a9d33b1..aa53a8558 100644 --- a/crates/sargon-uniffi/Cargo.toml +++ b/crates/sargon-uniffi/Cargo.toml @@ -19,8 +19,23 @@ path = "src/bindgen/bin.rs" [dependencies] # === SARGON CRATES === sargon-core = { path = "../sargon-core" } -sargon = { path = "../sargon" } +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 === diff --git a/crates/sargon-uniffi/src/lib.rs b/crates/sargon-uniffi/src/lib.rs index 3069ae47a..486b72e17 100644 --- a/crates/sargon-uniffi/src/lib.rs +++ b/crates/sargon-uniffi/src/lib.rs @@ -48,7 +48,7 @@ pub mod prelude { }; pub(crate) use sargon_uniffi_conversion_macros::*; - pub(crate) use sargon_manifests::prelude::*; + // pub(crate) use sargon_manifests::prelude::*; pub(crate) use sargon::prelude::{ DeserializeBytes, DeserializeStr, HasSampleValues, HashMap, HashSet, SerializeToBytes, SerializeToString, @@ -97,7 +97,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/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/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/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, From 76b8b283ad9afab2fdd1b251a8b1f69debd09666 Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Wed, 1 Jan 2025 22:25:25 +0100 Subject: [PATCH 13/23] its working its working its wooooorking --- Cargo.lock | 18 +++ Cargo.toml | 1 + _typos.toml | 2 +- .../details/fungible/collection_item.rs | 15 +-- .../Cargo.toml | 22 ++++ .../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 | 14 ++ ...ion_entity_index_with_ephemeral_offsets.rs | 0 ...ith_ephemeral_offsets_for_factor_source.rs | 0 .../Cargo.toml | 1 + .../src/next_index_assigner/mod.rs | 4 - .../Cargo.toml | 1 + .../src/lib.rs | 3 +- .../matrices/matrix_of_factor_instances.rs | 123 ++++++++++++++---- 18 files changed, 161 insertions(+), 43 deletions(-) create mode 100644 crates/next-derivation-index-ephemeral/Cargo.toml rename crates/{sargon-profile-security-structures => next-derivation-index-ephemeral}/src/agnostic_paths/derivation_preset.rs (100%) rename crates/{sargon-profile-security-structures => next-derivation-index-ephemeral}/src/agnostic_paths/index_agnostic_path.rs (100%) rename crates/{sargon-profile-security-structures => next-derivation-index-ephemeral}/src/agnostic_paths/mod.rs (100%) rename crates/{sargon-profile-security-structures => next-derivation-index-ephemeral}/src/agnostic_paths/quantified_derivation_preset.rs (100%) rename crates/{sargon-profile-security-structures => next-derivation-index-ephemeral}/src/agnostic_paths/quantities.rs (100%) create mode 100644 crates/next-derivation-index-ephemeral/src/lib.rs rename crates/{sargon-factor-instances-provider/src/next_index_assigner => next-derivation-index-ephemeral/src}/next_derivation_entity_index_with_ephemeral_offsets.rs (100%) rename crates/{sargon-factor-instances-provider/src/next_index_assigner => next-derivation-index-ephemeral/src}/next_derivation_entity_index_with_ephemeral_offsets_for_factor_source.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index d99c62071..c5813ad85 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1984,6 +1984,22 @@ dependencies = [ "tempfile", ] +[[package]] +name = "next-derivation-index-ephemeral" +version = "1.2.1" +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" @@ -3127,6 +3143,7 @@ dependencies = [ "itertools 0.12.0", "k256 0.13.3", "log", + "next-derivation-index-ephemeral", "paste 1.0.14", "pretty_assertions", "radix-common", @@ -3532,6 +3549,7 @@ dependencies = [ "itertools 0.12.0", "k256 0.13.3", "log", + "next-derivation-index-ephemeral", "once_cell 1.19.0", "paste 1.0.14", "pretty_assertions", diff --git a/Cargo.toml b/Cargo.toml index 9808b3728..4357cf97e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,6 +26,7 @@ members = [ "crates/sargon-profile-security-structures", "crates/sargon-profile-logic", "crates/sargon-factor-instances-provider", + "crates/next-derivation-index-ephemeral", "crates/gateway-models", "crates/gateway-logic", 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/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 index e748dd4ee..b697cc5b8 100644 --- 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 @@ -62,14 +62,13 @@ mod address_tests { #[test] fn resource_addresses() { - // let fungible = FungibleResourcesCollectionItem::sample(); - // let non_fungible = NonFungibleResourcesCollectionItem::sample(); - // let sut = SUT::new([fungible.clone()], [non_fungible.clone()]); + 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()] - // ); - todo!() // FIXME + assert_eq!( + sut.resource_addresses(), + vec![fungible.resource_address(), non_fungible.resource_address()] + ); } } diff --git a/crates/next-derivation-index-ephemeral/Cargo.toml b/crates/next-derivation-index-ephemeral/Cargo.toml new file mode 100644 index 000000000..a97d34e36 --- /dev/null +++ b/crates/next-derivation-index-ephemeral/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "next-derivation-index-ephemeral" +version = "1.2.1" +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-profile-security-structures/src/agnostic_paths/derivation_preset.rs b/crates/next-derivation-index-ephemeral/src/agnostic_paths/derivation_preset.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/agnostic_paths/derivation_preset.rs rename to crates/next-derivation-index-ephemeral/src/agnostic_paths/derivation_preset.rs diff --git a/crates/sargon-profile-security-structures/src/agnostic_paths/index_agnostic_path.rs b/crates/next-derivation-index-ephemeral/src/agnostic_paths/index_agnostic_path.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/agnostic_paths/index_agnostic_path.rs rename to crates/next-derivation-index-ephemeral/src/agnostic_paths/index_agnostic_path.rs diff --git a/crates/sargon-profile-security-structures/src/agnostic_paths/mod.rs b/crates/next-derivation-index-ephemeral/src/agnostic_paths/mod.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/agnostic_paths/mod.rs rename to crates/next-derivation-index-ephemeral/src/agnostic_paths/mod.rs diff --git a/crates/sargon-profile-security-structures/src/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-profile-security-structures/src/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-profile-security-structures/src/agnostic_paths/quantities.rs b/crates/next-derivation-index-ephemeral/src/agnostic_paths/quantities.rs similarity index 100% rename from crates/sargon-profile-security-structures/src/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-factor-instances-provider/src/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-factor-instances-provider/src/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-factor-instances-provider/src/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 100% rename from crates/sargon-factor-instances-provider/src/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 diff --git a/crates/sargon-factor-instances-provider/Cargo.toml b/crates/sargon-factor-instances-provider/Cargo.toml index da2b7b657..0d06877c6 100644 --- a/crates/sargon-factor-instances-provider/Cargo.toml +++ b/crates/sargon-factor-instances-provider/Cargo.toml @@ -18,6 +18,7 @@ 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 } diff --git a/crates/sargon-factor-instances-provider/src/next_index_assigner/mod.rs b/crates/sargon-factor-instances-provider/src/next_index_assigner/mod.rs index a687d9d3e..ea56ed523 100644 --- a/crates/sargon-factor-instances-provider/src/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-profile-security-structures/Cargo.toml b/crates/sargon-profile-security-structures/Cargo.toml index 8929e1691..46edefb07 100644 --- a/crates/sargon-profile-security-structures/Cargo.toml +++ b/crates/sargon-profile-security-structures/Cargo.toml @@ -10,6 +10,7 @@ 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 } diff --git a/crates/sargon-profile-security-structures/src/lib.rs b/crates/sargon-profile-security-structures/src/lib.rs index 822a25c45..f82533d1a 100644 --- a/crates/sargon-profile-security-structures/src/lib.rs +++ b/crates/sargon-profile-security-structures/src/lib.rs @@ -2,17 +2,16 @@ #![feature(generic_const_exprs)] #![feature(let_chains)] -mod agnostic_paths; mod factor_list_kind; mod role_kind; mod roles_matrices_structures; pub mod prelude { - pub use crate::agnostic_paths::*; 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::*; diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/matrix_of_factor_instances.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/matrix_of_factor_instances.rs index 46a75fa88..60f4e88a9 100644 --- a/crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/matrix_of_factor_instances.rs +++ b/crates/sargon-profile-security-structures/src/roles_matrices_structures/matrices/matrix_of_factor_instances.rs @@ -97,44 +97,111 @@ impl MatrixOfFactorInstances { 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() - todo!() // FIXME + 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 InstancesDeriving { + fn derive_instances_for_factor_sources( + network_id: NetworkID, + quantity_per_factor: usize, + derivation_presets: impl IntoIterator, + sources: impl IntoIterator, + ) -> IndexMap; +} + +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 derivation_presets = + derivation_presets.into_iter().collect::>(); + + let next_index_assigner = + NextDerivationEntityIndexWithEphemeralOffsets::default(); + + 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 + .reserve(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::>() } } impl HasSampleValues for MatrixOfFactorInstances { /// Account fn sample() -> Self { - // Self::sample_from_matrix_of_sources( - // MatrixOfFactorSources::sample(), - // CAP26EntityKind::Account, - // ) - todo!() + Self::sample_from_matrix_of_sources( + MatrixOfFactorSources::sample(), + CAP26EntityKind::Account, + ) } /// Persona fn sample_other() -> Self { - // Self::sample_from_matrix_of_sources( - // MatrixOfFactorSources::sample_other(), - // CAP26EntityKind::Identity, - // ) - todo!() + Self::sample_from_matrix_of_sources( + MatrixOfFactorSources::sample_other(), + CAP26EntityKind::Identity, + ) } } From bfc32febf77007a8733a6f4d5f419f56a6b52e80 Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Wed, 1 Jan 2025 22:36:11 +0100 Subject: [PATCH 14/23] clippy fix --- crates/gateway-logic/src/lib.rs | 12 +--- crates/gateway-models/src/lib.rs | 1 - .../gateway-models/src/types/request/mod.rs | 1 - .../account/page/authorized_depositor.rs | 5 +- .../state/account/page/resource_preference.rs | 5 +- .../src/agnostic_paths/index_agnostic_path.rs | 2 - ...ith_ephemeral_offsets_for_factor_source.rs | 2 - .../src/lib.rs | 2 - .../automatic_shield_builder/mod.rs | 1 - .../src/roles_matrices_structures/mod.rs | 1 - .../factor_instance_level/mod.rs | 1 - crates/sargon-transaction-models/src/lib.rs | 70 +++---------------- .../src/low_level/mod.rs | 1 - .../src/low_level/sbor_depth_validation.rs | 7 +- .../src/low_level/transaction_hashes/mod.rs | 3 - .../execution_summary/mod.rs | 2 - .../instructions/instructions.rs | 5 ++ .../low_level/v1/transaction_manifest/mod.rs | 1 - .../execution_summary_v2/mod.rs | 2 - .../instructions_v2/instructions_v2.rs | 5 ++ .../v2/transaction_manifest_v2/mod.rs | 1 - .../third_party_deposits/asset_exception.rs | 6 +- 22 files changed, 27 insertions(+), 109 deletions(-) diff --git a/crates/gateway-logic/src/lib.rs b/crates/gateway-logic/src/lib.rs index 4a0a3dd94..31d8fa26f 100644 --- a/crates/gateway-logic/src/lib.rs +++ b/crates/gateway-logic/src/lib.rs @@ -4,20 +4,10 @@ pub mod prelude { pub use crate::logic::*; pub(crate) use gateway_models::prelude::*; - pub(crate) use sargon_addresses::prelude::*; - pub(crate) use sargon_core::prelude::*; + pub(crate) use sargon_transaction_models::prelude::*; pub(crate) use itertools::Itertools; - - pub(crate) use radix_transactions::{ - builder::TransactionV2Builder as ScryptoTransactionV2Builder, - model::{ - IntentHeaderV2 as ScryptoIntentHeaderV2, - TransactionHeaderV2 as ScryptoTransactionHeaderV2, - }, - prelude::TransactionManifestV2 as ScryptoTransactionManifestV2, - }; } pub use prelude::*; diff --git a/crates/gateway-models/src/lib.rs b/crates/gateway-models/src/lib.rs index 72bdcd2eb..03ab4b091 100644 --- a/crates/gateway-models/src/lib.rs +++ b/crates/gateway-models/src/lib.rs @@ -5,7 +5,6 @@ pub mod prelude { pub use sargon_addresses::prelude::*; pub use sargon_core::prelude::*; - pub use sargon_core_assert_json::prelude::*; pub use radix_engine_toolkit_common::receipt::SerializableToolkitTransactionReceipt as ScryptoSerializableToolkitTransactionReceipt; diff --git a/crates/gateway-models/src/types/request/mod.rs b/crates/gateway-models/src/types/request/mod.rs index 8250c653d..fb1531dc5 100644 --- a/crates/gateway-models/src/types/request/mod.rs +++ b/crates/gateway-models/src/types/request/mod.rs @@ -5,7 +5,6 @@ mod state; mod transaction; pub use gw_public_key::*; -pub use gw_public_key_serde::*; pub use ledger_state_selector::*; pub use state::*; pub use transaction::*; 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 index dbf17b4ac..0c2784569 100644 --- 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 @@ -1,9 +1,6 @@ use crate::prelude::*; -use radix_engine_interface::blueprints::account::{ - AccountRemoveAuthorizedDepositorInput as ScryptoAccountRemoveAuthorizedDepositorInput, - AccountRemoveResourcePreferenceInput as ScryptoAccountRemoveResourcePreferenceInput, -}; +use radix_engine_interface::blueprints::account::AccountRemoveAuthorizedDepositorInput as ScryptoAccountRemoveAuthorizedDepositorInput; #[derive(Deserialize, Serialize, Clone, PartialEq, Eq, Debug)] #[serde(tag = "badge_type")] 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 index 649f51b72..5cd975a18 100644 --- 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 @@ -1,9 +1,6 @@ use crate::prelude::*; -use radix_engine_interface::blueprints::account::{ - AccountRemoveAuthorizedDepositorInput as ScryptoAccountRemoveAuthorizedDepositorInput, - AccountRemoveResourcePreferenceInput as ScryptoAccountRemoveResourcePreferenceInput, -}; +use radix_engine_interface::blueprints::account::AccountRemoveResourcePreferenceInput as ScryptoAccountRemoveResourcePreferenceInput; #[derive(Deserialize, Serialize, Clone, PartialEq, Eq, Debug)] pub struct AccountResourcePreference { diff --git a/crates/next-derivation-index-ephemeral/src/agnostic_paths/index_agnostic_path.rs b/crates/next-derivation-index-ephemeral/src/agnostic_paths/index_agnostic_path.rs index dd5eead59..0024617f7 100644 --- a/crates/next-derivation-index-ephemeral/src/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/next-derivation-index-ephemeral/src/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 index 20860e27e..357e9ca31 100644 --- a/crates/next-derivation-index-ephemeral/src/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-profile-security-structures/src/lib.rs b/crates/sargon-profile-security-structures/src/lib.rs index f82533d1a..9f12ddcc8 100644 --- a/crates/sargon-profile-security-structures/src/lib.rs +++ b/crates/sargon-profile-security-structures/src/lib.rs @@ -17,8 +17,6 @@ pub mod prelude { pub use sargon_factors::prelude::*; pub use sargon_hierarchical_deterministic::prelude::*; - pub(crate) use serde::*; - pub(crate) use radix_engine_interface::prelude::{ AccessRule as ScryptoAccessRule, BasicRequirement as ScryptoBasicRequirement, diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_structures/automatic_shield_builder/mod.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/automatic_shield_builder/mod.rs index e8cfebb4d..d34081397 100644 --- a/crates/sargon-profile-security-structures/src/roles_matrices_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-profile-security-structures/src/roles_matrices_structures/mod.rs b/crates/sargon-profile-security-structures/src/roles_matrices_structures/mod.rs index 73b8167d7..7749a6b92 100644 --- a/crates/sargon-profile-security-structures/src/roles_matrices_structures/mod.rs +++ b/crates/sargon-profile-security-structures/src/roles_matrices_structures/mod.rs @@ -12,7 +12,6 @@ mod security_structure_of_factors; mod selected_factor_sources_status; pub use automatic_shield_builder::*; -pub use general_role_with_hd_factor_instance_samples::*; pub use has_role_kind::*; pub use matrices::*; pub use roles::*; diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_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 index 5624c37f6..546f43c7a 100644 --- a/crates/sargon-profile-security-structures/src/roles_matrices_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::*; diff --git a/crates/sargon-transaction-models/src/lib.rs b/crates/sargon-transaction-models/src/lib.rs index 8bd0bd201..55a34d075 100644 --- a/crates/sargon-transaction-models/src/lib.rs +++ b/crates/sargon-transaction-models/src/lib.rs @@ -22,52 +22,20 @@ pub mod prelude { 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, - }, + transaction::FeeLocks as ScryptoFeeLocks, }; 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, + 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::{ - 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 radix_engine_interface::prelude::MetadataValue as ScryptoMetadataValue; pub use radix_engine_toolkit::{ functions::{ @@ -158,35 +126,18 @@ pub mod prelude { }, }; - 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::blueprints::account::{ + DefaultDepositRule as ScryptoDefaultDepositRule, + ResourcePreference as ScryptoResourcePreference, }; 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, @@ -196,11 +147,8 @@ pub mod prelude { 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::{ @@ -212,7 +160,6 @@ pub mod prelude { InstructionsV1 as ScryptoInstructions, InstructionsV2 as ScryptoInstructionsV2, IntentCoreV2 as ScryptoIntentCoreV2, - IntentHash as ScryptoIntentHash, IntentHeaderV2 as ScryptoIntentHeaderV2, IntentSignatureV1 as ScryptoIntentSignature, IntentSignaturesV1 as ScryptoIntentSignatures, @@ -235,7 +182,6 @@ pub mod prelude { TransactionHashBech32Decoder as ScryptoTransactionHashBech32Decoder, TransactionHashBech32Encoder as ScryptoTransactionHashBech32Encoder, TransactionHeaderV1 as ScryptoTransactionHeader, - TransactionHeaderV2 as ScryptoTransactionHeaderV2, TransactionIntentHash as ScryptoTransactionIntentHash, }, prelude::{ diff --git a/crates/sargon-transaction-models/src/low_level/mod.rs b/crates/sargon-transaction-models/src/low_level/mod.rs index 169bbb3de..38a75e552 100644 --- a/crates/sargon-transaction-models/src/low_level/mod.rs +++ b/crates/sargon-transaction-models/src/low_level/mod.rs @@ -24,7 +24,6 @@ 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-transaction-models/src/low_level/sbor_depth_validation.rs b/crates/sargon-transaction-models/src/low_level/sbor_depth_validation.rs index c6b10e98e..1f02659f3 100644 --- a/crates/sargon-transaction-models/src/low_level/sbor_depth_validation.rs +++ b/crates/sargon-transaction-models/src/low_level/sbor_depth_validation.rs @@ -1,5 +1,3 @@ -use crate::prelude::*; - #[cfg(test)] use radix_common::prelude::{ manifest_encode as Scrypto_manifest_encode, @@ -34,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, @@ -43,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-transaction-models/src/low_level/transaction_hashes/mod.rs b/crates/sargon-transaction-models/src/low_level/transaction_hashes/mod.rs index 9c0ab5382..6c81e3637 100644 --- a/crates/sargon-transaction-models/src/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-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 index 92f0d8085..119c9ef3c 100644 --- 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 @@ -1,3 +1 @@ mod transaction_manifest_execution_summary; - -pub use transaction_manifest_execution_summary::*; diff --git a/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/instructions/instructions.rs b/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/instructions/instructions.rs index 01e07a759..49f8eeeb9 100644 --- a/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/instructions/instructions.rs +++ b/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/instructions/instructions.rs @@ -1,5 +1,8 @@ use crate::prelude::*; +#[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())] pub struct Instructions { @@ -212,6 +215,8 @@ impl Instructions { mod tests { use super::*; use radix_transactions::manifest::{ + lexer::{LexerError, LexerErrorKind}, + token::{Position, Span}, DropAuthZoneProofs, DropAuthZoneRegularProofs, }; diff --git a/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/mod.rs b/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/mod.rs index 70b2d5900..33571531e 100644 --- a/crates/sargon-transaction-models/src/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-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 index 56d582206..a182eb61c 100644 --- 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 @@ -1,3 +1 @@ mod transaction_manifest_execution_summary_v2; - -pub use transaction_manifest_execution_summary_v2::*; diff --git a/crates/sargon-transaction-models/src/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 index 52a242d92..839b030ba 100644 --- a/crates/sargon-transaction-models/src/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 @@ -102,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(, )` @@ -212,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-transaction-models/src/low_level/v2/transaction_manifest_v2/mod.rs b/crates/sargon-transaction-models/src/low_level/v2/transaction_manifest_v2/mod.rs index b95141595..fa4ee0403 100644 --- a/crates/sargon-transaction-models/src/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-transaction-models/src/profile_models/third_party_deposits/asset_exception.rs b/crates/sargon-transaction-models/src/profile_models/third_party_deposits/asset_exception.rs index e1c8367b3..c3f6b9730 100644 --- a/crates/sargon-transaction-models/src/profile_models/third_party_deposits/asset_exception.rs +++ b/crates/sargon-transaction-models/src/profile_models/third_party_deposits/asset_exception.rs @@ -1,10 +1,6 @@ use crate::prelude::*; -use radix_engine_interface::blueprints::account::{ - AccountRemoveAuthorizedDepositorInput as ScryptoAccountRemoveAuthorizedDepositorInput, - AccountRemoveResourcePreferenceInput as ScryptoAccountRemoveResourcePreferenceInput, - AccountSetResourcePreferenceInput as ScryptoAccountSetResourcePreferenceInput, -}; +use radix_engine_interface::blueprints::account::AccountSetResourcePreferenceInput as ScryptoAccountSetResourcePreferenceInput; /// The specific Asset exception rule, which overrides the general /// `deposit_rule` of a `ThirdPartyDeposits` settings. From 1b148b2a8293b9bf9863e4906e5a0e9e54b60527 Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Wed, 1 Jan 2025 22:58:23 +0100 Subject: [PATCH 15/23] fix some import warnings --- .../src/client/gateway_client.rs | 1 - .../src/endpoints/mod.rs | 4 - crates/gateway-client-and-api/src/lib.rs | 3 - .../gateway-client-and-api/src/methods/mod.rs | 4 - .../src/methods/state_methods.rs | 2 - .../src/methods/transaction_methods.rs | 1 - crates/http-client/src/http_client.rs | 1 - .../cache/factor_instances_cache.rs | 5 +- .../host_info_client/host_info_client.rs | 2 - crates/sargon-clients/src/lib.rs | 4 - .../drivers/event_bus_driver/support/event.rs | 3 - .../event_bus_driver/support/event_kind.rs | 4 - .../src/lib.rs | 5 - crates/sargon-manifests/src/bucket.rs | 5 +- crates/sargon-manifests/src/bucket_factory.rs | 2 +- .../delete_account/manifest_delete_account.rs | 1 + .../assets_transfers/per_asset/mod.rs | 2 - .../assets_transfers/per_recipient/mod.rs | 2 - .../assets_transfers/transfer_types.rs | 2 +- .../high_level/token_definition_metadata.rs | 1 - crates/sargon-manifests/src/lib.rs | 123 +----------------- .../src/manifest_account_locker.rs | 1 + .../src/manifest_assets_transfers.rs | 2 + crates/sargon-manifests/src/manifests.rs | 2 + .../src/manifests_access_controller.rs | 2 +- .../src/manifests_create_tokens.rs | 3 +- .../sargon-manifests/src/modify_manifest.rs | 3 +- .../third_party_deposits_delta.rs | 3 +- crates/sargon-profile-gateway/src/lib.rs | 4 +- .../src/network_definition.rs | 1 + .../src/saved_gateways.rs | 2 + crates/sargon-profile-logic/src/logic/mod.rs | 1 - .../src/is_securified_entity.rs | 2 +- crates/sargon-profile/src/lib.rs | 31 ----- crates/sargon-profile/src/samples/mod.rs | 4 - .../v100/entity/persona/persona_data/mod.rs | 2 +- crates/sargon-profile/src/v100/mod.rs | 2 - .../networks/network/authorized_dapp/mod.rs | 2 +- .../resource_preferences.rs | 1 - .../src/v100/profile_legacy_state_bugs.rs | 1 - .../instructions/instructions.rs | 3 +- .../src/low_level/v2/message_v2/message_v2.rs | 4 +- crates/sargon/src/lib.rs | 100 ++++---------- .../diagnose_instance_duplicates.rs | 3 + .../subsystems/log_system/log_system.rs | 2 + 45 files changed, 58 insertions(+), 300 deletions(-) delete mode 100644 crates/sargon-profile/src/v100/profile_legacy_state_bugs.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 index 27335727b..9fa671de0 100644 --- a/crates/gateway-client-and-api/src/client/gateway_client.rs +++ b/crates/gateway-client-and-api/src/client/gateway_client.rs @@ -50,7 +50,6 @@ impl GatewayClient { mod tests { use super::*; use actix_rt::time::timeout; - use reqwest::Response; use std::time::Duration; const MAX: Duration = Duration::from_millis(10); diff --git a/crates/gateway-client-and-api/src/endpoints/mod.rs b/crates/gateway-client-and-api/src/endpoints/mod.rs index be4fab757..7a6d4cbab 100644 --- a/crates/gateway-client-and-api/src/endpoints/mod.rs +++ b/crates/gateway-client-and-api/src/endpoints/mod.rs @@ -1,7 +1,3 @@ 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/gateway-client-and-api/src/lib.rs b/crates/gateway-client-and-api/src/lib.rs index 085cbf367..41fce1c94 100644 --- a/crates/gateway-client-and-api/src/lib.rs +++ b/crates/gateway-client-and-api/src/lib.rs @@ -6,13 +6,10 @@ mod methods; pub mod prelude { pub use crate::assert_network_request::*; pub use crate::client::*; - pub use crate::endpoints::*; - pub use crate::methods::*; pub use gateway_logic::prelude::*; pub use gateway_models::prelude::*; pub use http_client::prelude::*; - pub use sargon_core::prelude::*; pub use sargon_drivers::prelude::*; pub use sargon_transaction_models::prelude::*; diff --git a/crates/gateway-client-and-api/src/methods/mod.rs b/crates/gateway-client-and-api/src/methods/mod.rs index 9a1da603f..c32e889c6 100644 --- a/crates/gateway-client-and-api/src/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/gateway-client-and-api/src/methods/state_methods.rs b/crates/gateway-client-and-api/src/methods/state_methods.rs index 73a4ac3c5..3ffd96f15 100644 --- a/crates/gateway-client-and-api/src/methods/state_methods.rs +++ b/crates/gateway-client-and-api/src/methods/state_methods.rs @@ -410,7 +410,6 @@ 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)] @@ -682,7 +681,6 @@ 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)] diff --git a/crates/gateway-client-and-api/src/methods/transaction_methods.rs b/crates/gateway-client-and-api/src/methods/transaction_methods.rs index 597c45cee..ff878e0a0 100644 --- a/crates/gateway-client-and-api/src/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/http-client/src/http_client.rs b/crates/http-client/src/http_client.rs index 16924cdc5..e4a30b09d 100644 --- a/crates/http-client/src/http_client.rs +++ b/crates/http-client/src/http_client.rs @@ -1,5 +1,4 @@ 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). diff --git a/crates/sargon-clients/src/clients/client/factor_instances_cache_client/cache/factor_instances_cache.rs b/crates/sargon-clients/src/clients/client/factor_instances_cache_client/cache/factor_instances_cache.rs index f6ba80cb0..043458a1e 100644 --- a/crates/sargon-clients/src/clients/client/factor_instances_cache_client/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::*; diff --git a/crates/sargon-clients/src/clients/client/host_info_client/host_info_client.rs b/crates/sargon-clients/src/clients/client/host_info_client/host_info_client.rs index 748b6e793..ef42d9938 100644 --- a/crates/sargon-clients/src/clients/client/host_info_client/host_info_client.rs +++ b/crates/sargon-clients/src/clients/client/host_info_client/host_info_client.rs @@ -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-clients/src/lib.rs b/crates/sargon-clients/src/lib.rs index 08225189e..996a3a6b6 100644 --- a/crates/sargon-clients/src/lib.rs +++ b/crates/sargon-clients/src/lib.rs @@ -2,11 +2,7 @@ mod clients; pub mod prelude { pub use gateway_client_and_api::prelude::*; - pub use http_client::prelude::*; - pub use sargon_core::prelude::*; - pub use sargon_drivers::prelude::*; pub use sargon_factors_supporting_types::prelude::*; - pub(crate) use sargon_hierarchical_deterministic::prelude::*; pub use sargon_profile::prelude::*; pub use sargon_profile_supporting_types::prelude::*; diff --git a/crates/sargon-drivers/src/drivers/event_bus_driver/support/event.rs b/crates/sargon-drivers/src/drivers/event_bus_driver/support/event.rs index ef3c1ee57..2191f55f4 100644 --- a/crates/sargon-drivers/src/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-drivers/src/drivers/event_bus_driver/support/event_kind.rs b/crates/sargon-drivers/src/drivers/event_bus_driver/support/event_kind.rs index 466096b1a..bbbe8c5eb 100644 --- a/crates/sargon-drivers/src/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-factor-instances-provider/src/lib.rs b/crates/sargon-factor-instances-provider/src/lib.rs index 1ffc2022c..45e19cb41 100644 --- a/crates/sargon-factor-instances-provider/src/lib.rs +++ b/crates/sargon-factor-instances-provider/src/lib.rs @@ -6,13 +6,8 @@ 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_core::prelude::*; - pub(crate) use sargon_factors::prelude::*; - pub(crate) use sargon_hierarchical_deterministic::prelude::*; pub(crate) use sargon_keys_collector::prelude::*; - pub(crate) use sargon_profile::prelude::*; pub(crate) use sargon_profile_logic::prelude::*; - pub(crate) use sargon_profile_supporting_types::prelude::*; pub use crate::next_index_assigner::*; pub use crate::provider::*; diff --git a/crates/sargon-manifests/src/bucket.rs b/crates/sargon-manifests/src/bucket.rs index 6f25ebf81..276fef4e0 100644 --- a/crates/sargon-manifests/src/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-manifests/src/bucket_factory.rs b/crates/sargon-manifests/src/bucket_factory.rs index aa1de65a7..53b81da05 100644 --- a/crates/sargon-manifests/src/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-manifests/src/delete_account/manifest_delete_account.rs b/crates/sargon-manifests/src/delete_account/manifest_delete_account.rs index 6e0430f17..99077007a 100644 --- a/crates/sargon-manifests/src/delete_account/manifest_delete_account.rs +++ b/crates/sargon-manifests/src/delete_account/manifest_delete_account.rs @@ -1,4 +1,5 @@ use crate::prelude::*; +use bucket_factory::BucketFactory; use radix_engine_interface::blueprints::account::{ AccountRemoveAuthorizedDepositorInput as ScryptoAccountRemoveAuthorizedDepositorInput, AccountRemoveResourcePreferenceInput as ScryptoAccountRemoveResourcePreferenceInput, diff --git a/crates/sargon-manifests/src/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 index 56764b3ba..eaca04a4f 100644 --- a/crates/sargon-manifests/src/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-manifests/src/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 index 9927c2f43..c89be841b 100644 --- a/crates/sargon-manifests/src/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-manifests/src/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 index c0ad345fe..5d3f2f995 100644 --- a/crates/sargon-manifests/src/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 @@ -53,7 +53,7 @@ macro_rules! decl_per_asset_transfer_of { 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-manifests/src/high_level/token_definition_metadata.rs b/crates/sargon-manifests/src/high_level/token_definition_metadata.rs index 77df20b59..1fe3a15d0 100644 --- a/crates/sargon-manifests/src/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 index f198e0814..4deefd671 100644 --- a/crates/sargon-manifests/src/lib.rs +++ b/crates/sargon-manifests/src/lib.rs @@ -12,18 +12,12 @@ mod third_party_deposit_update; pub mod prelude { pub use gateway_models::prelude::*; - pub use identified_vec_of::prelude::*; - pub use sargon_addresses::prelude::*; - pub use sargon_addresses::prelude::*; - pub use sargon_core::prelude::*; - pub use sargon_core_utils::prelude::*; pub use sargon_factors::prelude::*; pub use sargon_hierarchical_deterministic::prelude::*; pub use sargon_profile::prelude::*; - pub use sargon_transaction_models::prelude::*; - pub use crate::bucket::*; - pub use crate::bucket_factory::*; + pub(crate) use crate::bucket_factory; + pub use crate::delete_account::*; pub use crate::high_level::*; pub use crate::manifest_account_locker::*; @@ -36,45 +30,17 @@ pub mod prelude { pub use std::str::FromStr; - 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_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, + math::Decimal as ScryptoDecimal192, 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_toolkit_common::receipt::RuntimeToolkitTransactionReceipt as ScryptoRuntimeToolkitTransactionReceipt; - - pub(crate) use radix_engine_toolkit_common::receipt::SerializableToolkitTransactionReceipt as ScryptoSerializableToolkitTransactionReceipt; - 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, @@ -176,93 +142,12 @@ pub mod prelude { }; pub(crate) use radix_engine_interface::blueprints::{ - access_controller::{ - RecoveryProposal as ScryptoRecoveryProposal, - RuleSet as ScryptoRuleSet, - }, + access_controller::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_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, - }, }; } diff --git a/crates/sargon-manifests/src/manifest_account_locker.rs b/crates/sargon-manifests/src/manifest_account_locker.rs index 549ea6afa..422ca3dd4 100644 --- a/crates/sargon-manifests/src/manifest_account_locker.rs +++ b/crates/sargon-manifests/src/manifest_account_locker.rs @@ -1,4 +1,5 @@ use crate::prelude::*; +use bucket_factory::BucketFactory; use radix_engine_interface::blueprints::locker::ACCOUNT_LOCKER_CLAIM_IDENT; pub trait ManifestForAccountLockerClaim: Sized { diff --git a/crates/sargon-manifests/src/manifest_assets_transfers.rs b/crates/sargon-manifests/src/manifest_assets_transfers.rs index 7fdd463b1..a31048cf8 100644 --- a/crates/sargon-manifests/src/manifest_assets_transfers.rs +++ b/crates/sargon-manifests/src/manifest_assets_transfers.rs @@ -1,3 +1,5 @@ +use bucket_factory::BucketFactory; + use crate::prelude::*; pub trait TransactionManifestAssetTransfers: Sized { diff --git a/crates/sargon-manifests/src/manifests.rs b/crates/sargon-manifests/src/manifests.rs index 04cc2a874..dbcd8020d 100644 --- a/crates/sargon-manifests/src/manifests.rs +++ b/crates/sargon-manifests/src/manifests.rs @@ -1,3 +1,5 @@ +use bucket_factory::BucketFactory; + use crate::prelude::*; pub trait TransactionManifestFaucet: Sized { diff --git a/crates/sargon-manifests/src/manifests_access_controller.rs b/crates/sargon-manifests/src/manifests_access_controller.rs index 86e8a9143..7c59d5f63 100644 --- a/crates/sargon-manifests/src/manifests_access_controller.rs +++ b/crates/sargon-manifests/src/manifests_access_controller.rs @@ -1,4 +1,4 @@ -use radix_engine_interface::blueprints::access_controller::AccessControllerCreateManifestInput as ScryptoAccessControllerCreateManifestInput; +use bucket_factory::BucketFactory; use crate::prelude::*; diff --git a/crates/sargon-manifests/src/manifests_create_tokens.rs b/crates/sargon-manifests/src/manifests_create_tokens.rs index 2c24bd2ce..ca2cb1fe9 100644 --- a/crates/sargon-manifests/src/manifests_create_tokens.rs +++ b/crates/sargon-manifests/src/manifests_create_tokens.rs @@ -318,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-manifests/src/modify_manifest.rs b/crates/sargon-manifests/src/modify_manifest.rs index e0e8fbd5e..7bf2ade90 100644 --- a/crates/sargon-manifests/src/modify_manifest.rs +++ b/crates/sargon-manifests/src/modify_manifest.rs @@ -174,14 +174,13 @@ impl TransactionManifestModifying for 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-manifests/src/third_party_deposit_update/third_party_deposits_delta.rs b/crates/sargon-manifests/src/third_party_deposit_update/third_party_deposits_delta.rs index 70b42ffd3..37f4bec2b 100644 --- a/crates/sargon-manifests/src/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, }; @@ -119,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-gateway/src/lib.rs b/crates/sargon-profile-gateway/src/lib.rs index 3decdb862..0fcfc0be0 100644 --- a/crates/sargon-profile-gateway/src/lib.rs +++ b/crates/sargon-profile-gateway/src/lib.rs @@ -7,7 +7,9 @@ pub mod prelude { pub use crate::network_definition::*; pub use crate::saved_gateways::*; - pub use sargon_core::prelude::*; + pub(crate) use sargon_core::prelude::*; pub(crate) use serde::*; } + +pub use prelude::*; diff --git a/crates/sargon-profile-gateway/src/network_definition.rs b/crates/sargon-profile-gateway/src/network_definition.rs index 7db5e39b5..5ae9af1ab 100644 --- a/crates/sargon-profile-gateway/src/network_definition.rs +++ b/crates/sargon-profile-gateway/src/network_definition.rs @@ -43,6 +43,7 @@ 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/sargon-profile-gateway/src/saved_gateways.rs index a58e51496..f6bf7d15c 100644 --- a/crates/sargon-profile-gateway/src/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!( diff --git a/crates/sargon-profile-logic/src/logic/mod.rs b/crates/sargon-profile-logic/src/logic/mod.rs index bd9480f89..399864882 100644 --- a/crates/sargon-profile-logic/src/logic/mod.rs +++ b/crates/sargon-profile-logic/src/logic/mod.rs @@ -12,7 +12,6 @@ mod query_factor_sources; pub use account::*; pub use authorized_dapps_logic::*; pub use gateway::*; -pub use instances_deriving_with_factor_sources::*; pub use persona::*; pub use profile_header::*; pub use profile_network::*; diff --git a/crates/sargon-profile-supporting-types/src/is_securified_entity.rs b/crates/sargon-profile-supporting-types/src/is_securified_entity.rs index df5420181..a945e7515 100644 --- a/crates/sargon-profile-supporting-types/src/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/src/lib.rs b/crates/sargon-profile/src/lib.rs index 8d1bcba62..acad24e95 100644 --- a/crates/sargon-profile/src/lib.rs +++ b/crates/sargon-profile/src/lib.rs @@ -18,7 +18,6 @@ pub mod prelude { pub use sargon_factors::prelude::*; pub use sargon_hierarchical_deterministic::prelude::*; pub use sargon_profile_app_preferences::prelude::*; - pub use sargon_profile_security_structures::prelude::*; pub use sargon_transaction_models::prelude::*; pub use crate::encrypted::*; @@ -26,34 +25,4 @@ pub mod prelude { pub use crate::samples::*; pub use crate::supporting_types::*; pub use crate::v100::*; - - 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, - }, - 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, - }, - }; } diff --git a/crates/sargon-profile/src/samples/mod.rs b/crates/sargon-profile/src/samples/mod.rs index 0fd5ca9ec..479dffe70 100644 --- a/crates/sargon-profile/src/samples/mod.rs +++ b/crates/sargon-profile/src/samples/mod.rs @@ -6,8 +6,4 @@ mod persona_samples; mod profile_samples; pub use access_controller_address_samples::*; -pub use account_address_samples::*; -pub use account_samples::*; pub use identity_address_samples::*; -pub use persona_samples::*; -pub use profile_samples::*; diff --git a/crates/sargon-profile/src/v100/entity/persona/persona_data/mod.rs b/crates/sargon-profile/src/v100/entity/persona/persona_data/mod.rs index b53f57212..129056592 100644 --- a/crates/sargon-profile/src/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-profile/src/v100/mod.rs b/crates/sargon-profile/src/v100/mod.rs index 0e5a86f9e..7eb7b9ba2 100644 --- a/crates/sargon-profile/src/v100/mod.rs +++ b/crates/sargon-profile/src/v100/mod.rs @@ -5,7 +5,6 @@ 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; @@ -16,6 +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-profile/src/v100/networks/network/authorized_dapp/mod.rs b/crates/sargon-profile/src/v100/networks/network/authorized_dapp/mod.rs index 715998394..5e1fcb1aa 100644 --- a/crates/sargon-profile/src/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-profile/src/v100/networks/network/resource_preferences/resource_preferences.rs b/crates/sargon-profile/src/v100/networks/network/resource_preferences/resource_preferences.rs index df517c12e..d59fe993b 100644 --- a/crates/sargon-profile/src/v100/networks/network/resource_preferences/resource_preferences.rs +++ b/crates/sargon-profile/src/v100/networks/network/resource_preferences/resource_preferences.rs @@ -89,7 +89,6 @@ mod tests { #[test] fn hidden_resources() { - use ResourceIdentifier::*; let mut sut = SUT::new(); // Test with no resources hidden diff --git a/crates/sargon-profile/src/v100/profile_legacy_state_bugs.rs b/crates/sargon-profile/src/v100/profile_legacy_state_bugs.rs deleted file mode 100644 index 3616db216..000000000 --- a/crates/sargon-profile/src/v100/profile_legacy_state_bugs.rs +++ /dev/null @@ -1 +0,0 @@ -use crate::prelude::*; diff --git a/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/instructions/instructions.rs b/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/instructions/instructions.rs index 49f8eeeb9..95efa062e 100644 --- a/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/instructions/instructions.rs +++ b/crates/sargon-transaction-models/src/low_level/v1/transaction_manifest/instructions/instructions.rs @@ -178,8 +178,7 @@ impl Instructions { #[cfg(test)] use radix_common::prelude::MANIFEST_SBOR_V1_MAX_DEPTH; -#[cfg(test)] -use radix_engine_toolkit::functions::address::decode as RET_decode_address; + #[cfg(test)] use radix_transactions::manifest::CallMethod; diff --git a/crates/sargon-transaction-models/src/low_level/v2/message_v2/message_v2.rs b/crates/sargon-transaction-models/src/low_level/v2/message_v2/message_v2.rs index a2cb935c4..9b813cc05 100644 --- a/crates/sargon-transaction-models/src/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/lib.rs b/crates/sargon/src/lib.rs index e6456844a..6fbf2c992 100644 --- a/crates/sargon/src/lib.rs +++ b/crates/sargon/src/lib.rs @@ -1,3 +1,4 @@ +#![allow(async_fn_in_trait)] #![allow(unused_imports)] #![allow(internal_features)] #![allow(incomplete_features)] @@ -56,7 +57,7 @@ pub mod prelude { }, }; 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::{ @@ -75,7 +76,6 @@ pub mod prelude { 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, @@ -110,82 +110,28 @@ pub mod prelude { 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, + 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}, + 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::Span, + CompileError as ScryptoCompileError, + CompileErrorDiagnosticsStyle as ScryptoCompileErrorDiagnosticsStyle, + KnownManifestObjectNames as ScryptoKnownManifestObjectNames, + ManifestObjectNames as ScryptoManifestObjectNames, + MockBlobProvider as ScryptoMockBlobProvider, }; pub use radix_engine_toolkit::{ 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 index 8acbb4d76..fb74b2d50 100644 --- 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 @@ -42,6 +42,7 @@ fn with_android_bug_with_shared_pubkey_between_account_and_persona() -> Profile sut } +#[cfg(test)] fn with_instance_collision_both_accounts() -> Profile { let mwp = MnemonicWithPassphrase::sample_device(); let mut sut = Profile::from_mnemonic_with_passphrase( @@ -82,6 +83,7 @@ fn with_instance_collision_both_accounts() -> Profile { sut } +#[cfg(test)] fn with_instance_collision_securified() -> Profile { let mwp = MnemonicWithPassphrase::sample_device(); let mut sut = Profile::from_mnemonic_with_passphrase( @@ -108,6 +110,7 @@ fn with_instance_collision_securified() -> Profile { sut } +#[cfg(test)] fn with_instance_collision_both_personas() -> Profile { let mwp = MnemonicWithPassphrase::sample_device(); let mut sut = Profile::from_mnemonic_with_passphrase( 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..d474929e4 100644 --- a/crates/sargon/src/system/subsystems/log_system/log_system.rs +++ b/crates/sargon/src/system/subsystems/log_system/log_system.rs @@ -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() From f019ef471614af2c7bf1e52f2057ac67dc47313e Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Wed, 1 Jan 2025 23:26:18 +0100 Subject: [PATCH 16/23] remove unused --- ...r_instances_provider_outcome_for_factor.rs | 8 ++--- crates/sargon-profile-gateway/src/lib.rs | 2 -- ...trix_of_factor_instances_index_agnostic.rs | 1 + .../factor_instance_level/mod.rs | 2 +- .../factor_levels/factor_source_level/mod.rs | 2 +- .../src/samples/persona_samples.rs | 2 +- .../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 | 1 - .../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 +- .../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 +- .../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 - crates/sargon/src/home_cards/home_card.rs | 1 - crates/sargon/src/lib.rs | 31 ++++++------------- .../diagnose_instance_duplicates.rs | 1 + .../needs_a_new_home_dumping_ground/mod.rs | 2 -- .../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 | 3 -- .../radix_connect/mobile/session/session.rs | 1 - .../pre_authorization/pre_authorization.rs | 1 - .../pre_authorization/subintent_response.rs | 1 - crates/sargon/src/signing/collector/mod.rs | 1 - .../petition_for_factors_types/mod.rs | 1 - .../petition_for_factors_state.rs | 2 -- crates/sargon/src/signing/signables/mod.rs | 3 -- .../sargon/src/signing/signables/signable.rs | 1 - .../signing/signables/signable_subintent.rs | 1 - .../signing/signatures_outecome_types/mod.rs | 2 +- crates/sargon/src/signing/testing/mod.rs | 1 - .../system/sargon_os/delete_account/mod.rs | 1 - .../sargon_os_delete_account.rs | 1 - ...th_factor_source_and_derivation_outcome.rs | 1 - .../factor_instances_provider_unit_tests.rs | 2 -- crates/sargon/src/system/sargon_os/mod.rs | 16 +++++----- .../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 | 6 ++-- .../sargon/src/system/sargon_os/sargon_os.rs | 7 +---- .../system/sargon_os/sargon_os_accounts.rs | 6 +--- .../src/system/sargon_os/sargon_os_factors.rs | 1 - .../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 - .../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 -- .../subsystems/log_system/log_system.rs | 2 +- 81 files changed, 59 insertions(+), 181 deletions(-) diff --git a/crates/sargon-factor-instances-provider/src/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 index 886cb7982..a6fbccc04 100644 --- a/crates/sargon-factor-instances-provider/src/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 @@ -79,16 +79,16 @@ impl From for FactorInstancesProviderOutcomeForFactor { fn from(value: InternalFactorInstancesProviderOutcomeForFactor) -> Self { - 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, - }; - - _self + } } } diff --git a/crates/sargon-profile-gateway/src/lib.rs b/crates/sargon-profile-gateway/src/lib.rs index 0fcfc0be0..7740fdc76 100644 --- a/crates/sargon-profile-gateway/src/lib.rs +++ b/crates/sargon-profile-gateway/src/lib.rs @@ -8,8 +8,6 @@ pub mod prelude { pub use crate::saved_gateways::*; pub(crate) use sargon_core::prelude::*; - - pub(crate) use serde::*; } pub use prelude::*; 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 index 126e6bc3a..391556793 100644 --- 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 @@ -2,6 +2,7 @@ use crate::prelude::*; +#[allow(clippy::upper_case_acronyms)] type SUT = MatrixOfFactorInstances; #[test] diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_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 index 546f43c7a..eaa7dab0c 100644 --- a/crates/sargon-profile-security-structures/src/roles_matrices_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,4 +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_with_factor_instances::*; +pub(crate) use role_with_factor_instances::*; diff --git a/crates/sargon-profile-security-structures/src/roles_matrices_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 index b629e2284..5d55c8468 100644 --- a/crates/sargon-profile-security-structures/src/roles_matrices_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-profile/src/samples/persona_samples.rs b/crates/sargon-profile/src/samples/persona_samples.rs index 8d2bc35b4..c82f74f87 100644 --- a/crates/sargon-profile/src/samples/persona_samples.rs +++ b/crates/sargon-profile/src/samples/persona_samples.rs @@ -132,7 +132,7 @@ impl UnsafeHardcodingDerivationPathAsPersona unsafe fn invalid_hard_coding_derivation_path_as_persona(&self) -> Self { unsafe { Self::new( - self.factor_source_id.clone(), + self.factor_source_id, HierarchicalDeterministicPublicKey::new( self.public_key(), self.derivation_path().as_persona(), 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 486b72e17..d162e47dc 100644 --- a/crates/sargon-uniffi/src/lib.rs +++ b/crates/sargon-uniffi/src/lib.rs @@ -1,7 +1,6 @@ #![feature(async_closure)] #![feature(let_chains)] #![feature(core_intrinsics)] -#![allow(unused_imports)] #![allow(internal_features)] mod core; 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/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/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/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 6fbf2c992..9956126c5 100644 --- a/crates/sargon/src/lib.rs +++ b/crates/sargon/src/lib.rs @@ -1,5 +1,4 @@ #![allow(async_fn_in_trait)] -#![allow(unused_imports)] #![allow(internal_features)] #![allow(incomplete_features)] #![feature(async_closure)] @@ -22,40 +21,28 @@ mod types; pub mod prelude { pub use gateway_client_and_api::prelude::*; - pub use identified_vec_of::prelude::*; - pub use sargon_addresses::prelude::*; + pub(crate) use identified_vec_of::prelude::*; + pub(crate) use sargon_addresses::prelude::*; pub use sargon_clients::prelude::*; - pub use sargon_core::prelude::*; + pub(crate) use sargon_core::prelude::*; pub use sargon_factor_instances_provider::prelude::*; - pub use sargon_factors::prelude::*; - pub use sargon_hierarchical_deterministic::prelude::*; + pub(crate) use sargon_factors::prelude::*; + pub(crate) use sargon_hierarchical_deterministic::prelude::*; pub use sargon_keys_collector::prelude::*; pub use sargon_manifests::prelude::*; - pub use sargon_profile::prelude::*; + pub(crate) use sargon_profile::prelude::*; pub use sargon_profile_logic::prelude::*; - pub use sargon_profile_security_structures::prelude::*; - pub use sargon_transaction_models::prelude::*; + pub(crate) use sargon_profile_security_structures::prelude::*; + pub(crate) use sargon_transaction_models::prelude::*; pub use crate::home_cards::*; - pub use crate::needs_a_new_home_dumping_ground::*; + pub(crate) use crate::needs_a_new_home_dumping_ground::*; pub use crate::radix_connect::*; pub use crate::security_center::*; pub use crate::signing::*; pub use crate::system::*; pub use crate::types::*; - pub(crate) use once_cell::sync::Lazy; - - 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 sbor::Versioned; 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 index fb74b2d50..61cd3a8f7 100644 --- 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 @@ -1,3 +1,4 @@ +#[cfg(test)] use crate::prelude::*; #[cfg(test)] 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 index fa55db22e..23196acfc 100644 --- a/crates/sargon/src/needs_a_new_home_dumping_ground/mod.rs +++ b/crates/sargon/src/needs_a_new_home_dumping_ground/mod.rs @@ -1,3 +1 @@ mod diagnose_instance_duplicates; - -pub use diagnose_instance_duplicates::*; 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 0b0c2a207..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::*; @@ -100,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/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 01f8295f9..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 { 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/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..a8f035c56 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,4 +1,3 @@ -use std::cell::Ref; use super::*; use crate::prelude::*; @@ -137,7 +136,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 41cf5e34c..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; 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/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 31ce12d0f..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) 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 index 4eb98e9bf..dd05fcbd9 100644 --- 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 @@ -1,5 +1,4 @@ use crate::prelude::*; -use std::{future::Future, pin::Pin}; pub trait EntityCreatingWithFactorSourceAndDerivationOutcome { async fn create_unsaved_entities_with_factor_source_with_derivation_outcome< 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 c6bfb9e6c..0b85744cb 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,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; diff --git a/crates/sargon/src/system/sargon_os/mod.rs b/crates/sargon/src/system/sargon_os/mod.rs index ca1bce324..72a31ba91 100644 --- a/crates/sargon/src/system/sargon_os/mod.rs +++ b/crates/sargon/src/system/sargon_os/mod.rs @@ -24,13 +24,13 @@ 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(crate) 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(crate) use sargon_os_gateway::*; +pub(crate) use sargon_os_personas::*; +pub(crate) use sargon_os_profile::*; +pub(crate) use sargon_os_security_center::*; +pub(crate) use sargon_os_security_structures::*; +pub(crate) use sargon_os_signing::*; +pub(crate) 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 0c010dab6..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,7 +1,5 @@ -use async_std::sync::RwLockWriteGuard; - use crate::prelude::*; -use std::{borrow::Borrow, sync::RwLock}; +use std::sync::RwLock; #[derive(Debug)] pub struct ProfileStateHolder { @@ -182,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 8cd2502cf..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 @@ -511,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 8facac78a..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::*; // ================== @@ -998,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 aec3c4dce..6848388d8 100644 --- a/crates/sargon/src/system/sargon_os/sargon_os_factors.rs +++ b/crates/sargon/src/system/sargon_os/sargon_os_factors.rs @@ -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/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/subsystems/log_system/log_system.rs b/crates/sargon/src/system/subsystems/log_system/log_system.rs index d474929e4..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::*; From fc9c13960b2efe2ccfd5126e147048b1c118bcb0 Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Wed, 1 Jan 2025 23:41:23 +0100 Subject: [PATCH 17/23] eternal glory --- ...r_instances_provider_outcome_for_factor.rs | 2 - crates/sargon-uniffi/src/lib.rs | 19 ++-- .../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/sargon_specific_types/mod.rs | 2 - crates/sargon/src/lib.rs | 88 +------------------ .../petition_for_factors_state.rs | 1 - crates/sargon/src/system/sargon_os/mod.rs | 8 -- 12 files changed, 9 insertions(+), 124 deletions(-) diff --git a/crates/sargon-factor-instances-provider/src/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 index a6fbccc04..3230c2197 100644 --- a/crates/sargon-factor-instances-provider/src/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 @@ -79,8 +79,6 @@ impl From for FactorInstancesProviderOutcomeForFactor { fn from(value: InternalFactorInstancesProviderOutcomeForFactor) -> Self { - - Self { hidden: HiddenConstructor, factor_source_id: value.factor_source_id, diff --git a/crates/sargon-uniffi/src/lib.rs b/crates/sargon-uniffi/src/lib.rs index d162e47dc..0bcfecbe1 100644 --- a/crates/sargon-uniffi/src/lib.rs +++ b/crates/sargon-uniffi/src/lib.rs @@ -1,6 +1,7 @@ #![feature(async_closure)] #![feature(let_chains)] #![feature(core_intrinsics)] +#![allow(unused_imports)] #![allow(internal_features)] mod core; @@ -49,32 +50,22 @@ 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::*; } 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/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/src/lib.rs b/crates/sargon/src/lib.rs index 9956126c5..0d5627cc6 100644 --- a/crates/sargon/src/lib.rs +++ b/crates/sargon/src/lib.rs @@ -21,105 +21,23 @@ mod types; pub mod prelude { pub use gateway_client_and_api::prelude::*; - pub(crate) use identified_vec_of::prelude::*; - pub(crate) use sargon_addresses::prelude::*; pub use sargon_clients::prelude::*; - pub(crate) use sargon_core::prelude::*; pub use sargon_factor_instances_provider::prelude::*; - pub(crate) use sargon_factors::prelude::*; - pub(crate) use sargon_hierarchical_deterministic::prelude::*; pub use sargon_keys_collector::prelude::*; pub use sargon_manifests::prelude::*; - pub(crate) use sargon_profile::prelude::*; pub use sargon_profile_logic::prelude::*; - pub(crate) use sargon_profile_security_structures::prelude::*; - pub(crate) use sargon_transaction_models::prelude::*; pub use crate::home_cards::*; - pub(crate) use crate::needs_a_new_home_dumping_ground::*; pub use crate::radix_connect::*; pub use crate::security_center::*; pub use crate::signing::*; pub use crate::system::*; pub use crate::types::*; - pub(crate) use radix_engine_toolkit_common::receipt::RuntimeToolkitTransactionReceipt as ScryptoRuntimeToolkitTransactionReceipt; + pub(crate) use radix_engine_interface::prelude::MetadataValue as ScryptoMetadataValue; - 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, - 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 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}, - 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::Span, - CompileError as ScryptoCompileError, - CompileErrorDiagnosticsStyle as ScryptoCompileErrorDiagnosticsStyle, - KnownManifestObjectNames as ScryptoKnownManifestObjectNames, - ManifestObjectNames as ScryptoManifestObjectNames, - MockBlobProvider as ScryptoMockBlobProvider, - }; + #[cfg(test)] + pub(crate) use radix_common::math::Decimal as ScryptoDecimal192; pub use radix_engine_toolkit::{ functions::{ 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 a8f035c56..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,4 +1,3 @@ - use super::*; use crate::prelude::*; diff --git a/crates/sargon/src/system/sargon_os/mod.rs b/crates/sargon/src/system/sargon_os/mod.rs index 72a31ba91..56f1ad2fa 100644 --- a/crates/sargon/src/system/sargon_os/mod.rs +++ b/crates/sargon/src/system/sargon_os/mod.rs @@ -24,13 +24,5 @@ pub use pre_authorization::*; pub use profile_state_holder::*; pub use sargon_os::*; pub use sargon_os_accounts::*; -pub(crate) use sargon_os_entities_linked_to_factor_source::*; pub use sargon_os_factors::*; -pub(crate) use sargon_os_gateway::*; -pub(crate) use sargon_os_personas::*; -pub(crate) use sargon_os_profile::*; -pub(crate) use sargon_os_security_center::*; -pub(crate) use sargon_os_security_structures::*; -pub(crate) use sargon_os_signing::*; -pub(crate) use sargon_os_sync_accounts::*; pub use transactions::*; From 7fbd9c652fae3d3c765ca6735a89188a0300ca93 Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Thu, 2 Jan 2025 00:06:38 +0100 Subject: [PATCH 18/23] try fix swift and kotlin --- Package.resolved | 50 ++++++++++++++++++ .../ManifestBuildingTests.swift | 15 ++++-- ...WalletToDappInteractionResponseTests.swift | 7 ++- apple/Tests/Utils/Test.swift | 5 +- crates/.DS_Store | Bin 6148 -> 0 bytes .../java/com/radixdlt/sargon/ProfileTest.kt | 2 +- .../sargon/TransactionManifestTest.kt | 1 - 7 files changed, 71 insertions(+), 9 deletions(-) create mode 100644 Package.resolved delete mode 100644 crates/.DS_Store diff --git a/Package.resolved b/Package.resolved new file mode 100644 index 000000000..f202b8c0c --- /dev/null +++ b/Package.resolved @@ -0,0 +1,50 @@ +{ + "pins" : [ + { + "identity" : "asyncextensions", + "kind" : "remoteSourceControl", + "location" : "https://github.com/sideeffect-io/AsyncExtensions", + "state" : { + "revision" : "3442d3d046800f1974bda096faaf0ac510b21154", + "version" : "0.5.3" + } + }, + { + "identity" : "swift-collections", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-collections.git", + "state" : { + "revision" : "671108c96644956dddcd89dd59c203dcdb36cec7", + "version" : "1.1.4" + } + }, + { + "identity" : "swift-custom-dump", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-custom-dump", + "state" : { + "revision" : "82645ec760917961cfa08c9c0c7104a57a0fa4b1", + "version" : "1.3.3" + } + }, + { + "identity" : "swiftyjson", + "kind" : "remoteSourceControl", + "location" : "https://github.com/SwiftyJSON/SwiftyJSON", + "state" : { + "revision" : "af76cf3ef710b6ca5f8c05f3a31307d44a3c5828", + "version" : "5.0.2" + } + }, + { + "identity" : "xctest-dynamic-overlay", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/xctest-dynamic-overlay", + "state" : { + "revision" : "a3f634d1a409c7979cabc0a71b3f26ffa9fc8af1", + "version" : "1.4.3" + } + } + ], + "version" : 2 +} 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/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/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/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 acc03752e..70dafe6cc 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 @@ -353,7 +353,6 @@ class TransactionManifestTest : SampleTestable { assertTrue( contains( recipient.value - .address .string ) ) From f10548ba909717b1dbb74cc760252bd2cedbda13 Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Thu, 2 Jan 2025 09:15:52 +0100 Subject: [PATCH 19/23] try fix kotlin test --- .../test/java/com/radixdlt/sargon/TransactionManifestTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 70dafe6cc..a39e68fcd 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 @@ -649,5 +649,5 @@ class TransactionManifestTest : SampleTestable { private fun engineToolkitReceipt(name: String): String = openFile(name, "dat").readText() private fun openFile(name: String, extension: String) = - File("../../" + "crates/sargon/fixtures/transaction/$name.$extension") + File("../../" + "crates/sargon-transaction-models/fixtures/transaction/$name.$extension") } From be2a2fed7da00235df4622482eb459e7fa62a351 Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Thu, 2 Jan 2025 09:19:37 +0100 Subject: [PATCH 20/23] Release 1.1.99 gateway-client-and-api@1.1.99 gateway-logic@1.1.99 gateway-models@1.1.99 http-client@1.1.99 identified-vec-of@1.1.99 next-derivation-index-ephemeral@1.1.99 sargon@1.1.99 sargon-addresses@1.1.99 sargon-clients@1.1.99 sargon-core@1.1.99 sargon-core-assert-json@1.1.99 sargon-core-error@1.1.99 sargon-core-utils@1.1.99 sargon-drivers@1.1.99 sargon-factor-instances-provider@1.1.99 sargon-factors@1.1.99 sargon-factors-supporting-types@1.1.99 sargon-hierarchical-deterministic@1.1.99 sargon-keys-collector@1.1.99 sargon-manifests@1.1.99 sargon-profile@1.1.99 sargon-profile-app-preferences@1.1.99 sargon-profile-gateway@1.1.99 sargon-profile-logic@1.1.99 sargon-profile-security-structures@1.1.99 sargon-profile-supporting-types@1.1.99 sargon-transaction-models@1.1.99 sargon-uniffi@1.1.99 Generated by cargo-workspaces --- Cargo.lock | 56 +++++++++---------- crates/gateway-client-and-api/Cargo.toml | 2 +- crates/gateway-logic/Cargo.toml | 2 +- crates/gateway-models/Cargo.toml | 2 +- crates/http-client/Cargo.toml | 2 +- crates/identified-vec-of/Cargo.toml | 2 +- .../Cargo.toml | 2 +- crates/sargon-addresses/Cargo.toml | 2 +- crates/sargon-clients/Cargo.toml | 2 +- crates/sargon-core-assert-json/Cargo.toml | 2 +- crates/sargon-core-error/Cargo.toml | 4 +- crates/sargon-core-utils/Cargo.toml | 2 +- crates/sargon-core/Cargo.toml | 2 +- crates/sargon-drivers/Cargo.toml | 4 +- .../Cargo.toml | 2 +- .../Cargo.toml | 2 +- crates/sargon-factors/Cargo.toml | 2 +- .../Cargo.toml | 4 +- crates/sargon-keys-collector/Cargo.toml | 2 +- crates/sargon-manifests/Cargo.toml | 2 +- .../sargon-profile-app-preferences/Cargo.toml | 2 +- crates/sargon-profile-gateway/Cargo.toml | 2 +- crates/sargon-profile-logic/Cargo.toml | 2 +- .../Cargo.toml | 2 +- .../Cargo.toml | 2 +- crates/sargon-profile/Cargo.toml | 2 +- crates/sargon-transaction-models/Cargo.toml | 2 +- crates/sargon-uniffi/Cargo.toml | 2 +- crates/sargon/Cargo.toml | 2 +- 29 files changed, 59 insertions(+), 59 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c5813ad85..29a43d4c8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1299,7 +1299,7 @@ dependencies = [ [[package]] name = "gateway-client-and-api" -version = "1.2.1" +version = "1.1.99" dependencies = [ "actix-rt", "derive_more", @@ -1323,7 +1323,7 @@ dependencies = [ [[package]] name = "gateway-logic" -version = "1.2.1" +version = "1.1.99" dependencies = [ "derive_more", "gateway-models", @@ -1339,7 +1339,7 @@ dependencies = [ [[package]] name = "gateway-models" -version = "1.2.1" +version = "1.1.99" dependencies = [ "derive_more", "radix-engine-interface", @@ -1551,7 +1551,7 @@ dependencies = [ [[package]] name = "http-client" -version = "1.2.1" +version = "1.1.99" dependencies = [ "actix-rt", "reqwest", @@ -1658,7 +1658,7 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "identified-vec-of" -version = "1.2.1" +version = "1.1.99" dependencies = [ "derive_more", "itertools 0.12.0", @@ -1986,7 +1986,7 @@ dependencies = [ [[package]] name = "next-derivation-index-ephemeral" -version = "1.2.1" +version = "1.1.99" dependencies = [ "derive_more", "enum-iterator", @@ -2846,7 +2846,7 @@ dependencies = [ [[package]] name = "sargon" -version = "1.2.1" +version = "1.1.99" dependencies = [ "actix-rt", "aes-gcm", @@ -2914,7 +2914,7 @@ dependencies = [ [[package]] name = "sargon-addresses" -version = "1.2.1" +version = "1.1.99" dependencies = [ "derive_more", "enum-iterator", @@ -2936,7 +2936,7 @@ dependencies = [ [[package]] name = "sargon-clients" -version = "1.2.1" +version = "1.1.99" dependencies = [ "actix-rt", "aes-gcm", @@ -2993,7 +2993,7 @@ dependencies = [ [[package]] name = "sargon-core" -version = "1.2.1" +version = "1.1.99" dependencies = [ "aes-gcm", "arraystring", @@ -3033,7 +3033,7 @@ dependencies = [ [[package]] name = "sargon-core-assert-json" -version = "1.2.1" +version = "1.1.99" dependencies = [ "assert-json-diff", "log", @@ -3046,7 +3046,7 @@ dependencies = [ [[package]] name = "sargon-core-error" -version = "1.2.1" +version = "1.1.99" dependencies = [ "log", "serde_json 1.0.108", @@ -3055,7 +3055,7 @@ dependencies = [ [[package]] name = "sargon-core-utils" -version = "1.2.1" +version = "1.1.99" dependencies = [ "iso8601-timestamp", "log", @@ -3069,7 +3069,7 @@ dependencies = [ [[package]] name = "sargon-drivers" -version = "1.2.1" +version = "1.1.99" dependencies = [ "actix-rt", "aes-gcm", @@ -3123,7 +3123,7 @@ dependencies = [ [[package]] name = "sargon-factor-instances-provider" -version = "1.2.1" +version = "1.1.99" dependencies = [ "actix-rt", "aes-gcm", @@ -3176,7 +3176,7 @@ dependencies = [ [[package]] name = "sargon-factors" -version = "1.2.1" +version = "1.1.99" dependencies = [ "arraystring", "assert-json-diff", @@ -3217,7 +3217,7 @@ dependencies = [ [[package]] name = "sargon-factors-supporting-types" -version = "1.2.1" +version = "1.1.99" dependencies = [ "async-trait", "identified-vec-of", @@ -3228,7 +3228,7 @@ dependencies = [ [[package]] name = "sargon-hierarchical-deterministic" -version = "1.2.1" +version = "1.1.99" dependencies = [ "assert-json-diff", "bip39", @@ -3265,7 +3265,7 @@ dependencies = [ [[package]] name = "sargon-keys-collector" -version = "1.2.1" +version = "1.1.99" dependencies = [ "actix-rt", "async-trait", @@ -3280,7 +3280,7 @@ dependencies = [ [[package]] name = "sargon-manifests" -version = "1.2.1" +version = "1.1.99" dependencies = [ "assert-json-diff", "async-trait", @@ -3330,7 +3330,7 @@ dependencies = [ [[package]] name = "sargon-profile" -version = "1.2.1" +version = "1.1.99" dependencies = [ "actix-rt", "aes-gcm", @@ -3389,7 +3389,7 @@ dependencies = [ [[package]] name = "sargon-profile-app-preferences" -version = "1.2.1" +version = "1.1.99" dependencies = [ "aes-gcm", "assert-json-diff", @@ -3446,7 +3446,7 @@ dependencies = [ [[package]] name = "sargon-profile-gateway" -version = "1.2.1" +version = "1.1.99" dependencies = [ "aes-gcm", "assert-json-diff", @@ -3501,7 +3501,7 @@ dependencies = [ [[package]] name = "sargon-profile-logic" -version = "1.2.1" +version = "1.1.99" dependencies = [ "derive_more", "identified-vec-of", @@ -3528,7 +3528,7 @@ dependencies = [ [[package]] name = "sargon-profile-security-structures" -version = "1.2.1" +version = "1.1.99" dependencies = [ "aes-gcm", "assert-json-diff", @@ -3582,7 +3582,7 @@ dependencies = [ [[package]] name = "sargon-profile-supporting-types" -version = "1.2.1" +version = "1.1.99" dependencies = [ "derive_more", "identified-vec-of", @@ -3608,7 +3608,7 @@ dependencies = [ [[package]] name = "sargon-transaction-models" -version = "1.2.1" +version = "1.1.99" dependencies = [ "assert-json-diff", "async-trait", @@ -3654,7 +3654,7 @@ dependencies = [ [[package]] name = "sargon-uniffi" -version = "1.2.1" +version = "1.1.99" dependencies = [ "actix-rt", "assert-json-diff", diff --git a/crates/gateway-client-and-api/Cargo.toml b/crates/gateway-client-and-api/Cargo.toml index 302d5ed79..1c8af2b90 100644 --- a/crates/gateway-client-and-api/Cargo.toml +++ b/crates/gateway-client-and-api/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gateway-client-and-api" -version = "1.2.1" +version = "1.1.99" edition = "2021" [dependencies] diff --git a/crates/gateway-logic/Cargo.toml b/crates/gateway-logic/Cargo.toml index e482ef35a..a4b515d52 100644 --- a/crates/gateway-logic/Cargo.toml +++ b/crates/gateway-logic/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gateway-logic" -version = "1.2.1" +version = "1.1.99" edition = "2021" build = "build.rs" diff --git a/crates/gateway-models/Cargo.toml b/crates/gateway-models/Cargo.toml index 80d3c3be1..7e97a0e29 100644 --- a/crates/gateway-models/Cargo.toml +++ b/crates/gateway-models/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gateway-models" -version = "1.2.1" +version = "1.1.99" edition = "2021" build = "build.rs" diff --git a/crates/http-client/Cargo.toml b/crates/http-client/Cargo.toml index 01c589366..2bcb66169 100644 --- a/crates/http-client/Cargo.toml +++ b/crates/http-client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "http-client" -version = "1.2.1" +version = "1.1.99" edition = "2021" [dependencies] diff --git a/crates/identified-vec-of/Cargo.toml b/crates/identified-vec-of/Cargo.toml index 667d85027..75472073a 100644 --- a/crates/identified-vec-of/Cargo.toml +++ b/crates/identified-vec-of/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "identified-vec-of" -version = "1.2.1" +version = "1.1.99" edition = "2021" [dependencies] diff --git a/crates/next-derivation-index-ephemeral/Cargo.toml b/crates/next-derivation-index-ephemeral/Cargo.toml index a97d34e36..211c5bd30 100644 --- a/crates/next-derivation-index-ephemeral/Cargo.toml +++ b/crates/next-derivation-index-ephemeral/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "next-derivation-index-ephemeral" -version = "1.2.1" +version = "1.1.99" edition = "2021" [dependencies] diff --git a/crates/sargon-addresses/Cargo.toml b/crates/sargon-addresses/Cargo.toml index b5d643125..533ee53c5 100644 --- a/crates/sargon-addresses/Cargo.toml +++ b/crates/sargon-addresses/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sargon-addresses" -version = "1.2.1" +version = "1.1.99" edition = "2021" [dependencies] diff --git a/crates/sargon-clients/Cargo.toml b/crates/sargon-clients/Cargo.toml index 76dc862b9..9af540249 100644 --- a/crates/sargon-clients/Cargo.toml +++ b/crates/sargon-clients/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sargon-clients" -version = "1.2.1" +version = "1.1.99" edition = "2021" [dependencies] diff --git a/crates/sargon-core-assert-json/Cargo.toml b/crates/sargon-core-assert-json/Cargo.toml index 3ec7c3504..084528e93 100644 --- a/crates/sargon-core-assert-json/Cargo.toml +++ b/crates/sargon-core-assert-json/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sargon-core-assert-json" -version = "1.2.1" +version = "1.1.99" edition = "2021" [dependencies] diff --git a/crates/sargon-core-error/Cargo.toml b/crates/sargon-core-error/Cargo.toml index d408b95c0..eb1946eb3 100644 --- a/crates/sargon-core-error/Cargo.toml +++ b/crates/sargon-core-error/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sargon-core-error" -version = "1.2.1" +version = "1.1.99" edition = "2021" [dependencies] @@ -12,4 +12,4 @@ edition = "2021" # === EXTERNAL DEPENDENCIES === log = { workspace = true } serde_json = { workspace = true } -thiserror = { workspace = true } \ No newline at end of file +thiserror = { workspace = true } diff --git a/crates/sargon-core-utils/Cargo.toml b/crates/sargon-core-utils/Cargo.toml index 771b72bc8..406e1a03c 100644 --- a/crates/sargon-core-utils/Cargo.toml +++ b/crates/sargon-core-utils/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sargon-core-utils" -version = "1.2.1" +version = "1.1.99" edition = "2021" [dependencies] diff --git a/crates/sargon-core/Cargo.toml b/crates/sargon-core/Cargo.toml index 76230cd14..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] diff --git a/crates/sargon-drivers/Cargo.toml b/crates/sargon-drivers/Cargo.toml index 373003a25..9dc11c203 100644 --- a/crates/sargon-drivers/Cargo.toml +++ b/crates/sargon-drivers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sargon-drivers" -version = "1.2.1" +version = "1.1.99" edition = "2021" [dependencies] @@ -58,4 +58,4 @@ uuid = { workspace = true } zeroize = { workspace = true } [dev-dependencies] -actix-rt = { workspace = true } \ No newline at end of file +actix-rt = { workspace = true } diff --git a/crates/sargon-factor-instances-provider/Cargo.toml b/crates/sargon-factor-instances-provider/Cargo.toml index 0d06877c6..e0b1b269a 100644 --- a/crates/sargon-factor-instances-provider/Cargo.toml +++ b/crates/sargon-factor-instances-provider/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sargon-factor-instances-provider" -version = "1.2.1" +version = "1.1.99" edition = "2021" [dependencies] diff --git a/crates/sargon-factors-supporting-types/Cargo.toml b/crates/sargon-factors-supporting-types/Cargo.toml index 774d76c24..b37d2c5b7 100644 --- a/crates/sargon-factors-supporting-types/Cargo.toml +++ b/crates/sargon-factors-supporting-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sargon-factors-supporting-types" -version = "1.2.1" +version = "1.1.99" edition = "2021" [dependencies] diff --git a/crates/sargon-factors/Cargo.toml b/crates/sargon-factors/Cargo.toml index 7ad1e0f6e..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" diff --git a/crates/sargon-hierarchical-deterministic/Cargo.toml b/crates/sargon-hierarchical-deterministic/Cargo.toml index e3594495f..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] @@ -39,4 +39,4 @@ strum = { workspace = true } thiserror = { workspace = true } url = { workspace = true } uuid = { workspace = true } -zeroize = { workspace = true } \ No newline at end of file +zeroize = { workspace = true } diff --git a/crates/sargon-keys-collector/Cargo.toml b/crates/sargon-keys-collector/Cargo.toml index be2c936bf..6bd8abeba 100644 --- a/crates/sargon-keys-collector/Cargo.toml +++ b/crates/sargon-keys-collector/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sargon-keys-collector" -version = "1.2.1" +version = "1.1.99" edition = "2021" [dependencies] diff --git a/crates/sargon-manifests/Cargo.toml b/crates/sargon-manifests/Cargo.toml index d56021b36..b0402edcb 100644 --- a/crates/sargon-manifests/Cargo.toml +++ b/crates/sargon-manifests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sargon-manifests" -version = "1.2.1" +version = "1.1.99" edition = "2021" build = "build.rs" diff --git a/crates/sargon-profile-app-preferences/Cargo.toml b/crates/sargon-profile-app-preferences/Cargo.toml index 1c9d21748..32da16d33 100644 --- a/crates/sargon-profile-app-preferences/Cargo.toml +++ b/crates/sargon-profile-app-preferences/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sargon-profile-app-preferences" -version = "1.2.1" +version = "1.1.99" edition = "2021" [dependencies] diff --git a/crates/sargon-profile-gateway/Cargo.toml b/crates/sargon-profile-gateway/Cargo.toml index d9f37085f..8c7616236 100644 --- a/crates/sargon-profile-gateway/Cargo.toml +++ b/crates/sargon-profile-gateway/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sargon-profile-gateway" -version = "1.2.1" +version = "1.1.99" edition = "2021" [dependencies] diff --git a/crates/sargon-profile-logic/Cargo.toml b/crates/sargon-profile-logic/Cargo.toml index 2cd3925c4..f1a52e238 100644 --- a/crates/sargon-profile-logic/Cargo.toml +++ b/crates/sargon-profile-logic/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sargon-profile-logic" -version = "1.2.1" +version = "1.1.99" edition = "2021" [dependencies] diff --git a/crates/sargon-profile-security-structures/Cargo.toml b/crates/sargon-profile-security-structures/Cargo.toml index 46edefb07..fa0bb3ef0 100644 --- a/crates/sargon-profile-security-structures/Cargo.toml +++ b/crates/sargon-profile-security-structures/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sargon-profile-security-structures" -version = "1.2.1" +version = "1.1.99" edition = "2021" [dependencies] diff --git a/crates/sargon-profile-supporting-types/Cargo.toml b/crates/sargon-profile-supporting-types/Cargo.toml index d94b2dd09..321461a56 100644 --- a/crates/sargon-profile-supporting-types/Cargo.toml +++ b/crates/sargon-profile-supporting-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sargon-profile-supporting-types" -version = "1.2.1" +version = "1.1.99" edition = "2021" [dependencies] diff --git a/crates/sargon-profile/Cargo.toml b/crates/sargon-profile/Cargo.toml index 433207240..570630fd1 100644 --- a/crates/sargon-profile/Cargo.toml +++ b/crates/sargon-profile/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sargon-profile" -version = "1.2.1" +version = "1.1.99" edition = "2021" build = "build.rs" diff --git a/crates/sargon-transaction-models/Cargo.toml b/crates/sargon-transaction-models/Cargo.toml index d1be78d88..237276d3f 100644 --- a/crates/sargon-transaction-models/Cargo.toml +++ b/crates/sargon-transaction-models/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sargon-transaction-models" -version = "1.2.1" +version = "1.1.99" edition = "2021" build = "build.rs" diff --git a/crates/sargon-uniffi/Cargo.toml b/crates/sargon-uniffi/Cargo.toml index aa53a8558..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" diff --git a/crates/sargon/Cargo.toml b/crates/sargon/Cargo.toml index 984f8ba3a..8098eb06e 100644 --- a/crates/sargon/Cargo.toml +++ b/crates/sargon/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sargon" -version = "1.2.1" +version = "1.1.99" edition = "2021" build = "build.rs" From 9638bb8fe2d3f4aad3dfa7f606078bfabf5d346b Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Thu, 2 Jan 2025 09:34:39 +0100 Subject: [PATCH 21/23] remove unused dependencies in crate `gateway-client-and-api` --- Cargo.lock | 5 ----- crates/gateway-client-and-api/Cargo.toml | 5 ----- .../gateway-client-and-api/src/client/gateway_client.rs | 9 ++++++++- crates/gateway-client-and-api/src/lib.rs | 2 -- .../gateway-client-and-api/src/methods/state_methods.rs | 2 ++ 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 29a43d4c8..0c977e9eb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1302,15 +1302,10 @@ name = "gateway-client-and-api" version = "1.1.99" dependencies = [ "actix-rt", - "derive_more", "gateway-logic", "gateway-models", "http-client", - "itertools 0.12.0", "radix-common", - "radix-engine-toolkit-common", - "radix-transactions", - "reqwest", "sargon-addresses", "sargon-core", "sargon-core-assert-json", diff --git a/crates/gateway-client-and-api/Cargo.toml b/crates/gateway-client-and-api/Cargo.toml index 1c8af2b90..33c886d2a 100644 --- a/crates/gateway-client-and-api/Cargo.toml +++ b/crates/gateway-client-and-api/Cargo.toml @@ -16,14 +16,9 @@ gateway-logic = { path = "../gateway-logic" } sargon-profile-gateway = { path = "../sargon-profile-gateway" } # === RADIX DEPENDENCIES === -radix-engine-toolkit-common = { workspace = true } -radix-transactions = { workspace = true } radix-common = { workspace = true } # === EXTERNAL DEPENDENCIES === -derive_more = { workspace = true } -itertools = { workspace = true } -reqwest = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } diff --git a/crates/gateway-client-and-api/src/client/gateway_client.rs b/crates/gateway-client-and-api/src/client/gateway_client.rs index 9fa671de0..5c048e3ae 100644 --- a/crates/gateway-client-and-api/src/client/gateway_client.rs +++ b/crates/gateway-client-and-api/src/client/gateway_client.rs @@ -68,7 +68,14 @@ mod tests { 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() })); + + assert_eq!( + result, + Err( + CommonError::GatewaySubmitDuplicateTX { + intent_hash: r#"txid_rdx198k527d5wt4ms5tvrdcu8089v4hptp7ztv388k539uzzvmw25ltsj7u4zz"#.to_owned() } + ) + ); } #[actix_rt::test] diff --git a/crates/gateway-client-and-api/src/lib.rs b/crates/gateway-client-and-api/src/lib.rs index 41fce1c94..9fcae971c 100644 --- a/crates/gateway-client-and-api/src/lib.rs +++ b/crates/gateway-client-and-api/src/lib.rs @@ -13,8 +13,6 @@ pub mod prelude { pub use sargon_drivers::prelude::*; pub use sargon_transaction_models::prelude::*; - pub use radix_common::prelude::ACCOUNT_OWNER_BADGE as SCRYPTO_ACCOUNT_OWNER_BADGE; - pub use serde::{Deserialize, Serialize}; } diff --git a/crates/gateway-client-and-api/src/methods/state_methods.rs b/crates/gateway-client-and-api/src/methods/state_methods.rs index 3ffd96f15..703814acc 100644 --- a/crates/gateway-client-and-api/src/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. From 0128860ea5d74ea3ddf4da45acaf7248f2f591bd Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Thu, 2 Jan 2025 09:50:33 +0100 Subject: [PATCH 22/23] Try fix kotlin - remove crate 'gateway-logic' since it was tiny --- Cargo.lock | 18 +- Cargo.toml | 1 - crates/gateway-client-and-api/Cargo.toml | 1 - crates/gateway-client-and-api/src/lib.rs | 1 - crates/gateway-logic/Cargo.toml | 25 - crates/gateway-logic/build.rs | 20 - ...ity_details__single_account_no_assets.json | 27 - ...quest_entity_details__single_resource.json | 27 - .../request_entity_details__two_accounts.json | 28 - ...ingle_account_many_nfts_and_fungibles.json | 2980 ----------------- ...ity_details__single_account_no_assets.json | 277 -- ...ponse_entity_details__single_resource.json | 649 ---- ..._details__single_resource_no_metadata.json | 398 --- ...response_entity_details__two_accounts.json | 1025 ------ ...ty_details_details__fungible_resource.json | 347 -- ...etails_details__non_fungible_resource.json | 344 -- crates/gateway-logic/src/lib.rs | 13 - crates/gateway-logic/src/logic/mod.rs | 5 - .../src/logic/new_transaction_preview.rs | 117 - crates/gateway-logic/src/logic/request/mod.rs | 3 - ...action_submit_request_from_notarized_tx.rs | 34 - crates/gateway-models/Cargo.toml | 1 + .../models/transaction/request_preview.json | 0 crates/gateway-models/src/lib.rs | 1 + .../preview/transaction_preview.rs | 106 + .../transaction/submit/transaction_submit.rs | 27 + .../sargon_os/sargon_os_sync_accounts.rs | 2 + .../sargon/TransactionManifestTest.kt | 11 +- 28 files changed, 145 insertions(+), 6343 deletions(-) delete mode 100644 crates/gateway-logic/Cargo.toml delete mode 100644 crates/gateway-logic/build.rs delete mode 100644 crates/gateway-logic/fixtures/models/state/request_entity_details__single_account_no_assets.json delete mode 100644 crates/gateway-logic/fixtures/models/state/request_entity_details__single_resource.json delete mode 100644 crates/gateway-logic/fixtures/models/state/request_entity_details__two_accounts.json delete mode 100644 crates/gateway-logic/fixtures/models/state/response_entity_details__single_account_many_nfts_and_fungibles.json delete mode 100644 crates/gateway-logic/fixtures/models/state/response_entity_details__single_account_no_assets.json delete mode 100644 crates/gateway-logic/fixtures/models/state/response_entity_details__single_resource.json delete mode 100644 crates/gateway-logic/fixtures/models/state/response_entity_details__single_resource_no_metadata.json delete mode 100644 crates/gateway-logic/fixtures/models/state/response_entity_details__two_accounts.json delete mode 100644 crates/gateway-logic/fixtures/models/state/response_entity_details_details__fungible_resource.json delete mode 100644 crates/gateway-logic/fixtures/models/state/response_entity_details_details__non_fungible_resource.json delete mode 100644 crates/gateway-logic/src/lib.rs delete mode 100644 crates/gateway-logic/src/logic/mod.rs delete mode 100644 crates/gateway-logic/src/logic/new_transaction_preview.rs delete mode 100644 crates/gateway-logic/src/logic/request/mod.rs delete mode 100644 crates/gateway-logic/src/logic/request/transaction_submit_request_from_notarized_tx.rs rename crates/{gateway-logic => gateway-models}/fixtures/models/transaction/request_preview.json (100%) diff --git a/Cargo.lock b/Cargo.lock index 0c977e9eb..987908c6e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1302,7 +1302,6 @@ name = "gateway-client-and-api" version = "1.1.99" dependencies = [ "actix-rt", - "gateway-logic", "gateway-models", "http-client", "radix-common", @@ -1316,22 +1315,6 @@ dependencies = [ "serde_json 1.0.108", ] -[[package]] -name = "gateway-logic" -version = "1.1.99" -dependencies = [ - "derive_more", - "gateway-models", - "itertools 0.12.0", - "radix-engine-toolkit-common", - "radix-transactions", - "sargon-addresses", - "sargon-core", - "sargon-core-assert-json", - "sargon-transaction-models", - "serde", -] - [[package]] name = "gateway-models" version = "1.1.99" @@ -1343,6 +1326,7 @@ dependencies = [ "sargon-addresses", "sargon-core", "sargon-core-assert-json", + "sargon-transaction-models", "serde", ] diff --git a/Cargo.toml b/Cargo.toml index 4357cf97e..930ad069b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,6 @@ members = [ "crates/next-derivation-index-ephemeral", "crates/gateway-models", - "crates/gateway-logic", "crates/gateway-client-and-api", "crates/sargon", # to be split diff --git a/crates/gateway-client-and-api/Cargo.toml b/crates/gateway-client-and-api/Cargo.toml index 33c886d2a..0ad1c1df0 100644 --- a/crates/gateway-client-and-api/Cargo.toml +++ b/crates/gateway-client-and-api/Cargo.toml @@ -12,7 +12,6 @@ sargon-drivers = { path = "../sargon-drivers" } http-client = { path = "../http-client" } gateway-models = { path = "../gateway-models" } sargon-transaction-models = { path = "../sargon-transaction-models" } -gateway-logic = { path = "../gateway-logic" } sargon-profile-gateway = { path = "../sargon-profile-gateway" } # === RADIX DEPENDENCIES === diff --git a/crates/gateway-client-and-api/src/lib.rs b/crates/gateway-client-and-api/src/lib.rs index 9fcae971c..dcb924c71 100644 --- a/crates/gateway-client-and-api/src/lib.rs +++ b/crates/gateway-client-and-api/src/lib.rs @@ -7,7 +7,6 @@ pub mod prelude { pub use crate::assert_network_request::*; pub use crate::client::*; - pub use gateway_logic::prelude::*; pub use gateway_models::prelude::*; pub use http_client::prelude::*; pub use sargon_drivers::prelude::*; diff --git a/crates/gateway-logic/Cargo.toml b/crates/gateway-logic/Cargo.toml deleted file mode 100644 index a4b515d52..000000000 --- a/crates/gateway-logic/Cargo.toml +++ /dev/null @@ -1,25 +0,0 @@ -[package] -name = "gateway-logic" -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" } -gateway-models = { path = "../gateway-models" } - -# hmm should maybe not do this, we only use NotarizedTransaction for a ctor, we can put -# it elsewhere... outside of gateway-logic crate -sargon-transaction-models = { path = "../sargon-transaction-models" } - -# === RADIX DEPENDENCIES === -radix-engine-toolkit-common = { workspace = true } -radix-transactions = { workspace = true } - -# === EXTERNAL DEPENDENCIES === -derive_more = { workspace = true } -itertools = { workspace = true } -serde = { workspace = true } diff --git a/crates/gateway-logic/build.rs b/crates/gateway-logic/build.rs deleted file mode 100644 index 4a040fa98..000000000 --- a/crates/gateway-logic/build.rs +++ /dev/null @@ -1,20 +0,0 @@ -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() - ); - - let fixtures_models_path = fixtures_path.join("models"); - println!( - "cargo:rustc-env=FIXTURES_MODELS_GW={}/", - fixtures_models_path.display() - ); -} diff --git a/crates/gateway-logic/fixtures/models/state/request_entity_details__single_account_no_assets.json b/crates/gateway-logic/fixtures/models/state/request_entity_details__single_account_no_assets.json deleted file mode 100644 index 281b7679c..000000000 --- a/crates/gateway-logic/fixtures/models/state/request_entity_details__single_account_no_assets.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "addresses": - [ - "account_tdx_2_12ylv4l9tj9vx0myyge2s7mzmgnzjmk9fgu3h72dn62s8d9lcafxzds" - ], - "aggregation_level": "Vault", - "opt_ins": - { - "ancestor_identities": false, - "component_royalty_vault_balance": false, - "explicit_metadata": - [ - "dapp_definition", - "validator", - "dapp_definitions", - "tags", - "pool", - "description", - "account_type", - "name", - "symbol", - "icon_url" - ], - "non_fungible_include_nfids": false, - "package_royalty_vault_balance": false - } -} \ No newline at end of file diff --git a/crates/gateway-logic/fixtures/models/state/request_entity_details__single_resource.json b/crates/gateway-logic/fixtures/models/state/request_entity_details__single_resource.json deleted file mode 100644 index 6ef342a63..000000000 --- a/crates/gateway-logic/fixtures/models/state/request_entity_details__single_resource.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "addresses": - [ - "resource_tdx_2_1thkcveg0p2l35kvwlxasltvw0wjgsrpch6yfjct9qahze3wce8ukj8" - ], - "aggregation_level": "Vault", - "opt_ins": - { - "ancestor_identities": false, - "component_royalty_vault_balance": false, - "explicit_metadata": - [ - "symbol", - "dapp_definition", - "name", - "dapp_definitions", - "icon_url", - "tags", - "validator", - "description", - "account_type", - "pool" - ], - "non_fungible_include_nfids": false, - "package_royalty_vault_balance": false - } -} \ No newline at end of file diff --git a/crates/gateway-logic/fixtures/models/state/request_entity_details__two_accounts.json b/crates/gateway-logic/fixtures/models/state/request_entity_details__two_accounts.json deleted file mode 100644 index 05b97db0e..000000000 --- a/crates/gateway-logic/fixtures/models/state/request_entity_details__two_accounts.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "addresses": - [ - "account_tdx_2_129vd0a8epu6wa46nh8fkcjhmxwtwet6mut8rgzef2ng68zh5t04t88", - "account_tdx_2_12xwjddwn7wp3tqgj353rur4c2jzjg7uvydfj7y8yaflymxnd9czd4c" - ], - "aggregation_level": "Vault", - "opt_ins": - { - "ancestor_identities": false, - "component_royalty_vault_balance": false, - "explicit_metadata": - [ - "pool", - "tags", - "validator", - "description", - "account_type", - "icon_url", - "symbol", - "name", - "dapp_definition", - "dapp_definitions" - ], - "non_fungible_include_nfids": false, - "package_royalty_vault_balance": false - } -} \ No newline at end of file diff --git a/crates/gateway-logic/fixtures/models/state/response_entity_details__single_account_many_nfts_and_fungibles.json b/crates/gateway-logic/fixtures/models/state/response_entity_details__single_account_many_nfts_and_fungibles.json deleted file mode 100644 index 6105e827f..000000000 --- a/crates/gateway-logic/fixtures/models/state/response_entity_details__single_account_many_nfts_and_fungibles.json +++ /dev/null @@ -1,2980 +0,0 @@ -{ - "ledger_state": - { - "network": "stokenet", - "state_version": 73654157, - "proposer_round_timestamp": "2024-04-10T08:36:43.74Z", - "epoch": 51651, - "round": 411 - }, - "items": - [ - { - "address": "account_tdx_2_12ylv4l9tj9vx0myyge2s7mzmgnzjmk9fgu3h72dn62s8d9lcafxzds", - "fungible_resources": - { - "total_count": 11, - "items": - [ - { - "vaults": - { - "total_count": 1, - "items": - [ - { - "vault_address": "internal_vault_tdx_2_1trlp0h0jtkdzr5h79sp9c60wgrpznxlsx4j68djwht5tn6apzkx3m0", - "amount": "9991.09666653402", - "last_updated_at_state_version": 73654060 - } - ] - }, - "aggregation_level": "Vault", - "resource_address": "resource_tdx_2_1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxtfd2jc", - "explicit_metadata": - { - "total_count": 5, - "items": - [ - { - "key": "name", - "value": - { - "raw_hex": "5c2200010c055261646978", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Radix", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Radix", - "type": "String" - } - }, - "is_locked": true, - "last_updated_at_state_version": 2 - }, - { - "key": "icon_url", - "value": - { - "raw_hex": "5c220d010c3468747470733a2f2f6173736574732e7261646978646c742e636f6d2f69636f6e732f69636f6e2d7872642d33327833322e706e67", - "programmatic_json": - { - "variant_id": 13, - "fields": - [ - { - "value": "https://assets.radixdlt.com/icons/icon-xrd-32x32.png", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "https://assets.radixdlt.com/icons/icon-xrd-32x32.png", - "type": "Url" - } - }, - "is_locked": true, - "last_updated_at_state_version": 2 - }, - { - "key": "description", - "value": - { - "raw_hex": "5c2200010c9e01546865205261646978205075626c6963204e6574776f726b2773206e617469766520746f6b656e2c207573656420746f2070617920746865206e6574776f726b2773207265717569726564207472616e73616374696f6e206665657320616e6420746f2073656375726520746865206e6574776f726b207468726f756768207374616b696e6720746f206974732076616c696461746f72206e6f6465732e", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "The Radix Public Network's native token, used to pay the network's required transaction fees and to secure the network through staking to its validator nodes.", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "The Radix Public Network's native token, used to pay the network's required transaction fees and to secure the network through staking to its validator nodes.", - "type": "String" - } - }, - "is_locked": true, - "last_updated_at_state_version": 2 - }, - { - "key": "symbol", - "value": - { - "raw_hex": "5c2200010c03585244", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "XRD", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "XRD", - "type": "String" - } - }, - "is_locked": true, - "last_updated_at_state_version": 2 - }, - { - "key": "tags", - "value": - { - "raw_hex": "5c228001200c00", - "programmatic_json": - { - "variant_id": 128, - "fields": - [ - { - "element_kind": "String", - "elements": - [], - "kind": "Array" - } - ], - "kind": "Enum" - }, - "typed": - { - "values": - [], - "type": "StringArray" - } - }, - "is_locked": true, - "last_updated_at_state_version": 2 - } - ] - } - }, - { - "vaults": - { - "total_count": 1, - "items": - [ - { - "vault_address": "internal_vault_tdx_2_1trenve8ltw9lk2snmjng9fwu72d85xtanwyx47haln86dx3x5x4wlm", - "amount": "21000000", - "last_updated_at_state_version": 73654060 - } - ] - }, - "aggregation_level": "Vault", - "resource_address": "resource_tdx_2_1t5znvqz9uaqj4afa2xwuzxy6mum3u2406r5gx9fcjpepfauu25qwm7", - "explicit_metadata": - { - "total_count": 5, - "items": - [ - { - "key": "name", - "value": - { - "raw_hex": "5c2200010c0c5363726962626c65636f696e", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Scribblecoin", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Scribblecoin", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "icon_url", - "value": - { - "raw_hex": "5c220d010c5868747470733a2f2f757877696e672e636f6d2f77702d636f6e74656e742f7468656d65732f757877696e672f646f776e6c6f61642f65646974696e672d757365722d616374696f6e2f70656e63696c2d69636f6e2e706e67", - "programmatic_json": - { - "variant_id": 13, - "fields": - [ - { - "value": "https://uxwing.com/wp-content/themes/uxwing/download/editing-user-action/pencil-icon.png", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "https://uxwing.com/wp-content/themes/uxwing/download/editing-user-action/pencil-icon.png", - "type": "Url" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "description", - "value": - { - "raw_hex": "5c2200010c5b5363726962626c65636f696e202d206d616b696e6720697473206d61726b20696e2074686520776f726c64206f66206469676974616c2063757272656e63792c206f6e65207472616e73616374696f6e20617420612074696d6521", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Scribblecoin - making its mark in the world of digital currency, one transaction at a time!", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Scribblecoin - making its mark in the world of digital currency, one transaction at a time!", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "symbol", - "value": - { - "raw_hex": "5c2200010c055343524942", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "SCRIB", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "SCRIB", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "tags", - "value": - { - "raw_hex": "5c228001200c0206536172676f6e055275737479", - "programmatic_json": - { - "variant_id": 128, - "fields": - [ - { - "element_kind": "String", - "elements": - [ - { - "value": "Sargon", - "kind": "String" - }, - { - "value": "Rusty", - "kind": "String" - } - ], - "kind": "Array" - } - ], - "kind": "Enum" - }, - "typed": - { - "values": - [ - "Sargon", - "Rusty" - ], - "type": "StringArray" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - } - ] - } - }, - { - "vaults": - { - "total_count": 1, - "items": - [ - { - "vault_address": "internal_vault_tdx_2_1tq6fhk82u9r9t3473phmvh4h0cjw8n67zndnwr2qrmykvd3t65dt9w", - "amount": "21000000", - "last_updated_at_state_version": 73654060 - } - ] - }, - "aggregation_level": "Vault", - "resource_address": "resource_tdx_2_1t4s3vqdeasekxcqfudltsp65n4tlx6xy9z9mm440v79q53zfjsm8mm", - "explicit_metadata": - { - "total_count": 5, - "items": - [ - { - "key": "name", - "value": - { - "raw_hex": "5c2200010c08476c6f77636f696e", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Glowcoin", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Glowcoin", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "icon_url", - "value": - { - "raw_hex": "5c220d010c5c68747470733a2f2f757877696e672e636f6d2f77702d636f6e74656e742f7468656d65732f757877696e672f646f776e6c6f61642f617274732d677261706869632d7368617065732f676c6172652d737461722d69636f6e2e706e67", - "programmatic_json": - { - "variant_id": 13, - "fields": - [ - { - "value": "https://uxwing.com/wp-content/themes/uxwing/download/arts-graphic-shapes/glare-star-icon.png", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "https://uxwing.com/wp-content/themes/uxwing/download/arts-graphic-shapes/glare-star-icon.png", - "type": "Url" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "description", - "value": - { - "raw_hex": "5c2200010c54476c6f77636f696e202d20696c6c756d696e6174696e6720746865207061746820746f2066696e616e6369616c2066726565646f6d2077697468206974732072616469616e74207472616e73616374696f6e7321", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Glowcoin - illuminating the path to financial freedom with its radiant transactions!", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Glowcoin - illuminating the path to financial freedom with its radiant transactions!", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "symbol", - "value": - { - "raw_hex": "5c2200010c04474c4f57", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "GLOW", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "GLOW", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "tags", - "value": - { - "raw_hex": "5c228001200c0206536172676f6e055275737479", - "programmatic_json": - { - "variant_id": 128, - "fields": - [ - { - "element_kind": "String", - "elements": - [ - { - "value": "Sargon", - "kind": "String" - }, - { - "value": "Rusty", - "kind": "String" - } - ], - "kind": "Array" - } - ], - "kind": "Enum" - }, - "typed": - { - "values": - [ - "Sargon", - "Rusty" - ], - "type": "StringArray" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - } - ] - } - }, - { - "vaults": - { - "total_count": 1, - "items": - [ - { - "vault_address": "internal_vault_tdx_2_1tzcm7l58c0zvsh4cy9ptj4m36qrkj3m7x9wt3lj0gxj5r0u8cr6uj6", - "amount": "21000000", - "last_updated_at_state_version": 73654060 - } - ] - }, - "aggregation_level": "Vault", - "resource_address": "resource_tdx_2_1thkcveg0p2l35kvwlxasltvw0wjgsrpch6yfjct9qahze3wce8ukj8", - "explicit_metadata": - { - "total_count": 5, - "items": - [ - { - "key": "name", - "value": - { - "raw_hex": "5c2200010c09426c697373636f696e", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Blisscoin", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Blisscoin", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "icon_url", - "value": - { - "raw_hex": "5c220d010c5b68747470733a2f2f757877696e672e636f6d2f77702d636f6e74656e742f7468656d65732f757877696e672f646f776e6c6f61642f656d6f6a692d656d6f7469636f6e2f6c61756768696e672d626c61636b2d69636f6e2e706e67", - "programmatic_json": - { - "variant_id": 13, - "fields": - [ - { - "value": "https://uxwing.com/wp-content/themes/uxwing/download/emoji-emoticon/laughing-black-icon.png", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "https://uxwing.com/wp-content/themes/uxwing/download/emoji-emoticon/laughing-black-icon.png", - "type": "Url" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "description", - "value": - { - "raw_hex": "5c2200010c70426c697373636f696e202d20657870657269656e6365207075726520626c6973732077697468206576657279207472616e73616374696f6e212048617070696e6573732067756172616e7465656420696e2074686520776f726c64206f66206469676974616c2063757272656e63792e", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Blisscoin - experience pure bliss with every transaction! Happiness guaranteed in the world of digital currency.", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Blisscoin - experience pure bliss with every transaction! Happiness guaranteed in the world of digital currency.", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "symbol", - "value": - { - "raw_hex": "5c2200010c05424c495353", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "BLISS", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "BLISS", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "tags", - "value": - { - "raw_hex": "5c228001200c0206536172676f6e055275737479", - "programmatic_json": - { - "variant_id": 128, - "fields": - [ - { - "element_kind": "String", - "elements": - [ - { - "value": "Sargon", - "kind": "String" - }, - { - "value": "Rusty", - "kind": "String" - } - ], - "kind": "Array" - } - ], - "kind": "Enum" - }, - "typed": - { - "values": - [ - "Sargon", - "Rusty" - ], - "type": "StringArray" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - } - ] - } - }, - { - "vaults": - { - "total_count": 1, - "items": - [ - { - "vault_address": "internal_vault_tdx_2_1tqzsqja9g2jpccv5q02xp0nuw2gzr7z8sr9hm7j0uthzyj7yv9tac9", - "amount": "21000000", - "last_updated_at_state_version": 73654060 - } - ] - }, - "aggregation_level": "Vault", - "resource_address": "resource_tdx_2_1t4ljhq7gdhuklfpe2vvdrpy2uuf2ff9n7at20z7f3pmwshpjgvyv7r", - "explicit_metadata": - { - "total_count": 5, - "items": - [ - { - "key": "name", - "value": - { - "raw_hex": "5c2200010c0a526f636b65746675656c", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Rocketfuel", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Rocketfuel", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "icon_url", - "value": - { - "raw_hex": "5c220d010c6568747470733a2f2f757877696e672e636f6d2f77702d636f6e74656e742f7468656d65732f757877696e672f646f776e6c6f61642f7472616e73706f72746174696f6e2d6175746f6d6f746976652f726f636b65742d6c61756e63682d69636f6e2e706e67", - "programmatic_json": - { - "variant_id": 13, - "fields": - [ - { - "value": "https://uxwing.com/wp-content/themes/uxwing/download/transportation-automotive/rocket-launch-icon.png", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "https://uxwing.com/wp-content/themes/uxwing/download/transportation-automotive/rocket-launch-icon.png", - "type": "Url" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "description", - "value": - { - "raw_hex": "5c2200010c65526f636b65746675656c202d20706f776572696e6720796f757220696e766573746d656e747320746f206e657720686569676874732120537472617020696e20666f722061206a6f75726e657920746f20746865206d6f6f6e20616e64206265796f6e642e", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Rocketfuel - powering your investments to new heights! Strap in for a journey to the moon and beyond.", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Rocketfuel - powering your investments to new heights! Strap in for a journey to the moon and beyond.", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "symbol", - "value": - { - "raw_hex": "5c2200010c044655454c", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "FUEL", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "FUEL", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "tags", - "value": - { - "raw_hex": "5c228001200c0206536172676f6e055275737479", - "programmatic_json": - { - "variant_id": 128, - "fields": - [ - { - "element_kind": "String", - "elements": - [ - { - "value": "Sargon", - "kind": "String" - }, - { - "value": "Rusty", - "kind": "String" - } - ], - "kind": "Array" - } - ], - "kind": "Enum" - }, - "typed": - { - "values": - [ - "Sargon", - "Rusty" - ], - "type": "StringArray" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - } - ] - } - }, - { - "vaults": - { - "total_count": 1, - "items": - [ - { - "vault_address": "internal_vault_tdx_2_1tqr6uqrcae6eh9pvt7gfq0k5qzctsfujdsx8fk9gdympjks408s73d", - "amount": "21000000", - "last_updated_at_state_version": 73654060 - } - ] - }, - "aggregation_level": "Vault", - "resource_address": "resource_tdx_2_1tk40xeu6lfzgzwjyrkw6rvveeue9gs0wxspqutcyrktzjwc65hrh9l", - "explicit_metadata": - { - "total_count": 5, - "items": - [ - { - "key": "name", - "value": - { - "raw_hex": "5c2200010c094a656c6c79636f696e", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Jellycoin", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Jellycoin", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "icon_url", - "value": - { - "raw_hex": "5c220d010c5968747470733a2f2f757877696e672e636f6d2f77702d636f6e74656e742f7468656d65732f757877696e672f646f776e6c6f61642f616e696d616c732d616e642d62697264732f6a656c6c79666973682d69636f6e2e706e67", - "programmatic_json": - { - "variant_id": 13, - "fields": - [ - { - "value": "https://uxwing.com/wp-content/themes/uxwing/download/animals-and-birds/jellyfish-icon.png", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "https://uxwing.com/wp-content/themes/uxwing/download/animals-and-birds/jellyfish-icon.png", - "type": "Url" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "description", - "value": - { - "raw_hex": "5c2200010c5e4a656c6c79636f696e202d206d616b696e6720796f757220696e766573746d656e747320776f62626c652077697468206578636974656d656e7421204469766520696e746f206120706f6f6c206f662073776565742070726f666974732e", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Jellycoin - making your investments wobble with excitement! Dive into a pool of sweet profits.", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Jellycoin - making your investments wobble with excitement! Dive into a pool of sweet profits.", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "symbol", - "value": - { - "raw_hex": "5c2200010c054a454c4c59", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "JELLY", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "JELLY", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "tags", - "value": - { - "raw_hex": "5c228001200c0206536172676f6e055275737479", - "programmatic_json": - { - "variant_id": 128, - "fields": - [ - { - "element_kind": "String", - "elements": - [ - { - "value": "Sargon", - "kind": "String" - }, - { - "value": "Rusty", - "kind": "String" - } - ], - "kind": "Array" - } - ], - "kind": "Enum" - }, - "typed": - { - "values": - [ - "Sargon", - "Rusty" - ], - "type": "StringArray" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - } - ] - } - }, - { - "vaults": - { - "total_count": 1, - "items": - [ - { - "vault_address": "internal_vault_tdx_2_1trv245s7clmc8yjskr6n52x26vsxytpr6rert20udsvfjr33xg56q7", - "amount": "21000000", - "last_updated_at_state_version": 73654060 - } - ] - }, - "aggregation_level": "Vault", - "resource_address": "resource_tdx_2_1t4dr4f2xcxjfr0a5d9vxdz2h7pwz67z9mqamv9jtez38unwx7lvz92", - "explicit_metadata": - { - "total_count": 5, - "items": - [ - { - "key": "name", - "value": - { - "raw_hex": "5c2200010c0842697465636f696e", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Bitecoin", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Bitecoin", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "icon_url", - "value": - { - "raw_hex": "5c220d010c5568747470733a2f2f757877696e672e636f6d2f77702d636f6e74656e742f7468656d65732f757877696e672f646f776e6c6f61642f616e696d616c732d616e642d62697264732f736861726b2d69636f6e2e706e67", - "programmatic_json": - { - "variant_id": 13, - "fields": - [ - { - "value": "https://uxwing.com/wp-content/themes/uxwing/download/animals-and-birds/shark-icon.png", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "https://uxwing.com/wp-content/themes/uxwing/download/animals-and-birds/shark-icon.png", - "type": "Url" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "description", - "value": - { - "raw_hex": "5c2200010c7042697465636f696e202d2074616b696e672061206269672062697465206f7574206f66207468652063727970746f63757272656e6379206d61726b6574212053696e6b20796f757220746565746820696e746f2070726f6669747320776974682042697465636f696e20746f6461792e", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Bitecoin - taking a big bite out of the cryptocurrency market! Sink your teeth into profits with Bitecoin today.", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Bitecoin - taking a big bite out of the cryptocurrency market! Sink your teeth into profits with Bitecoin today.", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "symbol", - "value": - { - "raw_hex": "5c2200010c0442495445", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "BITE", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "BITE", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "tags", - "value": - { - "raw_hex": "5c228001200c0206536172676f6e055275737479", - "programmatic_json": - { - "variant_id": 128, - "fields": - [ - { - "element_kind": "String", - "elements": - [ - { - "value": "Sargon", - "kind": "String" - }, - { - "value": "Rusty", - "kind": "String" - } - ], - "kind": "Array" - } - ], - "kind": "Enum" - }, - "typed": - { - "values": - [ - "Sargon", - "Rusty" - ], - "type": "StringArray" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - } - ] - } - }, - { - "vaults": - { - "total_count": 1, - "items": - [ - { - "vault_address": "internal_vault_tdx_2_1tzf3zlvdt3m66yelvret4kdnymsy6pgyhl22q74vjn2w2pmpwt3hgs", - "amount": "21000000", - "last_updated_at_state_version": 73654060 - } - ] - }, - "aggregation_level": "Vault", - "resource_address": "resource_tdx_2_1t4skra7nnudarl50jp9uxgyh32tynjumnlcgkzlr6qm3k4f3hlx4g0", - "explicit_metadata": - { - "total_count": 5, - "items": - [ - { - "key": "name", - "value": - { - "raw_hex": "5c2200010c0850617773636f696e", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Pawscoin", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Pawscoin", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "icon_url", - "value": - { - "raw_hex": "5c220d010c5368747470733a2f2f757877696e672e636f6d2f77702d636f6e74656e742f7468656d65732f757877696e672f646f776e6c6f61642f616e696d616c732d616e642d62697264732f7061772d69636f6e2e706e67", - "programmatic_json": - { - "variant_id": 13, - "fields": - [ - { - "value": "https://uxwing.com/wp-content/themes/uxwing/download/animals-and-birds/paw-icon.png", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "https://uxwing.com/wp-content/themes/uxwing/download/animals-and-birds/paw-icon.png", - "type": "Url" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "description", - "value": - { - "raw_hex": "5c2200010c6150617773636f696e202d20746865207061772d736f6d65206469676974616c2063757272656e63792074686174206c65617665732061206c617374696e6720696d7072657373696f6e2077697468206576657279207472616e73616374696f6e21", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Pawscoin - the paw-some digital currency that leaves a lasting impression with every transaction!", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Pawscoin - the paw-some digital currency that leaves a lasting impression with every transaction!", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "symbol", - "value": - { - "raw_hex": "5c2200010c0450415753", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "PAWS", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "PAWS", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "tags", - "value": - { - "raw_hex": "5c228001200c0206536172676f6e055275737479", - "programmatic_json": - { - "variant_id": 128, - "fields": - [ - { - "element_kind": "String", - "elements": - [ - { - "value": "Sargon", - "kind": "String" - }, - { - "value": "Rusty", - "kind": "String" - } - ], - "kind": "Array" - } - ], - "kind": "Enum" - }, - "typed": - { - "values": - [ - "Sargon", - "Rusty" - ], - "type": "StringArray" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - } - ] - } - }, - { - "vaults": - { - "total_count": 1, - "items": - [ - { - "vault_address": "internal_vault_tdx_2_1tqwy89mkv68fjfnzzvpkf7n57tcd4jnrkqhayczqhysnvet7wrhq6c", - "amount": "21000000", - "last_updated_at_state_version": 73654060 - } - ] - }, - "aggregation_level": "Vault", - "resource_address": "resource_tdx_2_1t40c6yfuvau7t0w8rkeuqq97f3662y0d4dayxq8w2mym4965krp559", - "explicit_metadata": - { - "total_count": 5, - "items": - [ - { - "key": "name", - "value": - { - "raw_hex": "5c2200010c09537061636563616b65", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Spacecake", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Spacecake", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "icon_url", - "value": - { - "raw_hex": "5c220d010c5268747470733a2f2f757877696e672e636f6d2f77702d636f6e74656e742f7468656d65732f757877696e672f646f776e6c6f61642f666f6f642d616e642d6472696e6b732f63616b652d69636f6e2e706e67", - "programmatic_json": - { - "variant_id": 13, - "fields": - [ - { - "value": "https://uxwing.com/wp-content/themes/uxwing/download/food-and-drinks/cake-icon.png", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "https://uxwing.com/wp-content/themes/uxwing/download/food-and-drinks/cake-icon.png", - "type": "Url" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "description", - "value": - { - "raw_hex": "5c2200010c64537061636563616b65202d206675656c696e6720696e74657267616c6163746963207472616e73616374696f6e732077697468206120737072696e6b6c65206f662073776565746e657373212049742773206f7574206f66207468697320776f726c6421", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Spacecake - fueling intergalactic transactions with a sprinkle of sweetness! It's out of this world!", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Spacecake - fueling intergalactic transactions with a sprinkle of sweetness! It's out of this world!", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "symbol", - "value": - { - "raw_hex": "5c2200010c0443414b45", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "CAKE", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "CAKE", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "tags", - "value": - { - "raw_hex": "5c228001200c0206536172676f6e055275737479", - "programmatic_json": - { - "variant_id": 128, - "fields": - [ - { - "element_kind": "String", - "elements": - [ - { - "value": "Sargon", - "kind": "String" - }, - { - "value": "Rusty", - "kind": "String" - } - ], - "kind": "Array" - } - ], - "kind": "Enum" - }, - "typed": - { - "values": - [ - "Sargon", - "Rusty" - ], - "type": "StringArray" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - } - ] - } - }, - { - "vaults": - { - "total_count": 1, - "items": - [ - { - "vault_address": "internal_vault_tdx_2_1tpp0r7dq4wu9xalrdrlek3nsgtedzgmgdsyh36sf49h8fs7p8cuvft", - "amount": "21000000", - "last_updated_at_state_version": 73654060 - } - ] - }, - "aggregation_level": "Vault", - "resource_address": "resource_tdx_2_1t45vncjuyac0u65cscu44kvsxsrgqkpmvg9a0jquwwh6dy7kl33slp", - "explicit_metadata": - { - "total_count": 5, - "items": - [ - { - "key": "name", - "value": - { - "raw_hex": "5c2200010c09517561636b636f696e", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Quackcoin", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Quackcoin", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "icon_url", - "value": - { - "raw_hex": "5c220d010c5468747470733a2f2f757877696e672e636f6d2f77702d636f6e74656e742f7468656d65732f757877696e672f646f776e6c6f61642f616e696d616c732d616e642d62697264732f6475636b2d69636f6e2e706e67", - "programmatic_json": - { - "variant_id": 13, - "fields": - [ - { - "value": "https://uxwing.com/wp-content/themes/uxwing/download/animals-and-birds/duck-icon.png", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "https://uxwing.com/wp-content/themes/uxwing/download/animals-and-birds/duck-icon.png", - "type": "Url" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "description", - "value": - { - "raw_hex": "5c2200010c784469766520696e746f2074686520717561636b7920776f726c64206f662063727970746f207769746820517561636b636f696e212049742773206d616b696e6720776176657320616e64207475726e696e6720686561647320666173746572207468616e20796f752063616e2073617920276475636b2721", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Dive into the quacky world of crypto with Quackcoin! It's making waves and turning heads faster than you can say 'duck'!", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Dive into the quacky world of crypto with Quackcoin! It's making waves and turning heads faster than you can say 'duck'!", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "symbol", - "value": - { - "raw_hex": "5c2200010c05515541434b", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "QUACK", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "QUACK", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "tags", - "value": - { - "raw_hex": "5c228001200c0206536172676f6e055275737479", - "programmatic_json": - { - "variant_id": 128, - "fields": - [ - { - "element_kind": "String", - "elements": - [ - { - "value": "Sargon", - "kind": "String" - }, - { - "value": "Rusty", - "kind": "String" - } - ], - "kind": "Array" - } - ], - "kind": "Enum" - }, - "typed": - { - "values": - [ - "Sargon", - "Rusty" - ], - "type": "StringArray" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - } - ] - } - }, - { - "vaults": - { - "total_count": 1, - "items": - [ - { - "vault_address": "internal_vault_tdx_2_1tqd4clkva5lt0dg5sjd773fk5x2c68vavrkhw7qu2nh6cl0xrkfyvh", - "amount": "21000000", - "last_updated_at_state_version": 73654060 - } - ] - }, - "aggregation_level": "Vault", - "resource_address": "resource_tdx_2_1tklpwgg2gsfwl79rwdpe3gsn2xl24mf05pudtvvkqpqd3qlqtf8yef", - "explicit_metadata": - { - "total_count": 5, - "items": - [ - { - "key": "name", - "value": - { - "raw_hex": "5c2200010c0850757272636f696e", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Purrcoin", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Purrcoin", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "icon_url", - "value": - { - "raw_hex": "5c220d010c5868747470733a2f2f757877696e672e636f6d2f77702d636f6e74656e742f7468656d65732f757877696e672f646f776e6c6f61642f616e696d616c732d616e642d62697264732f6361742d666163652d69636f6e2e706e67", - "programmatic_json": - { - "variant_id": 13, - "fields": - [ - { - "value": "https://uxwing.com/wp-content/themes/uxwing/download/animals-and-birds/cat-face-icon.png", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "https://uxwing.com/wp-content/themes/uxwing/download/animals-and-birds/cat-face-icon.png", - "type": "Url" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "description", - "value": - { - "raw_hex": "5c2200010c704a6f696e2074686520707572722d66656374207265766f6c7574696f6e20696e206469676974616c2063757272656e637920776974682050757272636f696e21204974277320746865206361742773206d656f7720696e2074686520776f726c64206f6620626c6f636b636861696e2e", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Join the purr-fect revolution in digital currency with Purrcoin! It's the cat's meow in the world of blockchain.", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Join the purr-fect revolution in digital currency with Purrcoin! It's the cat's meow in the world of blockchain.", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "symbol", - "value": - { - "raw_hex": "5c2200010c0450555252", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "PURR", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "PURR", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "tags", - "value": - { - "raw_hex": "5c228001200c0206536172676f6e055275737479", - "programmatic_json": - { - "variant_id": 128, - "fields": - [ - { - "element_kind": "String", - "elements": - [ - { - "value": "Sargon", - "kind": "String" - }, - { - "value": "Rusty", - "kind": "String" - } - ], - "kind": "Array" - } - ], - "kind": "Enum" - }, - "typed": - { - "values": - [ - "Sargon", - "Rusty" - ], - "type": "StringArray" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - } - ] - } - } - ] - }, - "non_fungible_resources": - { - "total_count": 5, - "items": - [ - { - "vaults": - { - "total_count": 1, - "items": - [ - { - "total_count": 10, - "vault_address": "internal_vault_tdx_2_1nzqzqc0mg53pm4kwucdp6x3fjdt3534vwl8dlnkw7shl7nc9dkh8nk", - "last_updated_at_state_version": 73653987 - } - ] - }, - "aggregation_level": "Vault", - "resource_address": "resource_tdx_2_1ngv6vuxn03khftr9939pyvl7qrtt0v6csul5v2csqf6p50adkpjx64", - "explicit_metadata": - { - "total_count": 5, - "items": - [ - { - "key": "name", - "value": - { - "raw_hex": "5c2200010c0541626f7665", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Above", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Above", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73653987 - }, - { - "key": "icon_url", - "value": - { - "raw_hex": "5c220d010c6168747470733a2f2f696d6167652d736572766963652d746573742d696d616765732e73332e65752d776573742d322e616d617a6f6e6177732e636f6d2f77616c6c65745f746573745f696d616765732f4672616d652b362d6c617267652e706e67", - "programmatic_json": - { - "variant_id": 13, - "fields": - [ - { - "value": "https://image-service-test-images.s3.eu-west-2.amazonaws.com/wallet_test_images/Frame+6-large.png", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "https://image-service-test-images.s3.eu-west-2.amazonaws.com/wallet_test_images/Frame+6-large.png", - "type": "Url" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73653987 - }, - { - "key": "description", - "value": - { - "raw_hex": "5c2200010c3641626f76653a20416e20616d617a696e676c7920696e6e6f76617469766520616e642072617265204e465420636f6c6c656374696f6e", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Above: An amazingly innovative and rare NFT collection", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Above: An amazingly innovative and rare NFT collection", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73653987 - }, - { - "key": "symbol", - "value": - { - "raw_hex": "5c2200010c0541424f5645", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "ABOVE", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "ABOVE", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73653987 - }, - { - "key": "tags", - "value": - { - "raw_hex": "5c228001200c0306556e6971756504464f4d4f08416476616e636564", - "programmatic_json": - { - "variant_id": 128, - "fields": - [ - { - "element_kind": "String", - "elements": - [ - { - "value": "Unique", - "kind": "String" - }, - { - "value": "FOMO", - "kind": "String" - }, - { - "value": "Advanced", - "kind": "String" - } - ], - "kind": "Array" - } - ], - "kind": "Enum" - }, - "typed": - { - "values": - [ - "Unique", - "FOMO", - "Advanced" - ], - "type": "StringArray" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73653987 - } - ] - } - }, - { - "vaults": - { - "total_count": 1, - "items": - [ - { - "total_count": 10, - "vault_address": "internal_vault_tdx_2_1nq35lt8ezp4lfmp29vmgq8sk3tqg26aa77cf7mx8gqamnk9rn0exju", - "last_updated_at_state_version": 73653987 - } - ] - }, - "aggregation_level": "Vault", - "resource_address": "resource_tdx_2_1ng9qglheajmctgr3ahnnv3yvjhdkpm3rrgc45ujrz5a499hf5r02ym", - "explicit_metadata": - { - "total_count": 5, - "items": - [ - { - "key": "name", - "value": - { - "raw_hex": "5c2200010c0541626f7574", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "About", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "About", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73653987 - }, - { - "key": "icon_url", - "value": - { - "raw_hex": "5c220d010c7368747470733a2f2f696d6167652d736572766963652d746573742d696d616765732e73332e65752d776573742d322e616d617a6f6e6177732e636f6d2f77616c6c65745f746573745f696d616765732f46696c6c696e672b53746174696f6e2b427265616b666173742d736d616c6c2e6a7067", - "programmatic_json": - { - "variant_id": 13, - "fields": - [ - { - "value": "https://image-service-test-images.s3.eu-west-2.amazonaws.com/wallet_test_images/Filling+Station+Breakfast-small.jpg", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "https://image-service-test-images.s3.eu-west-2.amazonaws.com/wallet_test_images/Filling+Station+Breakfast-small.jpg", - "type": "Url" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73653987 - }, - { - "key": "description", - "value": - { - "raw_hex": "5c2200010c3641626f75743a20416e20616d617a696e676c7920696e6e6f76617469766520616e642072617265204e465420636f6c6c656374696f6e", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "About: An amazingly innovative and rare NFT collection", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "About: An amazingly innovative and rare NFT collection", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73653987 - }, - { - "key": "symbol", - "value": - { - "raw_hex": "5c2200010c0541424f5554", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "ABOUT", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "ABOUT", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73653987 - }, - { - "key": "tags", - "value": - { - "raw_hex": "5c228001200c0306556e6971756504464f4d4f08416476616e636564", - "programmatic_json": - { - "variant_id": 128, - "fields": - [ - { - "element_kind": "String", - "elements": - [ - { - "value": "Unique", - "kind": "String" - }, - { - "value": "FOMO", - "kind": "String" - }, - { - "value": "Advanced", - "kind": "String" - } - ], - "kind": "Array" - } - ], - "kind": "Enum" - }, - "typed": - { - "values": - [ - "Unique", - "FOMO", - "Advanced" - ], - "type": "StringArray" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73653987 - } - ] - } - }, - { - "vaults": - { - "total_count": 1, - "items": - [ - { - "total_count": 10, - "vault_address": "internal_vault_tdx_2_1npvlf6g9aqz25rt4c3la6zamwge83e96kyue5wvx7sc5fnwm6nwr0y", - "last_updated_at_state_version": 73653987 - } - ] - }, - "aggregation_level": "Vault", - "resource_address": "resource_tdx_2_1n24330848d0qdu2hz3jzfrq6rk6pxq9002eww0mv7mqtamcj6th5zr", - "explicit_metadata": - { - "total_count": 5, - "items": - [ - { - "key": "name", - "value": - { - "raw_hex": "5c2200010c0441626c65", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Able", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Able", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73653987 - }, - { - "key": "icon_url", - "value": - { - "raw_hex": "5c220d010c7468747470733a2f2f696d6167652d736572766963652d746573742d696d616765732e73332e65752d776573742d322e616d617a6f6e6177732e636f6d2f77616c6c65745f746573745f696d616765732f46696c6c696e672b53746174696f6e2b427265616b666173742d6d656469756d2e6a7067", - "programmatic_json": - { - "variant_id": 13, - "fields": - [ - { - "value": "https://image-service-test-images.s3.eu-west-2.amazonaws.com/wallet_test_images/Filling+Station+Breakfast-medium.jpg", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "https://image-service-test-images.s3.eu-west-2.amazonaws.com/wallet_test_images/Filling+Station+Breakfast-medium.jpg", - "type": "Url" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73653987 - }, - { - "key": "description", - "value": - { - "raw_hex": "5c2200010c3541626c653a20416e20616d617a696e676c7920696e6e6f76617469766520616e642072617265204e465420636f6c6c656374696f6e", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Able: An amazingly innovative and rare NFT collection", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Able: An amazingly innovative and rare NFT collection", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73653987 - }, - { - "key": "symbol", - "value": - { - "raw_hex": "5c2200010c0441424c45", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "ABLE", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "ABLE", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73653987 - }, - { - "key": "tags", - "value": - { - "raw_hex": "5c228001200c0306556e6971756504464f4d4f08416476616e636564", - "programmatic_json": - { - "variant_id": 128, - "fields": - [ - { - "element_kind": "String", - "elements": - [ - { - "value": "Unique", - "kind": "String" - }, - { - "value": "FOMO", - "kind": "String" - }, - { - "value": "Advanced", - "kind": "String" - } - ], - "kind": "Array" - } - ], - "kind": "Enum" - }, - "typed": - { - "values": - [ - "Unique", - "FOMO", - "Advanced" - ], - "type": "StringArray" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73653987 - } - ] - } - }, - { - "vaults": - { - "total_count": 1, - "items": - [ - { - "total_count": 10, - "vault_address": "internal_vault_tdx_2_1nrj0uh6jkhuefpjjwr78kerhm960ea29uleje7ewjkrjjmw0mjqk3f", - "last_updated_at_state_version": 73653987 - } - ] - }, - "aggregation_level": "Vault", - "resource_address": "resource_tdx_2_1ngya0vwrl2yjjuhquqymf2afjau6n2d7lynss4yu2ycavhha9mymgn", - "explicit_metadata": - { - "total_count": 5, - "items": - [ - { - "key": "name", - "value": - { - "raw_hex": "5c2200010c074162696c697479", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Ability", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Ability", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73653987 - }, - { - "key": "icon_url", - "value": - { - "raw_hex": "5c220d010c7368747470733a2f2f696d6167652d736572766963652d746573742d696d616765732e73332e65752d776573742d322e616d617a6f6e6177732e636f6d2f77616c6c65745f746573745f696d616765732f46696c6c696e672b53746174696f6e2b427265616b666173742d6c617267652e6a7067", - "programmatic_json": - { - "variant_id": 13, - "fields": - [ - { - "value": "https://image-service-test-images.s3.eu-west-2.amazonaws.com/wallet_test_images/Filling+Station+Breakfast-large.jpg", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "https://image-service-test-images.s3.eu-west-2.amazonaws.com/wallet_test_images/Filling+Station+Breakfast-large.jpg", - "type": "Url" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73653987 - }, - { - "key": "description", - "value": - { - "raw_hex": "5c2200010c384162696c6974793a20416e20616d617a696e676c7920696e6e6f76617469766520616e642072617265204e465420636f6c6c656374696f6e", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Ability: An amazingly innovative and rare NFT collection", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Ability: An amazingly innovative and rare NFT collection", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73653987 - }, - { - "key": "symbol", - "value": - { - "raw_hex": "5c2200010c074142494c495459", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "ABILITY", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "ABILITY", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73653987 - }, - { - "key": "tags", - "value": - { - "raw_hex": "5c228001200c0306556e6971756504464f4d4f08416476616e636564", - "programmatic_json": - { - "variant_id": 128, - "fields": - [ - { - "element_kind": "String", - "elements": - [ - { - "value": "Unique", - "kind": "String" - }, - { - "value": "FOMO", - "kind": "String" - }, - { - "value": "Advanced", - "kind": "String" - } - ], - "kind": "Array" - } - ], - "kind": "Enum" - }, - "typed": - { - "values": - [ - "Unique", - "FOMO", - "Advanced" - ], - "type": "StringArray" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73653987 - } - ] - } - }, - { - "vaults": - { - "total_count": 1, - "items": - [ - { - "total_count": 10, - "vault_address": "internal_vault_tdx_2_1np5lx6ea6fqljdw9x6rryjqap4zxkrp7ye8zg0a359r0pplj3sjjwy", - "last_updated_at_state_version": 73653987 - } - ] - }, - "aggregation_level": "Vault", - "resource_address": "resource_tdx_2_1ntkmxen44prp7w3svq7qfd4yypsvdd8n6nslwjhnls83dnprerwuxt", - "explicit_metadata": - { - "total_count": 5, - "items": - [ - { - "key": "name", - "value": - { - "raw_hex": "5c2200010c074162616e646f6e", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Abandon", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Abandon", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73653987 - }, - { - "key": "icon_url", - "value": - { - "raw_hex": "5c220d010c6568747470733a2f2f696d6167652d736572766963652d746573742d696d616765732e73332e65752d776573742d322e616d617a6f6e6177732e636f6d2f77616c6c65745f746573745f696d616765732f7363727970746f6e6175745f70617463682e737667", - "programmatic_json": - { - "variant_id": 13, - "fields": - [ - { - "value": "https://image-service-test-images.s3.eu-west-2.amazonaws.com/wallet_test_images/scryptonaut_patch.svg", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "https://image-service-test-images.s3.eu-west-2.amazonaws.com/wallet_test_images/scryptonaut_patch.svg", - "type": "Url" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73653987 - }, - { - "key": "description", - "value": - { - "raw_hex": "5c2200010c384162616e646f6e3a20416e20616d617a696e676c7920696e6e6f76617469766520616e642072617265204e465420636f6c6c656374696f6e", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Abandon: An amazingly innovative and rare NFT collection", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Abandon: An amazingly innovative and rare NFT collection", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73653987 - }, - { - "key": "symbol", - "value": - { - "raw_hex": "5c2200010c074142414e444f4e", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "ABANDON", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "ABANDON", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73653987 - }, - { - "key": "tags", - "value": - { - "raw_hex": "5c228001200c0306556e6971756504464f4d4f08416476616e636564", - "programmatic_json": - { - "variant_id": 128, - "fields": - [ - { - "element_kind": "String", - "elements": - [ - { - "value": "Unique", - "kind": "String" - }, - { - "value": "FOMO", - "kind": "String" - }, - { - "value": "Advanced", - "kind": "String" - } - ], - "kind": "Array" - } - ], - "kind": "Enum" - }, - "typed": - { - "values": - [ - "Unique", - "FOMO", - "Advanced" - ], - "type": "StringArray" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73653987 - } - ] - } - } - ] - }, - "metadata": - { - "total_count": 2, - "items": - [ - { - "key": "owner_keys", - "value": - { - "raw_hex": "5c228f01202201010120071d3ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8", - "programmatic_json": - { - "variant_id": 143, - "fields": - [ - { - "element_kind": "Enum", - "elements": - [ - { - "variant_id": 1, - "fields": - [ - { - "element_kind": "U8", - "hex": "3ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8", - "kind": "Bytes" - } - ], - "kind": "Enum" - } - ], - "kind": "Array" - } - ], - "kind": "Enum" - }, - "typed": - { - "values": - [ - { - "hash_hex": "3ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8", - "key_hash_type": "EddsaEd25519" - } - ], - "type": "PublicKeyHashArray" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73648065 - }, - { - "key": "owner_badge", - "value": - { - "raw_hex": "5c220b01c0021e513ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8", - "programmatic_json": - { - "variant_id": 11, - "fields": - [ - { - "value": "[513ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8]", - "kind": "NonFungibleLocalId" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "[513ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8]", - "type": "NonFungibleLocalId" - } - }, - "is_locked": true, - "last_updated_at_state_version": 73648065 - } - ] - }, - "explicit_metadata": - { - "total_count": 0, - "items": - [] - }, - "details": - { - "package_address": "package_tdx_2_1pkgxxxxxxxxxaccntxxxxxxxxxx000929625493xxxxxxxxx9jat20", - "blueprint_name": "Account", - "blueprint_version": "1.0.0", - "state": - { - "default_deposit_rule": "Accept" - }, - "role_assignments": - { - "owner": - { - "rule": - { - "type": "Protected", - "access_rule": - { - "type": "ProofRule", - "proof_rule": - { - "type": "Require", - "requirement": - { - "type": "NonFungible", - "non_fungible": - { - "local_id": - { - "id_type": "Bytes", - "sbor_hex": "5cc0021d3ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8", - "simple_rep": "[3ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8]" - }, - "resource_address": "resource_tdx_2_1nfxxxxxxxxxxed25sgxxxxxxxxx002236757237xxxxxxxxx3e2cpa" - } - } - } - } - }, - "updater": "Object" - }, - "entries": - [ - { - "role_key": - { - "module": "Main", - "name": "securify" - }, - "assignment": - { - "resolution": "Explicit", - "explicit_rule": - { - "type": "Protected", - "access_rule": - { - "type": "ProofRule", - "proof_rule": - { - "type": "Require", - "requirement": - { - "type": "NonFungible", - "non_fungible": - { - "local_id": - { - "id_type": "Bytes", - "sbor_hex": "5cc0021d3ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8", - "simple_rep": "[3ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8]" - }, - "resource_address": "resource_tdx_2_1nfxxxxxxxxxxed25sgxxxxxxxxx002236757237xxxxxxxxx3e2cpa" - } - } - } - } - } - }, - "updater_roles": - [ - { - "module": "Main", - "name": "_self_" - } - ] - }, - { - "role_key": - { - "module": "Metadata", - "name": "metadata_locker" - }, - "assignment": - { - "resolution": "Owner" - }, - "updater_roles": - [ - { - "module": "Metadata", - "name": "metadata_locker_updater" - } - ] - }, - { - "role_key": - { - "module": "Metadata", - "name": "metadata_locker_updater" - }, - "assignment": - { - "resolution": "Owner" - }, - "updater_roles": - [ - { - "module": "Metadata", - "name": "metadata_locker_updater" - } - ] - }, - { - "role_key": - { - "module": "Metadata", - "name": "metadata_setter" - }, - "assignment": - { - "resolution": "Owner" - }, - "updater_roles": - [ - { - "module": "Metadata", - "name": "metadata_setter_updater" - } - ] - }, - { - "role_key": - { - "module": "Metadata", - "name": "metadata_setter_updater" - }, - "assignment": - { - "resolution": "Owner" - }, - "updater_roles": - [ - { - "module": "Metadata", - "name": "metadata_setter_updater" - } - ] - } - ] - }, - "type": "Component" - } - } - ] -} \ No newline at end of file diff --git a/crates/gateway-logic/fixtures/models/state/response_entity_details__single_account_no_assets.json b/crates/gateway-logic/fixtures/models/state/response_entity_details__single_account_no_assets.json deleted file mode 100644 index 177755894..000000000 --- a/crates/gateway-logic/fixtures/models/state/response_entity_details__single_account_no_assets.json +++ /dev/null @@ -1,277 +0,0 @@ -{ - "ledger_state": - { - "network": "stokenet", - "state_version": 73647248, - "proposer_round_timestamp": "2024-04-10T08:19:15.58Z", - "epoch": 51647, - "round": 1405 - }, - "items": - [ - { - "address": "account_tdx_2_12ylv4l9tj9vx0myyge2s7mzmgnzjmk9fgu3h72dn62s8d9lcafxzds", - "fungible_resources": - { - "total_count": 0, - "items": - [] - }, - "non_fungible_resources": - { - "total_count": 0, - "items": - [] - }, - "metadata": - { - "total_count": 2, - "items": - [ - { - "key": "owner_keys", - "value": - { - "raw_hex": "5c228f01202201010120071d3ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8", - "programmatic_json": - { - "variant_id": 143, - "fields": - [ - { - "element_kind": "Enum", - "elements": - [ - { - "variant_id": 1, - "fields": - [ - { - "element_kind": "U8", - "hex": "3ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8", - "kind": "Bytes" - } - ], - "kind": "Enum" - } - ], - "kind": "Array" - } - ], - "kind": "Enum" - }, - "typed": - { - "values": - [ - { - "hash_hex": "3ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8", - "key_hash_type": "EddsaEd25519" - } - ], - "type": "PublicKeyHashArray" - } - }, - "is_locked": false, - "last_updated_at_state_version": 0 - }, - { - "key": "owner_badge", - "value": - { - "raw_hex": "5c220b01c0021e513ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8", - "programmatic_json": - { - "variant_id": 11, - "fields": - [ - { - "value": "[513ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8]", - "kind": "NonFungibleLocalId" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "[513ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8]", - "type": "NonFungibleLocalId" - } - }, - "is_locked": true, - "last_updated_at_state_version": 0 - } - ] - }, - "explicit_metadata": - { - "total_count": 0, - "items": - [] - }, - "details": - { - "package_address": "package_tdx_2_1pkgxxxxxxxxxaccntxxxxxxxxxx000929625493xxxxxxxxx9jat20", - "blueprint_name": "Account", - "blueprint_version": "1.0.0", - "state": - { - "default_deposit_rule": "Accept" - }, - "role_assignments": - { - "owner": - { - "updater": "Object", - "rule": - { - "access_rule": - { - "proof_rule": - { - "requirement": - { - "non_fungible": - { - "resource_address": "resource_tdx_2_1nfxxxxxxxxxxed25sgxxxxxxxxx002236757237xxxxxxxxx3e2cpa", - "local_id": - { - "id_type": "Bytes", - "simple_rep": "[3ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8]", - "sbor_hex": "5cc0021d3ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8" - } - }, - "type": "NonFungible" - }, - "type": "Require" - }, - "type": "ProofRule" - }, - "type": "Protected" - } - }, - "entries": - [ - { - "role_key": - { - "module": "Main", - "name": "securify" - }, - "assignment": - { - "resolution": "Explicit", - "explicit_rule": - { - "access_rule": - { - "proof_rule": - { - "requirement": - { - "non_fungible": - { - "resource_address": "resource_tdx_2_1nfxxxxxxxxxxed25sgxxxxxxxxx002236757237xxxxxxxxx3e2cpa", - "local_id": - { - "id_type": "Bytes", - "simple_rep": "[3ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8]", - "sbor_hex": "5cc0021d3ecafcab915867ec8446550f6c5b44c52dd8a947237f29b3d2a07697f8" - } - }, - "type": "NonFungible" - }, - "type": "Require" - }, - "type": "ProofRule" - }, - "type": "Protected" - } - }, - "updater_roles": - [ - { - "module": "Main", - "name": "_self_" - } - ] - }, - { - "role_key": - { - "module": "Metadata", - "name": "metadata_locker" - }, - "assignment": - { - "resolution": "Owner" - }, - "updater_roles": - [ - { - "module": "Metadata", - "name": "metadata_locker_updater" - } - ] - }, - { - "role_key": - { - "module": "Metadata", - "name": "metadata_locker_updater" - }, - "assignment": - { - "resolution": "Owner" - }, - "updater_roles": - [ - { - "module": "Metadata", - "name": "metadata_locker_updater" - } - ] - }, - { - "role_key": - { - "module": "Metadata", - "name": "metadata_setter" - }, - "assignment": - { - "resolution": "Owner" - }, - "updater_roles": - [ - { - "module": "Metadata", - "name": "metadata_setter_updater" - } - ] - }, - { - "role_key": - { - "module": "Metadata", - "name": "metadata_setter_updater" - }, - "assignment": - { - "resolution": "Owner" - }, - "updater_roles": - [ - { - "module": "Metadata", - "name": "metadata_setter_updater" - } - ] - } - ] - }, - "type": "Component" - } - } - ] -} \ No newline at end of file diff --git a/crates/gateway-logic/fixtures/models/state/response_entity_details__single_resource.json b/crates/gateway-logic/fixtures/models/state/response_entity_details__single_resource.json deleted file mode 100644 index 6272a41e8..000000000 --- a/crates/gateway-logic/fixtures/models/state/response_entity_details__single_resource.json +++ /dev/null @@ -1,649 +0,0 @@ -{ - "ledger_state": - { - "network": "stokenet", - "state_version": 73657313, - "proposer_round_timestamp": "2024-04-10T08:44:37.403Z", - "epoch": 51652, - "round": 1559 - }, - "items": - [ - { - "address": "resource_tdx_2_1thkcveg0p2l35kvwlxasltvw0wjgsrpch6yfjct9qahze3wce8ukj8", - "fungible_resources": - { - "total_count": 0, - "items": - [] - }, - "non_fungible_resources": - { - "total_count": 0, - "items": - [] - }, - "metadata": - { - "total_count": 4, - "items": - [ - { - "key": "icon_url", - "value": - { - "raw_hex": "5c220d010c5b68747470733a2f2f757877696e672e636f6d2f77702d636f6e74656e742f7468656d65732f757877696e672f646f776e6c6f61642f656d6f6a692d656d6f7469636f6e2f6c61756768696e672d626c61636b2d69636f6e2e706e67", - "programmatic_json": - { - "variant_id": 13, - "fields": - [ - { - "value": "https://uxwing.com/wp-content/themes/uxwing/download/emoji-emoticon/laughing-black-icon.png", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "https://uxwing.com/wp-content/themes/uxwing/download/emoji-emoticon/laughing-black-icon.png", - "type": "Url" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "symbol", - "value": - { - "raw_hex": "5c2200010c05424c495353", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "BLISS", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "BLISS", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "description", - "value": - { - "raw_hex": "5c2200010c70426c697373636f696e202d20657870657269656e6365207075726520626c6973732077697468206576657279207472616e73616374696f6e212048617070696e6573732067756172616e7465656420696e2074686520776f726c64206f66206469676974616c2063757272656e63792e", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Blisscoin - experience pure bliss with every transaction! Happiness guaranteed in the world of digital currency.", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Blisscoin - experience pure bliss with every transaction! Happiness guaranteed in the world of digital currency.", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "name", - "value": - { - "raw_hex": "5c2200010c09426c697373636f696e", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Blisscoin", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Blisscoin", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - } - ] - }, - "explicit_metadata": - { - "total_count": 5, - "items": - [ - { - "key": "symbol", - "value": - { - "raw_hex": "5c2200010c05424c495353", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "BLISS", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "BLISS", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "name", - "value": - { - "raw_hex": "5c2200010c09426c697373636f696e", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Blisscoin", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Blisscoin", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "icon_url", - "value": - { - "raw_hex": "5c220d010c5b68747470733a2f2f757877696e672e636f6d2f77702d636f6e74656e742f7468656d65732f757877696e672f646f776e6c6f61642f656d6f6a692d656d6f7469636f6e2f6c61756768696e672d626c61636b2d69636f6e2e706e67", - "programmatic_json": - { - "variant_id": 13, - "fields": - [ - { - "value": "https://uxwing.com/wp-content/themes/uxwing/download/emoji-emoticon/laughing-black-icon.png", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "https://uxwing.com/wp-content/themes/uxwing/download/emoji-emoticon/laughing-black-icon.png", - "type": "Url" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "tags", - "value": - { - "raw_hex": "5c228001200c0206536172676f6e055275737479", - "programmatic_json": - { - "variant_id": 128, - "fields": - [ - { - "element_kind": "String", - "elements": - [ - { - "value": "Sargon", - "kind": "String" - }, - { - "value": "Rusty", - "kind": "String" - } - ], - "kind": "Array" - } - ], - "kind": "Enum" - }, - "typed": - { - "values": - [ - "Sargon", - "Rusty" - ], - "type": "StringArray" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - }, - { - "key": "description", - "value": - { - "raw_hex": "5c2200010c70426c697373636f696e202d20657870657269656e6365207075726520626c6973732077697468206576657279207472616e73616374696f6e212048617070696e6573732067756172616e7465656420696e2074686520776f726c64206f66206469676974616c2063757272656e63792e", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Blisscoin - experience pure bliss with every transaction! Happiness guaranteed in the world of digital currency.", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Blisscoin - experience pure bliss with every transaction! Happiness guaranteed in the world of digital currency.", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73654060 - } - ] - }, - "details": - { - "role_assignments": - { - "owner": - { - "rule": - { - "type": "AllowAll" - }, - "updater": "Owner" - }, - "entries": - [ - { - "role_key": - { - "module": "Main", - "name": "burner" - }, - "assignment": - { - "resolution": "Explicit", - "explicit_rule": - { - "type": "AllowAll" - } - }, - "updater_roles": - [ - { - "module": "Main", - "name": "burner_updater" - } - ] - }, - { - "role_key": - { - "module": "Main", - "name": "minter" - }, - "assignment": - { - "resolution": "Explicit", - "explicit_rule": - { - "type": "AllowAll" - } - }, - "updater_roles": - [ - { - "module": "Main", - "name": "minter_updater" - } - ] - }, - { - "role_key": - { - "module": "Main", - "name": "freezer" - }, - "assignment": - { - "resolution": "Explicit", - "explicit_rule": - { - "type": "AllowAll" - } - }, - "updater_roles": - [ - { - "module": "Main", - "name": "freezer_updater" - } - ] - }, - { - "role_key": - { - "module": "Main", - "name": "recaller" - }, - "assignment": - { - "resolution": "Explicit", - "explicit_rule": - { - "type": "AllowAll" - } - }, - "updater_roles": - [ - { - "module": "Main", - "name": "recaller_updater" - } - ] - }, - { - "role_key": - { - "module": "Main", - "name": "depositor" - }, - "assignment": - { - "resolution": "Explicit", - "explicit_rule": - { - "type": "AllowAll" - } - }, - "updater_roles": - [ - { - "module": "Main", - "name": "depositor_updater" - } - ] - }, - { - "role_key": - { - "module": "Main", - "name": "withdrawer" - }, - "assignment": - { - "resolution": "Explicit", - "explicit_rule": - { - "type": "AllowAll" - } - }, - "updater_roles": - [ - { - "module": "Main", - "name": "withdrawer_updater" - } - ] - }, - { - "role_key": - { - "module": "Main", - "name": "burner_updater" - }, - "assignment": - { - "resolution": "Explicit", - "explicit_rule": - { - "type": "DenyAll" - } - }, - "updater_roles": - [ - { - "module": "Main", - "name": "burner_updater" - } - ] - }, - { - "role_key": - { - "module": "Main", - "name": "minter_updater" - }, - "assignment": - { - "resolution": "Explicit", - "explicit_rule": - { - "type": "DenyAll" - } - }, - "updater_roles": - [ - { - "module": "Main", - "name": "minter_updater" - } - ] - }, - { - "role_key": - { - "module": "Main", - "name": "freezer_updater" - }, - "assignment": - { - "resolution": "Explicit", - "explicit_rule": - { - "type": "DenyAll" - } - }, - "updater_roles": - [ - { - "module": "Main", - "name": "freezer_updater" - } - ] - }, - { - "role_key": - { - "module": "Main", - "name": "recaller_updater" - }, - "assignment": - { - "resolution": "Explicit", - "explicit_rule": - { - "type": "DenyAll" - } - }, - "updater_roles": - [ - { - "module": "Main", - "name": "recaller_updater" - } - ] - }, - { - "role_key": - { - "module": "Main", - "name": "depositor_updater" - }, - "assignment": - { - "resolution": "Explicit", - "explicit_rule": - { - "type": "DenyAll" - } - }, - "updater_roles": - [ - { - "module": "Main", - "name": "depositor_updater" - } - ] - }, - { - "role_key": - { - "module": "Main", - "name": "withdrawer_updater" - }, - "assignment": - { - "resolution": "Explicit", - "explicit_rule": - { - "type": "DenyAll" - } - }, - "updater_roles": - [ - { - "module": "Main", - "name": "withdrawer_updater" - } - ] - }, - { - "role_key": - { - "module": "Metadata", - "name": "metadata_locker" - }, - "assignment": - { - "resolution": "Owner" - }, - "updater_roles": - [ - { - "module": "Metadata", - "name": "metadata_locker_updater" - } - ] - }, - { - "role_key": - { - "module": "Metadata", - "name": "metadata_locker_updater" - }, - "assignment": - { - "resolution": "Owner" - }, - "updater_roles": - [ - { - "module": "Metadata", - "name": "metadata_locker_updater" - } - ] - }, - { - "role_key": - { - "module": "Metadata", - "name": "metadata_setter" - }, - "assignment": - { - "resolution": "Owner" - }, - "updater_roles": - [ - { - "module": "Metadata", - "name": "metadata_setter_updater" - } - ] - }, - { - "role_key": - { - "module": "Metadata", - "name": "metadata_setter_updater" - }, - "assignment": - { - "resolution": "Owner" - }, - "updater_roles": - [ - { - "module": "Metadata", - "name": "metadata_setter_updater" - } - ] - } - ] - }, - "divisibility": 10, - "total_supply": "21000000", - "total_minted": "21000000", - "total_burned": "0", - "type": "FungibleResource" - } - } - ] -} \ No newline at end of file diff --git a/crates/gateway-logic/fixtures/models/state/response_entity_details__single_resource_no_metadata.json b/crates/gateway-logic/fixtures/models/state/response_entity_details__single_resource_no_metadata.json deleted file mode 100644 index 35bb59826..000000000 --- a/crates/gateway-logic/fixtures/models/state/response_entity_details__single_resource_no_metadata.json +++ /dev/null @@ -1,398 +0,0 @@ -{ - "ledger_state": - { - "network": "stokenet", - "state_version": 73657313, - "proposer_round_timestamp": "2024-04-10T08:44:37.403Z", - "epoch": 51652, - "round": 1559 - }, - "items": - [ - { - "address": "resource_tdx_2_1thkcveg0p2l35kvwlxasltvw0wjgsrpch6yfjct9qahze3wce8ukj8", - "fungible_resources": - { - "total_count": 0, - "items": - [] - }, - "non_fungible_resources": - { - "total_count": 0, - "items": - [] - }, - "metadata": - { - "total_count": 0, - "items": - [] - }, - "explicit_metadata": - { - "total_count": 0, - "items": - [] - }, - "details": - { - "role_assignments": - { - "owner": - { - "rule": - { - "type": "AllowAll" - }, - "updater": "Owner" - }, - "entries": - [ - { - "role_key": - { - "module": "Main", - "name": "burner" - }, - "assignment": - { - "resolution": "Explicit", - "explicit_rule": - { - "type": "AllowAll" - } - }, - "updater_roles": - [ - { - "module": "Main", - "name": "burner_updater" - } - ] - }, - { - "role_key": - { - "module": "Main", - "name": "minter" - }, - "assignment": - { - "resolution": "Explicit", - "explicit_rule": - { - "type": "AllowAll" - } - }, - "updater_roles": - [ - { - "module": "Main", - "name": "minter_updater" - } - ] - }, - { - "role_key": - { - "module": "Main", - "name": "freezer" - }, - "assignment": - { - "resolution": "Explicit", - "explicit_rule": - { - "type": "AllowAll" - } - }, - "updater_roles": - [ - { - "module": "Main", - "name": "freezer_updater" - } - ] - }, - { - "role_key": - { - "module": "Main", - "name": "recaller" - }, - "assignment": - { - "resolution": "Explicit", - "explicit_rule": - { - "type": "AllowAll" - } - }, - "updater_roles": - [ - { - "module": "Main", - "name": "recaller_updater" - } - ] - }, - { - "role_key": - { - "module": "Main", - "name": "depositor" - }, - "assignment": - { - "resolution": "Explicit", - "explicit_rule": - { - "type": "AllowAll" - } - }, - "updater_roles": - [ - { - "module": "Main", - "name": "depositor_updater" - } - ] - }, - { - "role_key": - { - "module": "Main", - "name": "withdrawer" - }, - "assignment": - { - "resolution": "Explicit", - "explicit_rule": - { - "type": "AllowAll" - } - }, - "updater_roles": - [ - { - "module": "Main", - "name": "withdrawer_updater" - } - ] - }, - { - "role_key": - { - "module": "Main", - "name": "burner_updater" - }, - "assignment": - { - "resolution": "Explicit", - "explicit_rule": - { - "type": "DenyAll" - } - }, - "updater_roles": - [ - { - "module": "Main", - "name": "burner_updater" - } - ] - }, - { - "role_key": - { - "module": "Main", - "name": "minter_updater" - }, - "assignment": - { - "resolution": "Explicit", - "explicit_rule": - { - "type": "DenyAll" - } - }, - "updater_roles": - [ - { - "module": "Main", - "name": "minter_updater" - } - ] - }, - { - "role_key": - { - "module": "Main", - "name": "freezer_updater" - }, - "assignment": - { - "resolution": "Explicit", - "explicit_rule": - { - "type": "DenyAll" - } - }, - "updater_roles": - [ - { - "module": "Main", - "name": "freezer_updater" - } - ] - }, - { - "role_key": - { - "module": "Main", - "name": "recaller_updater" - }, - "assignment": - { - "resolution": "Explicit", - "explicit_rule": - { - "type": "DenyAll" - } - }, - "updater_roles": - [ - { - "module": "Main", - "name": "recaller_updater" - } - ] - }, - { - "role_key": - { - "module": "Main", - "name": "depositor_updater" - }, - "assignment": - { - "resolution": "Explicit", - "explicit_rule": - { - "type": "DenyAll" - } - }, - "updater_roles": - [ - { - "module": "Main", - "name": "depositor_updater" - } - ] - }, - { - "role_key": - { - "module": "Main", - "name": "withdrawer_updater" - }, - "assignment": - { - "resolution": "Explicit", - "explicit_rule": - { - "type": "DenyAll" - } - }, - "updater_roles": - [ - { - "module": "Main", - "name": "withdrawer_updater" - } - ] - }, - { - "role_key": - { - "module": "Metadata", - "name": "metadata_locker" - }, - "assignment": - { - "resolution": "Owner" - }, - "updater_roles": - [ - { - "module": "Metadata", - "name": "metadata_locker_updater" - } - ] - }, - { - "role_key": - { - "module": "Metadata", - "name": "metadata_locker_updater" - }, - "assignment": - { - "resolution": "Owner" - }, - "updater_roles": - [ - { - "module": "Metadata", - "name": "metadata_locker_updater" - } - ] - }, - { - "role_key": - { - "module": "Metadata", - "name": "metadata_setter" - }, - "assignment": - { - "resolution": "Owner" - }, - "updater_roles": - [ - { - "module": "Metadata", - "name": "metadata_setter_updater" - } - ] - }, - { - "role_key": - { - "module": "Metadata", - "name": "metadata_setter_updater" - }, - "assignment": - { - "resolution": "Owner" - }, - "updater_roles": - [ - { - "module": "Metadata", - "name": "metadata_setter_updater" - } - ] - } - ] - }, - "divisibility": 10, - "total_supply": "21000000", - "total_minted": "21000000", - "total_burned": "0", - "type": "FungibleResource" - } - } - ] -} \ No newline at end of file diff --git a/crates/gateway-logic/fixtures/models/state/response_entity_details__two_accounts.json b/crates/gateway-logic/fixtures/models/state/response_entity_details__two_accounts.json deleted file mode 100644 index c4d742007..000000000 --- a/crates/gateway-logic/fixtures/models/state/response_entity_details__two_accounts.json +++ /dev/null @@ -1,1025 +0,0 @@ -{ - "ledger_state": - { - "network": "stokenet", - "state_version": 73659327, - "proposer_round_timestamp": "2024-04-10T08:49:40.926Z", - "epoch": 51653, - "round": 1594 - }, - "items": - [ - { - "address": "account_tdx_2_129vd0a8epu6wa46nh8fkcjhmxwtwet6mut8rgzef2ng68zh5t04t88", - "fungible_resources": - { - "total_count": 1, - "items": - [ - { - "vaults": - { - "total_count": 1, - "items": - [ - { - "vault_address": "internal_vault_tdx_2_1tr9dv2wt2av5u9juks9x276x5qphccswqgq0g9lgpm00rzs7kzclz4", - "amount": "21000000", - "last_updated_at_state_version": 73659244 - } - ] - }, - "aggregation_level": "Vault", - "resource_address": "resource_tdx_2_1tk3rduua8eyy64zcnaanvnkc8558qh5fuz797khrpx20p0a60ev86e", - "explicit_metadata": - { - "total_count": 5, - "items": - [ - { - "key": "tags", - "value": - { - "raw_hex": "5c228001200c0106427269676874", - "programmatic_json": - { - "variant_id": 128, - "fields": - [ - { - "element_kind": "String", - "elements": - [ - { - "value": "Bright", - "kind": "String" - } - ], - "kind": "Array" - } - ], - "kind": "Enum" - }, - "typed": - { - "values": - [ - "Bright" - ], - "type": "StringArray" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73659101 - }, - { - "key": "description", - "value": - { - "raw_hex": "5c2200010c2f5468652062726967687465737420636f6d706f6e656e7420696e207468652052616469782065636f73797374656d2e", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "The brightest component in the Radix ecosystem.", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "The brightest component in the Radix ecosystem.", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73659101 - }, - { - "key": "icon_url", - "value": - { - "raw_hex": "5c220d010c5b68747470733a2f2f757877696e672e636f6d2f77702d636f6e74656e742f7468656d65732f757877696e672f646f776e6c6f61642f617274732d677261706869632d7368617065732f737461722d66756c6c2d69636f6e2e706e67", - "programmatic_json": - { - "variant_id": 13, - "fields": - [ - { - "value": "https://uxwing.com/wp-content/themes/uxwing/download/arts-graphic-shapes/star-full-icon.png", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "https://uxwing.com/wp-content/themes/uxwing/download/arts-graphic-shapes/star-full-icon.png", - "type": "Url" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73659101 - }, - { - "key": "symbol", - "value": - { - "raw_hex": "5c2200010c0453544152", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "STAR", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "STAR", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73659101 - }, - { - "key": "name", - "value": - { - "raw_hex": "5c2200010c065374656c6c61", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Stella", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Stella", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73659101 - } - ] - } - } - ] - }, - "non_fungible_resources": - { - "total_count": 0, - "items": - [] - }, - "metadata": - { - "total_count": 2, - "items": - [ - { - "key": "owner_keys", - "value": - { - "raw_hex": "5c228f01202201010120071d58d7f4f90f34eed753b9d36c4afb3396ecaf5be2ce340b2954d1a38af4", - "programmatic_json": - { - "variant_id": 143, - "fields": - [ - { - "element_kind": "Enum", - "elements": - [ - { - "variant_id": 1, - "fields": - [ - { - "element_kind": "U8", - "hex": "58d7f4f90f34eed753b9d36c4afb3396ecaf5be2ce340b2954d1a38af4", - "kind": "Bytes" - } - ], - "kind": "Enum" - } - ], - "kind": "Array" - } - ], - "kind": "Enum" - }, - "typed": - { - "values": - [ - { - "hash_hex": "58d7f4f90f34eed753b9d36c4afb3396ecaf5be2ce340b2954d1a38af4", - "key_hash_type": "EddsaEd25519" - } - ], - "type": "PublicKeyHashArray" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73659244 - }, - { - "key": "owner_badge", - "value": - { - "raw_hex": "5c220b01c0021e5158d7f4f90f34eed753b9d36c4afb3396ecaf5be2ce340b2954d1a38af4", - "programmatic_json": - { - "variant_id": 11, - "fields": - [ - { - "value": "[5158d7f4f90f34eed753b9d36c4afb3396ecaf5be2ce340b2954d1a38af4]", - "kind": "NonFungibleLocalId" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "[5158d7f4f90f34eed753b9d36c4afb3396ecaf5be2ce340b2954d1a38af4]", - "type": "NonFungibleLocalId" - } - }, - "is_locked": true, - "last_updated_at_state_version": 73659244 - } - ] - }, - "explicit_metadata": - { - "total_count": 0, - "items": - [] - }, - "details": - { - "package_address": "package_tdx_2_1pkgxxxxxxxxxaccntxxxxxxxxxx000929625493xxxxxxxxx9jat20", - "blueprint_name": "Account", - "blueprint_version": "1.0.0", - "state": - { - "default_deposit_rule": "Accept" - }, - "role_assignments": - { - "owner": - { - "rule": - { - "type": "Protected", - "access_rule": - { - "type": "ProofRule", - "proof_rule": - { - "type": "Require", - "requirement": - { - "type": "NonFungible", - "non_fungible": - { - "local_id": - { - "id_type": "Bytes", - "sbor_hex": "5cc0021d58d7f4f90f34eed753b9d36c4afb3396ecaf5be2ce340b2954d1a38af4", - "simple_rep": "[58d7f4f90f34eed753b9d36c4afb3396ecaf5be2ce340b2954d1a38af4]" - }, - "resource_address": "resource_tdx_2_1nfxxxxxxxxxxed25sgxxxxxxxxx002236757237xxxxxxxxx3e2cpa" - } - } - } - } - }, - "updater": "Object" - }, - "entries": - [ - { - "role_key": - { - "module": "Main", - "name": "securify" - }, - "assignment": - { - "resolution": "Explicit", - "explicit_rule": - { - "type": "Protected", - "access_rule": - { - "type": "ProofRule", - "proof_rule": - { - "type": "Require", - "requirement": - { - "type": "NonFungible", - "non_fungible": - { - "local_id": - { - "id_type": "Bytes", - "sbor_hex": "5cc0021d58d7f4f90f34eed753b9d36c4afb3396ecaf5be2ce340b2954d1a38af4", - "simple_rep": "[58d7f4f90f34eed753b9d36c4afb3396ecaf5be2ce340b2954d1a38af4]" - }, - "resource_address": "resource_tdx_2_1nfxxxxxxxxxxed25sgxxxxxxxxx002236757237xxxxxxxxx3e2cpa" - } - } - } - } - } - }, - "updater_roles": - [ - { - "module": "Main", - "name": "_self_" - } - ] - }, - { - "role_key": - { - "module": "Metadata", - "name": "metadata_locker" - }, - "assignment": - { - "resolution": "Owner" - }, - "updater_roles": - [ - { - "module": "Metadata", - "name": "metadata_locker_updater" - } - ] - }, - { - "role_key": - { - "module": "Metadata", - "name": "metadata_locker_updater" - }, - "assignment": - { - "resolution": "Owner" - }, - "updater_roles": - [ - { - "module": "Metadata", - "name": "metadata_locker_updater" - } - ] - }, - { - "role_key": - { - "module": "Metadata", - "name": "metadata_setter" - }, - "assignment": - { - "resolution": "Owner" - }, - "updater_roles": - [ - { - "module": "Metadata", - "name": "metadata_setter_updater" - } - ] - }, - { - "role_key": - { - "module": "Metadata", - "name": "metadata_setter_updater" - }, - "assignment": - { - "resolution": "Owner" - }, - "updater_roles": - [ - { - "module": "Metadata", - "name": "metadata_setter_updater" - } - ] - } - ] - }, - "type": "Component" - } - }, - { - "address": "account_tdx_2_12xwjddwn7wp3tqgj353rur4c2jzjg7uvydfj7y8yaflymxnd9czd4c", - "fungible_resources": - { - "total_count": 2, - "items": - [ - { - "vaults": - { - "total_count": 1, - "items": - [ - { - "vault_address": "internal_vault_tdx_2_1tppjldluq7xd09w67hhlnpclreq7ksep5alqyf9ep7d50xc3dnrgju", - "amount": "0", - "last_updated_at_state_version": 73659244 - } - ] - }, - "aggregation_level": "Vault", - "resource_address": "resource_tdx_2_1tk3rduua8eyy64zcnaanvnkc8558qh5fuz797khrpx20p0a60ev86e", - "explicit_metadata": - { - "total_count": 5, - "items": - [ - { - "key": "tags", - "value": - { - "raw_hex": "5c228001200c0106427269676874", - "programmatic_json": - { - "variant_id": 128, - "fields": - [ - { - "element_kind": "String", - "elements": - [ - { - "value": "Bright", - "kind": "String" - } - ], - "kind": "Array" - } - ], - "kind": "Enum" - }, - "typed": - { - "values": - [ - "Bright" - ], - "type": "StringArray" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73659101 - }, - { - "key": "description", - "value": - { - "raw_hex": "5c2200010c2f5468652062726967687465737420636f6d706f6e656e7420696e207468652052616469782065636f73797374656d2e", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "The brightest component in the Radix ecosystem.", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "The brightest component in the Radix ecosystem.", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73659101 - }, - { - "key": "icon_url", - "value": - { - "raw_hex": "5c220d010c5b68747470733a2f2f757877696e672e636f6d2f77702d636f6e74656e742f7468656d65732f757877696e672f646f776e6c6f61642f617274732d677261706869632d7368617065732f737461722d66756c6c2d69636f6e2e706e67", - "programmatic_json": - { - "variant_id": 13, - "fields": - [ - { - "value": "https://uxwing.com/wp-content/themes/uxwing/download/arts-graphic-shapes/star-full-icon.png", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "https://uxwing.com/wp-content/themes/uxwing/download/arts-graphic-shapes/star-full-icon.png", - "type": "Url" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73659101 - }, - { - "key": "symbol", - "value": - { - "raw_hex": "5c2200010c0453544152", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "STAR", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "STAR", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73659101 - }, - { - "key": "name", - "value": - { - "raw_hex": "5c2200010c065374656c6c61", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Stella", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Stella", - "type": "String" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73659101 - } - ] - } - }, - { - "vaults": - { - "total_count": 1, - "items": - [ - { - "vault_address": "internal_vault_tdx_2_1tze65r2ttle267qztjj2ysyqmp3mfusm87ujllqgx7ynyny5wm60z0", - "amount": "9998.87481552813", - "last_updated_at_state_version": 73659244 - } - ] - }, - "aggregation_level": "Vault", - "resource_address": "resource_tdx_2_1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxtfd2jc", - "explicit_metadata": - { - "total_count": 5, - "items": - [ - { - "key": "tags", - "value": - { - "raw_hex": "5c228001200c00", - "programmatic_json": - { - "variant_id": 128, - "fields": - [ - { - "element_kind": "String", - "elements": - [], - "kind": "Array" - } - ], - "kind": "Enum" - }, - "typed": - { - "values": - [], - "type": "StringArray" - } - }, - "is_locked": true, - "last_updated_at_state_version": 2 - }, - { - "key": "description", - "value": - { - "raw_hex": "5c2200010c9e01546865205261646978205075626c6963204e6574776f726b2773206e617469766520746f6b656e2c207573656420746f2070617920746865206e6574776f726b2773207265717569726564207472616e73616374696f6e206665657320616e6420746f2073656375726520746865206e6574776f726b207468726f756768207374616b696e6720746f206974732076616c696461746f72206e6f6465732e", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "The Radix Public Network's native token, used to pay the network's required transaction fees and to secure the network through staking to its validator nodes.", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "The Radix Public Network's native token, used to pay the network's required transaction fees and to secure the network through staking to its validator nodes.", - "type": "String" - } - }, - "is_locked": true, - "last_updated_at_state_version": 2 - }, - { - "key": "icon_url", - "value": - { - "raw_hex": "5c220d010c3468747470733a2f2f6173736574732e7261646978646c742e636f6d2f69636f6e732f69636f6e2d7872642d33327833322e706e67", - "programmatic_json": - { - "variant_id": 13, - "fields": - [ - { - "value": "https://assets.radixdlt.com/icons/icon-xrd-32x32.png", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "https://assets.radixdlt.com/icons/icon-xrd-32x32.png", - "type": "Url" - } - }, - "is_locked": true, - "last_updated_at_state_version": 2 - }, - { - "key": "symbol", - "value": - { - "raw_hex": "5c2200010c03585244", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "XRD", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "XRD", - "type": "String" - } - }, - "is_locked": true, - "last_updated_at_state_version": 2 - }, - { - "key": "name", - "value": - { - "raw_hex": "5c2200010c055261646978", - "programmatic_json": - { - "variant_id": 0, - "fields": - [ - { - "value": "Radix", - "kind": "String" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "Radix", - "type": "String" - } - }, - "is_locked": true, - "last_updated_at_state_version": 2 - } - ] - } - } - ] - }, - "non_fungible_resources": - { - "total_count": 0, - "items": - [] - }, - "metadata": - { - "total_count": 2, - "items": - [ - { - "key": "owner_keys", - "value": - { - "raw_hex": "5c228f01202201010120071d9d26b5d3f3831581128d223e0eb85485247b8c23532f10e4ea7e4d9a6d", - "programmatic_json": - { - "variant_id": 143, - "fields": - [ - { - "element_kind": "Enum", - "elements": - [ - { - "variant_id": 1, - "fields": - [ - { - "element_kind": "U8", - "hex": "9d26b5d3f3831581128d223e0eb85485247b8c23532f10e4ea7e4d9a6d", - "kind": "Bytes" - } - ], - "kind": "Enum" - } - ], - "kind": "Array" - } - ], - "kind": "Enum" - }, - "typed": - { - "values": - [ - { - "hash_hex": "9d26b5d3f3831581128d223e0eb85485247b8c23532f10e4ea7e4d9a6d", - "key_hash_type": "EddsaEd25519" - } - ], - "type": "PublicKeyHashArray" - } - }, - "is_locked": false, - "last_updated_at_state_version": 73658898 - }, - { - "key": "owner_badge", - "value": - { - "raw_hex": "5c220b01c0021e519d26b5d3f3831581128d223e0eb85485247b8c23532f10e4ea7e4d9a6d", - "programmatic_json": - { - "variant_id": 11, - "fields": - [ - { - "value": "[519d26b5d3f3831581128d223e0eb85485247b8c23532f10e4ea7e4d9a6d]", - "kind": "NonFungibleLocalId" - } - ], - "kind": "Enum" - }, - "typed": - { - "value": "[519d26b5d3f3831581128d223e0eb85485247b8c23532f10e4ea7e4d9a6d]", - "type": "NonFungibleLocalId" - } - }, - "is_locked": true, - "last_updated_at_state_version": 73658898 - } - ] - }, - "explicit_metadata": - { - "total_count": 0, - "items": - [] - }, - "details": - { - "package_address": "package_tdx_2_1pkgxxxxxxxxxaccntxxxxxxxxxx000929625493xxxxxxxxx9jat20", - "blueprint_name": "Account", - "blueprint_version": "1.0.0", - "state": - { - "default_deposit_rule": "Accept" - }, - "role_assignments": - { - "owner": - { - "rule": - { - "type": "Protected", - "access_rule": - { - "type": "ProofRule", - "proof_rule": - { - "type": "Require", - "requirement": - { - "type": "NonFungible", - "non_fungible": - { - "local_id": - { - "id_type": "Bytes", - "sbor_hex": "5cc0021d9d26b5d3f3831581128d223e0eb85485247b8c23532f10e4ea7e4d9a6d", - "simple_rep": "[9d26b5d3f3831581128d223e0eb85485247b8c23532f10e4ea7e4d9a6d]" - }, - "resource_address": "resource_tdx_2_1nfxxxxxxxxxxed25sgxxxxxxxxx002236757237xxxxxxxxx3e2cpa" - } - } - } - } - }, - "updater": "Object" - }, - "entries": - [ - { - "role_key": - { - "module": "Main", - "name": "securify" - }, - "assignment": - { - "resolution": "Explicit", - "explicit_rule": - { - "type": "Protected", - "access_rule": - { - "type": "ProofRule", - "proof_rule": - { - "type": "Require", - "requirement": - { - "type": "NonFungible", - "non_fungible": - { - "local_id": - { - "id_type": "Bytes", - "sbor_hex": "5cc0021d9d26b5d3f3831581128d223e0eb85485247b8c23532f10e4ea7e4d9a6d", - "simple_rep": "[9d26b5d3f3831581128d223e0eb85485247b8c23532f10e4ea7e4d9a6d]" - }, - "resource_address": "resource_tdx_2_1nfxxxxxxxxxxed25sgxxxxxxxxx002236757237xxxxxxxxx3e2cpa" - } - } - } - } - } - }, - "updater_roles": - [ - { - "module": "Main", - "name": "_self_" - } - ] - }, - { - "role_key": - { - "module": "Metadata", - "name": "metadata_locker" - }, - "assignment": - { - "resolution": "Owner" - }, - "updater_roles": - [ - { - "module": "Metadata", - "name": "metadata_locker_updater" - } - ] - }, - { - "role_key": - { - "module": "Metadata", - "name": "metadata_locker_updater" - }, - "assignment": - { - "resolution": "Owner" - }, - "updater_roles": - [ - { - "module": "Metadata", - "name": "metadata_locker_updater" - } - ] - }, - { - "role_key": - { - "module": "Metadata", - "name": "metadata_setter" - }, - "assignment": - { - "resolution": "Owner" - }, - "updater_roles": - [ - { - "module": "Metadata", - "name": "metadata_setter_updater" - } - ] - }, - { - "role_key": - { - "module": "Metadata", - "name": "metadata_setter_updater" - }, - "assignment": - { - "resolution": "Owner" - }, - "updater_roles": - [ - { - "module": "Metadata", - "name": "metadata_setter_updater" - } - ] - } - ] - }, - "type": "Component" - } - } - ] -} \ No newline at end of file diff --git a/crates/gateway-logic/fixtures/models/state/response_entity_details_details__fungible_resource.json b/crates/gateway-logic/fixtures/models/state/response_entity_details_details__fungible_resource.json deleted file mode 100644 index ba60d09e4..000000000 --- a/crates/gateway-logic/fixtures/models/state/response_entity_details_details__fungible_resource.json +++ /dev/null @@ -1,347 +0,0 @@ -{ - "role_assignments": { - "owner": { - "rule": { - "type": "Protected", - "access_rule": { - "type": "ProofRule", - "proof_rule": { - "type": "Require", - "requirement": { - "type": "NonFungible", - "non_fungible": { - "local_id": { - "id_type": "Integer", - "sbor_hex": "5cc0010000000000000000", - "simple_rep": "#0#" - }, - "resource_address": "resource_tdx_2_1nfxxxxxxxxxxsystxnxxxxxxxxx002683325037xxxxxxxxxcss8hx" - } - } - } - } - }, - "updater": "None" - }, - "entries": [ - { - "role_key": { - "module": "Main", - "name": "burner" - }, - "assignment": { - "resolution": "Explicit", - "explicit_rule": { - "type": "Protected", - "access_rule": { - "type": "ProofRule", - "proof_rule": { - "type": "Require", - "requirement": { - "type": "NonFungible", - "non_fungible": { - "local_id": { - "id_type": "Bytes", - "sbor_hex": "5cc0022068c44e9d432e71c51e2a2ac285897b372328d8b31374ff29131bc6b25b6bd070", - "simple_rep": "[68c44e9d432e71c51e2a2ac285897b372328d8b31374ff29131bc6b25b6bd070]" - }, - "resource_address": "resource_tdx_2_1nfxxxxxxxxxxglcllrxxxxxxxxx002350006550xxxxxxxxxqtcnwk" - } - } - } - } - } - }, - "updater_roles": [ - { - "module": "Main", - "name": "burner_updater" - } - ] - }, - { - "role_key": { - "module": "Main", - "name": "minter" - }, - "assignment": { - "resolution": "Explicit", - "explicit_rule": { - "type": "Protected", - "access_rule": { - "type": "ProofRule", - "proof_rule": { - "type": "Require", - "requirement": { - "type": "NonFungible", - "non_fungible": { - "local_id": { - "id_type": "Bytes", - "sbor_hex": "5cc0022068c44e9d432e71c51e2a2ac285897b372328d8b31374ff29131bc6b25b6bd070", - "simple_rep": "[68c44e9d432e71c51e2a2ac285897b372328d8b31374ff29131bc6b25b6bd070]" - }, - "resource_address": "resource_tdx_2_1nfxxxxxxxxxxglcllrxxxxxxxxx002350006550xxxxxxxxxqtcnwk" - } - } - } - } - } - }, - "updater_roles": [ - { - "module": "Main", - "name": "minter_updater" - } - ] - }, - { - "role_key": { - "module": "Main", - "name": "freezer" - }, - "assignment": { - "resolution": "Explicit", - "explicit_rule": { - "type": "DenyAll" - } - }, - "updater_roles": [ - { - "module": "Main", - "name": "freezer_updater" - } - ] - }, - { - "role_key": { - "module": "Main", - "name": "recaller" - }, - "assignment": { - "resolution": "Explicit", - "explicit_rule": { - "type": "DenyAll" - } - }, - "updater_roles": [ - { - "module": "Main", - "name": "recaller_updater" - } - ] - }, - { - "role_key": { - "module": "Main", - "name": "depositor" - }, - "assignment": { - "resolution": "Explicit", - "explicit_rule": { - "type": "AllowAll" - } - }, - "updater_roles": [ - { - "module": "Main", - "name": "depositor_updater" - } - ] - }, - { - "role_key": { - "module": "Main", - "name": "withdrawer" - }, - "assignment": { - "resolution": "Explicit", - "explicit_rule": { - "type": "AllowAll" - } - }, - "updater_roles": [ - { - "module": "Main", - "name": "withdrawer_updater" - } - ] - }, - { - "role_key": { - "module": "Main", - "name": "burner_updater" - }, - "assignment": { - "resolution": "Explicit", - "explicit_rule": { - "type": "DenyAll" - } - }, - "updater_roles": [ - { - "module": "Main", - "name": "burner_updater" - } - ] - }, - { - "role_key": { - "module": "Main", - "name": "minter_updater" - }, - "assignment": { - "resolution": "Explicit", - "explicit_rule": { - "type": "DenyAll" - } - }, - "updater_roles": [ - { - "module": "Main", - "name": "minter_updater" - } - ] - }, - { - "role_key": { - "module": "Main", - "name": "freezer_updater" - }, - "assignment": { - "resolution": "Explicit", - "explicit_rule": { - "type": "DenyAll" - } - }, - "updater_roles": [ - { - "module": "Main", - "name": "freezer_updater" - } - ] - }, - { - "role_key": { - "module": "Main", - "name": "recaller_updater" - }, - "assignment": { - "resolution": "Explicit", - "explicit_rule": { - "type": "DenyAll" - } - }, - "updater_roles": [ - { - "module": "Main", - "name": "recaller_updater" - } - ] - }, - { - "role_key": { - "module": "Main", - "name": "depositor_updater" - }, - "assignment": { - "resolution": "Explicit", - "explicit_rule": { - "type": "DenyAll" - } - }, - "updater_roles": [ - { - "module": "Main", - "name": "depositor_updater" - } - ] - }, - { - "role_key": { - "module": "Main", - "name": "withdrawer_updater" - }, - "assignment": { - "resolution": "Explicit", - "explicit_rule": { - "type": "DenyAll" - } - }, - "updater_roles": [ - { - "module": "Main", - "name": "withdrawer_updater" - } - ] - }, - { - "role_key": { - "module": "Metadata", - "name": "metadata_locker" - }, - "assignment": { - "resolution": "Owner" - }, - "updater_roles": [ - { - "module": "Metadata", - "name": "metadata_locker_updater" - } - ] - }, - { - "role_key": { - "module": "Metadata", - "name": "metadata_locker_updater" - }, - "assignment": { - "resolution": "Owner" - }, - "updater_roles": [ - { - "module": "Metadata", - "name": "metadata_locker_updater" - } - ] - }, - { - "role_key": { - "module": "Metadata", - "name": "metadata_setter" - }, - "assignment": { - "resolution": "Owner" - }, - "updater_roles": [ - { - "module": "Metadata", - "name": "metadata_setter_updater" - } - ] - }, - { - "role_key": { - "module": "Metadata", - "name": "metadata_setter_updater" - }, - "assignment": { - "resolution": "Owner" - }, - "updater_roles": [ - { - "module": "Metadata", - "name": "metadata_setter_updater" - } - ] - } - ] - }, - "divisibility": 18, - "total_supply": "1704148276154.93015940148695633", - "total_minted": "1704148839860.06441597855528793", - "total_burned": "563705.1342565770683316", - "native_resource_details": { - "kind": "Xrd" - }, - "type": "FungibleResource" -} \ No newline at end of file diff --git a/crates/gateway-logic/fixtures/models/state/response_entity_details_details__non_fungible_resource.json b/crates/gateway-logic/fixtures/models/state/response_entity_details_details__non_fungible_resource.json deleted file mode 100644 index d5cc2012e..000000000 --- a/crates/gateway-logic/fixtures/models/state/response_entity_details_details__non_fungible_resource.json +++ /dev/null @@ -1,344 +0,0 @@ -{ - "non_fungible_id_type": "String", - "role_assignments": { - "owner": { - "rule": { - "type": "Protected", - "access_rule": { - "type": "ProofRule", - "proof_rule": { - "type": "Require", - "requirement": { - "type": "Resource", - "resource": "resource_tdx_2_1thwucrt37ajfknluwmj9s483qxz7cqcwlvf9xaun9wx5yxn3r8zh7v" - } - } - } - }, - "updater": "None" - }, - "entries": [ - { - "role_key": { - "module": "Main", - "name": "burner" - }, - "assignment": { - "resolution": "Owner" - }, - "updater_roles": [ - { - "module": "Main", - "name": "burner_updater" - } - ] - }, - { - "role_key": { - "module": "Main", - "name": "minter" - }, - "assignment": { - "resolution": "Explicit", - "explicit_rule": { - "type": "Protected", - "access_rule": { - "type": "ProofRule", - "proof_rule": { - "type": "Require", - "requirement": { - "type": "Resource", - "resource": "resource_tdx_2_1tkewy5e4cgwr6qztyum8zch85fgccfjpujkp3jx45ag9qzwev3ud49" - } - } - } - } - }, - "updater_roles": [ - { - "module": "Main", - "name": "minter_updater" - } - ] - }, - { - "role_key": { - "module": "Main", - "name": "freezer" - }, - "assignment": { - "resolution": "Explicit", - "explicit_rule": { - "type": "DenyAll" - } - }, - "updater_roles": [ - { - "module": "Main", - "name": "freezer_updater" - } - ] - }, - { - "role_key": { - "module": "Main", - "name": "recaller" - }, - "assignment": { - "resolution": "Owner" - }, - "updater_roles": [ - { - "module": "Main", - "name": "recaller_updater" - } - ] - }, - { - "role_key": { - "module": "Main", - "name": "depositor" - }, - "assignment": { - "resolution": "Explicit", - "explicit_rule": { - "type": "AllowAll" - } - }, - "updater_roles": [ - { - "module": "Main", - "name": "depositor_updater" - } - ] - }, - { - "role_key": { - "module": "Main", - "name": "withdrawer" - }, - "assignment": { - "resolution": "Explicit", - "explicit_rule": { - "type": "DenyAll" - } - }, - "updater_roles": [ - { - "module": "Main", - "name": "withdrawer_updater" - } - ] - }, - { - "role_key": { - "module": "Main", - "name": "burner_updater" - }, - "assignment": { - "resolution": "Owner" - }, - "updater_roles": [ - { - "module": "Main", - "name": "burner_updater" - } - ] - }, - { - "role_key": { - "module": "Main", - "name": "minter_updater" - }, - "assignment": { - "resolution": "Owner" - }, - "updater_roles": [ - { - "module": "Main", - "name": "minter_updater" - } - ] - }, - { - "role_key": { - "module": "Main", - "name": "freezer_updater" - }, - "assignment": { - "resolution": "Explicit", - "explicit_rule": { - "type": "DenyAll" - } - }, - "updater_roles": [ - { - "module": "Main", - "name": "freezer_updater" - } - ] - }, - { - "role_key": { - "module": "Main", - "name": "recaller_updater" - }, - "assignment": { - "resolution": "Owner" - }, - "updater_roles": [ - { - "module": "Main", - "name": "recaller_updater" - } - ] - }, - { - "role_key": { - "module": "Main", - "name": "depositor_updater" - }, - "assignment": { - "resolution": "Explicit", - "explicit_rule": { - "type": "DenyAll" - } - }, - "updater_roles": [ - { - "module": "Main", - "name": "depositor_updater" - } - ] - }, - { - "role_key": { - "module": "Main", - "name": "withdrawer_updater" - }, - "assignment": { - "resolution": "Owner" - }, - "updater_roles": [ - { - "module": "Main", - "name": "withdrawer_updater" - } - ] - }, - { - "role_key": { - "module": "Main", - "name": "non_fungible_data_updater" - }, - "assignment": { - "resolution": "Explicit", - "explicit_rule": { - "type": "Protected", - "access_rule": { - "type": "ProofRule", - "proof_rule": { - "type": "Require", - "requirement": { - "type": "Resource", - "resource": "resource_tdx_2_1tkewy5e4cgwr6qztyum8zch85fgccfjpujkp3jx45ag9qzwev3ud49" - } - } - } - } - }, - "updater_roles": [ - { - "module": "Main", - "name": "non_fungible_data_updater_updater" - } - ] - }, - { - "role_key": { - "module": "Main", - "name": "non_fungible_data_updater_updater" - }, - "assignment": { - "resolution": "Owner" - }, - "updater_roles": [ - { - "module": "Main", - "name": "non_fungible_data_updater_updater" - } - ] - }, - { - "role_key": { - "module": "Metadata", - "name": "metadata_locker" - }, - "assignment": { - "resolution": "Owner" - }, - "updater_roles": [ - { - "module": "Metadata", - "name": "metadata_locker_updater" - } - ] - }, - { - "role_key": { - "module": "Metadata", - "name": "metadata_locker_updater" - }, - "assignment": { - "resolution": "Owner" - }, - "updater_roles": [ - { - "module": "Metadata", - "name": "metadata_locker_updater" - } - ] - }, - { - "role_key": { - "module": "Metadata", - "name": "metadata_setter" - }, - "assignment": { - "resolution": "Owner" - }, - "updater_roles": [ - { - "module": "Metadata", - "name": "metadata_setter_updater" - } - ] - }, - { - "role_key": { - "module": "Metadata", - "name": "metadata_setter_updater" - }, - "assignment": { - "resolution": "Owner" - }, - "updater_roles": [ - { - "module": "Metadata", - "name": "metadata_setter_updater" - } - ] - } - ] - }, - "total_supply": "3100", - "total_minted": "3100", - "total_burned": "0", - "non_fungible_data_mutable_fields": [ - "description", - "key_image_url", - "quests_completed", - "quest_counter" - ], - "type": "NonFungibleResource" -} \ No newline at end of file diff --git a/crates/gateway-logic/src/lib.rs b/crates/gateway-logic/src/lib.rs deleted file mode 100644 index 31d8fa26f..000000000 --- a/crates/gateway-logic/src/lib.rs +++ /dev/null @@ -1,13 +0,0 @@ -mod logic; - -pub mod prelude { - pub use crate::logic::*; - - pub(crate) use gateway_models::prelude::*; - - pub(crate) use sargon_transaction_models::prelude::*; - - pub(crate) use itertools::Itertools; -} - -pub use prelude::*; diff --git a/crates/gateway-logic/src/logic/mod.rs b/crates/gateway-logic/src/logic/mod.rs deleted file mode 100644 index bb8969a4c..000000000 --- a/crates/gateway-logic/src/logic/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -mod new_transaction_preview; -mod request; - -pub use new_transaction_preview::*; -pub use request::*; diff --git a/crates/gateway-logic/src/logic/new_transaction_preview.rs b/crates/gateway-logic/src/logic/new_transaction_preview.rs deleted file mode 100644 index 2c876d48b..000000000 --- a/crates/gateway-logic/src/logic/new_transaction_preview.rs +++ /dev/null @@ -1,117 +0,0 @@ -pub use crate::prelude::*; - -pub trait TransactionPreviewRequestFromManifest: Sized { - fn new_transaction_analysis( - manifest: TransactionManifest, - start_epoch_inclusive: Epoch, - signer_public_keys: impl IntoIterator, - notary_public_key: Option, - nonce: Nonce, - ) -> Self; -} - -impl TransactionPreviewRequestFromManifest for TransactionPreviewRequest { - fn new_transaction_analysis( - manifest: TransactionManifest, - start_epoch_inclusive: Epoch, - signer_public_keys: impl IntoIterator, - notary_public_key: Option, - nonce: Nonce, - ) -> Self { - let signer_public_keys = signer_public_keys - .into_iter() - .map(GWPublicKey::from) - .collect_vec(); - - Self { - manifest: manifest.manifest_string(), - blobs_hex: Some( - manifest - .blobs() - .blobs() - .into_iter() - .map(|b| b.to_hex()) - .collect_vec(), - ), - start_epoch_inclusive: start_epoch_inclusive.into(), - end_epoch_exclusive: Epoch::window_end_from_start( - start_epoch_inclusive, - ) - .into(), - notary_public_key: notary_public_key.map(GWPublicKey::from), - notary_is_signatory: signer_public_keys.is_empty(), - tip_percentage: 0, - nonce: nonce.into(), - signer_public_keys, - flags: TransactionPreviewRequestFlags::default(), - opt_ins: TransactionPreviewRequestOptIns::default(), - } - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[allow(clippy::upper_case_acronyms)] - type SUT = TransactionPreviewRequest; - - #[test] - fn test_new() { - let do_test = |intent: TransactionIntent| { - let header = intent.header; - let keys = vec![PublicKey::sample(), PublicKey::sample_other()]; - let flags = TransactionPreviewRequestFlags::default(); - let sut = SUT::new_transaction_analysis( - intent.clone().manifest, - intent.header.start_epoch_inclusive, - keys.clone(), - Some(intent.header.notary_public_key), - intent.header.nonce, - ); - assert_eq!(sut.flags, flags); - assert_eq!( - sut.signer_public_keys, - keys.into_iter().map(GWPublicKey::from).collect_vec() - ); - assert_eq!(sut.manifest, intent.manifest_string()); - assert_eq!( - Epoch::from(sut.start_epoch_inclusive), - header.start_epoch_inclusive - ); - assert_eq!( - Epoch::from(sut.end_epoch_exclusive), - header.end_epoch_exclusive - ); - assert_eq!( - sut.blobs_hex.unwrap(), - intent - .clone() - .blobs() - .blobs() - .into_iter() - .map(|b| b.to_string()) - .collect_vec() - ); - assert!(!sut.notary_is_signatory); - assert_eq!( - sut.notary_public_key.unwrap(), - GWPublicKey::from(header.notary_public_key) - ); - assert_eq!(sut.tip_percentage, header.tip_percentage); - assert_eq!(Nonce::from(sut.nonce), header.nonce); - }; - do_test(TransactionIntent::sample()); - do_test(TransactionIntent::sample_other()); - } - - #[test] - fn request_json_test() { - let (sut, json) = fixture_and_json::(include_str!(concat!( - env!("FIXTURES_MODELS_GW"), - "transaction/request_preview.json" - ))) - .unwrap(); - assert_json_value_eq_after_roundtrip(&sut, json) - } -} diff --git a/crates/gateway-logic/src/logic/request/mod.rs b/crates/gateway-logic/src/logic/request/mod.rs deleted file mode 100644 index 3c409be93..000000000 --- a/crates/gateway-logic/src/logic/request/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -mod transaction_submit_request_from_notarized_tx; - -pub use transaction_submit_request_from_notarized_tx::*; diff --git a/crates/gateway-logic/src/logic/request/transaction_submit_request_from_notarized_tx.rs b/crates/gateway-logic/src/logic/request/transaction_submit_request_from_notarized_tx.rs deleted file mode 100644 index 3159b0249..000000000 --- a/crates/gateway-logic/src/logic/request/transaction_submit_request_from_notarized_tx.rs +++ /dev/null @@ -1,34 +0,0 @@ -use crate::prelude::*; - -pub trait TransactionSubmitRequestFromNotarizedTransaction { - fn new(notarized_transaction: NotarizedTransaction) -> Self; -} - -impl TransactionSubmitRequestFromNotarizedTransaction - for TransactionSubmitRequest -{ - fn new(notarized_transaction: NotarizedTransaction) -> Self { - let compiled = notarized_transaction.compile(); - Self { - notarized_transaction_hex: compiled.to_string(), - } - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[allow(clippy::upper_case_acronyms)] - type SUT = TransactionSubmitRequest; - - #[test] - fn test_new() { - let tx = NotarizedTransaction::sample(); - let sut = SUT::new(tx.clone()); - assert_eq!( - sut.notarized_transaction_hex, - tx.compile().bytes().to_hex() - ); - } -} diff --git a/crates/gateway-models/Cargo.toml b/crates/gateway-models/Cargo.toml index 7e97a0e29..4c5e270ef 100644 --- a/crates/gateway-models/Cargo.toml +++ b/crates/gateway-models/Cargo.toml @@ -9,6 +9,7 @@ build = "build.rs" 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 } diff --git a/crates/gateway-logic/fixtures/models/transaction/request_preview.json b/crates/gateway-models/fixtures/models/transaction/request_preview.json similarity index 100% rename from crates/gateway-logic/fixtures/models/transaction/request_preview.json rename to crates/gateway-models/fixtures/models/transaction/request_preview.json diff --git a/crates/gateway-models/src/lib.rs b/crates/gateway-models/src/lib.rs index 03ab4b091..f631fa112 100644 --- a/crates/gateway-models/src/lib.rs +++ b/crates/gateway-models/src/lib.rs @@ -5,6 +5,7 @@ pub mod prelude { 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; 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 index a477db0de..7832fe4e5 100644 --- a/crates/gateway-models/src/types/request/transaction/preview/transaction_preview.rs +++ b/crates/gateway-models/src/types/request/transaction/preview/transaction_preview.rs @@ -40,3 +40,109 @@ pub struct TransactionPreviewRequest { /** 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, + start_epoch_inclusive: Epoch, + signer_public_keys: impl IntoIterator, + notary_public_key: Option, + nonce: Nonce, + ) -> Self { + let signer_public_keys = signer_public_keys + .into_iter() + .map(GWPublicKey::from) + .collect_vec(); + + Self { + manifest: manifest.manifest_string(), + blobs_hex: Some( + manifest + .blobs() + .blobs() + .into_iter() + .map(|b| b.to_hex()) + .collect_vec(), + ), + start_epoch_inclusive: start_epoch_inclusive.into(), + end_epoch_exclusive: Epoch::window_end_from_start( + start_epoch_inclusive, + ) + .into(), + notary_public_key: notary_public_key.map(GWPublicKey::from), + notary_is_signatory: signer_public_keys.is_empty(), + tip_percentage: 0, + nonce: nonce.into(), + signer_public_keys, + flags: TransactionPreviewRequestFlags::default(), + opt_ins: TransactionPreviewRequestOptIns::default(), + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[allow(clippy::upper_case_acronyms)] + type SUT = TransactionPreviewRequest; + + #[test] + fn test_new() { + let do_test = |intent: TransactionIntent| { + let header = intent.header; + let keys = vec![PublicKey::sample(), PublicKey::sample_other()]; + let flags = TransactionPreviewRequestFlags::default(); + let sut = SUT::new_transaction_analysis( + intent.clone().manifest, + intent.header.start_epoch_inclusive, + keys.clone(), + Some(intent.header.notary_public_key), + intent.header.nonce, + ); + assert_eq!(sut.flags, flags); + assert_eq!( + sut.signer_public_keys, + keys.into_iter().map(GWPublicKey::from).collect_vec() + ); + assert_eq!(sut.manifest, intent.manifest_string()); + assert_eq!( + Epoch::from(sut.start_epoch_inclusive), + header.start_epoch_inclusive + ); + assert_eq!( + Epoch::from(sut.end_epoch_exclusive), + header.end_epoch_exclusive + ); + assert_eq!( + sut.blobs_hex.unwrap(), + intent + .clone() + .blobs() + .blobs() + .into_iter() + .map(|b| b.to_string()) + .collect_vec() + ); + assert!(!sut.notary_is_signatory); + assert_eq!( + sut.notary_public_key.unwrap(), + GWPublicKey::from(header.notary_public_key) + ); + assert_eq!(sut.tip_percentage, header.tip_percentage); + assert_eq!(Nonce::from(sut.nonce), header.nonce); + }; + do_test(TransactionIntent::sample()); + do_test(TransactionIntent::sample_other()); + } + + #[test] + fn request_json_test() { + let (sut, json) = fixture_and_json::(include_str!(concat!( + env!("FIXTURES_MODELS_GW"), + "transaction/request_preview.json" + ))) + .unwrap(); + assert_json_value_eq_after_roundtrip(&sut, json) + } +} 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 index c294c8b1a..67faa18c4 100644 --- a/crates/gateway-models/src/types/request/transaction/submit/transaction_submit.rs +++ b/crates/gateway-models/src/types/request/transaction/submit/transaction_submit.rs @@ -12,3 +12,30 @@ 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(); + Self { + notarized_transaction_hex: compiled.to_string(), + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[allow(clippy::upper_case_acronyms)] + type SUT = TransactionSubmitRequest; + + #[test] + fn test_new() { + let tx = NotarizedTransaction::sample(); + let sut = SUT::new(tx.clone()); + assert_eq!( + sut.notarized_transaction_hex, + tx.compile().bytes().to_hex() + ); + } +} 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/jvm/sargon-android/src/test/java/com/radixdlt/sargon/TransactionManifestTest.kt b/jvm/sargon-android/src/test/java/com/radixdlt/sargon/TransactionManifestTest.kt index a39e68fcd..795929b22 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 @@ -587,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( @@ -642,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 openFile(name: String, extension: String) = - File("../../" + "crates/sargon-transaction-models/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) } From 2ff58f0ffca71bf4268362d4297ae6b8a192e552 Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Thu, 2 Jan 2025 12:38:24 +0100 Subject: [PATCH 23/23] try fix kotlin --- .../test/java/com/radixdlt/sargon/TransactionManifestTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 795929b22..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 @@ -646,7 +646,7 @@ class TransactionManifestTest : SampleTestable { 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 openFileInCrate(crate: String, name: String, extension: String) = File("../../" + "crates/" + crate + "/fixtures/transaction/$name.$extension")