From d7ecce4c61039c5e06e2eefb9a1208438b3a2e35 Mon Sep 17 00:00:00 2001 From: Omar Date: Thu, 31 Oct 2024 23:48:56 +0300 Subject: [PATCH] Update to latest scrypto & add classification method --- Cargo.lock | 46 ++-- Cargo.toml | 24 +-- .../builder/manifest_builder/builder_v1.rs | 200 +++++++++--------- .../builder/manifest_builder/builder_v2.rs | 200 +++++++++--------- .../src/builder/manifest_builder/traits.rs | 25 +++ .../src/common/access_rules.rs | 2 - .../src/common/address.rs | 32 +++ .../src/internal_prelude.rs | 185 ++++++++-------- .../src/transaction_v1/manifest.rs | 12 +- .../transaction_v2/transaction_manifest.rs | 12 +- .../src/functions/transaction_v1/manifest.rs | 5 + .../transaction_v2/transaction_manifest.rs | 4 + .../src/transaction_types/interface.rs | 89 +++++++- .../traverser/auxiliary/requiring_auth.rs | 6 +- crates/radix-engine-toolkit/src/utils.rs | 5 +- .../tests/transaction_types.rs | 79 ++++++- 16 files changed, 580 insertions(+), 346 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8987b8dc..90aab2ac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1257,7 +1257,7 @@ dependencies = [ [[package]] name = "radix-blueprint-schema-init" version = "1.3.0-dev" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=9cdcfd4292044ee1def2cb37aa9807cef95f74a3#9cdcfd4292044ee1def2cb37aa9807cef95f74a3" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=27da7a08fac63d36bd1ab209840fb014f470ebc6#27da7a08fac63d36bd1ab209840fb014f470ebc6" dependencies = [ "bitflags 1.3.2", "radix-common", @@ -1268,7 +1268,7 @@ dependencies = [ [[package]] name = "radix-common" version = "1.3.0-dev" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=9cdcfd4292044ee1def2cb37aa9807cef95f74a3#9cdcfd4292044ee1def2cb37aa9807cef95f74a3" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=27da7a08fac63d36bd1ab209840fb014f470ebc6#27da7a08fac63d36bd1ab209840fb014f470ebc6" dependencies = [ "bech32", "blake2", @@ -1294,7 +1294,7 @@ dependencies = [ [[package]] name = "radix-common-derive" version = "1.3.0-dev" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=9cdcfd4292044ee1def2cb37aa9807cef95f74a3#9cdcfd4292044ee1def2cb37aa9807cef95f74a3" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=27da7a08fac63d36bd1ab209840fb014f470ebc6#27da7a08fac63d36bd1ab209840fb014f470ebc6" dependencies = [ "paste", "proc-macro2", @@ -1306,7 +1306,7 @@ dependencies = [ [[package]] name = "radix-engine" version = "1.3.0-dev" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=9cdcfd4292044ee1def2cb37aa9807cef95f74a3#9cdcfd4292044ee1def2cb37aa9807cef95f74a3" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=27da7a08fac63d36bd1ab209840fb014f470ebc6#27da7a08fac63d36bd1ab209840fb014f470ebc6" dependencies = [ "bitflags 1.3.2", "colored", @@ -1338,7 +1338,7 @@ dependencies = [ [[package]] name = "radix-engine-interface" version = "1.3.0-dev" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=9cdcfd4292044ee1def2cb37aa9807cef95f74a3#9cdcfd4292044ee1def2cb37aa9807cef95f74a3" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=27da7a08fac63d36bd1ab209840fb014f470ebc6#27da7a08fac63d36bd1ab209840fb014f470ebc6" dependencies = [ "bitflags 1.3.2", "const-sha1", @@ -1359,7 +1359,7 @@ dependencies = [ [[package]] name = "radix-engine-profiling" version = "1.3.0-dev" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=9cdcfd4292044ee1def2cb37aa9807cef95f74a3#9cdcfd4292044ee1def2cb37aa9807cef95f74a3" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=27da7a08fac63d36bd1ab209840fb014f470ebc6#27da7a08fac63d36bd1ab209840fb014f470ebc6" dependencies = [ "fixedstr", ] @@ -1367,7 +1367,7 @@ dependencies = [ [[package]] name = "radix-engine-profiling-derive" version = "1.3.0-dev" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=9cdcfd4292044ee1def2cb37aa9807cef95f74a3#9cdcfd4292044ee1def2cb37aa9807cef95f74a3" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=27da7a08fac63d36bd1ab209840fb014f470ebc6#27da7a08fac63d36bd1ab209840fb014f470ebc6" dependencies = [ "proc-macro2", "quote", @@ -1404,7 +1404,7 @@ dependencies = [ [[package]] name = "radix-engine-toolkit-common" version = "1.3.0-dev" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=9cdcfd4292044ee1def2cb37aa9807cef95f74a3#9cdcfd4292044ee1def2cb37aa9807cef95f74a3" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=27da7a08fac63d36bd1ab209840fb014f470ebc6#27da7a08fac63d36bd1ab209840fb014f470ebc6" dependencies = [ "radix-common", "radix-engine", @@ -1441,7 +1441,7 @@ dependencies = [ [[package]] name = "radix-native-sdk" version = "1.3.0-dev" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=9cdcfd4292044ee1def2cb37aa9807cef95f74a3#9cdcfd4292044ee1def2cb37aa9807cef95f74a3" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=27da7a08fac63d36bd1ab209840fb014f470ebc6#27da7a08fac63d36bd1ab209840fb014f470ebc6" dependencies = [ "radix-common", "radix-engine-interface", @@ -1452,7 +1452,7 @@ dependencies = [ [[package]] name = "radix-rust" version = "1.3.0-dev" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=9cdcfd4292044ee1def2cb37aa9807cef95f74a3#9cdcfd4292044ee1def2cb37aa9807cef95f74a3" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=27da7a08fac63d36bd1ab209840fb014f470ebc6#27da7a08fac63d36bd1ab209840fb014f470ebc6" dependencies = [ "indexmap 2.6.0", "serde", @@ -1461,7 +1461,7 @@ dependencies = [ [[package]] name = "radix-sbor-derive" version = "1.3.0-dev" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=9cdcfd4292044ee1def2cb37aa9807cef95f74a3#9cdcfd4292044ee1def2cb37aa9807cef95f74a3" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=27da7a08fac63d36bd1ab209840fb014f470ebc6#27da7a08fac63d36bd1ab209840fb014f470ebc6" dependencies = [ "proc-macro2", "quote", @@ -1472,7 +1472,7 @@ dependencies = [ [[package]] name = "radix-substate-store-impls" version = "1.3.0-dev" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=9cdcfd4292044ee1def2cb37aa9807cef95f74a3#9cdcfd4292044ee1def2cb37aa9807cef95f74a3" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=27da7a08fac63d36bd1ab209840fb014f470ebc6#27da7a08fac63d36bd1ab209840fb014f470ebc6" dependencies = [ "hex", "itertools", @@ -1485,7 +1485,7 @@ dependencies = [ [[package]] name = "radix-substate-store-interface" version = "1.3.0-dev" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=9cdcfd4292044ee1def2cb37aa9807cef95f74a3#9cdcfd4292044ee1def2cb37aa9807cef95f74a3" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=27da7a08fac63d36bd1ab209840fb014f470ebc6#27da7a08fac63d36bd1ab209840fb014f470ebc6" dependencies = [ "hex", "itertools", @@ -1497,7 +1497,7 @@ dependencies = [ [[package]] name = "radix-substate-store-queries" version = "1.3.0-dev" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=9cdcfd4292044ee1def2cb37aa9807cef95f74a3#9cdcfd4292044ee1def2cb37aa9807cef95f74a3" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=27da7a08fac63d36bd1ab209840fb014f470ebc6#27da7a08fac63d36bd1ab209840fb014f470ebc6" dependencies = [ "hex", "itertools", @@ -1514,7 +1514,7 @@ dependencies = [ [[package]] name = "radix-transaction-scenarios" version = "1.3.0-dev" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=9cdcfd4292044ee1def2cb37aa9807cef95f74a3#9cdcfd4292044ee1def2cb37aa9807cef95f74a3" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=27da7a08fac63d36bd1ab209840fb014f470ebc6#27da7a08fac63d36bd1ab209840fb014f470ebc6" dependencies = [ "hex", "itertools", @@ -1534,7 +1534,7 @@ dependencies = [ [[package]] name = "radix-transactions" version = "1.3.0-dev" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=9cdcfd4292044ee1def2cb37aa9807cef95f74a3#9cdcfd4292044ee1def2cb37aa9807cef95f74a3" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=27da7a08fac63d36bd1ab209840fb014f470ebc6#27da7a08fac63d36bd1ab209840fb014f470ebc6" dependencies = [ "annotate-snippets", "bech32", @@ -1655,7 +1655,7 @@ dependencies = [ [[package]] name = "sbor" version = "1.3.0-dev" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=9cdcfd4292044ee1def2cb37aa9807cef95f74a3#9cdcfd4292044ee1def2cb37aa9807cef95f74a3" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=27da7a08fac63d36bd1ab209840fb014f470ebc6#27da7a08fac63d36bd1ab209840fb014f470ebc6" dependencies = [ "const-sha1", "hex", @@ -1669,7 +1669,7 @@ dependencies = [ [[package]] name = "sbor-derive" version = "1.3.0-dev" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=9cdcfd4292044ee1def2cb37aa9807cef95f74a3#9cdcfd4292044ee1def2cb37aa9807cef95f74a3" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=27da7a08fac63d36bd1ab209840fb014f470ebc6#27da7a08fac63d36bd1ab209840fb014f470ebc6" dependencies = [ "proc-macro2", "sbor-derive-common", @@ -1679,7 +1679,7 @@ dependencies = [ [[package]] name = "sbor-derive-common" version = "1.3.0-dev" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=9cdcfd4292044ee1def2cb37aa9807cef95f74a3#9cdcfd4292044ee1def2cb37aa9807cef95f74a3" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=27da7a08fac63d36bd1ab209840fb014f470ebc6#27da7a08fac63d36bd1ab209840fb014f470ebc6" dependencies = [ "const-sha1", "indexmap 2.6.0", @@ -1747,7 +1747,7 @@ dependencies = [ [[package]] name = "scrypto" version = "1.3.0-dev" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=9cdcfd4292044ee1def2cb37aa9807cef95f74a3#9cdcfd4292044ee1def2cb37aa9807cef95f74a3" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=27da7a08fac63d36bd1ab209840fb014f470ebc6#27da7a08fac63d36bd1ab209840fb014f470ebc6" dependencies = [ "bech32", "const-sha1", @@ -1768,7 +1768,7 @@ dependencies = [ [[package]] name = "scrypto-compiler" version = "1.3.0-dev" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=9cdcfd4292044ee1def2cb37aa9807cef95f74a3#9cdcfd4292044ee1def2cb37aa9807cef95f74a3" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=27da7a08fac63d36bd1ab209840fb014f470ebc6#27da7a08fac63d36bd1ab209840fb014f470ebc6" dependencies = [ "cargo_toml", "fslock", @@ -1783,7 +1783,7 @@ dependencies = [ [[package]] name = "scrypto-derive" version = "1.3.0-dev" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=9cdcfd4292044ee1def2cb37aa9807cef95f74a3#9cdcfd4292044ee1def2cb37aa9807cef95f74a3" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=27da7a08fac63d36bd1ab209840fb014f470ebc6#27da7a08fac63d36bd1ab209840fb014f470ebc6" dependencies = [ "proc-macro2", "quote", @@ -1799,7 +1799,7 @@ dependencies = [ [[package]] name = "scrypto-test" version = "1.3.0-dev" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=9cdcfd4292044ee1def2cb37aa9807cef95f74a3#9cdcfd4292044ee1def2cb37aa9807cef95f74a3" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?rev=27da7a08fac63d36bd1ab209840fb014f470ebc6#27da7a08fac63d36bd1ab209840fb014f470ebc6" dependencies = [ "ouroboros", "paste", diff --git a/Cargo.toml b/Cargo.toml index 3f2a0883..9b5cb68b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,24 +15,24 @@ members = [ # Shared dependencies that all of the crates need - for now this is just the # `radixdlt-scrypto` dependencies [workspace.dependencies] -sbor = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "9cdcfd4292044ee1def2cb37aa9807cef95f74a3", features = [ +sbor = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "27da7a08fac63d36bd1ab209840fb014f470ebc6", features = [ "serde", ] } -scrypto = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "9cdcfd4292044ee1def2cb37aa9807cef95f74a3", features = [ +scrypto = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "27da7a08fac63d36bd1ab209840fb014f470ebc6", features = [ "serde", ] } -scrypto-test = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "9cdcfd4292044ee1def2cb37aa9807cef95f74a3" } -radix-common = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "9cdcfd4292044ee1def2cb37aa9807cef95f74a3", features = [ +scrypto-test = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "27da7a08fac63d36bd1ab209840fb014f470ebc6" } +radix-common = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "27da7a08fac63d36bd1ab209840fb014f470ebc6", features = [ "serde", ] } -radix-engine = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "9cdcfd4292044ee1def2cb37aa9807cef95f74a3" } -radix-engine-interface = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "9cdcfd4292044ee1def2cb37aa9807cef95f74a3" } -radix-substate-store-queries = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "9cdcfd4292044ee1def2cb37aa9807cef95f74a3" } -radix-substate-store-impls = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "9cdcfd4292044ee1def2cb37aa9807cef95f74a3" } -radix-substate-store-interface = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "9cdcfd4292044ee1def2cb37aa9807cef95f74a3" } -radix-transactions = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "9cdcfd4292044ee1def2cb37aa9807cef95f74a3" } -radix-transaction-scenarios = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "9cdcfd4292044ee1def2cb37aa9807cef95f74a3" } -radix-engine-toolkit-common = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "9cdcfd4292044ee1def2cb37aa9807cef95f74a3" } +radix-engine = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "27da7a08fac63d36bd1ab209840fb014f470ebc6" } +radix-engine-interface = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "27da7a08fac63d36bd1ab209840fb014f470ebc6" } +radix-substate-store-queries = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "27da7a08fac63d36bd1ab209840fb014f470ebc6" } +radix-substate-store-impls = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "27da7a08fac63d36bd1ab209840fb014f470ebc6" } +radix-substate-store-interface = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "27da7a08fac63d36bd1ab209840fb014f470ebc6" } +radix-transactions = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "27da7a08fac63d36bd1ab209840fb014f470ebc6" } +radix-transaction-scenarios = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "27da7a08fac63d36bd1ab209840fb014f470ebc6" } +radix-engine-toolkit-common = { git = "https://github.com/radixdlt/radixdlt-scrypto", rev = "27da7a08fac63d36bd1ab209840fb014f470ebc6" } [profile.release] incremental = false diff --git a/crates/radix-engine-toolkit-uniffi/src/builder/manifest_builder/builder_v1.rs b/crates/radix-engine-toolkit-uniffi/src/builder/manifest_builder/builder_v1.rs index 7bbc082a..0fe3ff03 100644 --- a/crates/radix-engine-toolkit-uniffi/src/builder/manifest_builder/builder_v1.rs +++ b/crates/radix-engine-toolkit-uniffi/src/builder/manifest_builder/builder_v1.rs @@ -1046,7 +1046,9 @@ impl ManifestV1Builder { method_name: NATIVE_FUNGIBLE_RESOURCE_MANAGER_MINT_IDENT .to_owned(), args: native_to_manifest_value_and_unwrap!( - &NativeFungibleResourceManagerMintInput { amount } + &NativeFungibleResourceManagerMintManifestInput { + amount + } ), }); builder.instructions.push(instruction); @@ -1395,19 +1397,19 @@ builder_alias! { package_address: NATIVE_ACCOUNT_PACKAGE, blueprint_ident: NATIVE_ACCOUNT_BLUEPRINT, function_ident: NATIVE_ACCOUNT_CREATE_IDENT, - args: NativeAccountCreateInput {} + args: NativeAccountCreateManifestInput {} }, { builder_method: account_securify, method_ident: NATIVE_ACCOUNT_SECURIFY_IDENT, instruction: CallMethod, - args: NativeAccountSecurifyInput {} + args: NativeAccountSecurifyManifestInput {} }, { builder_method: account_lock_fee, method_ident: NATIVE_ACCOUNT_LOCK_FEE_IDENT, instruction: CallMethod, - args: NativeAccountLockFeeInput { + args: NativeAccountLockFeeManifestInput { amount: (Arc => NativeDecimal) } }, @@ -1415,7 +1417,7 @@ builder_alias! { builder_method: account_lock_contingent_fee, method_ident: NATIVE_ACCOUNT_LOCK_CONTINGENT_FEE_IDENT, instruction: CallMethod, - args: NativeAccountLockContingentFeeInput { + args: NativeAccountLockContingentFeeManifestInput { amount: (Arc => NativeDecimal) } }, @@ -1433,7 +1435,7 @@ builder_alias! { instruction: CallMethod, args: NativeAccountTryDepositOrAbortManifestInput { bucket: (ManifestBuilderBucket => NativeManifestBucket), - authorized_depositor_badge: (Option => Option), + authorized_depositor_badge: (Option => Option), } }, { @@ -1442,7 +1444,7 @@ builder_alias! { instruction: CallMethod, args: NativeAccountTryDepositOrRefundManifestInput { bucket: (ManifestBuilderBucket => NativeManifestBucket), - authorized_depositor_badge: (Option => Option), + authorized_depositor_badge: (Option => Option), } }, { @@ -1459,7 +1461,7 @@ builder_alias! { instruction: CallMethod, args: NativeAccountTryDepositBatchOrAbortManifestInput { buckets: (Vec => NativeBucketBatch), - authorized_depositor_badge: (Option => Option), + authorized_depositor_badge: (Option => Option), } }, { @@ -1468,15 +1470,15 @@ builder_alias! { instruction: CallMethod, args: NativeAccountTryDepositBatchOrRefundManifestInput { buckets: (Vec => NativeBucketBatch), - authorized_depositor_badge: (Option => Option), + authorized_depositor_badge: (Option => Option), } }, { builder_method: account_withdraw, method_ident: NATIVE_ACCOUNT_WITHDRAW_IDENT, instruction: CallMethod, - args: NativeAccountWithdrawInput { - resource_address: (Arc
=> NativeResourceAddress), + args: NativeAccountWithdrawManifestInput { + resource_address: (Arc
=> NativeDynamicResourceAddress), amount: (Arc => NativeDecimal), } }, @@ -1484,8 +1486,8 @@ builder_alias! { builder_method: account_withdraw_non_fungibles, method_ident: NATIVE_ACCOUNT_WITHDRAW_NON_FUNGIBLES_IDENT, instruction: CallMethod, - args: NativeAccountWithdrawNonFungiblesInput { - resource_address: (Arc
=> NativeResourceAddress), + args: NativeAccountWithdrawNonFungiblesManifestInput { + resource_address: (Arc
=> NativeDynamicResourceAddress), ids: (Vec => IndexSet), } }, @@ -1493,9 +1495,9 @@ builder_alias! { builder_method: account_lock_fee_and_withdraw, method_ident: NATIVE_ACCOUNT_LOCK_FEE_AND_WITHDRAW_IDENT, instruction: CallMethod, - args: NativeAccountLockFeeAndWithdrawInput { + args: NativeAccountLockFeeAndWithdrawManifestInput { amount_to_lock: (Arc => NativeDecimal), - resource_address: (Arc
=> NativeResourceAddress), + resource_address: (Arc
=> NativeDynamicResourceAddress), amount: (Arc => NativeDecimal), } }, @@ -1503,9 +1505,9 @@ builder_alias! { builder_method: account_lock_fee_and_withdraw_non_fungibles, method_ident: NATIVE_ACCOUNT_LOCK_FEE_AND_WITHDRAW_NON_FUNGIBLES_IDENT, instruction: CallMethod, - args: NativeAccountLockFeeAndWithdrawNonFungiblesInput { + args: NativeAccountLockFeeAndWithdrawNonFungiblesManifestInput { amount_to_lock: (Arc => NativeDecimal), - resource_address: (Arc
=> NativeResourceAddress), + resource_address: (Arc
=> NativeDynamicResourceAddress), ids: (Vec => IndexSet), } }, @@ -1513,8 +1515,8 @@ builder_alias! { builder_method: account_create_proof_of_amount, method_ident: NATIVE_ACCOUNT_CREATE_PROOF_OF_AMOUNT_IDENT, instruction: CallMethod, - args: NativeAccountCreateProofOfAmountInput { - resource_address: (Arc
=> NativeResourceAddress), + args: NativeAccountCreateProofOfAmountManifestInput { + resource_address: (Arc
=> NativeDynamicResourceAddress), amount: (Arc => NativeDecimal), } }, @@ -1522,8 +1524,8 @@ builder_alias! { builder_method: account_create_proof_of_non_fungibles, method_ident: NATIVE_ACCOUNT_CREATE_PROOF_OF_NON_FUNGIBLES_IDENT, instruction: CallMethod, - args: NativeAccountCreateProofOfNonFungiblesInput { - resource_address: (Arc
=> NativeResourceAddress), + args: NativeAccountCreateProofOfNonFungiblesManifestInput { + resource_address: (Arc
=> NativeDynamicResourceAddress), ids: (Vec => IndexSet), } }, @@ -1531,7 +1533,7 @@ builder_alias! { builder_method: account_set_default_deposit_rule, method_ident: NATIVE_ACCOUNT_SET_DEFAULT_DEPOSIT_RULE_IDENT, instruction: CallMethod, - args: NativeAccountSetDefaultDepositRuleInput { + args: NativeAccountSetDefaultDepositRuleManifestInput { default as default_deposit_rule: (AccountDefaultDepositRule => NativeDefaultDepositRule), } }, @@ -1539,8 +1541,8 @@ builder_alias! { builder_method: account_set_resource_preference, method_ident: NATIVE_ACCOUNT_SET_RESOURCE_PREFERENCE_IDENT, instruction: CallMethod, - args: NativeAccountSetResourcePreferenceInput { - resource_address: (Arc
=> NativeResourceAddress), + args: NativeAccountSetResourcePreferenceManifestInput { + resource_address: (Arc
=> NativeDynamicResourceAddress), resource_preference: (ResourcePreference => NativeResourcePreference), } }, @@ -1548,16 +1550,16 @@ builder_alias! { builder_method: account_remove_resource_preference, method_ident: NATIVE_ACCOUNT_REMOVE_RESOURCE_PREFERENCE_IDENT, instruction: CallMethod, - args: NativeAccountRemoveResourcePreferenceInput { - resource_address: (Arc
=> NativeResourceAddress), + args: NativeAccountRemoveResourcePreferenceManifestInput { + resource_address: (Arc
=> NativeDynamicResourceAddress), } }, { builder_method: account_burn, method_ident: NATIVE_ACCOUNT_BURN_IDENT, instruction: CallMethod, - args: NativeAccountBurnInput { - resource_address: (Arc
=> NativeResourceAddress), + args: NativeAccountBurnManifestInput { + resource_address: (Arc
=> NativeDynamicResourceAddress), amount: (Arc => NativeDecimal), } }, @@ -1565,8 +1567,8 @@ builder_alias! { builder_method: account_burn_non_fungibles, method_ident: NATIVE_ACCOUNT_BURN_NON_FUNGIBLES_IDENT, instruction: CallMethod, - args: NativeAccountBurnNonFungiblesInput { - resource_address: (Arc
=> NativeResourceAddress), + args: NativeAccountBurnNonFungiblesManifestInput { + resource_address: (Arc
=> NativeDynamicResourceAddress), ids: (Vec => IndexSet), } }, @@ -1574,16 +1576,16 @@ builder_alias! { builder_method: account_add_authorized_depositor, method_ident: NATIVE_ACCOUNT_ADD_AUTHORIZED_DEPOSITOR_IDENT, instruction: CallMethod, - args: NativeAccountAddAuthorizedDepositorInput { - badge: (ResourceOrNonFungible => NativeResourceOrNonFungible), + args: NativeAccountAddAuthorizedDepositorManifestInput { + badge: (ResourceOrNonFungible => NativeManifestResourceOrNonFungible), } }, { builder_method: account_remove_authorized_depositor, method_ident: NATIVE_ACCOUNT_REMOVE_AUTHORIZED_DEPOSITOR_IDENT, instruction: CallMethod, - args: NativeAccountRemoveAuthorizedDepositorInput { - badge: (ResourceOrNonFungible => NativeResourceOrNonFungible), + args: NativeAccountRemoveAuthorizedDepositorManifestInput { + badge: (ResourceOrNonFungible => NativeManifestResourceOrNonFungible), } }, // ========== @@ -1593,13 +1595,13 @@ builder_alias! { builder_method: validator_register, method_ident: NATIVE_VALIDATOR_REGISTER_IDENT, instruction: CallMethod, - args: NativeValidatorRegisterInput {} + args: NativeValidatorRegisterManifestInput {} }, { builder_method: validator_unregister, method_ident: NATIVE_VALIDATOR_UNREGISTER_IDENT, instruction: CallMethod, - args: NativeValidatorUnregisterInput {} + args: NativeValidatorUnregisterManifestInput {} }, { builder_method: validator_stake_as_owner, @@ -1637,7 +1639,7 @@ builder_alias! { builder_method: validator_update_key, method_ident: NATIVE_VALIDATOR_UPDATE_KEY_IDENT, instruction: CallMethod, - args: NativeValidatorUpdateKeyInput { + args: NativeValidatorUpdateKeyManifestInput { key: (PublicKey => NativeSecp256k1PublicKey) } }, @@ -1645,7 +1647,7 @@ builder_alias! { builder_method: validator_update_fee, method_ident: NATIVE_VALIDATOR_UPDATE_FEE_IDENT, instruction: CallMethod, - args: NativeValidatorUpdateFeeInput { + args: NativeValidatorUpdateFeeManifestInput { new_fee_factor: (Arc => NativeDecimal) } }, @@ -1653,7 +1655,7 @@ builder_alias! { builder_method: validator_update_accept_delegated_stake, method_ident: NATIVE_VALIDATOR_UPDATE_ACCEPT_DELEGATED_STAKE_IDENT, instruction: CallMethod, - args: NativeValidatorUpdateAcceptDelegatedStakeInput { + args: NativeValidatorUpdateAcceptDelegatedStakeManifestInput { accept_delegated_stake: (bool => bool) } }, @@ -1661,25 +1663,25 @@ builder_alias! { builder_method: validator_accepts_delegated_stake, method_ident: NATIVE_VALIDATOR_ACCEPTS_DELEGATED_STAKE_IDENT, instruction: CallMethod, - args: NativeValidatorAcceptsDelegatedStakeInput {} + args: NativeValidatorAcceptsDelegatedStakeManifestInput {} }, { builder_method: validator_total_stake_xrd_amount, method_ident: NATIVE_VALIDATOR_TOTAL_STAKE_XRD_AMOUNT_IDENT, instruction: CallMethod, - args: NativeValidatorTotalStakeXrdAmountInput {} + args: NativeValidatorTotalStakeXrdAmountManifestInput {} }, { builder_method: validator_total_stake_unit_supply, method_ident: NATIVE_VALIDATOR_TOTAL_STAKE_UNIT_SUPPLY_IDENT, instruction: CallMethod, - args: NativeValidatorTotalStakeUnitSupplyInput {} + args: NativeValidatorTotalStakeUnitSupplyManifestInput {} }, { builder_method: validator_get_redemption_value, method_ident: NATIVE_VALIDATOR_GET_REDEMPTION_VALUE_IDENT, instruction: CallMethod, - args: NativeValidatorGetRedemptionValueInput { + args: NativeValidatorGetRedemptionValueManifestInput { amount_of_stake_units: (Arc => NativeDecimal) } }, @@ -1687,7 +1689,7 @@ builder_alias! { builder_method: validator_signal_protocol_update_readiness, method_ident: NATIVE_VALIDATOR_SIGNAL_PROTOCOL_UPDATE_READINESS_IDENT, instruction: CallMethod, - args: NativeValidatorSignalProtocolUpdateReadinessInput { + args: NativeValidatorSignalProtocolUpdateReadinessManifestInput { vote: (String => String) } }, @@ -1695,7 +1697,7 @@ builder_alias! { builder_method: validator_get_protocol_update_readiness, method_ident: NATIVE_VALIDATOR_GET_PROTOCOL_UPDATE_READINESS_IDENT, instruction: CallMethod, - args: NativeValidatorGetProtocolUpdateReadinessInput {} + args: NativeValidatorGetProtocolUpdateReadinessManifestInput {} }, { builder_method: validator_lock_owner_stake_units, @@ -1709,7 +1711,7 @@ builder_alias! { builder_method: validator_start_unlock_owner_stake_units, method_ident: NATIVE_VALIDATOR_START_UNLOCK_OWNER_STAKE_UNITS_IDENT, instruction: CallMethod, - args: NativeValidatorStartUnlockOwnerStakeUnitsInput { + args: NativeValidatorStartUnlockOwnerStakeUnitsManifestInput { requested_stake_unit_amount: (Arc => NativeDecimal) } }, @@ -1717,7 +1719,7 @@ builder_alias! { builder_method: validator_finish_unlock_owner_stake_units, method_ident: NATIVE_VALIDATOR_FINISH_UNLOCK_OWNER_STAKE_UNITS_IDENT, instruction: CallMethod, - args: NativeValidatorFinishUnlockOwnerStakeUnitsInput {} + args: NativeValidatorFinishUnlockOwnerStakeUnitsManifestInput {} }, // ================== // Access Controller @@ -1738,13 +1740,13 @@ builder_alias! { builder_method: access_controller_create_proof, method_ident: NATIVE_ACCESS_CONTROLLER_CREATE_PROOF_IDENT, instruction: CallMethod, - args: NativeAccessControllerCreateProofInput {} + args: NativeAccessControllerCreateProofManifestInput {} }, { builder_method: access_controller_initiate_recovery_as_primary, method_ident: NATIVE_ACCESS_CONTROLLER_INITIATE_RECOVERY_AS_PRIMARY_IDENT, instruction: CallMethod, - args: NativeAccessControllerInitiateRecoveryAsPrimaryInput { + args: NativeAccessControllerInitiateRecoveryAsPrimaryManifestInput { rule_set: (RuleSet => NativeRuleSet), timed_recovery_delay_in_minutes: (Option => Option), } @@ -1753,7 +1755,7 @@ builder_alias! { builder_method: access_controller_initiate_recovery_as_recovery, method_ident: NATIVE_ACCESS_CONTROLLER_INITIATE_RECOVERY_AS_RECOVERY_IDENT, instruction: CallMethod, - args: NativeAccessControllerInitiateRecoveryAsRecoveryInput { + args: NativeAccessControllerInitiateRecoveryAsRecoveryManifestInput { rule_set: (RuleSet => NativeRuleSet), timed_recovery_delay_in_minutes: (Option => Option), } @@ -1762,19 +1764,19 @@ builder_alias! { builder_method: access_controller_initiate_badge_withdraw_as_primary, method_ident: NATIVE_ACCESS_CONTROLLER_INITIATE_BADGE_WITHDRAW_ATTEMPT_AS_PRIMARY_IDENT, instruction: CallMethod, - args: NativeAccessControllerInitiateBadgeWithdrawAttemptAsPrimaryInput {} + args: NativeAccessControllerInitiateBadgeWithdrawAttemptAsPrimaryManifestInput {} }, { builder_method: access_controller_initiate_badge_withdraw_as_recovery, method_ident: NATIVE_ACCESS_CONTROLLER_INITIATE_BADGE_WITHDRAW_ATTEMPT_AS_RECOVERY_IDENT, instruction: CallMethod, - args: NativeAccessControllerInitiateBadgeWithdrawAttemptAsRecoveryInput {} + args: NativeAccessControllerInitiateBadgeWithdrawAttemptAsRecoveryManifestInput {} }, { builder_method: access_controller_quick_confirm_primary_role_recovery_proposal, method_ident: NATIVE_ACCESS_CONTROLLER_QUICK_CONFIRM_PRIMARY_ROLE_RECOVERY_PROPOSAL_IDENT, instruction: CallMethod, - args: NativeAccessControllerQuickConfirmPrimaryRoleRecoveryProposalInput { + args: NativeAccessControllerQuickConfirmPrimaryRoleRecoveryProposalManifestInput { rule_set: (RuleSet => NativeRuleSet), timed_recovery_delay_in_minutes: (Option => Option), } @@ -1783,7 +1785,7 @@ builder_alias! { builder_method: access_controller_quick_confirm_recovery_role_recovery_proposal, method_ident: NATIVE_ACCESS_CONTROLLER_QUICK_CONFIRM_RECOVERY_ROLE_RECOVERY_PROPOSAL_IDENT, instruction: CallMethod, - args: NativeAccessControllerQuickConfirmRecoveryRoleRecoveryProposalInput { + args: NativeAccessControllerQuickConfirmRecoveryRoleRecoveryProposalManifestInput { rule_set: (RuleSet => NativeRuleSet), timed_recovery_delay_in_minutes: (Option => Option), } @@ -1792,19 +1794,19 @@ builder_alias! { builder_method: access_controller_quick_confirm_primary_role_badge_withdraw_attempt, method_ident: NATIVE_ACCESS_CONTROLLER_QUICK_CONFIRM_PRIMARY_ROLE_BADGE_WITHDRAW_ATTEMPT_IDENT, instruction: CallMethod, - args: NativeAccessControllerQuickConfirmPrimaryRoleBadgeWithdrawAttemptInput {} + args: NativeAccessControllerQuickConfirmPrimaryRoleBadgeWithdrawAttemptManifestInput {} }, { builder_method: access_controller_quick_confirm_recovery_role_badge_withdraw_attempt, method_ident: NATIVE_ACCESS_CONTROLLER_QUICK_CONFIRM_RECOVERY_ROLE_BADGE_WITHDRAW_ATTEMPT_IDENT, instruction: CallMethod, - args: NativeAccessControllerQuickConfirmRecoveryRoleBadgeWithdrawAttemptInput {} + args: NativeAccessControllerQuickConfirmRecoveryRoleBadgeWithdrawAttemptManifestInput {} }, { builder_method: access_controller_timed_confirm_recovery, method_ident: NATIVE_ACCESS_CONTROLLER_TIMED_CONFIRM_RECOVERY_IDENT, instruction: CallMethod, - args: NativeAccessControllerTimedConfirmRecoveryInput { + args: NativeAccessControllerTimedConfirmRecoveryManifestInput { rule_set: (RuleSet => NativeRuleSet), timed_recovery_delay_in_minutes: (Option => Option), } @@ -1813,43 +1815,43 @@ builder_alias! { builder_method: access_controller_cancel_primary_role_recovery_proposal, method_ident: NATIVE_ACCESS_CONTROLLER_CANCEL_PRIMARY_ROLE_RECOVERY_PROPOSAL_IDENT, instruction: CallMethod, - args: NativeAccessControllerCancelPrimaryRoleRecoveryProposalInput {} + args: NativeAccessControllerCancelPrimaryRoleRecoveryProposalManifestInput {} }, { builder_method: access_controller_cancel_recovery_role_recovery_proposal, method_ident: NATIVE_ACCESS_CONTROLLER_CANCEL_RECOVERY_ROLE_RECOVERY_PROPOSAL_IDENT, instruction: CallMethod, - args: NativeAccessControllerCancelRecoveryRoleRecoveryProposalInput {} + args: NativeAccessControllerCancelRecoveryRoleRecoveryProposalManifestInput {} }, { builder_method: access_controller_cancel_primary_role_badge_withdraw_attempt, method_ident: NATIVE_ACCESS_CONTROLLER_CANCEL_PRIMARY_ROLE_BADGE_WITHDRAW_ATTEMPT_IDENT, instruction: CallMethod, - args: NativeAccessControllerCancelPrimaryRoleBadgeWithdrawAttemptInput {} + args: NativeAccessControllerCancelPrimaryRoleBadgeWithdrawAttemptManifestInput {} }, { builder_method: access_controller_cancel_recovery_role_badge_withdraw_attempt, method_ident: NATIVE_ACCESS_CONTROLLER_CANCEL_RECOVERY_ROLE_BADGE_WITHDRAW_ATTEMPT_IDENT, instruction: CallMethod, - args: NativeAccessControllerCancelRecoveryRoleBadgeWithdrawAttemptInput {} + args: NativeAccessControllerCancelRecoveryRoleBadgeWithdrawAttemptManifestInput {} }, { builder_method: access_controller_lock_primary_role, method_ident: NATIVE_ACCESS_CONTROLLER_LOCK_PRIMARY_ROLE_IDENT, instruction: CallMethod, - args: NativeAccessControllerLockPrimaryRoleInput {} + args: NativeAccessControllerLockPrimaryRoleManifestInput {} }, { builder_method: access_controller_unlock_primary_role, method_ident: NATIVE_ACCESS_CONTROLLER_UNLOCK_PRIMARY_ROLE_IDENT, instruction: CallMethod, - args: NativeAccessControllerUnlockPrimaryRoleInput {} + args: NativeAccessControllerUnlockPrimaryRoleManifestInput {} }, { builder_method: access_controller_stop_timed_recovery, method_ident: NATIVE_ACCESS_CONTROLLER_STOP_TIMED_RECOVERY_IDENT, instruction: CallMethod, - args: NativeAccessControllerStopTimedRecoveryInput { + args: NativeAccessControllerStopTimedRecoveryManifestInput { rule_set: (RuleSet => NativeRuleSet), timed_recovery_delay_in_minutes: (Option => Option), } @@ -1858,7 +1860,7 @@ builder_alias! { builder_method: access_controller_mint_recovery_badges, method_ident: NATIVE_ACCESS_CONTROLLER_MINT_RECOVERY_BADGES_IDENT, instruction: CallMethod, - args: NativeAccessControllerMintRecoveryBadgesInput { + args: NativeAccessControllerMintRecoveryBadgesManifestInput { non_fungible_local_ids: (Vec => IndexSet), } }, @@ -1870,7 +1872,7 @@ builder_alias! { package_address: NATIVE_IDENTITY_PACKAGE, blueprint_ident: NATIVE_IDENTITY_BLUEPRINT, function_ident: NATIVE_IDENTITY_CREATE_ADVANCED_IDENT, - args: NativeIdentityCreateAdvancedInput { + args: NativeIdentityCreateAdvancedManifestInput { owner_role: (OwnerRole => NativeOwnerRole), } }, @@ -1879,13 +1881,13 @@ builder_alias! { package_address: NATIVE_IDENTITY_PACKAGE, blueprint_ident: NATIVE_IDENTITY_BLUEPRINT, function_ident: NATIVE_IDENTITY_CREATE_IDENT, - args: NativeIdentityCreateInput {} + args: NativeIdentityCreateManifestInput {} }, { builder_method: identity_securify, method_ident: NATIVE_IDENTITY_SECURIFY_IDENT, instruction: CallMethod, - args: NativeIdentitySecurifyToSingleBadgeInput {} + args: NativeIdentitySecurifyToSingleBadgeManifestInput {} }, // ======== // Package @@ -1894,7 +1896,7 @@ builder_alias! { builder_method: package_claim_royalty, method_ident: NATIVE_PACKAGE_CLAIM_ROYALTIES_IDENT, instruction: CallMethod, - args: NativePackageClaimRoyaltiesInput {} + args: NativePackageClaimRoyaltiesManifestInput {} }, // ================== // One Resource Pool @@ -1907,7 +1909,7 @@ builder_alias! { args: NativeOneResourcePoolInstantiateManifestInput { owner_role: (OwnerRole => NativeOwnerRole), pool_manager_rule: (Arc => NativeAccessRule), - resource_address: (Arc
=> NativeResourceAddress), + resource_address: (Arc
=> NativeDynamicResourceAddress), address_reservation: (Option => Option) } }, @@ -1969,7 +1971,7 @@ builder_alias! { args: NativeTwoResourcePoolInstantiateManifestInput { owner_role: (OwnerRole => NativeOwnerRole), pool_manager_rule: (Arc => NativeAccessRule), - resource_addresses: (Vec> => (NativeResourceAddress, NativeResourceAddress)), + resource_addresses: (Vec> => (NativeDynamicResourceAddress, NativeDynamicResourceAddress)), address_reservation: (Option => Option) } }, @@ -2002,7 +2004,7 @@ builder_alias! { method_ident: NATIVE_TWO_RESOURCE_POOL_PROTECTED_WITHDRAW_IDENT, instruction: CallMethod, args: NativeTwoResourcePoolProtectedWithdrawManifestInput { - resource_address: (Arc
=> NativeResourceAddress), + resource_address: (Arc
=> NativeDynamicResourceAddress), amount: (Arc => NativeDecimal), withdraw_strategy: (WithdrawStrategy => NativeWithdrawStrategy) } @@ -2032,7 +2034,7 @@ builder_alias! { args: NativeMultiResourcePoolInstantiateManifestInput { owner_role: (OwnerRole => NativeOwnerRole), pool_manager_rule: (Arc => NativeAccessRule), - resource_addresses: (Vec> => IndexSet), + resource_addresses: (Vec> => IndexSet), address_reservation: (Option => Option) } }, @@ -2065,7 +2067,7 @@ builder_alias! { method_ident: NATIVE_MULTI_RESOURCE_POOL_PROTECTED_WITHDRAW_IDENT, instruction: CallMethod, args: NativeMultiResourcePoolProtectedWithdrawManifestInput { - resource_address: (Arc
=> NativeResourceAddress), + resource_address: (Arc
=> NativeDynamicResourceAddress), amount: (Arc => NativeDecimal), withdraw_strategy: (WithdrawStrategy => NativeWithdrawStrategy) } @@ -2091,7 +2093,7 @@ builder_alias! { builder_method: metadata_set, method_ident: NATIVE_METADATA_SET_IDENT, instruction: CallMetadataMethod, - args: NativeMetadataSetInput { + args: NativeMetadataSetManifestInput { key: (String => String), value: (MetadataValue => NativeMetadataValue) } @@ -2100,7 +2102,7 @@ builder_alias! { builder_method: metadata_lock, method_ident: NATIVE_METADATA_LOCK_IDENT, instruction: CallMetadataMethod, - args: NativeMetadataLockInput { + args: NativeMetadataLockManifestInput { key: (String => String), } }, @@ -2108,7 +2110,7 @@ builder_alias! { builder_method: metadata_get, method_ident: NATIVE_METADATA_GET_IDENT, instruction: CallMetadataMethod, - args: NativeMetadataGetInput { + args: NativeMetadataGetManifestInput { key: (String => String), } }, @@ -2116,7 +2118,7 @@ builder_alias! { builder_method: metadata_remove, method_ident: NATIVE_METADATA_REMOVE_IDENT, instruction: CallMetadataMethod, - args: NativeMetadataRemoveInput { + args: NativeMetadataRemoveManifestInput { key: (String => String), } }, @@ -2127,7 +2129,7 @@ builder_alias! { builder_method: role_assignment_get, method_ident: NATIVE_ROLE_ASSIGNMENT_GET_IDENT, instruction: CallRoleAssignmentMethod, - args: NativeRoleAssignmentGetInput { + args: NativeRoleAssignmentGetManifestInput { module: (ModuleId => NativeObjectModuleId), role_key: (String => NativeRoleKey), } @@ -2136,7 +2138,7 @@ builder_alias! { builder_method: role_assignment_set, method_ident: NATIVE_ROLE_ASSIGNMENT_SET_IDENT, instruction: CallRoleAssignmentMethod, - args: NativeRoleAssignmentSetInput { + args: NativeRoleAssignmentSetManifestInput { module: (ModuleId => NativeObjectModuleId), role_key: (String => NativeRoleKey), rule: (Arc => NativeAccessRule), @@ -2146,7 +2148,7 @@ builder_alias! { builder_method: role_assignment_set_owner, method_ident: NATIVE_ROLE_ASSIGNMENT_SET_OWNER_IDENT, instruction: CallRoleAssignmentMethod, - args: NativeRoleAssignmentSetOwnerInput { + args: NativeRoleAssignmentSetOwnerManifestInput { rule: (Arc => NativeAccessRule), } }, @@ -2154,7 +2156,7 @@ builder_alias! { builder_method: role_assignment_lock_owner, method_ident: NATIVE_ROLE_ASSIGNMENT_LOCK_OWNER_IDENT, instruction: CallRoleAssignmentMethod, - args: NativeRoleAssignmentLockOwnerInput {} + args: NativeRoleAssignmentLockOwnerManifestInput {} }, // =============== // Royalty Module @@ -2163,7 +2165,7 @@ builder_alias! { builder_method: royalty_set, method_ident: NATIVE_COMPONENT_ROYALTY_SET_ROYALTY_IDENT, instruction: CallRoyaltyMethod, - args: NativeComponentRoyaltySetInput { + args: NativeComponentRoyaltySetManifestInput { method: (String => String), amount: (RoyaltyAmount => NativeRoyaltyAmount), } @@ -2172,7 +2174,7 @@ builder_alias! { builder_method: royalty_lock, method_ident: NATIVE_COMPONENT_ROYALTY_LOCK_ROYALTY_IDENT, instruction: CallRoyaltyMethod, - args: NativeComponentRoyaltyLockInput { + args: NativeComponentRoyaltyLockManifestInput { method: (String => String), } }, @@ -2180,7 +2182,7 @@ builder_alias! { builder_method: royalty_claim, method_ident: NATIVE_COMPONENT_ROYALTY_CLAIM_ROYALTIES_IDENT, instruction: CallRoyaltyMethod, - args: NativeComponentClaimRoyaltiesInput {} + args: NativeComponentClaimRoyaltiesManifestInput {} }, // =============== // Account Locker @@ -2213,7 +2215,7 @@ builder_alias! { method_ident: NATIVE_ACCOUNT_LOCKER_STORE_IDENT, instruction: CallMethod, args: NativeAccountLockerStoreManifestInput { - claimant: (Arc
=> NativeComponentAddress), + claimant: (Arc
=> NativeDynamicComponentAddress), bucket: (ManifestBuilderBucket => NativeManifestBucket), try_direct_send: (bool => bool), } @@ -2223,7 +2225,7 @@ builder_alias! { method_ident: NATIVE_ACCOUNT_LOCKER_AIRDROP_IDENT, instruction: CallMethod, args: NativeAccountLockerAirdropManifestInput { - claimants: (HashMap => IndexMap), + claimants: (HashMap => IndexMap), bucket: (ManifestBuilderBucket => NativeManifestBucket), try_direct_send: (bool => bool), } @@ -2233,8 +2235,8 @@ builder_alias! { method_ident: NATIVE_ACCOUNT_LOCKER_RECOVER_IDENT, instruction: CallMethod, args: NativeAccountLockerRecoverManifestInput { - claimant: (Arc
=> NativeComponentAddress), - resource_address: (Arc
=> NativeResourceAddress), + claimant: (Arc
=> NativeDynamicComponentAddress), + resource_address: (Arc
=> NativeDynamicResourceAddress), amount: (Arc => NativeDecimal), } }, @@ -2243,8 +2245,8 @@ builder_alias! { method_ident: NATIVE_ACCOUNT_LOCKER_RECOVER_NON_FUNGIBLES_IDENT, instruction: CallMethod, args: NativeAccountLockerRecoverNonFungiblesManifestInput { - claimant: (Arc
=> NativeComponentAddress), - resource_address: (Arc
=> NativeResourceAddress), + claimant: (Arc
=> NativeDynamicComponentAddress), + resource_address: (Arc
=> NativeDynamicResourceAddress), ids: (Vec => IndexSet), } }, @@ -2253,8 +2255,8 @@ builder_alias! { method_ident: NATIVE_ACCOUNT_LOCKER_CLAIM_IDENT, instruction: CallMethod, args: NativeAccountLockerClaimManifestInput { - claimant: (Arc
=> NativeComponentAddress), - resource_address: (Arc
=> NativeResourceAddress), + claimant: (Arc
=> NativeDynamicComponentAddress), + resource_address: (Arc
=> NativeDynamicResourceAddress), amount: (Arc => NativeDecimal), } }, @@ -2263,8 +2265,8 @@ builder_alias! { method_ident: NATIVE_ACCOUNT_LOCKER_CLAIM_NON_FUNGIBLES_IDENT, instruction: CallMethod, args: NativeAccountLockerClaimNonFungiblesManifestInput { - claimant: (Arc
=> NativeComponentAddress), - resource_address: (Arc
=> NativeResourceAddress), + claimant: (Arc
=> NativeDynamicComponentAddress), + resource_address: (Arc
=> NativeDynamicResourceAddress), ids: (Vec => IndexSet), } }, @@ -2273,8 +2275,8 @@ builder_alias! { method_ident: NATIVE_ACCOUNT_LOCKER_GET_AMOUNT_IDENT, instruction: CallMethod, args: NativeAccountLockerGetAmountManifestInput { - claimant: (Arc
=> NativeComponentAddress), - resource_address: (Arc
=> NativeResourceAddress), + claimant: (Arc
=> NativeDynamicComponentAddress), + resource_address: (Arc
=> NativeDynamicResourceAddress), } }, { @@ -2282,8 +2284,8 @@ builder_alias! { method_ident: NATIVE_ACCOUNT_LOCKER_GET_NON_FUNGIBLE_LOCAL_IDS_IDENT, instruction: CallMethod, args: NativeAccountLockerGetNonFungibleLocalIdsManifestInput { - claimant: (Arc
=> NativeComponentAddress), - resource_address: (Arc
=> NativeResourceAddress), + claimant: (Arc
=> NativeDynamicComponentAddress), + resource_address: (Arc
=> NativeDynamicResourceAddress), limit: (u32 => u32) } }, diff --git a/crates/radix-engine-toolkit-uniffi/src/builder/manifest_builder/builder_v2.rs b/crates/radix-engine-toolkit-uniffi/src/builder/manifest_builder/builder_v2.rs index 8889783e..c0237aee 100644 --- a/crates/radix-engine-toolkit-uniffi/src/builder/manifest_builder/builder_v2.rs +++ b/crates/radix-engine-toolkit-uniffi/src/builder/manifest_builder/builder_v2.rs @@ -1069,7 +1069,9 @@ impl ManifestV2Builder { method_name: NATIVE_FUNGIBLE_RESOURCE_MANAGER_MINT_IDENT .to_owned(), args: native_to_manifest_value_and_unwrap!( - &NativeFungibleResourceManagerMintInput { amount } + &NativeFungibleResourceManagerMintManifestInput { + amount + } ), }); builder.instructions.push(instruction); @@ -1453,19 +1455,19 @@ builder_alias! { package_address: NATIVE_ACCOUNT_PACKAGE, blueprint_ident: NATIVE_ACCOUNT_BLUEPRINT, function_ident: NATIVE_ACCOUNT_CREATE_IDENT, - args: NativeAccountCreateInput {} + args: NativeAccountCreateManifestInput {} }, { builder_method: account_securify, method_ident: NATIVE_ACCOUNT_SECURIFY_IDENT, instruction: CallMethod, - args: NativeAccountSecurifyInput {} + args: NativeAccountSecurifyManifestInput {} }, { builder_method: account_lock_fee, method_ident: NATIVE_ACCOUNT_LOCK_FEE_IDENT, instruction: CallMethod, - args: NativeAccountLockFeeInput { + args: NativeAccountLockFeeManifestInput { amount: (Arc => NativeDecimal) } }, @@ -1473,7 +1475,7 @@ builder_alias! { builder_method: account_lock_contingent_fee, method_ident: NATIVE_ACCOUNT_LOCK_CONTINGENT_FEE_IDENT, instruction: CallMethod, - args: NativeAccountLockContingentFeeInput { + args: NativeAccountLockContingentFeeManifestInput { amount: (Arc => NativeDecimal) } }, @@ -1491,7 +1493,7 @@ builder_alias! { instruction: CallMethod, args: NativeAccountTryDepositOrAbortManifestInput { bucket: (ManifestBuilderBucket => NativeManifestBucket), - authorized_depositor_badge: (Option => Option), + authorized_depositor_badge: (Option => Option), } }, { @@ -1500,7 +1502,7 @@ builder_alias! { instruction: CallMethod, args: NativeAccountTryDepositOrRefundManifestInput { bucket: (ManifestBuilderBucket => NativeManifestBucket), - authorized_depositor_badge: (Option => Option), + authorized_depositor_badge: (Option => Option), } }, { @@ -1517,7 +1519,7 @@ builder_alias! { instruction: CallMethod, args: NativeAccountTryDepositBatchOrAbortManifestInput { buckets: (Vec => NativeBucketBatch), - authorized_depositor_badge: (Option => Option), + authorized_depositor_badge: (Option => Option), } }, { @@ -1526,15 +1528,15 @@ builder_alias! { instruction: CallMethod, args: NativeAccountTryDepositBatchOrRefundManifestInput { buckets: (Vec => NativeBucketBatch), - authorized_depositor_badge: (Option => Option), + authorized_depositor_badge: (Option => Option), } }, { builder_method: account_withdraw, method_ident: NATIVE_ACCOUNT_WITHDRAW_IDENT, instruction: CallMethod, - args: NativeAccountWithdrawInput { - resource_address: (Arc
=> NativeResourceAddress), + args: NativeAccountWithdrawManifestInput { + resource_address: (Arc
=> NativeDynamicResourceAddress), amount: (Arc => NativeDecimal), } }, @@ -1542,8 +1544,8 @@ builder_alias! { builder_method: account_withdraw_non_fungibles, method_ident: NATIVE_ACCOUNT_WITHDRAW_NON_FUNGIBLES_IDENT, instruction: CallMethod, - args: NativeAccountWithdrawNonFungiblesInput { - resource_address: (Arc
=> NativeResourceAddress), + args: NativeAccountWithdrawNonFungiblesManifestInput { + resource_address: (Arc
=> NativeDynamicResourceAddress), ids: (Vec => IndexSet), } }, @@ -1551,9 +1553,9 @@ builder_alias! { builder_method: account_lock_fee_and_withdraw, method_ident: NATIVE_ACCOUNT_LOCK_FEE_AND_WITHDRAW_IDENT, instruction: CallMethod, - args: NativeAccountLockFeeAndWithdrawInput { + args: NativeAccountLockFeeAndWithdrawManifestInput { amount_to_lock: (Arc => NativeDecimal), - resource_address: (Arc
=> NativeResourceAddress), + resource_address: (Arc
=> NativeDynamicResourceAddress), amount: (Arc => NativeDecimal), } }, @@ -1561,9 +1563,9 @@ builder_alias! { builder_method: account_lock_fee_and_withdraw_non_fungibles, method_ident: NATIVE_ACCOUNT_LOCK_FEE_AND_WITHDRAW_NON_FUNGIBLES_IDENT, instruction: CallMethod, - args: NativeAccountLockFeeAndWithdrawNonFungiblesInput { + args: NativeAccountLockFeeAndWithdrawNonFungiblesManifestInput { amount_to_lock: (Arc => NativeDecimal), - resource_address: (Arc
=> NativeResourceAddress), + resource_address: (Arc
=> NativeDynamicResourceAddress), ids: (Vec => IndexSet), } }, @@ -1571,8 +1573,8 @@ builder_alias! { builder_method: account_create_proof_of_amount, method_ident: NATIVE_ACCOUNT_CREATE_PROOF_OF_AMOUNT_IDENT, instruction: CallMethod, - args: NativeAccountCreateProofOfAmountInput { - resource_address: (Arc
=> NativeResourceAddress), + args: NativeAccountCreateProofOfAmountManifestInput { + resource_address: (Arc
=> NativeDynamicResourceAddress), amount: (Arc => NativeDecimal), } }, @@ -1580,8 +1582,8 @@ builder_alias! { builder_method: account_create_proof_of_non_fungibles, method_ident: NATIVE_ACCOUNT_CREATE_PROOF_OF_NON_FUNGIBLES_IDENT, instruction: CallMethod, - args: NativeAccountCreateProofOfNonFungiblesInput { - resource_address: (Arc
=> NativeResourceAddress), + args: NativeAccountCreateProofOfNonFungiblesManifestInput { + resource_address: (Arc
=> NativeDynamicResourceAddress), ids: (Vec => IndexSet), } }, @@ -1589,7 +1591,7 @@ builder_alias! { builder_method: account_set_default_deposit_rule, method_ident: NATIVE_ACCOUNT_SET_DEFAULT_DEPOSIT_RULE_IDENT, instruction: CallMethod, - args: NativeAccountSetDefaultDepositRuleInput { + args: NativeAccountSetDefaultDepositRuleManifestInput { default as default_deposit_rule: (AccountDefaultDepositRule => NativeDefaultDepositRule), } }, @@ -1597,8 +1599,8 @@ builder_alias! { builder_method: account_set_resource_preference, method_ident: NATIVE_ACCOUNT_SET_RESOURCE_PREFERENCE_IDENT, instruction: CallMethod, - args: NativeAccountSetResourcePreferenceInput { - resource_address: (Arc
=> NativeResourceAddress), + args: NativeAccountSetResourcePreferenceManifestInput { + resource_address: (Arc
=> NativeDynamicResourceAddress), resource_preference: (ResourcePreference => NativeResourcePreference), } }, @@ -1606,16 +1608,16 @@ builder_alias! { builder_method: account_remove_resource_preference, method_ident: NATIVE_ACCOUNT_REMOVE_RESOURCE_PREFERENCE_IDENT, instruction: CallMethod, - args: NativeAccountRemoveResourcePreferenceInput { - resource_address: (Arc
=> NativeResourceAddress), + args: NativeAccountRemoveResourcePreferenceManifestInput { + resource_address: (Arc
=> NativeDynamicResourceAddress), } }, { builder_method: account_burn, method_ident: NATIVE_ACCOUNT_BURN_IDENT, instruction: CallMethod, - args: NativeAccountBurnInput { - resource_address: (Arc
=> NativeResourceAddress), + args: NativeAccountBurnManifestInput { + resource_address: (Arc
=> NativeDynamicResourceAddress), amount: (Arc => NativeDecimal), } }, @@ -1623,8 +1625,8 @@ builder_alias! { builder_method: account_burn_non_fungibles, method_ident: NATIVE_ACCOUNT_BURN_NON_FUNGIBLES_IDENT, instruction: CallMethod, - args: NativeAccountBurnNonFungiblesInput { - resource_address: (Arc
=> NativeResourceAddress), + args: NativeAccountBurnNonFungiblesManifestInput { + resource_address: (Arc
=> NativeDynamicResourceAddress), ids: (Vec => IndexSet), } }, @@ -1632,16 +1634,16 @@ builder_alias! { builder_method: account_add_authorized_depositor, method_ident: NATIVE_ACCOUNT_ADD_AUTHORIZED_DEPOSITOR_IDENT, instruction: CallMethod, - args: NativeAccountAddAuthorizedDepositorInput { - badge: (ResourceOrNonFungible => NativeResourceOrNonFungible), + args: NativeAccountAddAuthorizedDepositorManifestInput { + badge: (ResourceOrNonFungible => NativeManifestResourceOrNonFungible), } }, { builder_method: account_remove_authorized_depositor, method_ident: NATIVE_ACCOUNT_REMOVE_AUTHORIZED_DEPOSITOR_IDENT, instruction: CallMethod, - args: NativeAccountRemoveAuthorizedDepositorInput { - badge: (ResourceOrNonFungible => NativeResourceOrNonFungible), + args: NativeAccountRemoveAuthorizedDepositorManifestInput { + badge: (ResourceOrNonFungible => NativeManifestResourceOrNonFungible), } }, // ========== @@ -1651,13 +1653,13 @@ builder_alias! { builder_method: validator_register, method_ident: NATIVE_VALIDATOR_REGISTER_IDENT, instruction: CallMethod, - args: NativeValidatorRegisterInput {} + args: NativeValidatorRegisterManifestInput {} }, { builder_method: validator_unregister, method_ident: NATIVE_VALIDATOR_UNREGISTER_IDENT, instruction: CallMethod, - args: NativeValidatorUnregisterInput {} + args: NativeValidatorUnregisterManifestInput {} }, { builder_method: validator_stake_as_owner, @@ -1695,7 +1697,7 @@ builder_alias! { builder_method: validator_update_key, method_ident: NATIVE_VALIDATOR_UPDATE_KEY_IDENT, instruction: CallMethod, - args: NativeValidatorUpdateKeyInput { + args: NativeValidatorUpdateKeyManifestInput { key: (PublicKey => NativeSecp256k1PublicKey) } }, @@ -1703,7 +1705,7 @@ builder_alias! { builder_method: validator_update_fee, method_ident: NATIVE_VALIDATOR_UPDATE_FEE_IDENT, instruction: CallMethod, - args: NativeValidatorUpdateFeeInput { + args: NativeValidatorUpdateFeeManifestInput { new_fee_factor: (Arc => NativeDecimal) } }, @@ -1711,7 +1713,7 @@ builder_alias! { builder_method: validator_update_accept_delegated_stake, method_ident: NATIVE_VALIDATOR_UPDATE_ACCEPT_DELEGATED_STAKE_IDENT, instruction: CallMethod, - args: NativeValidatorUpdateAcceptDelegatedStakeInput { + args: NativeValidatorUpdateAcceptDelegatedStakeManifestInput { accept_delegated_stake: (bool => bool) } }, @@ -1719,25 +1721,25 @@ builder_alias! { builder_method: validator_accepts_delegated_stake, method_ident: NATIVE_VALIDATOR_ACCEPTS_DELEGATED_STAKE_IDENT, instruction: CallMethod, - args: NativeValidatorAcceptsDelegatedStakeInput {} + args: NativeValidatorAcceptsDelegatedStakeManifestInput {} }, { builder_method: validator_total_stake_xrd_amount, method_ident: NATIVE_VALIDATOR_TOTAL_STAKE_XRD_AMOUNT_IDENT, instruction: CallMethod, - args: NativeValidatorTotalStakeXrdAmountInput {} + args: NativeValidatorTotalStakeXrdAmountManifestInput {} }, { builder_method: validator_total_stake_unit_supply, method_ident: NATIVE_VALIDATOR_TOTAL_STAKE_UNIT_SUPPLY_IDENT, instruction: CallMethod, - args: NativeValidatorTotalStakeUnitSupplyInput {} + args: NativeValidatorTotalStakeUnitSupplyManifestInput {} }, { builder_method: validator_get_redemption_value, method_ident: NATIVE_VALIDATOR_GET_REDEMPTION_VALUE_IDENT, instruction: CallMethod, - args: NativeValidatorGetRedemptionValueInput { + args: NativeValidatorGetRedemptionValueManifestInput { amount_of_stake_units: (Arc => NativeDecimal) } }, @@ -1745,7 +1747,7 @@ builder_alias! { builder_method: validator_signal_protocol_update_readiness, method_ident: NATIVE_VALIDATOR_SIGNAL_PROTOCOL_UPDATE_READINESS_IDENT, instruction: CallMethod, - args: NativeValidatorSignalProtocolUpdateReadinessInput { + args: NativeValidatorSignalProtocolUpdateReadinessManifestInput { vote: (String => String) } }, @@ -1753,7 +1755,7 @@ builder_alias! { builder_method: validator_get_protocol_update_readiness, method_ident: NATIVE_VALIDATOR_GET_PROTOCOL_UPDATE_READINESS_IDENT, instruction: CallMethod, - args: NativeValidatorGetProtocolUpdateReadinessInput {} + args: NativeValidatorGetProtocolUpdateReadinessManifestInput {} }, { builder_method: validator_lock_owner_stake_units, @@ -1767,7 +1769,7 @@ builder_alias! { builder_method: validator_start_unlock_owner_stake_units, method_ident: NATIVE_VALIDATOR_START_UNLOCK_OWNER_STAKE_UNITS_IDENT, instruction: CallMethod, - args: NativeValidatorStartUnlockOwnerStakeUnitsInput { + args: NativeValidatorStartUnlockOwnerStakeUnitsManifestInput { requested_stake_unit_amount: (Arc => NativeDecimal) } }, @@ -1775,7 +1777,7 @@ builder_alias! { builder_method: validator_finish_unlock_owner_stake_units, method_ident: NATIVE_VALIDATOR_FINISH_UNLOCK_OWNER_STAKE_UNITS_IDENT, instruction: CallMethod, - args: NativeValidatorFinishUnlockOwnerStakeUnitsInput {} + args: NativeValidatorFinishUnlockOwnerStakeUnitsManifestInput {} }, // ================== // Access Controller @@ -1796,13 +1798,13 @@ builder_alias! { builder_method: access_controller_create_proof, method_ident: NATIVE_ACCESS_CONTROLLER_CREATE_PROOF_IDENT, instruction: CallMethod, - args: NativeAccessControllerCreateProofInput {} + args: NativeAccessControllerCreateProofManifestInput {} }, { builder_method: access_controller_initiate_recovery_as_primary, method_ident: NATIVE_ACCESS_CONTROLLER_INITIATE_RECOVERY_AS_PRIMARY_IDENT, instruction: CallMethod, - args: NativeAccessControllerInitiateRecoveryAsPrimaryInput { + args: NativeAccessControllerInitiateRecoveryAsPrimaryManifestInput { rule_set: (RuleSet => NativeRuleSet), timed_recovery_delay_in_minutes: (Option => Option), } @@ -1811,7 +1813,7 @@ builder_alias! { builder_method: access_controller_initiate_recovery_as_recovery, method_ident: NATIVE_ACCESS_CONTROLLER_INITIATE_RECOVERY_AS_RECOVERY_IDENT, instruction: CallMethod, - args: NativeAccessControllerInitiateRecoveryAsRecoveryInput { + args: NativeAccessControllerInitiateRecoveryAsRecoveryManifestInput { rule_set: (RuleSet => NativeRuleSet), timed_recovery_delay_in_minutes: (Option => Option), } @@ -1820,19 +1822,19 @@ builder_alias! { builder_method: access_controller_initiate_badge_withdraw_as_primary, method_ident: NATIVE_ACCESS_CONTROLLER_INITIATE_BADGE_WITHDRAW_ATTEMPT_AS_PRIMARY_IDENT, instruction: CallMethod, - args: NativeAccessControllerInitiateBadgeWithdrawAttemptAsPrimaryInput {} + args: NativeAccessControllerInitiateBadgeWithdrawAttemptAsPrimaryManifestInput {} }, { builder_method: access_controller_initiate_badge_withdraw_as_recovery, method_ident: NATIVE_ACCESS_CONTROLLER_INITIATE_BADGE_WITHDRAW_ATTEMPT_AS_RECOVERY_IDENT, instruction: CallMethod, - args: NativeAccessControllerInitiateBadgeWithdrawAttemptAsRecoveryInput {} + args: NativeAccessControllerInitiateBadgeWithdrawAttemptAsRecoveryManifestInput {} }, { builder_method: access_controller_quick_confirm_primary_role_recovery_proposal, method_ident: NATIVE_ACCESS_CONTROLLER_QUICK_CONFIRM_PRIMARY_ROLE_RECOVERY_PROPOSAL_IDENT, instruction: CallMethod, - args: NativeAccessControllerQuickConfirmPrimaryRoleRecoveryProposalInput { + args: NativeAccessControllerQuickConfirmPrimaryRoleRecoveryProposalManifestInput { rule_set: (RuleSet => NativeRuleSet), timed_recovery_delay_in_minutes: (Option => Option), } @@ -1841,7 +1843,7 @@ builder_alias! { builder_method: access_controller_quick_confirm_recovery_role_recovery_proposal, method_ident: NATIVE_ACCESS_CONTROLLER_QUICK_CONFIRM_RECOVERY_ROLE_RECOVERY_PROPOSAL_IDENT, instruction: CallMethod, - args: NativeAccessControllerQuickConfirmRecoveryRoleRecoveryProposalInput { + args: NativeAccessControllerQuickConfirmRecoveryRoleRecoveryProposalManifestInput { rule_set: (RuleSet => NativeRuleSet), timed_recovery_delay_in_minutes: (Option => Option), } @@ -1850,19 +1852,19 @@ builder_alias! { builder_method: access_controller_quick_confirm_primary_role_badge_withdraw_attempt, method_ident: NATIVE_ACCESS_CONTROLLER_QUICK_CONFIRM_PRIMARY_ROLE_BADGE_WITHDRAW_ATTEMPT_IDENT, instruction: CallMethod, - args: NativeAccessControllerQuickConfirmPrimaryRoleBadgeWithdrawAttemptInput {} + args: NativeAccessControllerQuickConfirmPrimaryRoleBadgeWithdrawAttemptManifestInput {} }, { builder_method: access_controller_quick_confirm_recovery_role_badge_withdraw_attempt, method_ident: NATIVE_ACCESS_CONTROLLER_QUICK_CONFIRM_RECOVERY_ROLE_BADGE_WITHDRAW_ATTEMPT_IDENT, instruction: CallMethod, - args: NativeAccessControllerQuickConfirmRecoveryRoleBadgeWithdrawAttemptInput {} + args: NativeAccessControllerQuickConfirmRecoveryRoleBadgeWithdrawAttemptManifestInput {} }, { builder_method: access_controller_timed_confirm_recovery, method_ident: NATIVE_ACCESS_CONTROLLER_TIMED_CONFIRM_RECOVERY_IDENT, instruction: CallMethod, - args: NativeAccessControllerTimedConfirmRecoveryInput { + args: NativeAccessControllerTimedConfirmRecoveryManifestInput { rule_set: (RuleSet => NativeRuleSet), timed_recovery_delay_in_minutes: (Option => Option), } @@ -1871,43 +1873,43 @@ builder_alias! { builder_method: access_controller_cancel_primary_role_recovery_proposal, method_ident: NATIVE_ACCESS_CONTROLLER_CANCEL_PRIMARY_ROLE_RECOVERY_PROPOSAL_IDENT, instruction: CallMethod, - args: NativeAccessControllerCancelPrimaryRoleRecoveryProposalInput {} + args: NativeAccessControllerCancelPrimaryRoleRecoveryProposalManifestInput {} }, { builder_method: access_controller_cancel_recovery_role_recovery_proposal, method_ident: NATIVE_ACCESS_CONTROLLER_CANCEL_RECOVERY_ROLE_RECOVERY_PROPOSAL_IDENT, instruction: CallMethod, - args: NativeAccessControllerCancelRecoveryRoleRecoveryProposalInput {} + args: NativeAccessControllerCancelRecoveryRoleRecoveryProposalManifestInput {} }, { builder_method: access_controller_cancel_primary_role_badge_withdraw_attempt, method_ident: NATIVE_ACCESS_CONTROLLER_CANCEL_PRIMARY_ROLE_BADGE_WITHDRAW_ATTEMPT_IDENT, instruction: CallMethod, - args: NativeAccessControllerCancelPrimaryRoleBadgeWithdrawAttemptInput {} + args: NativeAccessControllerCancelPrimaryRoleBadgeWithdrawAttemptManifestInput {} }, { builder_method: access_controller_cancel_recovery_role_badge_withdraw_attempt, method_ident: NATIVE_ACCESS_CONTROLLER_CANCEL_RECOVERY_ROLE_BADGE_WITHDRAW_ATTEMPT_IDENT, instruction: CallMethod, - args: NativeAccessControllerCancelRecoveryRoleBadgeWithdrawAttemptInput {} + args: NativeAccessControllerCancelRecoveryRoleBadgeWithdrawAttemptManifestInput {} }, { builder_method: access_controller_lock_primary_role, method_ident: NATIVE_ACCESS_CONTROLLER_LOCK_PRIMARY_ROLE_IDENT, instruction: CallMethod, - args: NativeAccessControllerLockPrimaryRoleInput {} + args: NativeAccessControllerLockPrimaryRoleManifestInput {} }, { builder_method: access_controller_unlock_primary_role, method_ident: NATIVE_ACCESS_CONTROLLER_UNLOCK_PRIMARY_ROLE_IDENT, instruction: CallMethod, - args: NativeAccessControllerUnlockPrimaryRoleInput {} + args: NativeAccessControllerUnlockPrimaryRoleManifestInput {} }, { builder_method: access_controller_stop_timed_recovery, method_ident: NATIVE_ACCESS_CONTROLLER_STOP_TIMED_RECOVERY_IDENT, instruction: CallMethod, - args: NativeAccessControllerStopTimedRecoveryInput { + args: NativeAccessControllerStopTimedRecoveryManifestInput { rule_set: (RuleSet => NativeRuleSet), timed_recovery_delay_in_minutes: (Option => Option), } @@ -1916,7 +1918,7 @@ builder_alias! { builder_method: access_controller_mint_recovery_badges, method_ident: NATIVE_ACCESS_CONTROLLER_MINT_RECOVERY_BADGES_IDENT, instruction: CallMethod, - args: NativeAccessControllerMintRecoveryBadgesInput { + args: NativeAccessControllerMintRecoveryBadgesManifestInput { non_fungible_local_ids: (Vec => IndexSet), } }, @@ -1928,7 +1930,7 @@ builder_alias! { package_address: NATIVE_IDENTITY_PACKAGE, blueprint_ident: NATIVE_IDENTITY_BLUEPRINT, function_ident: NATIVE_IDENTITY_CREATE_ADVANCED_IDENT, - args: NativeIdentityCreateAdvancedInput { + args: NativeIdentityCreateAdvancedManifestInput { owner_role: (OwnerRole => NativeOwnerRole), } }, @@ -1937,13 +1939,13 @@ builder_alias! { package_address: NATIVE_IDENTITY_PACKAGE, blueprint_ident: NATIVE_IDENTITY_BLUEPRINT, function_ident: NATIVE_IDENTITY_CREATE_IDENT, - args: NativeIdentityCreateInput {} + args: NativeIdentityCreateManifestInput {} }, { builder_method: identity_securify, method_ident: NATIVE_IDENTITY_SECURIFY_IDENT, instruction: CallMethod, - args: NativeIdentitySecurifyToSingleBadgeInput {} + args: NativeIdentitySecurifyToSingleBadgeManifestInput {} }, // ======== // Package @@ -1952,7 +1954,7 @@ builder_alias! { builder_method: package_claim_royalty, method_ident: NATIVE_PACKAGE_CLAIM_ROYALTIES_IDENT, instruction: CallMethod, - args: NativePackageClaimRoyaltiesInput {} + args: NativePackageClaimRoyaltiesManifestInput {} }, // ================== // One Resource Pool @@ -1965,7 +1967,7 @@ builder_alias! { args: NativeOneResourcePoolInstantiateManifestInput { owner_role: (OwnerRole => NativeOwnerRole), pool_manager_rule: (Arc => NativeAccessRule), - resource_address: (Arc
=> NativeResourceAddress), + resource_address: (Arc
=> NativeDynamicResourceAddress), address_reservation: (Option => Option) } }, @@ -2027,7 +2029,7 @@ builder_alias! { args: NativeTwoResourcePoolInstantiateManifestInput { owner_role: (OwnerRole => NativeOwnerRole), pool_manager_rule: (Arc => NativeAccessRule), - resource_addresses: (Vec> => (NativeResourceAddress, NativeResourceAddress)), + resource_addresses: (Vec> => (NativeDynamicResourceAddress, NativeDynamicResourceAddress)), address_reservation: (Option => Option) } }, @@ -2060,7 +2062,7 @@ builder_alias! { method_ident: NATIVE_TWO_RESOURCE_POOL_PROTECTED_WITHDRAW_IDENT, instruction: CallMethod, args: NativeTwoResourcePoolProtectedWithdrawManifestInput { - resource_address: (Arc
=> NativeResourceAddress), + resource_address: (Arc
=> NativeDynamicResourceAddress), amount: (Arc => NativeDecimal), withdraw_strategy: (WithdrawStrategy => NativeWithdrawStrategy) } @@ -2090,7 +2092,7 @@ builder_alias! { args: NativeMultiResourcePoolInstantiateManifestInput { owner_role: (OwnerRole => NativeOwnerRole), pool_manager_rule: (Arc => NativeAccessRule), - resource_addresses: (Vec> => IndexSet), + resource_addresses: (Vec> => IndexSet), address_reservation: (Option => Option) } }, @@ -2123,7 +2125,7 @@ builder_alias! { method_ident: NATIVE_MULTI_RESOURCE_POOL_PROTECTED_WITHDRAW_IDENT, instruction: CallMethod, args: NativeMultiResourcePoolProtectedWithdrawManifestInput { - resource_address: (Arc
=> NativeResourceAddress), + resource_address: (Arc
=> NativeDynamicResourceAddress), amount: (Arc => NativeDecimal), withdraw_strategy: (WithdrawStrategy => NativeWithdrawStrategy) } @@ -2149,7 +2151,7 @@ builder_alias! { builder_method: metadata_set, method_ident: NATIVE_METADATA_SET_IDENT, instruction: CallMetadataMethod, - args: NativeMetadataSetInput { + args: NativeMetadataSetManifestInput { key: (String => String), value: (MetadataValue => NativeMetadataValue) } @@ -2158,7 +2160,7 @@ builder_alias! { builder_method: metadata_lock, method_ident: NATIVE_METADATA_LOCK_IDENT, instruction: CallMetadataMethod, - args: NativeMetadataLockInput { + args: NativeMetadataLockManifestInput { key: (String => String), } }, @@ -2166,7 +2168,7 @@ builder_alias! { builder_method: metadata_get, method_ident: NATIVE_METADATA_GET_IDENT, instruction: CallMetadataMethod, - args: NativeMetadataGetInput { + args: NativeMetadataGetManifestInput { key: (String => String), } }, @@ -2174,7 +2176,7 @@ builder_alias! { builder_method: metadata_remove, method_ident: NATIVE_METADATA_REMOVE_IDENT, instruction: CallMetadataMethod, - args: NativeMetadataRemoveInput { + args: NativeMetadataRemoveManifestInput { key: (String => String), } }, @@ -2185,7 +2187,7 @@ builder_alias! { builder_method: role_assignment_get, method_ident: NATIVE_ROLE_ASSIGNMENT_GET_IDENT, instruction: CallRoleAssignmentMethod, - args: NativeRoleAssignmentGetInput { + args: NativeRoleAssignmentGetManifestInput { module: (ModuleId => NativeObjectModuleId), role_key: (String => NativeRoleKey), } @@ -2194,7 +2196,7 @@ builder_alias! { builder_method: role_assignment_set, method_ident: NATIVE_ROLE_ASSIGNMENT_SET_IDENT, instruction: CallRoleAssignmentMethod, - args: NativeRoleAssignmentSetInput { + args: NativeRoleAssignmentSetManifestInput { module: (ModuleId => NativeObjectModuleId), role_key: (String => NativeRoleKey), rule: (Arc => NativeAccessRule), @@ -2204,7 +2206,7 @@ builder_alias! { builder_method: role_assignment_set_owner, method_ident: NATIVE_ROLE_ASSIGNMENT_SET_OWNER_IDENT, instruction: CallRoleAssignmentMethod, - args: NativeRoleAssignmentSetOwnerInput { + args: NativeRoleAssignmentSetOwnerManifestInput { rule: (Arc => NativeAccessRule), } }, @@ -2212,7 +2214,7 @@ builder_alias! { builder_method: role_assignment_lock_owner, method_ident: NATIVE_ROLE_ASSIGNMENT_LOCK_OWNER_IDENT, instruction: CallRoleAssignmentMethod, - args: NativeRoleAssignmentLockOwnerInput {} + args: NativeRoleAssignmentLockOwnerManifestInput {} }, // =============== // Royalty Module @@ -2221,7 +2223,7 @@ builder_alias! { builder_method: royalty_set, method_ident: NATIVE_COMPONENT_ROYALTY_SET_ROYALTY_IDENT, instruction: CallRoyaltyMethod, - args: NativeComponentRoyaltySetInput { + args: NativeComponentRoyaltySetManifestInput { method: (String => String), amount: (RoyaltyAmount => NativeRoyaltyAmount), } @@ -2230,7 +2232,7 @@ builder_alias! { builder_method: royalty_lock, method_ident: NATIVE_COMPONENT_ROYALTY_LOCK_ROYALTY_IDENT, instruction: CallRoyaltyMethod, - args: NativeComponentRoyaltyLockInput { + args: NativeComponentRoyaltyLockManifestInput { method: (String => String), } }, @@ -2238,7 +2240,7 @@ builder_alias! { builder_method: royalty_claim, method_ident: NATIVE_COMPONENT_ROYALTY_CLAIM_ROYALTIES_IDENT, instruction: CallRoyaltyMethod, - args: NativeComponentClaimRoyaltiesInput {} + args: NativeComponentClaimRoyaltiesManifestInput {} }, // =============== // Account Locker @@ -2271,7 +2273,7 @@ builder_alias! { method_ident: NATIVE_ACCOUNT_LOCKER_STORE_IDENT, instruction: CallMethod, args: NativeAccountLockerStoreManifestInput { - claimant: (Arc
=> NativeComponentAddress), + claimant: (Arc
=> NativeDynamicComponentAddress), bucket: (ManifestBuilderBucket => NativeManifestBucket), try_direct_send: (bool => bool), } @@ -2281,7 +2283,7 @@ builder_alias! { method_ident: NATIVE_ACCOUNT_LOCKER_AIRDROP_IDENT, instruction: CallMethod, args: NativeAccountLockerAirdropManifestInput { - claimants: (HashMap => IndexMap), + claimants: (HashMap => IndexMap), bucket: (ManifestBuilderBucket => NativeManifestBucket), try_direct_send: (bool => bool), } @@ -2291,8 +2293,8 @@ builder_alias! { method_ident: NATIVE_ACCOUNT_LOCKER_RECOVER_IDENT, instruction: CallMethod, args: NativeAccountLockerRecoverManifestInput { - claimant: (Arc
=> NativeComponentAddress), - resource_address: (Arc
=> NativeResourceAddress), + claimant: (Arc
=> NativeDynamicComponentAddress), + resource_address: (Arc
=> NativeDynamicResourceAddress), amount: (Arc => NativeDecimal), } }, @@ -2301,8 +2303,8 @@ builder_alias! { method_ident: NATIVE_ACCOUNT_LOCKER_RECOVER_NON_FUNGIBLES_IDENT, instruction: CallMethod, args: NativeAccountLockerRecoverNonFungiblesManifestInput { - claimant: (Arc
=> NativeComponentAddress), - resource_address: (Arc
=> NativeResourceAddress), + claimant: (Arc
=> NativeDynamicComponentAddress), + resource_address: (Arc
=> NativeDynamicResourceAddress), ids: (Vec => IndexSet), } }, @@ -2311,8 +2313,8 @@ builder_alias! { method_ident: NATIVE_ACCOUNT_LOCKER_CLAIM_IDENT, instruction: CallMethod, args: NativeAccountLockerClaimManifestInput { - claimant: (Arc
=> NativeComponentAddress), - resource_address: (Arc
=> NativeResourceAddress), + claimant: (Arc
=> NativeDynamicComponentAddress), + resource_address: (Arc
=> NativeDynamicResourceAddress), amount: (Arc => NativeDecimal), } }, @@ -2321,8 +2323,8 @@ builder_alias! { method_ident: NATIVE_ACCOUNT_LOCKER_CLAIM_NON_FUNGIBLES_IDENT, instruction: CallMethod, args: NativeAccountLockerClaimNonFungiblesManifestInput { - claimant: (Arc
=> NativeComponentAddress), - resource_address: (Arc
=> NativeResourceAddress), + claimant: (Arc
=> NativeDynamicComponentAddress), + resource_address: (Arc
=> NativeDynamicResourceAddress), ids: (Vec => IndexSet), } }, @@ -2331,8 +2333,8 @@ builder_alias! { method_ident: NATIVE_ACCOUNT_LOCKER_GET_AMOUNT_IDENT, instruction: CallMethod, args: NativeAccountLockerGetAmountManifestInput { - claimant: (Arc
=> NativeComponentAddress), - resource_address: (Arc
=> NativeResourceAddress), + claimant: (Arc
=> NativeDynamicComponentAddress), + resource_address: (Arc
=> NativeDynamicResourceAddress), } }, { @@ -2340,8 +2342,8 @@ builder_alias! { method_ident: NATIVE_ACCOUNT_LOCKER_GET_NON_FUNGIBLE_LOCAL_IDS_IDENT, instruction: CallMethod, args: NativeAccountLockerGetNonFungibleLocalIdsManifestInput { - claimant: (Arc
=> NativeComponentAddress), - resource_address: (Arc
=> NativeResourceAddress), + claimant: (Arc
=> NativeDynamicComponentAddress), + resource_address: (Arc
=> NativeDynamicResourceAddress), limit: (u32 => u32) } }, diff --git a/crates/radix-engine-toolkit-uniffi/src/builder/manifest_builder/traits.rs b/crates/radix-engine-toolkit-uniffi/src/builder/manifest_builder/traits.rs index 9a7b4104..4ef44113 100644 --- a/crates/radix-engine-toolkit-uniffi/src/builder/manifest_builder/traits.rs +++ b/crates/radix-engine-toolkit-uniffi/src/builder/manifest_builder/traits.rs @@ -217,6 +217,10 @@ impl_from_with_name_record_for_address_from_arc_address![ NativeResourceAddress, NativeComponentAddress, NativePackageAddress, + NativeDynamicGlobalAddress, + NativeDynamicResourceAddress, + NativeDynamicComponentAddress, + NativeDynamicPackageAddress, ]; macro_rules! impl_from_with_name_record_for_address_from_string { @@ -239,6 +243,10 @@ impl_from_with_name_record_for_address_from_string![ NativeResourceAddress, NativeComponentAddress, NativePackageAddress, + NativeDynamicGlobalAddress, + NativeDynamicResourceAddress, + NativeDynamicComponentAddress, + NativeDynamicPackageAddress, ]; impl FromWithNameRecordContext for NativeManifestBucket { @@ -323,6 +331,23 @@ impl FromWithNameRecordContext } } +impl FromWithNameRecordContext + for NativeManifestResourceOrNonFungible +{ + fn from(item: ResourceOrNonFungible, _: &NameRecord) -> Result { + match item { + ResourceOrNonFungible::Resource { value } => (*value) + .try_into() + .map(NativeManifestResourceOrNonFungible::Resource), + ResourceOrNonFungible::NonFungible { value } => { + Ok(NativeManifestResourceOrNonFungible::NonFungible( + value.0.clone(), + )) + } + } + } +} + impl FromWithNameRecordContext for NativeOwnerRole { fn from(item: OwnerRole, _: &NameRecord) -> Result { item.to_native() diff --git a/crates/radix-engine-toolkit-uniffi/src/common/access_rules.rs b/crates/radix-engine-toolkit-uniffi/src/common/access_rules.rs index 91fb0473..98d0fe1c 100644 --- a/crates/radix-engine-toolkit-uniffi/src/common/access_rules.rs +++ b/crates/radix-engine-toolkit-uniffi/src/common/access_rules.rs @@ -178,8 +178,6 @@ impl ToNative for ResourceOrNonFungible { fn to_native(self) -> Result { match self { - // Self::Resource { value } => - // value.try_into().map(Self::Native::Resource), Self::Resource { value } => { (*value).try_into().map(Self::Native::Resource) } diff --git a/crates/radix-engine-toolkit-uniffi/src/common/address.rs b/crates/radix-engine-toolkit-uniffi/src/common/address.rs index b9a2168e..91171c37 100644 --- a/crates/radix-engine-toolkit-uniffi/src/common/address.rs +++ b/crates/radix-engine-toolkit-uniffi/src/common/address.rs @@ -241,3 +241,35 @@ impl TryFrom
for NativeGlobalAddress { value.0.try_into().map_err(Into::into) } } + +impl TryFrom
for NativeDynamicResourceAddress { + type Error = RadixEngineToolkitError; + + fn try_from(value: Address) -> Result { + value.0.try_into().map_err(Into::into).map(Self::Static) + } +} + +impl TryFrom
for NativeDynamicComponentAddress { + type Error = RadixEngineToolkitError; + + fn try_from(value: Address) -> Result { + value.0.try_into().map_err(Into::into).map(Self::Static) + } +} + +impl TryFrom
for NativeDynamicPackageAddress { + type Error = RadixEngineToolkitError; + + fn try_from(value: Address) -> Result { + value.0.try_into().map_err(Into::into).map(Self::Static) + } +} + +impl TryFrom
for NativeDynamicGlobalAddress { + type Error = RadixEngineToolkitError; + + fn try_from(value: Address) -> Result { + value.0.try_into().map_err(Into::into).map(Self::Static) + } +} diff --git a/crates/radix-engine-toolkit-uniffi/src/internal_prelude.rs b/crates/radix-engine-toolkit-uniffi/src/internal_prelude.rs index d95ffa0a..ec3e066d 100644 --- a/crates/radix-engine-toolkit-uniffi/src/internal_prelude.rs +++ b/crates/radix-engine-toolkit-uniffi/src/internal_prelude.rs @@ -62,6 +62,7 @@ mod core { to_payload_bytes as core_transaction_v1_manifest_to_payload_bytes, from_payload_bytes as core_transaction_v1_manifest_from_payload_bytes, statically_validate as core_transaction_v1_manifest_statically_validate, + classify as core_transaction_v1_manifest_classify, statically_analyze as core_transaction_v1_manifest_statically_analyze, dynamically_analyze as core_transaction_v1_manifest_dynamically_analyze, }; @@ -89,6 +90,7 @@ mod core { pub use radix_engine_toolkit::functions::transaction_v2::transaction_manifest::{ to_payload_bytes as core_transaction_v2_transaction_manifest_to_payload_bytes, from_payload_bytes as core_transaction_v2_transaction_manifest_from_payload_bytes, + classify as core_transaction_v2_transaction_manifest_classify, statically_analyze as core_transaction_v2_transaction_manifest_statically_analyze, dynamically_analyze as core_transaction_v2_transaction_manifest_dynamically_analyze, statically_validate as core_transaction_v2_transaction_manifest_statically_validate, @@ -415,6 +417,7 @@ mod native { CheckedUrl as NativeCheckedUrl, ResourceOrNonFungible as NativeResourceOrNonFungible, + ManifestResourceOrNonFungible as NativeManifestResourceOrNonFungible, ResourceOrNonFungibleList as NativeResourceOrNonFungibleList, BasicRequirement as NativeBasicRequirement, AccessRule as NativeAccessRule, @@ -484,9 +487,6 @@ mod native { TransactionHeaderV2 as NativeTransactionHeaderV2, DecryptorsByCurveV2 as NativeDecryptorsByCurveV2, EncryptedMessageV2 as NativeEncryptedMessageV2, - - DynamicGlobalAddress as NativeDynamicGlobalAddress, - DynamicPackageAddress as NativeDynamicPackageAddress, MessageV1 as NativeMessageV1, AesGcmPayload as NativeAesGcmPayload, @@ -567,6 +567,10 @@ mod native { ScryptoCustomSchema as NativeScryptoCustomSchema, SCRYPTO_SBOR_V1_PAYLOAD_PREFIX as NATIVE_SCRYPTO_SBOR_V1_PAYLOAD_PREFIX, MANIFEST_SBOR_V1_PAYLOAD_PREFIX as NATIVE_MANIFEST_SBOR_V1_PAYLOAD_PREFIX, + DynamicGlobalAddress as NativeDynamicGlobalAddress, + DynamicResourceAddress as NativeDynamicResourceAddress, + DynamicComponentAddress as NativeDynamicComponentAddress, + DynamicPackageAddress as NativeDynamicPackageAddress, }; pub use radix_engine::transaction::{ FeeLocks as NativeFeeLocks @@ -736,21 +740,21 @@ mod native { COMPONENT_ROYALTY_SET_ROYALTY_IDENT as NATIVE_COMPONENT_ROYALTY_SET_ROYALTY_IDENT, COMPONENT_ROYALTY_LOCK_ROYALTY_IDENT as NATIVE_COMPONENT_ROYALTY_LOCK_ROYALTY_IDENT, COMPONENT_ROYALTY_CLAIM_ROYALTIES_IDENT as NATIVE_COMPONENT_ROYALTY_CLAIM_ROYALTIES_IDENT, - ComponentRoyaltyCreateInput as NativeComponentRoyaltyCreateInput, - ComponentRoyaltySetInput as NativeComponentRoyaltySetInput, - ComponentRoyaltyLockInput as NativeComponentRoyaltyLockInput, - ComponentClaimRoyaltiesInput as NativeComponentClaimRoyaltiesInput, + ComponentRoyaltyCreateManifestInput as NativeComponentRoyaltyCreateManifestInput, + ComponentRoyaltySetManifestInput as NativeComponentRoyaltySetManifestInput, + ComponentRoyaltyLockManifestInput as NativeComponentRoyaltyLockManifestInput, + ComponentClaimRoyaltiesManifestInput as NativeComponentClaimRoyaltiesManifestInput, ComponentRoyaltyCreateOutput as NativeComponentRoyaltyCreateOutput, ComponentRoyaltySetOutput as NativeComponentRoyaltySetOutput, ComponentRoyaltyLockOutput as NativeComponentRoyaltyLockOutput, ComponentClaimRoyaltiesOutput as NativeComponentClaimRoyaltiesOutput, }; pub use radix_engine_interface::prelude::{ - RoleAssignmentCreateInput as NativeRoleAssignmentCreateInput, - RoleAssignmentSetInput as NativeRoleAssignmentSetInput, - RoleAssignmentSetOwnerInput as NativeRoleAssignmentSetOwnerInput, - RoleAssignmentLockOwnerInput as NativeRoleAssignmentLockOwnerInput, - RoleAssignmentGetInput as NativeRoleAssignmentGetInput, + RoleAssignmentCreateManifestInput as NativeRoleAssignmentCreateManifestInput, + RoleAssignmentSetManifestInput as NativeRoleAssignmentSetManifestInput, + RoleAssignmentSetOwnerManifestInput as NativeRoleAssignmentSetOwnerManifestInput, + RoleAssignmentLockOwnerManifestInput as NativeRoleAssignmentLockOwnerManifestInput, + RoleAssignmentGetManifestInput as NativeRoleAssignmentGetManifestInput, ROLE_ASSIGNMENT_BLUEPRINT as NATIVE_ROLE_ASSIGNMENT_BLUEPRINT, ROLE_ASSIGNMENT_CREATE_IDENT as NATIVE_ROLE_ASSIGNMENT_CREATE_IDENT, ROLE_ASSIGNMENT_SET_IDENT as NATIVE_ROLE_ASSIGNMENT_SET_IDENT, @@ -802,34 +806,33 @@ mod native { METADATA_LOCK_IDENT as NATIVE_METADATA_LOCK_IDENT, METADATA_GET_IDENT as NATIVE_METADATA_GET_IDENT, METADATA_REMOVE_IDENT as NATIVE_METADATA_REMOVE_IDENT, - MetadataCreateInput as NativeMetadataCreateInput, - MetadataCreateWithDataInput as NativeMetadataCreateWithDataInput, - MetadataSetInput as NativeMetadataSetInput, - MetadataLockInput as NativeMetadataLockInput, - MetadataGetInput as NativeMetadataGetInput, - MetadataRemoveInput as NativeMetadataRemoveInput, + MetadataCreateManifestInput as NativeMetadataCreateManifestInput, + MetadataCreateWithDataManifestInput as NativeMetadataCreateWithDataManifestInput, + MetadataSetManifestInput as NativeMetadataSetManifestInput, + MetadataLockManifestInput as NativeMetadataLockManifestInput, + MetadataGetManifestInput as NativeMetadataGetManifestInput, + MetadataRemoveManifestInput as NativeMetadataRemoveManifestInput, }; pub use radix_engine_interface::blueprints::access_controller::{ - AccessControllerCreateInput as NativeAccessControllerCreateInput, AccessControllerCreateManifestInput as NativeAccessControllerCreateManifestInput, - AccessControllerCreateProofInput as NativeAccessControllerCreateProofInput, - AccessControllerInitiateRecoveryAsPrimaryInput as NativeAccessControllerInitiateRecoveryAsPrimaryInput, - AccessControllerInitiateRecoveryAsRecoveryInput as NativeAccessControllerInitiateRecoveryAsRecoveryInput, - AccessControllerInitiateBadgeWithdrawAttemptAsPrimaryInput as NativeAccessControllerInitiateBadgeWithdrawAttemptAsPrimaryInput, - AccessControllerInitiateBadgeWithdrawAttemptAsRecoveryInput as NativeAccessControllerInitiateBadgeWithdrawAttemptAsRecoveryInput, - AccessControllerQuickConfirmPrimaryRoleRecoveryProposalInput as NativeAccessControllerQuickConfirmPrimaryRoleRecoveryProposalInput, - AccessControllerQuickConfirmRecoveryRoleRecoveryProposalInput as NativeAccessControllerQuickConfirmRecoveryRoleRecoveryProposalInput, - AccessControllerQuickConfirmPrimaryRoleBadgeWithdrawAttemptInput as NativeAccessControllerQuickConfirmPrimaryRoleBadgeWithdrawAttemptInput, - AccessControllerQuickConfirmRecoveryRoleBadgeWithdrawAttemptInput as NativeAccessControllerQuickConfirmRecoveryRoleBadgeWithdrawAttemptInput, - AccessControllerTimedConfirmRecoveryInput as NativeAccessControllerTimedConfirmRecoveryInput, - AccessControllerCancelPrimaryRoleRecoveryProposalInput as NativeAccessControllerCancelPrimaryRoleRecoveryProposalInput, - AccessControllerCancelRecoveryRoleRecoveryProposalInput as NativeAccessControllerCancelRecoveryRoleRecoveryProposalInput, - AccessControllerCancelPrimaryRoleBadgeWithdrawAttemptInput as NativeAccessControllerCancelPrimaryRoleBadgeWithdrawAttemptInput, - AccessControllerCancelRecoveryRoleBadgeWithdrawAttemptInput as NativeAccessControllerCancelRecoveryRoleBadgeWithdrawAttemptInput, - AccessControllerLockPrimaryRoleInput as NativeAccessControllerLockPrimaryRoleInput, - AccessControllerUnlockPrimaryRoleInput as NativeAccessControllerUnlockPrimaryRoleInput, - AccessControllerStopTimedRecoveryInput as NativeAccessControllerStopTimedRecoveryInput, - AccessControllerMintRecoveryBadgesInput as NativeAccessControllerMintRecoveryBadgesInput, + AccessControllerCreateProofManifestInput as NativeAccessControllerCreateProofManifestInput, + AccessControllerInitiateRecoveryAsPrimaryManifestInput as NativeAccessControllerInitiateRecoveryAsPrimaryManifestInput, + AccessControllerInitiateRecoveryAsRecoveryManifestInput as NativeAccessControllerInitiateRecoveryAsRecoveryManifestInput, + AccessControllerInitiateBadgeWithdrawAttemptAsPrimaryManifestInput as NativeAccessControllerInitiateBadgeWithdrawAttemptAsPrimaryManifestInput, + AccessControllerInitiateBadgeWithdrawAttemptAsRecoveryManifestInput as NativeAccessControllerInitiateBadgeWithdrawAttemptAsRecoveryManifestInput, + AccessControllerQuickConfirmPrimaryRoleRecoveryProposalManifestInput as NativeAccessControllerQuickConfirmPrimaryRoleRecoveryProposalManifestInput, + AccessControllerQuickConfirmRecoveryRoleRecoveryProposalManifestInput as NativeAccessControllerQuickConfirmRecoveryRoleRecoveryProposalManifestInput, + AccessControllerQuickConfirmPrimaryRoleBadgeWithdrawAttemptManifestInput as NativeAccessControllerQuickConfirmPrimaryRoleBadgeWithdrawAttemptManifestInput, + AccessControllerQuickConfirmRecoveryRoleBadgeWithdrawAttemptManifestInput as NativeAccessControllerQuickConfirmRecoveryRoleBadgeWithdrawAttemptManifestInput, + AccessControllerTimedConfirmRecoveryManifestInput as NativeAccessControllerTimedConfirmRecoveryManifestInput, + AccessControllerCancelPrimaryRoleRecoveryProposalManifestInput as NativeAccessControllerCancelPrimaryRoleRecoveryProposalManifestInput, + AccessControllerCancelRecoveryRoleRecoveryProposalManifestInput as NativeAccessControllerCancelRecoveryRoleRecoveryProposalManifestInput, + AccessControllerCancelPrimaryRoleBadgeWithdrawAttemptManifestInput as NativeAccessControllerCancelPrimaryRoleBadgeWithdrawAttemptManifestInput, + AccessControllerCancelRecoveryRoleBadgeWithdrawAttemptManifestInput as NativeAccessControllerCancelRecoveryRoleBadgeWithdrawAttemptManifestInput, + AccessControllerLockPrimaryRoleManifestInput as NativeAccessControllerLockPrimaryRoleManifestInput, + AccessControllerUnlockPrimaryRoleManifestInput as NativeAccessControllerUnlockPrimaryRoleManifestInput, + AccessControllerStopTimedRecoveryManifestInput as NativeAccessControllerStopTimedRecoveryManifestInput, + AccessControllerMintRecoveryBadgesManifestInput as NativeAccessControllerMintRecoveryBadgesManifestInput, ACCESS_CONTROLLER_BLUEPRINT as NATIVE_ACCESS_CONTROLLER_BLUEPRINT, ACCESS_CONTROLLER_CREATE_IDENT as NATIVE_ACCESS_CONTROLLER_CREATE_IDENT, ACCESS_CONTROLLER_CREATE_PROOF_IDENT as NATIVE_ACCESS_CONTROLLER_CREATE_PROOF_IDENT, @@ -854,37 +857,30 @@ mod native { pub use radix_engine_interface::blueprints::account::{ ResourcePreference as NativeResourcePreference, DefaultDepositRule as NativeDefaultDepositRule, - AccountCreateAdvancedInput as NativeAccountCreateAdvancedInput, AccountCreateAdvancedManifestInput as NativeAccountCreateAdvancedManifestInput, - AccountCreateInput as NativeAccountCreateInput, - AccountSecurifyInput as NativeAccountSecurifyInput, - AccountLockFeeInput as NativeAccountLockFeeInput, - AccountLockContingentFeeInput as NativeAccountLockContingentFeeInput, - AccountDepositInput as NativeAccountDepositInput, + AccountCreateManifestInput as NativeAccountCreateManifestInput, + AccountSecurifyManifestInput as NativeAccountSecurifyManifestInput, + AccountLockFeeManifestInput as NativeAccountLockFeeManifestInput, + AccountLockContingentFeeManifestInput as NativeAccountLockContingentFeeManifestInput, AccountDepositManifestInput as NativeAccountDepositManifestInput, - AccountDepositBatchInput as NativeAccountDepositBatchInput, AccountDepositBatchManifestInput as NativeAccountDepositBatchManifestInput, - AccountWithdrawInput as NativeAccountWithdrawInput, - AccountWithdrawNonFungiblesInput as NativeAccountWithdrawNonFungiblesInput, - AccountLockFeeAndWithdrawInput as NativeAccountLockFeeAndWithdrawInput, - AccountLockFeeAndWithdrawNonFungiblesInput as NativeAccountLockFeeAndWithdrawNonFungiblesInput, - AccountCreateProofOfAmountInput as NativeAccountCreateProofOfAmountInput, - AccountCreateProofOfNonFungiblesInput as NativeAccountCreateProofOfNonFungiblesInput, - AccountSetDefaultDepositRuleInput as NativeAccountSetDefaultDepositRuleInput, - AccountSetResourcePreferenceInput as NativeAccountSetResourcePreferenceInput, - AccountRemoveResourcePreferenceInput as NativeAccountRemoveResourcePreferenceInput, - AccountTryDepositOrRefundInput as NativeAccountTryDepositOrRefundInput, + AccountWithdrawManifestInput as NativeAccountWithdrawManifestInput, + AccountWithdrawNonFungiblesManifestInput as NativeAccountWithdrawNonFungiblesManifestInput, + AccountLockFeeAndWithdrawManifestInput as NativeAccountLockFeeAndWithdrawManifestInput, + AccountLockFeeAndWithdrawNonFungiblesManifestInput as NativeAccountLockFeeAndWithdrawNonFungiblesManifestInput, + AccountCreateProofOfAmountManifestInput as NativeAccountCreateProofOfAmountManifestInput, + AccountCreateProofOfNonFungiblesManifestInput as NativeAccountCreateProofOfNonFungiblesManifestInput, + AccountSetDefaultDepositRuleManifestInput as NativeAccountSetDefaultDepositRuleManifestInput, + AccountSetResourcePreferenceManifestInput as NativeAccountSetResourcePreferenceManifestInput, + AccountRemoveResourcePreferenceManifestInput as NativeAccountRemoveResourcePreferenceManifestInput, AccountTryDepositOrRefundManifestInput as NativeAccountTryDepositOrRefundManifestInput, - AccountTryDepositBatchOrRefundInput as NativeAccountTryDepositBatchOrRefundInput, AccountTryDepositBatchOrRefundManifestInput as NativeAccountTryDepositBatchOrRefundManifestInput, - AccountTryDepositOrAbortInput as NativeAccountTryDepositOrAbortInput, AccountTryDepositOrAbortManifestInput as NativeAccountTryDepositOrAbortManifestInput, - AccountTryDepositBatchOrAbortInput as NativeAccountTryDepositBatchOrAbortInput, AccountTryDepositBatchOrAbortManifestInput as NativeAccountTryDepositBatchOrAbortManifestInput, - AccountBurnInput as NativeAccountBurnInput, - AccountBurnNonFungiblesInput as NativeAccountBurnNonFungiblesInput, - AccountAddAuthorizedDepositorInput as NativeAccountAddAuthorizedDepositorInput, - AccountRemoveAuthorizedDepositorInput as NativeAccountRemoveAuthorizedDepositorInput, + AccountBurnManifestInput as NativeAccountBurnManifestInput, + AccountBurnNonFungiblesManifestInput as NativeAccountBurnNonFungiblesManifestInput, + AccountAddAuthorizedDepositorManifestInput as NativeAccountAddAuthorizedDepositorManifestInput, + AccountRemoveAuthorizedDepositorManifestInput as NativeAccountRemoveAuthorizedDepositorManifestInput, ACCOUNT_BLUEPRINT as NATIVE_ACCOUNT_BLUEPRINT, ACCOUNT_CREATE_ADVANCED_IDENT as NATIVE_ACCOUNT_CREATE_ADVANCED_IDENT, ACCOUNT_CREATE_IDENT as NATIVE_ACCOUNT_CREATE_IDENT, @@ -916,9 +912,9 @@ mod native { IDENTITY_CREATE_ADVANCED_IDENT as NATIVE_IDENTITY_CREATE_ADVANCED_IDENT, IDENTITY_CREATE_IDENT as NATIVE_IDENTITY_CREATE_IDENT, IDENTITY_SECURIFY_IDENT as NATIVE_IDENTITY_SECURIFY_IDENT, - IdentityCreateAdvancedInput as NativeIdentityCreateAdvancedInput, - IdentityCreateInput as NativeIdentityCreateInput, - IdentitySecurifyToSingleBadgeInput as NativeIdentitySecurifyToSingleBadgeInput, + IdentityCreateAdvancedManifestInput as NativeIdentityCreateAdvancedManifestInput, + IdentityCreateManifestInput as NativeIdentityCreateManifestInput, + IdentitySecurifyToSingleBadgeManifestInput as NativeIdentitySecurifyToSingleBadgeManifestInput, }; pub use radix_engine_interface::blueprints::consensus_manager::{ VALIDATOR_BLUEPRINT as NATIVE_VALIDATOR_BLUEPRINT, @@ -942,40 +938,33 @@ mod native { VALIDATOR_LOCK_OWNER_STAKE_UNITS_IDENT as NATIVE_VALIDATOR_LOCK_OWNER_STAKE_UNITS_IDENT, VALIDATOR_START_UNLOCK_OWNER_STAKE_UNITS_IDENT as NATIVE_VALIDATOR_START_UNLOCK_OWNER_STAKE_UNITS_IDENT, VALIDATOR_FINISH_UNLOCK_OWNER_STAKE_UNITS_IDENT as NATIVE_VALIDATOR_FINISH_UNLOCK_OWNER_STAKE_UNITS_IDENT, - ValidatorRegisterInput as NativeValidatorRegisterInput, - ValidatorUnregisterInput as NativeValidatorUnregisterInput, - ValidatorStakeAsOwnerInput as NativeValidatorStakeAsOwnerInput, - ValidatorStakeInput as NativeValidatorStakeInput, - ValidatorUnstakeInput as NativeValidatorUnstakeInput, - ValidatorClaimXrdInput as NativeValidatorClaimXrdInput, - ValidatorUpdateKeyInput as NativeValidatorUpdateKeyInput, - ValidatorUpdateFeeInput as NativeValidatorUpdateFeeInput, - ValidatorUpdateAcceptDelegatedStakeInput as NativeValidatorUpdateAcceptDelegatedStakeInput, - ValidatorAcceptsDelegatedStakeInput as NativeValidatorAcceptsDelegatedStakeInput, - ValidatorTotalStakeXrdAmountInput as NativeValidatorTotalStakeXrdAmountInput, - ValidatorTotalStakeUnitSupplyInput as NativeValidatorTotalStakeUnitSupplyInput, - ValidatorGetRedemptionValueInput as NativeValidatorGetRedemptionValueInput, - ValidatorSignalProtocolUpdateReadinessInput as NativeValidatorSignalProtocolUpdateReadinessInput, - ValidatorGetProtocolUpdateReadinessInput as NativeValidatorGetProtocolUpdateReadinessInput, - ValidatorApplyEmissionInput as NativeValidatorApplyEmissionInput, - ValidatorApplyRewardInput as NativeValidatorApplyRewardInput, - ValidatorLockOwnerStakeUnitsInput as NativeValidatorLockOwnerStakeUnitsInput, - ValidatorStartUnlockOwnerStakeUnitsInput as NativeValidatorStartUnlockOwnerStakeUnitsInput, - ValidatorFinishUnlockOwnerStakeUnitsInput as NativeValidatorFinishUnlockOwnerStakeUnitsInput, + ValidatorRegisterManifestInput as NativeValidatorRegisterManifestInput, + ValidatorUnregisterManifestInput as NativeValidatorUnregisterManifestInput, ValidatorStakeAsOwnerManifestInput as NativeValidatorStakeAsOwnerManifestInput, ValidatorStakeManifestInput as NativeValidatorStakeManifestInput, ValidatorUnstakeManifestInput as NativeValidatorUnstakeManifestInput, ValidatorClaimXrdManifestInput as NativeValidatorClaimXrdManifestInput, + ValidatorUpdateKeyManifestInput as NativeValidatorUpdateKeyManifestInput, + ValidatorUpdateFeeManifestInput as NativeValidatorUpdateFeeManifestInput, + ValidatorUpdateAcceptDelegatedStakeManifestInput as NativeValidatorUpdateAcceptDelegatedStakeManifestInput, + ValidatorAcceptsDelegatedStakeManifestInput as NativeValidatorAcceptsDelegatedStakeManifestInput, + ValidatorTotalStakeXrdAmountManifestInput as NativeValidatorTotalStakeXrdAmountManifestInput, + ValidatorTotalStakeUnitSupplyManifestInput as NativeValidatorTotalStakeUnitSupplyManifestInput, + ValidatorGetRedemptionValueManifestInput as NativeValidatorGetRedemptionValueManifestInput, + ValidatorSignalProtocolUpdateReadinessManifestInput as NativeValidatorSignalProtocolUpdateReadinessManifestInput, + ValidatorGetProtocolUpdateReadinessManifestInput as NativeValidatorGetProtocolUpdateReadinessManifestInput, + ValidatorApplyEmissionManifestInput as NativeValidatorApplyEmissionManifestInput, + ValidatorApplyRewardManifestInput as NativeValidatorApplyRewardManifestInput, ValidatorLockOwnerStakeUnitsManifestInput as NativeValidatorLockOwnerStakeUnitsManifestInput, + ValidatorStartUnlockOwnerStakeUnitsManifestInput as NativeValidatorStartUnlockOwnerStakeUnitsManifestInput, + ValidatorFinishUnlockOwnerStakeUnitsManifestInput as NativeValidatorFinishUnlockOwnerStakeUnitsManifestInput, + }; pub use radix_engine_interface::blueprints::package::{ - PackagePublishWasmInput as NativePackagePublishWasmInput, PackagePublishWasmManifestInput as NativePackagePublishWasmManifestInput, - PackagePublishWasmAdvancedInput as NativePackagePublishWasmAdvancedInput, PackagePublishWasmAdvancedManifestInput as NativePackagePublishWasmAdvancedManifestInput, - PackagePublishNativeInput as NativePackagePublishNativeInput, PackagePublishNativeManifestInput as NativePackagePublishNativeManifestInput, - PackageClaimRoyaltiesInput as NativePackageClaimRoyaltiesInput, + PackageClaimRoyaltiesManifestInput as NativePackageClaimRoyaltiesManifestInput, PackageDefinition as NativePackageDefinition, BlueprintDefinitionInit as NativeBlueprintDefinitionInit, AuthConfig as NativeAuthConfig, @@ -1013,21 +1002,19 @@ mod native { FUNGIBLE_RESOURCE_MANAGER_CREATE_IDENT as NATIVE_FUNGIBLE_RESOURCE_MANAGER_CREATE_IDENT, FUNGIBLE_RESOURCE_MANAGER_CREATE_WITH_INITIAL_SUPPLY_IDENT as NATIVE_FUNGIBLE_RESOURCE_MANAGER_CREATE_WITH_INITIAL_SUPPLY_IDENT, FUNGIBLE_RESOURCE_MANAGER_MINT_IDENT as NATIVE_FUNGIBLE_RESOURCE_MANAGER_MINT_IDENT, - ResourceManagerBurnInput as NativeResourceManagerBurnInput, - ResourceManagerPackageBurnInput as NativeResourceManagerPackageBurnInput, - ResourceManagerCreateEmptyVaultInput as NativeResourceManagerCreateEmptyVaultInput, - ResourceManagerCreateEmptyBucketInput as NativeResourceManagerCreateEmptyBucketInput, - ResourceManagerDropEmptyBucketInput as NativeResourceManagerDropEmptyBucketInput, - ResourceManagerGetResourceTypeInput as NativeResourceManagerGetResourceTypeInput, - ResourceManagerGetTotalSupplyInput as NativeResourceManagerGetTotalSupplyInput, - ResourceManagerGetAmountForWithdrawalInput as NativeResourceManagerGetAmountForWithdrawalInput, + ResourceManagerBurnManifestInput as NativeResourceManagerBurnManifestInput, + ResourceManagerPackageBurnManifestInput as NativeResourceManagerPackageBurnManifestInput, + ResourceManagerCreateEmptyVaultManifestInput as NativeResourceManagerCreateEmptyVaultManifestInput, + ResourceManagerCreateEmptyBucketManifestInput as NativeResourceManagerCreateEmptyBucketManifestInput, + ResourceManagerDropEmptyBucketManifestInput as NativeResourceManagerDropEmptyBucketManifestInput, + ResourceManagerGetResourceTypeManifestInput as NativeResourceManagerGetResourceTypeManifestInput, + ResourceManagerGetTotalSupplyManifestInput as NativeResourceManagerGetTotalSupplyManifestInput, + ResourceManagerGetAmountForWithdrawalManifestInput as NativeResourceManagerGetAmountForWithdrawalManifestInput, ResourceFeature as NativeResourceFeature, FungibleResourceRoles as NativeFungibleResourceRoles, - FungibleResourceManagerCreateInput as NativeFungibleResourceManagerCreateInput, FungibleResourceManagerCreateManifestInput as NativeFungibleResourceManagerCreateManifestInput, - FungibleResourceManagerCreateWithInitialSupplyInput as NativeFungibleResourceManagerCreateWithInitialSupplyInput, FungibleResourceManagerCreateWithInitialSupplyManifestInput as NativeFungibleResourceManagerCreateWithInitialSupplyManifestInput, - FungibleResourceManagerMintInput as NativeFungibleResourceManagerMintInput, + FungibleResourceManagerMintManifestInput as NativeFungibleResourceManagerMintManifestInput, }; pub use radix_transactions::manifest::static_resource_movements::{ StaticResourceMovementsError as NativeStaticResourceMovementsError diff --git a/crates/radix-engine-toolkit-uniffi/src/transaction_v1/manifest.rs b/crates/radix-engine-toolkit-uniffi/src/transaction_v1/manifest.rs index 5fc2d768..a371632a 100644 --- a/crates/radix-engine-toolkit-uniffi/src/transaction_v1/manifest.rs +++ b/crates/radix-engine-toolkit-uniffi/src/transaction_v1/manifest.rs @@ -100,7 +100,10 @@ impl TransactionManifestV1 { map } - pub fn static_analysis(&self, network_id: u8) -> Result { + pub fn static_analysis_and_validate( + &self, + network_id: u8, + ) -> Result { let native = self.clone().to_native(); core_transaction_v1_manifest_statically_analyze(&native) .map_err(RadixEngineToolkitError::from) @@ -109,6 +112,13 @@ impl TransactionManifestV1 { }) } + pub fn classify(&self) -> Vec { + core_transaction_v1_manifest_classify(&self.to_native()) + .into_iter() + .map(ManifestClass::from) + .collect() + } + pub fn dynamic_analysis( &self, network_id: u8, diff --git a/crates/radix-engine-toolkit-uniffi/src/transaction_v2/transaction_manifest.rs b/crates/radix-engine-toolkit-uniffi/src/transaction_v2/transaction_manifest.rs index fbe8d065..0e63543f 100644 --- a/crates/radix-engine-toolkit-uniffi/src/transaction_v2/transaction_manifest.rs +++ b/crates/radix-engine-toolkit-uniffi/src/transaction_v2/transaction_manifest.rs @@ -90,7 +90,10 @@ impl TransactionManifestV2 { map } - pub fn static_analysis(&self, network_id: u8) -> Result { + pub fn static_analysis_and_validate( + &self, + network_id: u8, + ) -> Result { let native = self.clone().to_native(); core_transaction_v2_transaction_manifest_statically_analyze(&native) .map_err(RadixEngineToolkitError::from) @@ -132,6 +135,13 @@ impl TransactionManifestV2 { ) .map_err(Into::into) } + + pub fn classify(&self) -> Vec { + core_transaction_v2_transaction_manifest_classify(&self.to_native()) + .into_iter() + .map(ManifestClass::from) + .collect() + } } impl TransactionManifestV2 { diff --git a/crates/radix-engine-toolkit/src/functions/transaction_v1/manifest.rs b/crates/radix-engine-toolkit/src/functions/transaction_v1/manifest.rs index 81dd255a..d4e3876b 100644 --- a/crates/radix-engine-toolkit/src/functions/transaction_v1/manifest.rs +++ b/crates/radix-engine-toolkit/src/functions/transaction_v1/manifest.rs @@ -15,6 +15,7 @@ // specific language governing permissions and limitations // under the License. +use indexmap::IndexSet; use radix_common::prelude::*; use radix_engine_toolkit_common::receipt::RuntimeToolkitTransactionReceipt; use radix_transactions::errors::*; @@ -60,6 +61,10 @@ pub fn statically_analyze( crate::transaction_types::statically_analyze(manifest) } +pub fn classify(manifest: &TransactionManifestV1) -> IndexSet { + crate::transaction_types::classify_manifest(manifest) +} + pub fn dynamically_analyze( manifest: &TransactionManifestV1, receipt: &RuntimeToolkitTransactionReceipt, diff --git a/crates/radix-engine-toolkit/src/functions/transaction_v2/transaction_manifest.rs b/crates/radix-engine-toolkit/src/functions/transaction_v2/transaction_manifest.rs index ffefb188..635f38c0 100644 --- a/crates/radix-engine-toolkit/src/functions/transaction_v2/transaction_manifest.rs +++ b/crates/radix-engine-toolkit/src/functions/transaction_v2/transaction_manifest.rs @@ -45,6 +45,10 @@ pub fn statically_analyze( crate::transaction_types::statically_analyze(manifest) } +pub fn classify(manifest: &TransactionManifestV2) -> IndexSet { + crate::transaction_types::classify_manifest(manifest) +} + pub fn dynamically_analyze( manifest: &TransactionManifestV2, receipt: &RuntimeToolkitTransactionReceipt, diff --git a/crates/radix-engine-toolkit/src/transaction_types/interface.rs b/crates/radix-engine-toolkit/src/transaction_types/interface.rs index e1b65938..955be0e9 100644 --- a/crates/radix-engine-toolkit/src/transaction_types/interface.rs +++ b/crates/radix-engine-toolkit/src/transaction_types/interface.rs @@ -126,7 +126,10 @@ pub fn statically_analyze( let mut visitor = StaticResourceMovementsVisitor::new(true); interpreter.validate_and_apply_visitor(&mut visitor)?; let output = visitor.output(); - (output.account_deposits(), output.account_withdraws()) + ( + output.resolve_account_deposits(), + output.resolve_account_withdraws(), + ) }; Ok(StaticAnalysis { @@ -143,6 +146,90 @@ pub fn statically_analyze( }) } +pub fn classify_manifest( + manifest: &M, +) -> IndexSet { + // Settings up the various detectors + let mut presented_proofs_detector = PresentedProofsDetector::default(); + let mut encountered_entities_detector = + EncounteredGlobalEntities::default(); + let mut requiring_auth_detector = RequiringAuthDetector::default(); + let mut reserved_instructions_detector = + ReservedInstructionsDetector::default(); + let mut account_resource_movements_detector = + StaticAccountResourceMovementsDetector::default(); + + let mut general_transaction_detector = GeneralDetector::default(); + let mut transfer_transaction_detector = TransferDetector::default(); + let mut pool_contribution_detector = PoolContributionDetector::default(); + let mut pool_redemption_detector = PoolRedemptionDetector::default(); + let mut validator_stake_detector = ValidatorStakeDetector::default(); + let mut validator_unstake_detector = ValidatorUnstakeDetector::default(); + let mut validator_claim_detector = ValidatorClaimDetector::default(); + let mut accounts_settings_detector = + AccountSettingsUpdateDetector::default(); + + // Traversing the manifest with the passed detectors + traverser::static_analysis::traverse( + &mut [ + &mut presented_proofs_detector, + &mut encountered_entities_detector, + &mut requiring_auth_detector, + &mut reserved_instructions_detector, + &mut account_resource_movements_detector, + &mut general_transaction_detector, + &mut transfer_transaction_detector, + &mut pool_contribution_detector, + &mut pool_redemption_detector, + &mut validator_stake_detector, + &mut validator_unstake_detector, + &mut validator_claim_detector, + &mut accounts_settings_detector, + ], + manifest.iter_cloned_instructions(), + ); + + // Extracting the data out of the detectors and into the ManifestSummary + [ + ( + ManifestClass::General, + general_transaction_detector.is_valid(), + ), + ( + ManifestClass::Transfer, + transfer_transaction_detector.is_valid(), + ), + ( + ManifestClass::PoolContribution, + pool_contribution_detector.is_valid(), + ), + ( + ManifestClass::PoolRedemption, + pool_redemption_detector.is_valid(), + ), + ( + ManifestClass::ValidatorStake, + validator_stake_detector.is_valid(), + ), + ( + ManifestClass::ValidatorUnstake, + validator_unstake_detector.is_valid(), + ), + ( + ManifestClass::ValidatorClaim, + validator_claim_detector.is_valid(), + ), + ( + ManifestClass::AccountDepositSettingsUpdate, + accounts_settings_detector.is_valid(), + ), + ] + .into_iter() + .filter_map(|(class, is_valid)| if is_valid { Some(class) } else { None }) + .rev() + .collect::>() +} + pub fn dynamically_analyze( manifest: &M, receipt: &RuntimeToolkitTransactionReceipt, diff --git a/crates/radix-engine-toolkit/src/transaction_types/traverser/auxiliary/requiring_auth.rs b/crates/radix-engine-toolkit/src/transaction_types/traverser/auxiliary/requiring_auth.rs index 78292e0b..6c71b8d6 100644 --- a/crates/radix-engine-toolkit/src/transaction_types/traverser/auxiliary/requiring_auth.rs +++ b/crates/radix-engine-toolkit/src/transaction_types/traverser/auxiliary/requiring_auth.rs @@ -58,7 +58,8 @@ impl StaticAnalysisCallback for RequiringAuthDetector { match method_name.as_str() { ACCOUNT_LOCKER_CLAIM_IDENT => { let Some(AccountLockerClaimManifestInput { - claimant, + claimant: + DynamicComponentAddress::Static(claimant), .. }) = to_manifest_type(args) else { @@ -69,7 +70,8 @@ impl StaticAnalysisCallback for RequiringAuthDetector { ACCOUNT_LOCKER_CLAIM_NON_FUNGIBLES_IDENT => { let Some( AccountLockerClaimNonFungiblesManifestInput { - claimant, + claimant: + DynamicComponentAddress::Static(claimant), .. }, ) = to_manifest_type(args) diff --git a/crates/radix-engine-toolkit/src/utils.rs b/crates/radix-engine-toolkit/src/utils.rs index 0d170c5f..61481e2d 100644 --- a/crates/radix-engine-toolkit/src/utils.rs +++ b/crates/radix-engine-toolkit/src/utils.rs @@ -22,10 +22,9 @@ use sbor::{ generate_full_schema_from_single_type, validate_payload_against_schema, }; +use radix_common::prelude::*; use radix_transactions::model::IntentV1; -use radix_transactions::prelude::{ - DynamicGlobalAddress, TransactionManifestV1, -}; +use radix_transactions::prelude::*; use scrypto::prelude::*; pub fn manifest_from_intent(intent: &IntentV1) -> TransactionManifestV1 { diff --git a/crates/radix-engine-toolkit/tests/transaction_types.rs b/crates/radix-engine-toolkit/tests/transaction_types.rs index 5720c30f..15932761 100644 --- a/crates/radix-engine-toolkit/tests/transaction_types.rs +++ b/crates/radix-engine-toolkit/tests/transaction_types.rs @@ -21,6 +21,8 @@ use radix_engine_interface::blueprints::account::*; use radix_engine_interface::blueprints::consensus_manager::*; use radix_engine_interface::blueprints::pool::*; use radix_engine_toolkit::transaction_types::*; +use radix_engine_toolkit::utils::network_definition_from_network_id; +use radix_transactions::manifest::{compile, MockBlobProvider}; use radix_transactions::prelude::*; use scrypto_test::prelude::*; @@ -2443,7 +2445,7 @@ fn create_pools( address_reservation: None, owner_role: OwnerRole::None, pool_manager_rule: rule!(allow_all), - resource_address: resource1, + resource_address: resource1.into(), }, ) .call_function( @@ -2454,7 +2456,7 @@ fn create_pools( address_reservation: None, owner_role: OwnerRole::None, pool_manager_rule: rule!(allow_all), - resource_addresses: (resource1, resource2), + resource_addresses: (resource1.into(), resource2.into()), }, ) .call_function( @@ -2466,7 +2468,10 @@ fn create_pools( owner_role: OwnerRole::None, pool_manager_rule: rule!(allow_all), resource_addresses: indexset![ - resource1, resource2, resource3, resource4 + resource1.into(), + resource2.into(), + resource3.into(), + resource4.into() ], }, ) @@ -2557,7 +2562,7 @@ fn account_locker_is_recognized_as_general_transaction() { ACCOUNT_LOCKER_STORE_IDENT, AccountLockerStoreManifestInput { bucket, - claimant: account, + claimant: account.into(), try_direct_send: false, }, ) @@ -2645,3 +2650,69 @@ fn lock_fee_manifest_has_no_classification_except_general() { indexset![ManifestClass::General] ); } + +#[test] +fn example() { + let manifest = r#"CALL_METHOD + Address("component_loc1cptxxxxxxxxxfaucetxxxxxxxxx000527798379xxxxxxxxxxqq5d2") + "lock_fee" + Decimal("5000") +; +CALL_METHOD + Address("account_loc16996e320lnez82q6430eunaz9l3n5fnwk6eh9avrmtmj22e7rd55ln") + "set_default_deposit_rule" + Enum<1u8>() +; +CALL_METHOD + Address("account_loc168qgdkgfqxpnswu38wy6fy5v0q0um52zd0umuely5t9xrf8868l7uj") + "set_default_deposit_rule" + Enum<1u8>() +; +ALLOCATE_GLOBAL_ADDRESS + Address("package_loc1pkgxxxxxxxxxresrcexxxxxxxxx000538436477xxxxxxxxxvyv0vc") + "FungibleResourceManager" + AddressReservation("reservation1") + NamedAddress("address1") +; +CREATE_FUNGIBLE_RESOURCE_WITH_INITIAL_SUPPLY + Enum<0u8>() + true + 18u8 + Decimal("1") + Tuple( + Enum<0u8>(), + Enum<0u8>(), + Enum<0u8>(), + Enum<0u8>(), + Enum<0u8>(), + Enum<0u8>() + ) + Tuple( + Map(), + Map() + ) + Enum<1u8>( + AddressReservation("reservation1") + ) +; +CALL_METHOD + Address("account_loc168qgdkgfqxpnswu38wy6fy5v0q0um52zd0umuely5t9xrf8868l7uj") + "add_authorized_depositor" + Enum<1u8>( + NamedAddress("address1") + ) +; +CALL_METHOD + Address("account_loc16996e320lnez82q6430eunaz9l3n5fnwk6eh9avrmtmj22e7rd55ln") + "deposit_batch" + Expression("ENTIRE_WORKTOP") +;"#; + let manifest = compile( + manifest, + &network_definition_from_network_id(0xf0), + MockBlobProvider::new(), + ) + .unwrap(); + + dbg!(statically_analyze(&manifest)); +}