diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 490a8e3a..1fc8d4ee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -154,6 +154,7 @@ jobs: repository: radixdlt/uniffi-bindgen-cs path: uniffi-bindgen-cs submodules: 'recursive' + ref: f1a6ef67449b47028fd5c3d8e5c6d3b80ddefd2b - uses: actions/download-artifact@v3 with: path: artifacts diff --git a/generator/Cargo.lock b/generator/Cargo.lock index 320407ae..a5eef0b9 100644 --- a/generator/Cargo.lock +++ b/generator/Cargo.lock @@ -1175,8 +1175,8 @@ dependencies = [ [[package]] name = "native-sdk" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "radix-engine-common", "radix-engine-derive", @@ -1393,11 +1393,12 @@ dependencies = [ [[package]] name = "radix-engine" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "bitflags 1.3.2", "colored", + "const-sha1", "hex", "lazy_static", "moka", @@ -1412,7 +1413,7 @@ dependencies = [ "sbor", "serde_json", "strum", - "syn 1.0.109", + "syn 1.0.93", "transaction", "utils", "wasm-instrument", @@ -1422,8 +1423,8 @@ dependencies = [ [[package]] name = "radix-engine-common" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "bech32", "blake2", @@ -1443,19 +1444,19 @@ dependencies = [ [[package]] name = "radix-engine-derive" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "proc-macro2", "quote", "sbor-derive-common", - "syn 1.0.109", + "syn 1.0.93", ] [[package]] name = "radix-engine-interface" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "bitflags 1.3.2", "const-sha1", @@ -1474,26 +1475,26 @@ dependencies = [ [[package]] name = "radix-engine-macros" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 1.0.93", ] [[package]] name = "radix-engine-profiling" -version = "0.9.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "fixedstr", ] [[package]] name = "radix-engine-queries" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "hex", "itertools", @@ -1508,8 +1509,8 @@ dependencies = [ [[package]] name = "radix-engine-store-interface" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "hex", "itertools", @@ -1522,8 +1523,8 @@ dependencies = [ [[package]] name = "radix-engine-stores" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "hex", "itertools", @@ -1536,7 +1537,7 @@ dependencies = [ [[package]] name = "radix-engine-toolkit" -version = "0.12.0-rcnetv3.1" +version = "0.12.1" dependencies = [ "bech32", "indexmap 1.9.3", @@ -1558,7 +1559,7 @@ dependencies = [ [[package]] name = "radix-engine-toolkit-core" -version = "0.12.0-rcnetv3.1" +version = "0.12.1" dependencies = [ "bech32", "cargo_toml", @@ -1724,12 +1725,12 @@ checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "resources-tracker-macro" version = "0.1.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "proc-macro2", "quote", "radix-engine-profiling", - "syn 1.0.109", + "syn 1.0.93", ] [[package]] @@ -1892,8 +1893,8 @@ dependencies = [ [[package]] name = "sbor" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "const-sha1", "hex", @@ -1906,8 +1907,8 @@ dependencies = [ [[package]] name = "sbor-derive" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "proc-macro2", "sbor-derive-common", @@ -1915,19 +1916,19 @@ dependencies = [ [[package]] name = "sbor-derive-common" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "const-sha1", "itertools", "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.93", ] [[package]] name = "sbor-json" -version = "0.12.0-rcnetv3.1" +version = "0.12.1" dependencies = [ "bech32", "radix-engine-common", @@ -1988,8 +1989,8 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "scrypto" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "bech32", "const-sha1", @@ -2010,8 +2011,8 @@ dependencies = [ [[package]] name = "scrypto-derive" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "proc-macro2", "quote", @@ -2020,13 +2021,13 @@ dependencies = [ "scrypto-schema", "serde", "serde_json", - "syn 1.0.109", + "syn 1.0.93", ] [[package]] name = "scrypto-schema" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "bitflags 1.3.2", "radix-engine-common", @@ -2036,8 +2037,8 @@ dependencies = [ [[package]] name = "scrypto-unit" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "radix-engine", "radix-engine-interface", @@ -2319,6 +2320,16 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +[[package]] +name = "syn" +version = "1.0.93" +source = "git+https://github.com/dtolnay/syn.git?tag=1.0.93#2e505a847174ff8939431c4f5ffb565906590ac2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + [[package]] name = "syn" version = "1.0.109" @@ -2575,8 +2586,8 @@ dependencies = [ [[package]] name = "transaction" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "bech32", "ed25519-dalek", @@ -2592,8 +2603,8 @@ dependencies = [ [[package]] name = "transaction-scenarios" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "hex", "itertools", @@ -2696,8 +2707,8 @@ checksum = "f28467d3e1d3c6586d8f25fa243f544f5800fec42d97032474e17222c2b75cfa" [[package]] name = "utils" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "indexmap 2.0.0-pre", "serde", diff --git a/generator/Cargo.toml b/generator/Cargo.toml index 3242fd1f..138e4610 100644 --- a/generator/Cargo.toml +++ b/generator/Cargo.toml @@ -5,15 +5,15 @@ edition = "2021" [dependencies] # radixdlt-scrypto dependencies. -sbor = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc", features = ["serde"] } -scrypto = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc", features = ["serde"] } -scrypto-unit = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc" } -transaction = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc" } -transaction-scenarios = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc" } -radix-engine = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc" } -radix-engine-stores = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc" } -radix-engine-common = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc", features = ["serde"] } -radix-engine-interface = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc" } +sbor = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f", features = ["serde"] } +scrypto = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f", features = ["serde"] } +scrypto-unit = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f" } +transaction = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f" } +transaction-scenarios = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f" } +radix-engine = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f" } +radix-engine-stores = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f" } +radix-engine-common = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f", features = ["serde"] } +radix-engine-interface = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f" } # Core Radix Engine Toolkit and Toolkit Native Library radix-engine-toolkit-core = { path = "../radix-engine-toolkit-core", default-features = false, features = ["moka"]} diff --git a/generator/src/function_examples/execution.rs b/generator/src/function_examples/execution.rs index 6ad10866..05dd6f79 100644 --- a/generator/src/function_examples/execution.rs +++ b/generator/src/function_examples/execution.rs @@ -17,6 +17,7 @@ use radix_engine::transaction::{ execute_and_commit_transaction, CostingParameters, ExecutionConfig, TransactionReceipt, + VersionedTransactionReceipt, }; use radix_engine::types::ResourceOrNonFungible; use radix_engine::vm::Vm; @@ -33,8 +34,8 @@ use transaction_scenarios::scenarios::get_builder_for_every_scenario; use super::traits::HasExamples; -impl<'f> HasExamples<'f, 65> for ExecutionAnalyze { - fn example_inputs() -> [Self::Input; 65] { +impl<'f> HasExamples<'f, 66> for ExecutionAnalyze { + fn example_inputs() -> [Self::Input; 66] { let op1 = { let mut test_runner = TestRunnerBuilder::new().without_trace().build(); let (public_key1, _, account1) = test_runner.new_account(true); @@ -147,7 +148,8 @@ impl<'f> HasExamples<'f, 65> for ExecutionAnalyze { let instructions = to_serializable_instructions(&manifest.instructions, 0xf2).unwrap(); let instructions = SerializableInstructions::Parsed(instructions); - let preview_receipt = scrypto_encode(&receipt).unwrap(); + let preview_receipt = + scrypto_encode(&VersionedTransactionReceipt::V1(receipt)).unwrap(); Self::Input { instructions, diff --git a/radix-engine-toolkit-core/Cargo.lock b/radix-engine-toolkit-core/Cargo.lock index c9be855d..a075aa9e 100644 --- a/radix-engine-toolkit-core/Cargo.lock +++ b/radix-engine-toolkit-core/Cargo.lock @@ -709,8 +709,8 @@ dependencies = [ [[package]] name = "native-sdk" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "radix-engine-common", "radix-engine-derive", @@ -837,11 +837,12 @@ dependencies = [ [[package]] name = "radix-engine" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "bitflags 1.3.2", "colored", + "const-sha1", "hex", "lazy_static", "lru", @@ -857,7 +858,7 @@ dependencies = [ "sbor", "serde_json", "strum", - "syn 1.0.109", + "syn 1.0.93", "transaction", "utils", "wasm-instrument", @@ -867,8 +868,8 @@ dependencies = [ [[package]] name = "radix-engine-common" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "bech32", "blake2", @@ -888,19 +889,19 @@ dependencies = [ [[package]] name = "radix-engine-derive" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "proc-macro2", "quote", "sbor-derive-common", - "syn 1.0.109", + "syn 1.0.93", ] [[package]] name = "radix-engine-interface" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "bitflags 1.3.2", "const-sha1", @@ -919,26 +920,26 @@ dependencies = [ [[package]] name = "radix-engine-macros" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 1.0.93", ] [[package]] name = "radix-engine-profiling" -version = "0.9.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "fixedstr", ] [[package]] name = "radix-engine-queries" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "hex", "itertools", @@ -953,8 +954,8 @@ dependencies = [ [[package]] name = "radix-engine-store-interface" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "hex", "itertools", @@ -967,8 +968,8 @@ dependencies = [ [[package]] name = "radix-engine-stores" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "hex", "itertools", @@ -981,7 +982,7 @@ dependencies = [ [[package]] name = "radix-engine-toolkit-core" -version = "0.12.0-rcnetv3.1" +version = "0.12.1" dependencies = [ "bech32", "cargo_toml", @@ -1083,12 +1084,12 @@ checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "resources-tracker-macro" version = "0.1.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "proc-macro2", "quote", "radix-engine-profiling", - "syn 1.0.109", + "syn 1.0.93", ] [[package]] @@ -1136,8 +1137,8 @@ dependencies = [ [[package]] name = "sbor" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "const-sha1", "hex", @@ -1150,8 +1151,8 @@ dependencies = [ [[package]] name = "sbor-derive" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "proc-macro2", "sbor-derive-common", @@ -1159,19 +1160,19 @@ dependencies = [ [[package]] name = "sbor-derive-common" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "const-sha1", "itertools", "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.93", ] [[package]] name = "sbor-json" -version = "0.12.0-rcnetv3.1" +version = "0.12.1" dependencies = [ "bech32", "radix-engine-common", @@ -1200,8 +1201,8 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "scrypto" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "bech32", "const-sha1", @@ -1222,8 +1223,8 @@ dependencies = [ [[package]] name = "scrypto-derive" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "proc-macro2", "quote", @@ -1232,13 +1233,13 @@ dependencies = [ "scrypto-schema", "serde", "serde_json", - "syn 1.0.109", + "syn 1.0.93", ] [[package]] name = "scrypto-schema" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "bitflags 1.3.2", "radix-engine-common", @@ -1248,8 +1249,8 @@ dependencies = [ [[package]] name = "scrypto-unit" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "radix-engine", "radix-engine-interface", @@ -1442,6 +1443,16 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +[[package]] +name = "syn" +version = "1.0.93" +source = "git+https://github.com/dtolnay/syn.git?tag=1.0.93#2e505a847174ff8939431c4f5ffb565906590ac2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + [[package]] name = "syn" version = "1.0.109" @@ -1567,8 +1578,8 @@ dependencies = [ [[package]] name = "transaction" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "bech32", "ed25519-dalek", @@ -1609,10 +1620,16 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + [[package]] name = "utils" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "indexmap 2.0.0-pre", "serde", diff --git a/radix-engine-toolkit-core/Cargo.toml b/radix-engine-toolkit-core/Cargo.toml index 0198276c..7eb600a5 100644 --- a/radix-engine-toolkit-core/Cargo.toml +++ b/radix-engine-toolkit-core/Cargo.toml @@ -1,20 +1,20 @@ [package] name = "radix-engine-toolkit-core" -version = "0.12.0-rcnetv3.1" +version = "0.12.1" edition = "2021" build = "build.rs" [dependencies] # radixdlt-scrypto dependencies. -sbor = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc", features = ["serde"] } -scrypto = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc", features = ["serde"] } -transaction = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc" } -radix-engine = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc", default-features= false, features = ["std"] } -radix-engine-stores = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc" } -radix-engine-common = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc", features = ["serde"] } -radix-engine-queries = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc", default-features= false, features = ["std"] } -radix-engine-interface = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc" } -radix-engine-store-interface = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc" } +sbor = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f", features = ["serde"] } +scrypto = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f", features = ["serde"] } +transaction = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f" } +radix-engine = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f", default-features= false, features = ["std"] } +radix-engine-stores = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f" } +radix-engine-common = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f", features = ["serde"] } +radix-engine-queries = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f", default-features= false, features = ["std"] } +radix-engine-interface = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f" } +radix-engine-store-interface = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f" } # Bech32 encoding and decoding of addresses. Used for the Olympia <-> Babylon address derivations. bech32 = { version = "0.9.1" } @@ -35,7 +35,7 @@ sbor-json = { path = "../sbor-json" } cargo_toml = { version = "0.15.3" } [dev-dependencies] -scrypto-unit = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc", default-features = false, features = ["std", "resource_tracker"] } +scrypto-unit = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f", default-features = false, features = ["std", "resource_tracker"] } [features] default = ["moka"] diff --git a/radix-engine-toolkit-core/src/functions/execution.rs b/radix-engine-toolkit-core/src/functions/execution.rs index fb821b89..426481fa 100644 --- a/radix-engine-toolkit-core/src/functions/execution.rs +++ b/radix-engine-toolkit-core/src/functions/execution.rs @@ -141,55 +141,63 @@ pub fn analyze( /// execution of the transaction succeeded and was committed to ledger state and that there is an /// execution trace output. pub struct ExecutionAnalysisTransactionReceipt<'r>( - &'r TransactionReceipt, + &'r VersionedTransactionReceipt, + &'r TransactionReceiptV1, &'r TransactionExecutionTrace, &'r CommitResult, ); impl<'r> ExecutionAnalysisTransactionReceipt<'r> { - pub fn new(transaction_receipt: &'r TransactionReceipt) -> Result { + pub fn new( + transaction_receipt: &'r VersionedTransactionReceipt, + ) -> Result { + let v1_receipt = transaction_receipt + .as_latest_ref() + .ok_or(ExecutionModuleError::FailedToConvertReceiptToLatest)?; + if let TransactionResult::Commit( commit_result @ CommitResult { outcome: TransactionOutcome::Success(..), execution_trace, .. }, - ) = &transaction_receipt.result + ) = &v1_receipt.result { if let Some(ref execution_trace) = execution_trace { - Ok(Self(transaction_receipt, execution_trace, commit_result)) + Ok(Self( + transaction_receipt, + v1_receipt, + execution_trace, + commit_result, + )) } else { Err(ExecutionModuleError::NoExecutionTrace) } } else { - Err( - ExecutionModuleError::TransactionWasNotCommittedSuccessfully( - transaction_receipt.clone(), - ), - ) + Err(ExecutionModuleError::TransactionWasNotCommittedSuccessfully(v1_receipt.clone())) } } pub fn execution_trace(&self) -> &'r TransactionExecutionTrace { - self.1 + self.2 } pub fn commit_result(&self) -> &'r CommitResult { - self.2 + self.3 } } -impl<'r> AsRef for ExecutionAnalysisTransactionReceipt<'r> { - fn as_ref(&self) -> &TransactionReceipt { - self.0 +impl<'r> AsRef for ExecutionAnalysisTransactionReceipt<'r> { + fn as_ref(&self) -> &TransactionReceiptV1 { + self.1 } } impl<'r> std::ops::Deref for ExecutionAnalysisTransactionReceipt<'r> { - type Target = TransactionReceipt; + type Target = TransactionReceiptV1; fn deref(&self) -> &Self::Target { - self.0 + self.1 } } @@ -259,10 +267,11 @@ pub struct GeneralTransactionType { #[derive(Clone, Debug)] pub enum ExecutionModuleError { - TransactionWasNotCommittedSuccessfully(TransactionReceipt), + TransactionWasNotCommittedSuccessfully(TransactionReceiptV1), InstructionVisitorError(InstructionVisitorError), LocatedGeneralTransactionTypeError(LocatedGeneralTransactionTypeError), InvalidEntityTypeIdError(InvalidEntityTypeIdError), + FailedToConvertReceiptToLatest, NoExecutionTrace, } diff --git a/radix-engine-toolkit-core/src/functions/manifest_sbor.rs b/radix-engine-toolkit-core/src/functions/manifest_sbor.rs index 1727c8a2..dcda3d03 100644 --- a/radix-engine-toolkit-core/src/functions/manifest_sbor.rs +++ b/radix-engine-toolkit-core/src/functions/manifest_sbor.rs @@ -37,7 +37,7 @@ pub fn decode_to_string_representation( value: T, representation: ManifestSborStringRepresentation, bech32_encoder: &AddressBech32Encoder, - schema: Option<(LocalTypeIndex, Schema)>, + schema: Option<(LocalTypeId, Schema)>, ) -> Result where T: AsRef<[u8]>, @@ -46,11 +46,11 @@ where // Ensure that whatever value was passed either matches the schema if given or is valid Manifest // sbor. - if let Some((ref local_type_index, ref schema)) = schema { + if let Some((ref local_type_id, ref schema)) = schema { validate_payload_against_schema::( value, schema, - *local_type_index, + *local_type_id, &(), MANIFEST_SBOR_V1_MAX_DEPTH, ) @@ -62,13 +62,12 @@ where let string = match representation { ManifestSborStringRepresentation::JSON(representation) => { let context = ManifestValueDisplayContext::with_optional_bech32(Some(bech32_encoder)); - let serialization_parameters = if let Some((ref local_type_index, ref schema)) = schema - { + let serialization_parameters = if let Some((ref local_type_id, ref schema)) = schema { SerializationParameters::WithSchema { mode: representation, custom_context: context, schema, - type_index: *local_type_index, + type_id: *local_type_id, depth_limit: MANIFEST_SBOR_V1_MAX_DEPTH, } } else { diff --git a/radix-engine-toolkit-core/src/functions/scrypto_sbor.rs b/radix-engine-toolkit-core/src/functions/scrypto_sbor.rs index b7c9d4de..c3af4cf2 100644 --- a/radix-engine-toolkit-core/src/functions/scrypto_sbor.rs +++ b/radix-engine-toolkit-core/src/functions/scrypto_sbor.rs @@ -38,7 +38,7 @@ pub fn decode_to_string_representation( value: T, representation: SerializationMode, bech32_encoder: &AddressBech32Encoder, - schema: Option<(LocalTypeIndex, Schema)>, + schema: Option<(LocalTypeId, Schema)>, ) -> Result where T: AsRef<[u8]>, @@ -47,11 +47,11 @@ where // Ensure that whatever value was passed either matches the schema if given or is valid Scrypto // sbor. - if let Some((ref local_type_index, ref schema)) = schema { + if let Some((ref local_type_id, ref schema)) = schema { validate_payload_against_schema::( value, schema, - *local_type_index, + *local_type_id, &(), SCRYPTO_SBOR_V1_MAX_DEPTH, ) @@ -61,12 +61,12 @@ where }; let context = ScryptoValueDisplayContext::with_optional_bech32(Some(bech32_encoder)); - let serialization_parameters = if let Some((ref local_type_index, ref schema)) = schema { + let serialization_parameters = if let Some((ref local_type_id, ref schema)) = schema { SerializationParameters::WithSchema { mode: representation, custom_context: context, schema, - type_index: *local_type_index, + type_id: *local_type_id, depth_limit: SCRYPTO_SBOR_V1_MAX_DEPTH, } } else { diff --git a/radix-engine-toolkit-core/src/instruction_visitor/visitors/transaction_type/general_transaction_visitor.rs b/radix-engine-toolkit-core/src/instruction_visitor/visitors/transaction_type/general_transaction_visitor.rs index 8f4fa0b5..34eae0c6 100644 --- a/radix-engine-toolkit-core/src/instruction_visitor/visitors/transaction_type/general_transaction_visitor.rs +++ b/radix-engine-toolkit-core/src/instruction_visitor/visitors/transaction_type/general_transaction_visitor.rs @@ -301,7 +301,7 @@ impl<'r> GeneralTransactionTypeVisitor<'r> { } ResourceSpecifier::Ids(changes_resource_address, changes_ids) => { self.assert_eq_or_error(&changes_resource_address, &resource_address)?; - self.assert_eq_or_error(&btree_set_decimal_len(&changes_ids), &amount)?; + self.assert_eq_or_error(&set_decimal_len(&changes_ids), &amount)?; ResourceTracker::NonFungible { resource_address, @@ -335,7 +335,7 @@ impl<'r> GeneralTransactionTypeVisitor<'r> { ResourceTracker::NonFungible { resource_address, - amount: Source::Guaranteed(btree_set_decimal_len(&ids)), + amount: Source::Guaranteed(set_decimal_len(&ids)), ids: Source::Guaranteed(ids), } } @@ -399,7 +399,7 @@ impl<'r> GeneralTransactionTypeVisitor<'r> { resource_address: *resource_address, amount: Source::Predicted( self.instruction_index, - btree_set_decimal_len(ids), + set_decimal_len(ids), ), ids: Source::Predicted(self.instruction_index, ids.clone()), }), @@ -472,7 +472,7 @@ impl<'r> GeneralTransactionTypeVisitor<'r> { .as_node_id() .is_global_non_fungible_resource_manager(), )?; - self.assert_eq_or_error(amount, &btree_set_decimal_len(ids))?; + self.assert_eq_or_error(amount, &set_decimal_len(ids))?; ResourceTracker::NonFungible { resource_address: *resource_address, @@ -509,7 +509,7 @@ impl<'r> GeneralTransactionTypeVisitor<'r> { pub fn handle_take_non_fungibles_from_worktop( &mut self, resource_address: &ResourceAddress, - ids: &BTreeSet, + ids: &IndexSet, ) -> Result<(), GeneralTransactionTypeError> { // In this case, the resource is non-fungible and the take from worktop is of a known set of // ids, which we can also say of a known set of amounts. Thus, everything about this can be @@ -517,7 +517,7 @@ impl<'r> GeneralTransactionTypeVisitor<'r> { // to look at the worktop changes. let resource_tracker = ResourceTracker::NonFungible { resource_address: *resource_address, - amount: Source::Guaranteed(btree_set_decimal_len(ids)), + amount: Source::Guaranteed(set_decimal_len(ids)), ids: Source::Guaranteed(ids.clone()), }; @@ -561,7 +561,7 @@ impl<'r> GeneralTransactionTypeVisitor<'r> { ResourceTracker::NonFungible { resource_address: *resource_address, - amount: Source::Predicted(self.instruction_index, btree_set_decimal_len(ids)), + amount: Source::Predicted(self.instruction_index, set_decimal_len(ids)), ids: Source::Predicted(self.instruction_index, ids.clone()), } } @@ -678,11 +678,11 @@ pub enum ResourceTracker { NonFungible { resource_address: ResourceAddress, amount: Source, - ids: Source>, + ids: Source>, }, } -fn btree_set_decimal_len(set: &BTreeSet) -> Decimal { +fn set_decimal_len(set: &IndexSet) -> Decimal { set.len() .to_string() .parse() diff --git a/radix-engine-toolkit-core/src/instruction_visitor/visitors/transaction_type/transfer_visitor.rs b/radix-engine-toolkit-core/src/instruction_visitor/visitors/transaction_type/transfer_visitor.rs index c596765a..1cfb2f74 100644 --- a/radix-engine-toolkit-core/src/instruction_visitor/visitors/transaction_type/transfer_visitor.rs +++ b/radix-engine-toolkit-core/src/instruction_visitor/visitors/transaction_type/transfer_visitor.rs @@ -328,7 +328,7 @@ impl Worktop { Resources::Amount(worktop_amount) => { if *worktop_amount >= amount { *worktop_amount = worktop_amount - .safe_sub(amount) + .checked_sub(amount) .ok_or(WorktopError::TakeError)?; Ok(Resources::Amount(amount)) } else { @@ -346,7 +346,7 @@ impl Worktop { .iter() .take(amount_to_take) .cloned() - .collect::>(); + .collect::>(); for id in ids_to_take.iter() { worktop_ids.remove(id); } @@ -363,7 +363,7 @@ impl Worktop { fn take_non_fungibles( &mut self, resource_address: ResourceAddress, - ids: &BTreeSet, + ids: &IndexSet, ) -> Result<(ManifestBucket, Resources), WorktopError> { let worktop_contents = self.worktop @@ -404,17 +404,17 @@ impl Worktop { } } -#[derive(Clone, Debug, PartialEq, PartialOrd, Ord, Eq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub enum Resources { Amount(Decimal), - Ids(BTreeSet), + Ids(IndexSet), } impl Resources { fn checked_add(&self, other: &Self) -> Option { match (self, other) { (Self::Amount(amount1), Self::Amount(amount2)) => { - amount1.safe_add(*amount2).map(Self::Amount) + amount1.checked_add(*amount2).map(Self::Amount) } (Self::Ids(ids1), Self::Ids(ids2)) => Some(Self::Ids({ let mut ids = ids1.clone(); @@ -425,7 +425,7 @@ impl Resources { } } - fn checked_sub_ids(&self, other: &BTreeSet) -> Option { + fn checked_sub_ids(&self, other: &IndexSet) -> Option { match self { Self::Ids(ids) => { let mut ids = ids.clone(); diff --git a/radix-engine-toolkit-core/src/schema_visitor/core/error.rs b/radix-engine-toolkit-core/src/schema_visitor/core/error.rs index b2f76dfb..a94fd754 100644 --- a/radix-engine-toolkit-core/src/schema_visitor/core/error.rs +++ b/radix-engine-toolkit-core/src/schema_visitor/core/error.rs @@ -15,13 +15,13 @@ // specific language governing permissions and limitations // under the License. -use sbor::LocalTypeIndex; +use sbor::LocalTypeId; use std::convert::Infallible; #[derive(Debug, Clone)] pub enum SchemaVisitorError { Infallible(Infallible), - InvalidLocalTypeIndex(LocalTypeIndex), + InvalidLocalTypeId(LocalTypeId), } impl From for SchemaVisitorError { diff --git a/radix-engine-toolkit-core/src/schema_visitor/core/traits.rs b/radix-engine-toolkit-core/src/schema_visitor/core/traits.rs index 240ab167..82929d35 100644 --- a/radix-engine-toolkit-core/src/schema_visitor/core/traits.rs +++ b/radix-engine-toolkit-core/src/schema_visitor/core/traits.rs @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -use sbor::{CustomSchema, LocalTypeIndex, Schema}; +use sbor::{CustomSchema, LocalTypeId, Schema}; use std::fmt::Debug; #[allow(unused_variables)] @@ -28,7 +28,7 @@ where #[inline] fn visit_any( &mut self, - local_type_index: LocalTypeIndex, + local_type_id: LocalTypeId, schema: &Schema, ) -> Result<(), Self::Error> { Ok(()) @@ -37,7 +37,7 @@ where #[inline] fn visit_bool( &mut self, - local_type_index: LocalTypeIndex, + local_type_id: LocalTypeId, schema: &Schema, ) -> Result<(), Self::Error> { Ok(()) @@ -46,7 +46,7 @@ where #[inline] fn visit_i8( &mut self, - local_type_index: LocalTypeIndex, + local_type_id: LocalTypeId, schema: &Schema, ) -> Result<(), Self::Error> { Ok(()) @@ -55,7 +55,7 @@ where #[inline] fn visit_i16( &mut self, - local_type_index: LocalTypeIndex, + local_type_id: LocalTypeId, schema: &Schema, ) -> Result<(), Self::Error> { Ok(()) @@ -64,7 +64,7 @@ where #[inline] fn visit_i32( &mut self, - local_type_index: LocalTypeIndex, + local_type_id: LocalTypeId, schema: &Schema, ) -> Result<(), Self::Error> { Ok(()) @@ -73,7 +73,7 @@ where #[inline] fn visit_i64( &mut self, - local_type_index: LocalTypeIndex, + local_type_id: LocalTypeId, schema: &Schema, ) -> Result<(), Self::Error> { Ok(()) @@ -82,7 +82,7 @@ where #[inline] fn visit_i128( &mut self, - local_type_index: LocalTypeIndex, + local_type_id: LocalTypeId, schema: &Schema, ) -> Result<(), Self::Error> { Ok(()) @@ -91,7 +91,7 @@ where #[inline] fn visit_u8( &mut self, - local_type_index: LocalTypeIndex, + local_type_id: LocalTypeId, schema: &Schema, ) -> Result<(), Self::Error> { Ok(()) @@ -100,7 +100,7 @@ where #[inline] fn visit_u16( &mut self, - local_type_index: LocalTypeIndex, + local_type_id: LocalTypeId, schema: &Schema, ) -> Result<(), Self::Error> { Ok(()) @@ -109,7 +109,7 @@ where #[inline] fn visit_u32( &mut self, - local_type_index: LocalTypeIndex, + local_type_id: LocalTypeId, schema: &Schema, ) -> Result<(), Self::Error> { Ok(()) @@ -118,7 +118,7 @@ where #[inline] fn visit_u64( &mut self, - local_type_index: LocalTypeIndex, + local_type_id: LocalTypeId, schema: &Schema, ) -> Result<(), Self::Error> { Ok(()) @@ -127,7 +127,7 @@ where #[inline] fn visit_u128( &mut self, - local_type_index: LocalTypeIndex, + local_type_id: LocalTypeId, schema: &Schema, ) -> Result<(), Self::Error> { Ok(()) @@ -136,7 +136,7 @@ where #[inline] fn visit_string( &mut self, - local_type_index: LocalTypeIndex, + local_type_id: LocalTypeId, schema: &Schema, ) -> Result<(), Self::Error> { Ok(()) @@ -145,7 +145,7 @@ where #[inline] fn visit_array( &mut self, - local_type_index: LocalTypeIndex, + local_type_id: LocalTypeId, schema: &Schema, ) -> Result<(), Self::Error> { Ok(()) @@ -154,7 +154,7 @@ where #[inline] fn visit_tuple( &mut self, - local_type_index: LocalTypeIndex, + local_type_id: LocalTypeId, schema: &Schema, ) -> Result<(), Self::Error> { Ok(()) @@ -163,7 +163,7 @@ where #[inline] fn visit_enum( &mut self, - local_type_index: LocalTypeIndex, + local_type_id: LocalTypeId, schema: &Schema, ) -> Result<(), Self::Error> { Ok(()) @@ -172,7 +172,7 @@ where #[inline] fn visit_map( &mut self, - local_type_index: LocalTypeIndex, + local_type_id: LocalTypeId, schema: &Schema, ) -> Result<(), Self::Error> { Ok(()) @@ -181,9 +181,9 @@ where #[inline] fn visit_custom( &mut self, - local_type_index: LocalTypeIndex, + local_type_id: LocalTypeId, schema: &Schema, - custom_type_kind: &T::CustomTypeKind, + custom_type_kind: &T::CustomTypeKind, ) -> Result<(), Self::Error> { Ok(()) } diff --git a/radix-engine-toolkit-core/src/schema_visitor/core/traverser.rs b/radix-engine-toolkit-core/src/schema_visitor/core/traverser.rs index 18b520be..b28a393e 100644 --- a/radix-engine-toolkit-core/src/schema_visitor/core/traverser.rs +++ b/radix-engine-toolkit-core/src/schema_visitor/core/traverser.rs @@ -16,77 +16,77 @@ // under the License. use super::{error::SchemaVisitorError, traits::SchemaVisitor}; -use sbor::{CustomSchema, LocalTypeIndex, Schema, SchemaTypeKind}; +use sbor::{CustomSchema, LocalTypeId, Schema, SchemaTypeKind}; use std::fmt::Debug; pub fn traverse( schema: &Schema, - local_type_index: LocalTypeIndex, + local_type_id: LocalTypeId, visitors: &mut [&mut dyn SchemaVisitor>], ) -> Result<(), SchemaVisitorError> where T: CustomSchema, { - let type_kind = schema.resolve_type_kind(local_type_index).map_or( - Err(SchemaVisitorError::InvalidLocalTypeIndex(local_type_index)), + let type_kind = schema.resolve_type_kind(local_type_id).map_or( + Err(SchemaVisitorError::InvalidLocalTypeId(local_type_id)), Ok, )?; match type_kind { SchemaTypeKind::::Any => { - for_each_enabled_visitor!(visitors, visit_any(local_type_index, schema)) + for_each_enabled_visitor!(visitors, visit_any(local_type_id, schema)) } SchemaTypeKind::::Bool => { - for_each_enabled_visitor!(visitors, visit_bool(local_type_index, schema)) + for_each_enabled_visitor!(visitors, visit_bool(local_type_id, schema)) } SchemaTypeKind::::I8 => { - for_each_enabled_visitor!(visitors, visit_i8(local_type_index, schema)) + for_each_enabled_visitor!(visitors, visit_i8(local_type_id, schema)) } SchemaTypeKind::::I16 => { - for_each_enabled_visitor!(visitors, visit_i16(local_type_index, schema)) + for_each_enabled_visitor!(visitors, visit_i16(local_type_id, schema)) } SchemaTypeKind::::I32 => { - for_each_enabled_visitor!(visitors, visit_i32(local_type_index, schema)) + for_each_enabled_visitor!(visitors, visit_i32(local_type_id, schema)) } SchemaTypeKind::::I64 => { - for_each_enabled_visitor!(visitors, visit_i64(local_type_index, schema)) + for_each_enabled_visitor!(visitors, visit_i64(local_type_id, schema)) } SchemaTypeKind::::I128 => { - for_each_enabled_visitor!(visitors, visit_i128(local_type_index, schema)) + for_each_enabled_visitor!(visitors, visit_i128(local_type_id, schema)) } SchemaTypeKind::::U8 => { - for_each_enabled_visitor!(visitors, visit_u8(local_type_index, schema)) + for_each_enabled_visitor!(visitors, visit_u8(local_type_id, schema)) } SchemaTypeKind::::U16 => { - for_each_enabled_visitor!(visitors, visit_u16(local_type_index, schema)) + for_each_enabled_visitor!(visitors, visit_u16(local_type_id, schema)) } SchemaTypeKind::::U32 => { - for_each_enabled_visitor!(visitors, visit_u32(local_type_index, schema)) + for_each_enabled_visitor!(visitors, visit_u32(local_type_id, schema)) } SchemaTypeKind::::U64 => { - for_each_enabled_visitor!(visitors, visit_u64(local_type_index, schema)) + for_each_enabled_visitor!(visitors, visit_u64(local_type_id, schema)) } SchemaTypeKind::::U128 => { - for_each_enabled_visitor!(visitors, visit_u128(local_type_index, schema)) + for_each_enabled_visitor!(visitors, visit_u128(local_type_id, schema)) } SchemaTypeKind::::String => { - for_each_enabled_visitor!(visitors, visit_string(local_type_index, schema)) + for_each_enabled_visitor!(visitors, visit_string(local_type_id, schema)) } SchemaTypeKind::::Array { element_type } => { - for_each_enabled_visitor!(visitors, visit_array(local_type_index, schema)); + for_each_enabled_visitor!(visitors, visit_array(local_type_id, schema)); traverse(schema, *element_type, visitors)?; } SchemaTypeKind::::Tuple { field_types } => { - for_each_enabled_visitor!(visitors, visit_tuple(local_type_index, schema)); - for local_type_index in field_types { - traverse(schema, *local_type_index, visitors)?; + for_each_enabled_visitor!(visitors, visit_tuple(local_type_id, schema)); + for local_type_id in field_types { + traverse(schema, *local_type_id, visitors)?; } } SchemaTypeKind::::Enum { variants } => { - for_each_enabled_visitor!(visitors, visit_enum(local_type_index, schema)); + for_each_enabled_visitor!(visitors, visit_enum(local_type_id, schema)); for local_type_indices in variants.values() { - for local_type_index in local_type_indices { - traverse(schema, *local_type_index, visitors)?; + for local_type_id in local_type_indices { + traverse(schema, *local_type_id, visitors)?; } } } @@ -94,12 +94,12 @@ where key_type, value_type, } => { - for_each_enabled_visitor!(visitors, visit_map(local_type_index, schema)); + for_each_enabled_visitor!(visitors, visit_map(local_type_id, schema)); traverse(schema, *key_type, visitors)?; traverse(schema, *value_type, visitors)?; } SchemaTypeKind::::Custom(custom) => { - for_each_enabled_visitor!(visitors, visit_custom(local_type_index, schema, custom)); + for_each_enabled_visitor!(visitors, visit_custom(local_type_id, schema, custom)); } }; diff --git a/radix-engine-toolkit-core/src/schema_visitor/visitors/bucket_in_path_visitor.rs b/radix-engine-toolkit-core/src/schema_visitor/visitors/bucket_in_path_visitor.rs index 3a8ae233..6ab434a0 100644 --- a/radix-engine-toolkit-core/src/schema_visitor/visitors/bucket_in_path_visitor.rs +++ b/radix-engine-toolkit-core/src/schema_visitor/visitors/bucket_in_path_visitor.rs @@ -19,7 +19,7 @@ use crate::schema_visitor::core::{error::SchemaVisitorError, traits::SchemaVisit use radix_engine_common::prelude::{ OwnValidation, ScryptoCustomSchema, ScryptoCustomTypeKind, ScryptoCustomTypeValidation, }; -use sbor::{LocalTypeIndex, Schema, TypeValidation}; +use sbor::{LocalTypeId, Schema, TypeValidation}; #[derive(Default)] pub struct BucketInPathVisitor(bool); @@ -29,14 +29,12 @@ impl SchemaVisitor for BucketInPathVisitor { fn visit_custom( &mut self, - local_type_index: LocalTypeIndex, + local_type_id: LocalTypeId, schema: &Schema, - custom_type_kind: &::CustomTypeKind< - LocalTypeIndex, - >, + custom_type_kind: &::CustomTypeKind, ) -> Result<(), Self::Error> { - let type_validation = schema.resolve_type_validation(local_type_index).map_or( - Err(SchemaVisitorError::InvalidLocalTypeIndex(local_type_index)), + let type_validation = schema.resolve_type_validation(local_type_id).map_or( + Err(SchemaVisitorError::InvalidLocalTypeId(local_type_id)), Ok, )?; if *custom_type_kind == ScryptoCustomTypeKind::Own diff --git a/radix-engine-toolkit-core/src/schema_visitor/visitors/proof_in_path_visitor.rs b/radix-engine-toolkit-core/src/schema_visitor/visitors/proof_in_path_visitor.rs index 73b62a72..53ba3ff0 100644 --- a/radix-engine-toolkit-core/src/schema_visitor/visitors/proof_in_path_visitor.rs +++ b/radix-engine-toolkit-core/src/schema_visitor/visitors/proof_in_path_visitor.rs @@ -19,7 +19,7 @@ use crate::schema_visitor::core::{error::SchemaVisitorError, traits::SchemaVisit use radix_engine_common::prelude::{ OwnValidation, ScryptoCustomSchema, ScryptoCustomTypeKind, ScryptoCustomTypeValidation, }; -use sbor::{LocalTypeIndex, Schema, TypeValidation}; +use sbor::{LocalTypeId, Schema, TypeValidation}; #[derive(Default)] pub struct ProofInPathVisitor(bool); @@ -29,14 +29,12 @@ impl SchemaVisitor for ProofInPathVisitor { fn visit_custom( &mut self, - local_type_index: LocalTypeIndex, + local_type_id: LocalTypeId, schema: &Schema, - custom_type_kind: &::CustomTypeKind< - LocalTypeIndex, - >, + custom_type_kind: &::CustomTypeKind, ) -> Result<(), Self::Error> { - let type_validation = schema.resolve_type_validation(local_type_index).map_or( - Err(SchemaVisitorError::InvalidLocalTypeIndex(local_type_index)), + let type_validation = schema.resolve_type_validation(local_type_id).map_or( + Err(SchemaVisitorError::InvalidLocalTypeId(local_type_id)), Ok, )?; if *custom_type_kind == ScryptoCustomTypeKind::Own diff --git a/radix-engine-toolkit-core/src/statics.rs b/radix-engine-toolkit-core/src/statics.rs index f41ccedb..813fa9bb 100644 --- a/radix-engine-toolkit-core/src/statics.rs +++ b/radix-engine-toolkit-core/src/statics.rs @@ -80,8 +80,8 @@ fn account_deposit_methods() -> Vec { return None; } - let local_type_index = type_ref_static_or_panic(&function_schema.input); - if path_contains_a_bucket(*local_type_index, &ACCOUNT_BLUEPRINT_SCHEMA.schema.schema) { + let local_type_id = type_ref_static_or_panic(&function_schema.input); + if path_contains_a_bucket(*local_type_id, &ACCOUNT_BLUEPRINT_SCHEMA.schema.schema) { Some(function_ident.to_owned()) } else { None @@ -143,23 +143,17 @@ fn account_proof_creation_methods() -> Vec { .collect::>() } -fn path_contains_a_bucket( - local_type_index: LocalTypeIndex, - schema: &VersionedScryptoSchema, -) -> bool { +fn path_contains_a_bucket(local_type_id: LocalTypeId, schema: &VersionedScryptoSchema) -> bool { let VersionedScryptoSchema::V1(schema) = schema; let mut visitor = BucketInPathVisitor::default(); - traverse(schema, local_type_index, &mut [&mut visitor]).unwrap(); + traverse(schema, local_type_id, &mut [&mut visitor]).unwrap(); visitor.path_contains_bucket() } -fn path_contains_a_proof( - local_type_index: LocalTypeIndex, - schema: &VersionedScryptoSchema, -) -> bool { +fn path_contains_a_proof(local_type_id: LocalTypeId, schema: &VersionedScryptoSchema) -> bool { let VersionedScryptoSchema::V1(schema) = schema; let mut visitor = ProofInPathVisitor::default(); - traverse(schema, local_type_index, &mut [&mut visitor]).unwrap(); + traverse(schema, local_type_id, &mut [&mut visitor]).unwrap(); visitor.path_contains_proof() } diff --git a/radix-engine-toolkit-core/src/utils.rs b/radix-engine-toolkit-core/src/utils.rs index d506be16..27682b7e 100644 --- a/radix-engine-toolkit-core/src/utils.rs +++ b/radix-engine-toolkit-core/src/utils.rs @@ -16,6 +16,7 @@ // under the License. use radix_engine::system::system_substates::{KeyValueEntrySubstate, KeyValueEntrySubstateV1}; +use radix_engine::track::{BatchPartitionUpdate, NodeStateUpdates, PartitionStateUpdates}; use radix_engine_common::prelude::NetworkDefinition; use radix_engine_queries::typed_substate_layout::{ to_typed_substate_key, to_typed_substate_value, NonFungibleResourceManagerDataEntryPayload, @@ -176,13 +177,13 @@ pub fn to_manifest_type(value: &ManifestValue) -> Option { pub fn validate_manifest_value_against_schema( value: &ManifestValue, ) -> Result<(), ()> { - let (local_type_index, VersionedSchema::V1(schema)) = + let (local_type_id, VersionedSchema::V1(schema)) = generate_full_schema_from_single_type::(); let encoded_payload = manifest_encode(&value).map_err(|_| ())?; validate_payload_against_schema::( &encoded_payload, &schema, - local_type_index, + local_type_id, &(), SCRYPTO_SBOR_V1_MAX_DEPTH, ) @@ -246,44 +247,52 @@ pub fn metadata_of_newly_created_entities( }; let entry = map.entry(global_address).or_default(); - if let Some(key_update_map) = receipt + if let Some(NodeStateUpdates::Delta { by_partition }) = receipt .expect_commit_success() .state_updates - .system_updates - .get(&(*global_address.as_node_id(), METADATA_BASE_PARTITION)) + .by_node + .get(global_address.as_node_id()) { - for (substate_key, database_update) in key_update_map.iter() { - if let DatabaseUpdate::Set(data) = database_update { - if let Ok(( - TypedSubstateKey::MetadataModule(key), - TypedSubstateValue::MetadataModule(value), - )) = to_typed_substate_key( - global_address.as_node_id().entity_type().unwrap(), - METADATA_BASE_PARTITION, - substate_key, - ) - .and_then(|typed_substate_key| { - to_typed_substate_value(&typed_substate_key, data) - .map(|typed_substate_value| (typed_substate_key, typed_substate_value)) - }) { - let TypedMetadataModuleSubstateKey::MetadataEntryKey(key) = key; - let value = match value { - TypedMetadataModuleSubstateValue::MetadataEntry( - KeyValueEntrySubstate::V1(KeyValueEntrySubstateV1 { - value, .. - }), - ) => value, - }; - entry.insert( - key, - value.map(|metadata_entry| { - let VersionedMetadataEntry::V1(metadata) = metadata_entry.content; - metadata - }), - ); - } - } else { - continue; + let entries = match by_partition.get(&METADATA_BASE_PARTITION) { + Some(PartitionStateUpdates::Delta { by_substate }) => by_substate + .iter() + .filter_map(|(key, value)| match value { + DatabaseUpdate::Set(value) => Some((key.clone(), value.clone())), + DatabaseUpdate::Delete => None, + }) + .collect::>(), + Some(PartitionStateUpdates::Batch(BatchPartitionUpdate::Reset { + new_substate_values, + })) => new_substate_values.clone(), + None => continue, + }; + + for (substate_key, data) in entries.into_iter() { + if let Ok(( + TypedSubstateKey::MetadataModule(key), + TypedSubstateValue::MetadataModule(value), + )) = to_typed_substate_key( + global_address.as_node_id().entity_type().unwrap(), + METADATA_BASE_PARTITION, + &substate_key, + ) + .and_then(|typed_substate_key| { + to_typed_substate_value(&typed_substate_key, &data) + .map(|typed_substate_value| (typed_substate_key, typed_substate_value)) + }) { + let TypedMetadataModuleSubstateKey::MetadataEntryKey(key) = key; + let value = match value { + TypedMetadataModuleSubstateValue::MetadataEntry( + KeyValueEntrySubstate::V1(KeyValueEntrySubstateV1 { value, .. }), + ) => value, + }; + entry.insert( + key, + value.map(|metadata_entry| { + let VersionedMetadataEntry::V1(metadata) = metadata_entry.content; + metadata + }), + ); } } } @@ -321,67 +330,99 @@ pub fn data_of_newly_minted_non_fungibles( ) -> HashMap> { let mut map = HashMap::>::new(); let commit_result = receipt.expect_commit_success(); - for ((node_id, partition_number), database_update_map) in - commit_result.state_updates.system_updates.iter() - { - // Only care about non-fungible resource manager nodes, ignore everything else + + for (node_id, node_state_update) in commit_result.state_updates.by_node.iter() { if !node_id.entity_type().map_or(false, |entity_type| { entity_type.is_global_non_fungible_resource_manager() }) { continue; } - for (substate_key, database_update) in database_update_map { - if let DatabaseUpdate::Set(data) = database_update { - if let Ok(( - TypedSubstateKey::MainModule( - TypedMainModuleSubstateKey::NonFungibleResourceManager( - NonFungibleResourceManagerTypedSubstateKey::DataKeyValueEntry( - NonFungibleResourceManagerDataKeyPayload { - content: non_fungible_local_id, - }, - ), + let NodeStateUpdates::Delta { by_partition } = node_state_update; + + let entries: IndexMap<(PartitionNumber, SubstateKey), Vec> = by_partition + .iter() + .flat_map( + |(partition_number, partition_state_update)| match partition_state_update { + PartitionStateUpdates::Delta { by_substate } => by_substate + .iter() + .filter_map(|(key, value)| match value { + DatabaseUpdate::Set(value) => { + Some(((*partition_number, key.clone()), value.clone())) + } + DatabaseUpdate::Delete => None, + }) + .collect::>>(), + PartitionStateUpdates::Batch(BatchPartitionUpdate::Reset { + new_substate_values, + }) => new_substate_values + .iter() + .map(|(substate_key, data)| { + ((*partition_number, substate_key.clone()), data.clone()) + }) + .collect(), + }, + ) + .collect(); + + for ((partition_number, substate_key), data) in entries { + if let Ok(( + TypedSubstateKey::MainModule( + TypedMainModuleSubstateKey::NonFungibleResourceManager( + NonFungibleResourceManagerTypedSubstateKey::DataKeyValueEntry( + NonFungibleResourceManagerDataKeyPayload { + content: non_fungible_local_id, + }, ), ), - TypedSubstateValue::MainModule( - TypedMainModuleSubstateValue::NonFungibleResourceManager( - NonFungibleResourceManagerTypedSubstateValue::DataKeyValue( - NonFungibleResourceManagerDataEntrySubstate::V1( - KeyValueEntrySubstateV1 { - value: - Some(NonFungibleResourceManagerDataEntryPayload { - content: non_fungible_data, - }), - .. - }, - ), + ), + TypedSubstateValue::MainModule( + TypedMainModuleSubstateValue::NonFungibleResourceManager( + NonFungibleResourceManagerTypedSubstateValue::DataKeyValue( + NonFungibleResourceManagerDataEntrySubstate::V1( + KeyValueEntrySubstateV1 { + value: + Some(NonFungibleResourceManagerDataEntryPayload { + content: non_fungible_data, + }), + .. + }, ), ), ), - )) = to_typed_substate_key( - node_id.entity_type().unwrap(), - *partition_number, - substate_key, - ) - .and_then(|typed_substate_key| { - to_typed_substate_value(&typed_substate_key, data) - .map(|typed_substate_value| (typed_substate_key, typed_substate_value)) - }) { - let resource_address = ResourceAddress::new_or_panic(node_id.0); - let non_fungible_local_id = non_fungible_local_id; - let non_fungible_data = scrypto_decode::( - &scrypto_encode(&non_fungible_data).unwrap(), - ) - .unwrap(); + ), + )) = to_typed_substate_key( + node_id.entity_type().unwrap(), + partition_number, + &substate_key, + ) + .and_then(|typed_substate_key| { + to_typed_substate_value(&typed_substate_key, &data) + .map(|typed_substate_value| (typed_substate_key, typed_substate_value)) + }) { + let resource_address = ResourceAddress::new_or_panic(node_id.0); + let non_fungible_local_id = non_fungible_local_id; + let non_fungible_data = + scrypto_decode::(&scrypto_encode(&non_fungible_data).unwrap()) + .unwrap(); - map.entry(resource_address) - .or_default() - .insert(non_fungible_local_id, non_fungible_data); - } - } else { - continue; + map.entry(resource_address) + .or_default() + .insert(non_fungible_local_id, non_fungible_data); } } } + + // for ((node_id, partition_number), database_update_map) in + // commit_result.state_updates.by_node.iter() + // { + // // Only care about non-fungible resource manager nodes, ignore everything else + // if !node_id.entity_type().map_or(false, |entity_type| { + // entity_type.is_global_non_fungible_resource_manager() + // }) { + // continue; + // } + + // } map } diff --git a/radix-engine-toolkit-core/tests/execution.rs b/radix-engine-toolkit-core/tests/execution.rs index 8e8554a3..621c4de0 100644 --- a/radix-engine-toolkit-core/tests/execution.rs +++ b/radix-engine-toolkit-core/tests/execution.rs @@ -16,7 +16,7 @@ // under the License. use radix_engine::system::system_modules::execution_trace::ResourceSpecifier; -use radix_engine::transaction::TransactionReceipt; +use radix_engine::transaction::{TransactionReceipt, VersionedTransactionReceipt}; use radix_engine_interface::blueprints::account::{ACCOUNT_LOCK_FEE_IDENT, AccountLockFeeInput, ACCOUNT_LOCK_CONTINGENT_FEE_IDENT, AccountLockContingentFeeInput}; use radix_engine_toolkit_core::functions::execution::{self, *}; use radix_engine_toolkit_core::instruction_visitor::visitors::transaction_type::general_transaction_visitor::{ResourceTracker, Source}; @@ -225,10 +225,10 @@ fn general_transaction_handles_take_non_fungible_ids_from_worktop_correctly() { ResourceTracker::NonFungible { resource_address, amount: Source::Guaranteed(dec!("2")), - ids: Source::Predicted(0, btreeset!( + ids: Source::Predicted(0, IndexSet::from([ NonFungibleLocalId::integer(1), NonFungibleLocalId::integer(2), - )) + ])) } ] } @@ -240,10 +240,10 @@ fn general_transaction_handles_take_non_fungible_ids_from_worktop_correctly() { ResourceTracker::NonFungible { resource_address, amount: Source::Guaranteed(dec!("2")), - ids: Source::Predicted(1, btreeset!( + ids: Source::Predicted(1, IndexSet::from([ NonFungibleLocalId::integer(1), NonFungibleLocalId::integer(2), - )) + ])) } ] } @@ -304,7 +304,8 @@ fn test_manifest_with_lock_fee( // Act let transaction_types = transaction_types( &manifest.instructions, - &ExecutionAnalysisTransactionReceipt::new(&receipt).unwrap(), + &ExecutionAnalysisTransactionReceipt::new(&VersionedTransactionReceipt::V1(receipt)) + .unwrap(), ); // Assert @@ -333,7 +334,10 @@ fn transaction_types( ) -> Vec { let analysis = execution::analyze( manifest_instructions, - &ExecutionAnalysisTransactionReceipt::new(receipt).unwrap(), + &ExecutionAnalysisTransactionReceipt::new(&VersionedTransactionReceipt::V1( + receipt.clone(), + )) + .unwrap(), ) .unwrap(); analysis.transaction_types diff --git a/radix-engine-toolkit-core/tests/manifest_sbor.rs b/radix-engine-toolkit-core/tests/manifest_sbor.rs index 60c38309..aa021d63 100644 --- a/radix-engine-toolkit-core/tests/manifest_sbor.rs +++ b/radix-engine-toolkit-core/tests/manifest_sbor.rs @@ -55,7 +55,7 @@ fn manifest_value_can_be_represented_as_a_string() { let value = MyStruct { value: true }; let encoded_value = manifest_encode(&value).unwrap(); - let (local_type_index, VersionedSchema::V1(schema)) = + let (local_type_id, VersionedSchema::V1(schema)) = generate_full_schema_from_single_type::(); let serialization_modes_params = [ @@ -64,7 +64,7 @@ fn manifest_value_can_be_represented_as_a_string() { ManifestSborStringRepresentation::JSON(SerializationMode::Natural), ManifestSborStringRepresentation::JSON(SerializationMode::Programmatic), ]; - let schema_params = [None, Some((local_type_index, schema))]; + let schema_params = [None, Some((local_type_id, schema))]; let bech32_encoder = AddressBech32Encoder::for_simulator(); for representation in serialization_modes_params { diff --git a/radix-engine-toolkit-core/tests/schema_visitor.rs b/radix-engine-toolkit-core/tests/schema_visitor.rs index 09e19f48..7aff3795 100644 --- a/radix-engine-toolkit-core/tests/schema_visitor.rs +++ b/radix-engine-toolkit-core/tests/schema_visitor.rs @@ -33,12 +33,12 @@ struct MyStruct { #[test] fn bucket_in_path_visitor_can_detect_a_bucket_in_the_schema() { // Arrange - let (local_type_index, VersionedSchema::V1(schema)) = + let (local_type_id, VersionedSchema::V1(schema)) = generate_full_schema_from_single_type::(); // Act let mut visitor = BucketInPathVisitor::default(); - traverse(&schema, local_type_index, &mut [&mut visitor]).unwrap(); + traverse(&schema, local_type_id, &mut [&mut visitor]).unwrap(); // Assert assert!(visitor.path_contains_bucket()) @@ -47,12 +47,12 @@ fn bucket_in_path_visitor_can_detect_a_bucket_in_the_schema() { #[test] fn bucket_in_path_visitor_can_detect_a_bucket_thats_nested() { // Arrange - let (local_type_index, VersionedSchema::V1(schema)) = + let (local_type_id, VersionedSchema::V1(schema)) = generate_full_schema_from_single_type::(); // Act let mut visitor = BucketInPathVisitor::default(); - traverse(&schema, local_type_index, &mut [&mut visitor]).unwrap(); + traverse(&schema, local_type_id, &mut [&mut visitor]).unwrap(); // Assert assert!(visitor.path_contains_bucket()) @@ -61,12 +61,12 @@ fn bucket_in_path_visitor_can_detect_a_bucket_thats_nested() { #[test] fn bucket_in_path_visitor_does_not_detect_non_existent_buckets() { // Arrange - let (local_type_index, VersionedSchema::V1(schema)) = + let (local_type_id, VersionedSchema::V1(schema)) = generate_full_schema_from_single_type::(); // Act let mut visitor = BucketInPathVisitor::default(); - traverse(&schema, local_type_index, &mut [&mut visitor]).unwrap(); + traverse(&schema, local_type_id, &mut [&mut visitor]).unwrap(); // Assert assert!(!visitor.path_contains_bucket()) @@ -75,14 +75,14 @@ fn bucket_in_path_visitor_does_not_detect_non_existent_buckets() { #[test] fn proof_in_path_visitor_can_detect_a_proof_in_the_schema() { // Arrange - let (local_type_index, VersionedSchema::V1(schema)) = generate_full_schema_from_single_type::< + let (local_type_id, VersionedSchema::V1(schema)) = generate_full_schema_from_single_type::< AccountCreateProofOfAmountOutput, ScryptoCustomSchema, >(); // Act let mut visitor = ProofInPathVisitor::default(); - traverse(&schema, local_type_index, &mut [&mut visitor]).unwrap(); + traverse(&schema, local_type_id, &mut [&mut visitor]).unwrap(); // Assert assert!(visitor.path_contains_proof()) @@ -91,12 +91,12 @@ fn proof_in_path_visitor_can_detect_a_proof_in_the_schema() { #[test] fn proof_in_path_visitor_can_detect_a_proof_thats_nested() { // Arrange - let (local_type_index, VersionedSchema::V1(schema)) = + let (local_type_id, VersionedSchema::V1(schema)) = generate_full_schema_from_single_type::(); // Act let mut visitor = ProofInPathVisitor::default(); - traverse(&schema, local_type_index, &mut [&mut visitor]).unwrap(); + traverse(&schema, local_type_id, &mut [&mut visitor]).unwrap(); // Assert assert!(visitor.path_contains_proof()) @@ -105,12 +105,12 @@ fn proof_in_path_visitor_can_detect_a_proof_thats_nested() { #[test] fn proof_in_path_visitor_does_not_detect_non_existent_proofs() { // Arrange - let (local_type_index, VersionedSchema::V1(schema)) = + let (local_type_id, VersionedSchema::V1(schema)) = generate_full_schema_from_single_type::(); // Act let mut visitor = ProofInPathVisitor::default(); - traverse(&schema, local_type_index, &mut [&mut visitor]).unwrap(); + traverse(&schema, local_type_id, &mut [&mut visitor]).unwrap(); // Assert assert!(!visitor.path_contains_proof()) diff --git a/radix-engine-toolkit-core/tests/scrypto_sbor.rs b/radix-engine-toolkit-core/tests/scrypto_sbor.rs index ba2f00f6..e1ca0acb 100644 --- a/radix-engine-toolkit-core/tests/scrypto_sbor.rs +++ b/radix-engine-toolkit-core/tests/scrypto_sbor.rs @@ -54,7 +54,7 @@ fn scrypto_value_can_be_represented_as_a_string() { let value = MyStruct { value: true }; let encoded_value = scrypto_encode(&value).unwrap(); - let (local_type_index, VersionedSchema::V1(schema)) = + let (local_type_id, VersionedSchema::V1(schema)) = generate_full_schema_from_single_type::(); let serialization_modes_params = [ @@ -62,7 +62,7 @@ fn scrypto_value_can_be_represented_as_a_string() { SerializationMode::Natural, SerializationMode::Programmatic, ]; - let schema_params = [None, Some((local_type_index, schema))]; + let schema_params = [None, Some((local_type_id, schema))]; let bech32_encoder = AddressBech32Encoder::for_simulator(); for representation in serialization_modes_params { diff --git a/radix-engine-toolkit-core/tests/simple_transfer_visitor.rs b/radix-engine-toolkit-core/tests/simple_transfer_visitor.rs index e564fe89..2d831e73 100644 --- a/radix-engine-toolkit-core/tests/simple_transfer_visitor.rs +++ b/radix-engine-toolkit-core/tests/simple_transfer_visitor.rs @@ -65,7 +65,7 @@ pub fn simple_transfer_visitor_can_pick_up_non_fungible_transfer() { .withdraw_non_fungibles_from_account( account1, XRD, - BTreeSet::from([ + IndexSet::from([ NonFungibleLocalId::integer(1), NonFungibleLocalId::integer(2), ]), @@ -90,7 +90,7 @@ pub fn simple_transfer_visitor_can_pick_up_non_fungible_transfer() { resource_specifier, ResourceSpecifier::Ids( XRD, - BTreeSet::from([ + IndexSet::from([ NonFungibleLocalId::integer(1), NonFungibleLocalId::integer(2), ]) @@ -109,7 +109,7 @@ pub fn simple_transfer_visitor_invalidated_transfer_with_an_additional_withdraw( .withdraw_non_fungibles_from_account( account1, XRD, - BTreeSet::from([ + IndexSet::from([ NonFungibleLocalId::integer(1), NonFungibleLocalId::integer(2), ]), diff --git a/radix-engine-toolkit-core/tests/transfer_visitor.rs b/radix-engine-toolkit-core/tests/transfer_visitor.rs index e1e55edd..40e7d07d 100644 --- a/radix-engine-toolkit-core/tests/transfer_visitor.rs +++ b/radix-engine-toolkit-core/tests/transfer_visitor.rs @@ -132,7 +132,7 @@ pub fn transfer_visitor_can_pick_up_non_fungible_transfer() { .withdraw_non_fungibles_from_account( account1, XRD, - BTreeSet::from([ + IndexSet::from([ NonFungibleLocalId::integer(1), NonFungibleLocalId::integer(2), ]), @@ -156,7 +156,7 @@ pub fn transfer_visitor_can_pick_up_non_fungible_transfer() { deposits, hashmap!( account2 => hashmap! { - XRD => Resources::Ids(BTreeSet::from([ + XRD => Resources::Ids(IndexSet::from([ NonFungibleLocalId::integer(1), NonFungibleLocalId::integer(2), ])) diff --git a/radix-engine-toolkit-core/tests/utils.rs b/radix-engine-toolkit-core/tests/utils.rs index b9acba4d..a8ea5497 100644 --- a/radix-engine-toolkit-core/tests/utils.rs +++ b/radix-engine-toolkit-core/tests/utils.rs @@ -15,17 +15,16 @@ // specific language governing permissions and limitations // under the License. -use radix_engine::system::bootstrap::{Bootstrapper, GenesisReceipts}; -use radix_engine::transaction::{CommitResult, TransactionReceipt, TransactionResult}; +use radix_engine::system::bootstrap::*; +use radix_engine::transaction::*; use radix_engine::types::*; -use radix_engine::vm::wasm::{DefaultWasmEngine, WasmValidatorConfigV1}; -use radix_engine::vm::{DefaultNativeVm, ScryptoVm, Vm}; -use radix_engine_interface::metadata_init; -use radix_engine_stores::memory_db::InMemorySubstateDatabase; -use radix_engine_toolkit_core::functions::execution::ExecutionAnalysisTransactionReceipt; -use radix_engine_toolkit_core::functions::utils::decode_transaction_id; -use scrypto::api::node_modules::metadata::MetadataValue; -use scrypto::prelude::ModuleConfig; +use radix_engine::vm::wasm::*; +use radix_engine::vm::*; +use radix_engine_interface::*; +use radix_engine_stores::memory_db::*; +use radix_engine_toolkit_core::functions::execution::*; +use radix_engine_toolkit_core::functions::utils::*; +use scrypto::prelude::*; use scrypto::*; use scrypto_unit::*; use transaction::prelude::*; @@ -52,7 +51,10 @@ fn extraction_of_metadata_from_receipts_succeeds() { .build(); let receipt = add_execution_trace(test_runner.execute_manifest_ignoring_fee(manifest, vec![])); let metadata = radix_engine_toolkit_core::utils::metadata_of_newly_created_entities( - &ExecutionAnalysisTransactionReceipt::new(&receipt).unwrap(), + &ExecutionAnalysisTransactionReceipt::new(&VersionedTransactionReceipt::V1( + receipt.clone(), + )) + .unwrap(), ) .unwrap(); @@ -109,7 +111,10 @@ fn extraction_of_non_fungible_data_from_receipts_succeeds() { .build(); let receipt = add_execution_trace(test_runner.execute_manifest_ignoring_fee(manifest, vec![])); let new_non_fungibles = radix_engine_toolkit_core::utils::data_of_newly_minted_non_fungibles( - &ExecutionAnalysisTransactionReceipt::new(&receipt).unwrap(), + &ExecutionAnalysisTransactionReceipt::new(&VersionedTransactionReceipt::V1( + receipt.clone(), + )) + .unwrap(), ); // Assert @@ -158,7 +163,7 @@ fn able_to_extract_metadata_of_new_entities_in_genesis() { wasm_validator_config: WasmValidatorConfigV1::new(), }; let native_vm = DefaultNativeVm::new(); - let vm = Vm::new(&scrypto_vm, native_vm.clone()); + let vm = Vm::new(&scrypto_vm, native_vm); let mut substate_db = InMemorySubstateDatabase::standard(); let mut bootstrapper = Bootstrapper::new(NetworkDefinition::simulator(), &mut substate_db, vm, false); @@ -175,7 +180,8 @@ fn able_to_extract_metadata_of_new_entities_in_genesis() { { // Act & Assert let _metadata = radix_engine_toolkit_core::utils::metadata_of_newly_created_entities( - &ExecutionAnalysisTransactionReceipt::new(&receipt).unwrap(), + &ExecutionAnalysisTransactionReceipt::new(&VersionedTransactionReceipt::V1(receipt)) + .unwrap(), ); } } @@ -204,7 +210,8 @@ fn empty_metadata_can_be_processed_by_ret() { // Act & Assert let _metadata = radix_engine_toolkit_core::utils::metadata_of_newly_created_entities( - &ExecutionAnalysisTransactionReceipt::new(&receipt).unwrap(), + &ExecutionAnalysisTransactionReceipt::new(&VersionedTransactionReceipt::V1(receipt)) + .unwrap(), ); } diff --git a/radix-engine-toolkit-uniffi/Cargo.lock b/radix-engine-toolkit-uniffi/Cargo.lock index 5d80853a..9eee91b9 100644 --- a/radix-engine-toolkit-uniffi/Cargo.lock +++ b/radix-engine-toolkit-uniffi/Cargo.lock @@ -908,8 +908,8 @@ dependencies = [ [[package]] name = "native-sdk" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "radix-engine-common", "radix-engine-derive", @@ -1052,11 +1052,12 @@ dependencies = [ [[package]] name = "radix-engine" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "bitflags 1.3.2", "colored", + "const-sha1", "hex", "lazy_static", "moka", @@ -1071,7 +1072,7 @@ dependencies = [ "sbor", "serde_json", "strum", - "syn 1.0.109", + "syn 1.0.93", "transaction", "utils", "wasm-instrument", @@ -1081,8 +1082,8 @@ dependencies = [ [[package]] name = "radix-engine-common" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "bech32", "blake2", @@ -1102,19 +1103,19 @@ dependencies = [ [[package]] name = "radix-engine-derive" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "proc-macro2", "quote", "sbor-derive-common", - "syn 1.0.109", + "syn 1.0.93", ] [[package]] name = "radix-engine-interface" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "bitflags 1.3.2", "const-sha1", @@ -1133,26 +1134,26 @@ dependencies = [ [[package]] name = "radix-engine-macros" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 1.0.93", ] [[package]] name = "radix-engine-profiling" -version = "0.9.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "fixedstr", ] [[package]] name = "radix-engine-queries" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "hex", "itertools", @@ -1167,8 +1168,8 @@ dependencies = [ [[package]] name = "radix-engine-store-interface" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "hex", "itertools", @@ -1181,8 +1182,8 @@ dependencies = [ [[package]] name = "radix-engine-stores" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "hex", "itertools", @@ -1195,7 +1196,7 @@ dependencies = [ [[package]] name = "radix-engine-toolkit-core" -version = "0.12.0-rcnetv3.1" +version = "0.12.1" dependencies = [ "bech32", "cargo_toml", @@ -1216,7 +1217,7 @@ dependencies = [ [[package]] name = "radix-engine-toolkit-uniffi" -version = "0.12.0-rcnetv3.1" +version = "0.12.1" dependencies = [ "hex", "paste", @@ -1317,12 +1318,12 @@ checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "resources-tracker-macro" version = "0.1.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "proc-macro2", "quote", "radix-engine-profiling", - "syn 1.0.109", + "syn 1.0.93", ] [[package]] @@ -1370,8 +1371,8 @@ dependencies = [ [[package]] name = "sbor" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "const-sha1", "hex", @@ -1384,8 +1385,8 @@ dependencies = [ [[package]] name = "sbor-derive" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "proc-macro2", "sbor-derive-common", @@ -1393,19 +1394,19 @@ dependencies = [ [[package]] name = "sbor-derive-common" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "const-sha1", "itertools", "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.93", ] [[package]] name = "sbor-json" -version = "0.12.0-rcnetv3.1" +version = "0.12.1" dependencies = [ "bech32", "radix-engine-common", @@ -1454,8 +1455,8 @@ dependencies = [ [[package]] name = "scrypto" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "bech32", "const-sha1", @@ -1476,8 +1477,8 @@ dependencies = [ [[package]] name = "scrypto-derive" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "proc-macro2", "quote", @@ -1486,13 +1487,13 @@ dependencies = [ "scrypto-schema", "serde", "serde_json", - "syn 1.0.109", + "syn 1.0.93", ] [[package]] name = "scrypto-schema" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "bitflags 1.3.2", "radix-engine-common", @@ -1502,8 +1503,8 @@ dependencies = [ [[package]] name = "scrypto-unit" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "radix-engine", "radix-engine-interface", @@ -1708,6 +1709,16 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +[[package]] +name = "syn" +version = "1.0.93" +source = "git+https://github.com/dtolnay/syn.git?tag=1.0.93#2e505a847174ff8939431c4f5ffb565906590ac2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + [[package]] name = "syn" version = "1.0.109" @@ -1842,8 +1853,8 @@ dependencies = [ [[package]] name = "transaction" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "bech32", "ed25519-dalek", @@ -1859,8 +1870,8 @@ dependencies = [ [[package]] name = "transaction-scenarios" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "hex", "itertools", @@ -1902,6 +1913,12 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + [[package]] name = "uniffi" version = "0.24.1" @@ -2037,8 +2054,8 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "utils" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "indexmap 2.0.0-pre", "serde", diff --git a/radix-engine-toolkit-uniffi/Cargo.toml b/radix-engine-toolkit-uniffi/Cargo.toml index e68cbfce..9fe23a03 100644 --- a/radix-engine-toolkit-uniffi/Cargo.toml +++ b/radix-engine-toolkit-uniffi/Cargo.toml @@ -1,18 +1,18 @@ [package] name = "radix-engine-toolkit-uniffi" -version = "0.12.0-rcnetv3.1" +version = "0.12.1" edition = "2021" build = "build.rs" [dependencies] # radixdlt-scrypto dependencies. -sbor = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc", features = ["serde"] } -scrypto = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc", features = ["serde"] } -transaction = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc" } -radix-engine = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc", default-features= false, features = ["std", "moka"] } -radix-engine-common = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc", features = ["serde"] } -radix-engine-queries = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc", default-features = false, features = ["std", "moka"] } -radix-engine-interface = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc" } +sbor = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f", features = ["serde"] } +scrypto = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f", features = ["serde"] } +transaction = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f" } +radix-engine = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f", default-features= false, features = ["std", "moka"] } +radix-engine-common = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f", features = ["serde"] } +radix-engine-queries = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f", default-features = false, features = ["std", "moka"] } +radix-engine-interface = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f" } # Core Radix Engine Toolkit radix-engine-toolkit-core = { path = "../radix-engine-toolkit-core" } @@ -30,9 +30,9 @@ uniffi = { git = "https://github.com/mozilla/uniffi-rs/", rev = "7b18fa787336aa7 [dev-dependencies] # The UniFFI crate for generating bindings to other languages uniffi = { git = "https://github.com/mozilla/uniffi-rs/", rev = "7b18fa787336aa738f205a44f7b2df728e83a097", features = ["bindgen-tests"] } -scrypto-unit = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc", default-features = false, features = ["std", "moka"] } -radix-engine-stores = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc" } -transaction-scenarios = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc" } +scrypto-unit = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f", default-features = false, features = ["std", "moka"] } +radix-engine-stores = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f" } +transaction-scenarios = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f" } [lib] crate-type = ["staticlib", "cdylib", "lib"] diff --git a/radix-engine-toolkit-uniffi/src/blueprints/metadata.rs b/radix-engine-toolkit-uniffi/src/blueprints/metadata.rs index e84349da..1f4f7fe1 100644 --- a/radix-engine-toolkit-uniffi/src/blueprints/metadata.rs +++ b/radix-engine-toolkit-uniffi/src/blueprints/metadata.rs @@ -51,7 +51,7 @@ impl ToNative for MetadataInit { }, )) }) - .collect::>>>( + .collect::>>>( ) .map(|data| NativeMetadataInit { data }) } diff --git a/radix-engine-toolkit-uniffi/src/common/decimal.rs b/radix-engine-toolkit-uniffi/src/common/decimal.rs index c1ec675f..d3be18e9 100644 --- a/radix-engine-toolkit-uniffi/src/common/decimal.rs +++ b/radix-engine-toolkit-uniffi/src/common/decimal.rs @@ -56,23 +56,23 @@ macro_rules! define_uniffi_decimal { } pub fn add(&self, other: $crate::prelude::Arc) -> $crate::prelude::Result<$crate::prelude::Arc> { - use $crate::prelude::NativeSafeAdd; - self.0.safe_add(other.0).ok_or($crate::prelude::RadixEngineToolkitError::DecimalError).map(Self).map($crate::prelude::Arc::new) + use $crate::prelude::NativeCheckedAdd; + self.0.checked_add(other.0).ok_or($crate::prelude::RadixEngineToolkitError::DecimalError).map(Self).map($crate::prelude::Arc::new) } pub fn sub(&self, other: $crate::prelude::Arc) -> $crate::prelude::Result<$crate::prelude::Arc> { - use $crate::prelude::NativeSafeSub; - self.0.safe_sub(other.0).ok_or($crate::prelude::RadixEngineToolkitError::DecimalError).map(Self).map($crate::prelude::Arc::new) + use $crate::prelude::NativeCheckedSub; + self.0.checked_sub(other.0).ok_or($crate::prelude::RadixEngineToolkitError::DecimalError).map(Self).map($crate::prelude::Arc::new) } pub fn mul(&self, other: $crate::prelude::Arc) -> $crate::prelude::Result<$crate::prelude::Arc> { - use $crate::prelude::NativeSafeMul; - self.0.safe_mul(other.0).ok_or($crate::prelude::RadixEngineToolkitError::DecimalError).map(Self).map($crate::prelude::Arc::new) + use $crate::prelude::NativeCheckedMul; + self.0.checked_mul(other.0).ok_or($crate::prelude::RadixEngineToolkitError::DecimalError).map(Self).map($crate::prelude::Arc::new) } pub fn div(&self, other: $crate::prelude::Arc) -> $crate::prelude::Result<$crate::prelude::Arc> { - use $crate::prelude::NativeSafeDiv; - self.0.safe_div(other.0).ok_or($crate::prelude::RadixEngineToolkitError::DecimalError).map(Self).map($crate::prelude::Arc::new) + use $crate::prelude::NativeCheckedDiv; + self.0.checked_div(other.0).ok_or($crate::prelude::RadixEngineToolkitError::DecimalError).map(Self).map($crate::prelude::Arc::new) } pub fn as_str(&self) -> String { @@ -91,44 +91,60 @@ macro_rules! define_uniffi_decimal { self.0.is_negative() } - pub fn abs(&self) -> $crate::prelude::Arc { - $crate::prelude::Arc::new(Self(self.0.abs())) + pub fn abs(&self) -> $crate::error::Result<$crate::prelude::Arc> { + self.0 + .checked_abs() + .ok_or($crate::prelude::RadixEngineToolkitError::DecimalError) + .map(Self) + .map($crate::prelude::Arc::new) } - pub fn floor(&self) -> $crate::prelude::Arc { - $crate::prelude::Arc::new(Self(self.0.floor())) + pub fn floor(&self) -> $crate::error::Result<$crate::prelude::Arc> { + self.0 + .checked_floor() + .ok_or($crate::prelude::RadixEngineToolkitError::DecimalError) + .map(Self) + .map($crate::prelude::Arc::new) } - pub fn ceiling(&self) -> $crate::prelude::Arc { - $crate::prelude::Arc::new(Self(self.0.ceiling())) + pub fn ceiling(&self) -> $crate::error::Result<$crate::prelude::Arc> { + self.0 + .checked_ceiling() + .ok_or($crate::prelude::RadixEngineToolkitError::DecimalError) + .map(Self) + .map($crate::prelude::Arc::new) } - pub fn round(&self, decimal_places: i32, rounding_mode: $crate::prelude::RoundingMode) -> $crate::prelude::Arc { - $crate::prelude::Arc::new(Self(self.0.round(decimal_places, rounding_mode.into()))) + pub fn round(&self, decimal_places: i32, rounding_mode: $crate::prelude::RoundingMode) -> $crate::error::Result<$crate::prelude::Arc> { + self.0 + .checked_round(decimal_places, rounding_mode.into()) + .ok_or($crate::prelude::RadixEngineToolkitError::DecimalError) + .map(Self) + .map($crate::prelude::Arc::new) } pub fn powi(&self, exp: i64) -> $crate::error::Result<$crate::prelude::Arc> { self.0 - .safe_powi(exp) + .checked_powi(exp) .map(Self) .map(crate::prelude::Arc::new) .ok_or($crate::prelude::RadixEngineToolkitError::DecimalError) } pub fn sqrt(&self) -> Option<$crate::prelude::Arc> { - self.0.sqrt().map(|value| $crate::prelude::Arc::new(Self(value))) + self.0.checked_sqrt().map(|value| $crate::prelude::Arc::new(Self(value))) } pub fn cbrt(&self) -> $crate::error::Result<$crate::prelude::Arc> { self.0 - .cbrt() + .checked_cbrt() .map(Self) .map(crate::prelude::Arc::new) .ok_or($crate::prelude::RadixEngineToolkitError::DecimalError) } pub fn nth_root(&self, n: u32) -> Option<$crate::prelude::Arc> { - self.0.nth_root(n).map(|value| $crate::prelude::Arc::new(Self(value))) + self.0.checked_nth_root(n).map(|value| $crate::prelude::Arc::new(Self(value))) } pub fn equal(&self, other: $crate::prelude::Arc) -> bool { diff --git a/radix-engine-toolkit-uniffi/src/internal_prelude.rs b/radix-engine-toolkit-uniffi/src/internal_prelude.rs index 85c67190..446d5110 100644 --- a/radix-engine-toolkit-uniffi/src/internal_prelude.rs +++ b/radix-engine-toolkit-uniffi/src/internal_prelude.rs @@ -296,11 +296,11 @@ mod native { require as native_require, dec as native_dec, - SafeAdd as NativeSafeAdd, - SafeSub as NativeSafeSub, - SafeMul as NativeSafeMul, - SafeDiv as NativeSafeDiv, - SafeNeg as NativeSafeNeg, + CheckedAdd as NativeCheckedAdd, + CheckedSub as NativeCheckedSub, + CheckedMul as NativeCheckedMul, + CheckedDiv as NativeCheckedDiv, + CheckedNeg as NativeCheckedNeg, }; pub use scrypto::address::{ AddressBech32Decoder as NativeAddressBech32Decoder, @@ -362,9 +362,6 @@ mod native { pub use radix_engine_common::data::scrypto::model::{ ContentValidationError as NativeContentValidationError, }; - pub use radix_engine_common::types::{ - TypeIdentifier as NativeTypeIdentifier - }; pub use radix_engine_common::data::manifest::converter::{ from_decimal as native_from_decimal, from_precise_decimal as native_from_precise_decimal, @@ -385,7 +382,7 @@ mod native { DecodeError as NativeDecodeError, }; pub use sbor::schema::{ - LocalTypeIndex as NativeLocalTypeIndex + LocalTypeId as NativeLocalTypeId }; pub use sbor::representations::{ SerializationMode as NativeSerializationMode @@ -402,6 +399,7 @@ mod native { ResourceSpecifier as NativeResourceSpecifier, }; pub use radix_engine::transaction::{ + VersionedTransactionReceipt as NativeVersionedTransactionReceipt, TransactionReceipt as NativeTransactionReceipt, CommitResult as NativeCommitResult }; diff --git a/radix-engine-toolkit-uniffi/src/lib.rs b/radix-engine-toolkit-uniffi/src/lib.rs index ae9c9595..7f63d7f7 100644 --- a/radix-engine-toolkit-uniffi/src/lib.rs +++ b/radix-engine-toolkit-uniffi/src/lib.rs @@ -114,6 +114,7 @@ pub mod prelude { pub(crate) use crate::internal_prelude::*; /* Often needed */ + pub(crate) use sbor::prelude::IndexMap; pub(crate) use std::collections::{BTreeMap, HashMap}; pub(crate) use std::str::FromStr; pub(crate) use std::sync::Arc; diff --git a/radix-engine-toolkit-uniffi/src/sbor/functions.rs b/radix-engine-toolkit-uniffi/src/sbor/functions.rs index 1a106d31..d6d39214 100644 --- a/radix-engine-toolkit-uniffi/src/sbor/functions.rs +++ b/radix-engine-toolkit-uniffi/src/sbor/functions.rs @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -use sbor::WellKnownTypeIndex; +use sbor::WellKnownTypeId; use crate::prelude::*; @@ -110,14 +110,14 @@ pub enum SerializationMode { } #[derive(Clone, Debug, Enum)] -pub enum LocalTypeIndex { +pub enum LocalTypeId { WellKnown { value: u8 }, SchemaLocalIndex { value: u64 }, } #[derive(Clone, Debug, Record)] pub struct Schema { - pub local_type_index: LocalTypeIndex, + pub local_type_id: LocalTypeId, pub schema: Vec, } @@ -144,32 +144,27 @@ impl From for NativeSerializationMode { } } -impl From for NativeLocalTypeIndex { - fn from(value: LocalTypeIndex) -> Self { +impl From for NativeLocalTypeId { + fn from(value: LocalTypeId) -> Self { match value { - LocalTypeIndex::WellKnown { value } => Self::WellKnown(WellKnownTypeIndex::of(value)), - LocalTypeIndex::SchemaLocalIndex { value } => Self::SchemaLocalIndex(value as usize), + LocalTypeId::WellKnown { value } => Self::WellKnown(WellKnownTypeId::of(value)), + LocalTypeId::SchemaLocalIndex { value } => Self::SchemaLocalIndex(value as usize), } } } -impl TryFrom - for ( - NativeLocalTypeIndex, - NativeSchema, - ) -{ +impl TryFrom for (NativeLocalTypeId, NativeSchema) { type Error = RadixEngineToolkitError; fn try_from( Schema { - local_type_index, + local_type_id, schema, }: Schema, ) -> Result { - let local_type_index = local_type_index.into(); + let local_type_id = local_type_id.into(); let schema = native_scrypto_decode(&schema)?; - Ok((local_type_index, schema)) + Ok((local_type_id, schema)) } } diff --git a/radix-engine-toolkit-uniffi/src/transaction/manifest.rs b/radix-engine-toolkit-uniffi/src/transaction/manifest.rs index 67e1da98..c66ba5e8 100644 --- a/radix-engine-toolkit-uniffi/src/transaction/manifest.rs +++ b/radix-engine-toolkit-uniffi/src/transaction/manifest.rs @@ -89,7 +89,8 @@ impl TransactionManifest { } pub fn analyze_execution(&self, transaction_receipt: Vec) -> Result { - let receipt = native_scrypto_decode::(&transaction_receipt)?; + let receipt = + native_scrypto_decode::(&transaction_receipt)?; let analysis = core_execution_analyze( &self.instructions.0, &CoreExecutionAnalysisTransactionReceipt::new(&receipt)?, diff --git a/radix-engine-toolkit-uniffi/tests/bindings/example.kts b/radix-engine-toolkit-uniffi/tests/bindings/example.kts index e33f3906..e293ed87 100644 --- a/radix-engine-toolkit-uniffi/tests/bindings/example.kts +++ b/radix-engine-toolkit-uniffi/tests/bindings/example.kts @@ -4,4 +4,4 @@ import com.radixdlt.ret.*; val information = buildInformation(); // Assert -assert(information.version == "0.12.0-rcnetv3.1"); \ No newline at end of file +assert(information.version == "0.12.1"); \ No newline at end of file diff --git a/radix-engine-toolkit-uniffi/tests/bindings/example.py b/radix-engine-toolkit-uniffi/tests/bindings/example.py index ebf59181..a1433ccd 100644 --- a/radix-engine-toolkit-uniffi/tests/bindings/example.py +++ b/radix-engine-toolkit-uniffi/tests/bindings/example.py @@ -4,4 +4,4 @@ build_info = build_information() # Assert -assert build_info.version == "0.12.0-rcnetv3.1" \ No newline at end of file +assert build_info.version == "0.12.1" \ No newline at end of file diff --git a/radix-engine-toolkit-uniffi/tests/bindings/example.swift b/radix-engine-toolkit-uniffi/tests/bindings/example.swift index 507b3d72..bc7f68bf 100644 --- a/radix-engine-toolkit-uniffi/tests/bindings/example.swift +++ b/radix-engine-toolkit-uniffi/tests/bindings/example.swift @@ -6,5 +6,5 @@ do { let buildInformation = radix_engine_toolkit_uniffi.buildInformation() // Assert - assert(buildInformation.version == "0.12.0-rcnetv3.1") + assert(buildInformation.version == "0.12.1") } diff --git a/radix-engine-toolkit-uniffi/tests/typed_events.rs b/radix-engine-toolkit-uniffi/tests/typed_events.rs index df7b548e..e19acf7f 100644 --- a/radix-engine-toolkit-uniffi/tests/typed_events.rs +++ b/radix-engine-toolkit-uniffi/tests/typed_events.rs @@ -37,6 +37,19 @@ pub fn events_emitted_from_native_entities_can_be_converted_to_typed() { .application_events .iter() { + let node_id = match event_identifier.0 { + Emitter::Function(BlueprintId { + package_address, .. + }) => package_address.into_node_id(), + Emitter::Method(node_id, ..) => node_id, + }; + if matches!( + node_id.entity_type(), + Some(EntityType::GlobalGenericComponent | EntityType::InternalGenericComponent) + ) { + continue; + } + let event_type_identifier = radix_engine_toolkit_uniffi::functions::EventTypeIdentifier { emitter: match event_identifier.0 { diff --git a/radix-engine-toolkit/Cargo.lock b/radix-engine-toolkit/Cargo.lock index b5a9383b..e48c85fb 100644 --- a/radix-engine-toolkit/Cargo.lock +++ b/radix-engine-toolkit/Cargo.lock @@ -746,8 +746,8 @@ dependencies = [ [[package]] name = "native-sdk" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "radix-engine-common", "radix-engine-derive", @@ -874,11 +874,12 @@ dependencies = [ [[package]] name = "radix-engine" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "bitflags 1.3.2", "colored", + "const-sha1", "hex", "lazy_static", "lru", @@ -894,7 +895,7 @@ dependencies = [ "sbor", "serde_json", "strum", - "syn 1.0.109", + "syn 1.0.93", "transaction", "utils", "wasm-instrument", @@ -904,8 +905,8 @@ dependencies = [ [[package]] name = "radix-engine-common" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "bech32", "blake2", @@ -925,19 +926,19 @@ dependencies = [ [[package]] name = "radix-engine-derive" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "proc-macro2", "quote", "sbor-derive-common", - "syn 1.0.109", + "syn 1.0.93", ] [[package]] name = "radix-engine-interface" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "bitflags 1.3.2", "const-sha1", @@ -956,26 +957,26 @@ dependencies = [ [[package]] name = "radix-engine-macros" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 1.0.93", ] [[package]] name = "radix-engine-profiling" -version = "0.9.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "fixedstr", ] [[package]] name = "radix-engine-queries" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "hex", "itertools", @@ -990,8 +991,8 @@ dependencies = [ [[package]] name = "radix-engine-store-interface" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "hex", "itertools", @@ -1004,8 +1005,8 @@ dependencies = [ [[package]] name = "radix-engine-stores" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "hex", "itertools", @@ -1018,7 +1019,7 @@ dependencies = [ [[package]] name = "radix-engine-toolkit" -version = "0.12.0-rcnetv3.1" +version = "0.12.1" dependencies = [ "bech32", "indexmap 1.9.3", @@ -1040,7 +1041,7 @@ dependencies = [ [[package]] name = "radix-engine-toolkit-core" -version = "0.12.0-rcnetv3.1" +version = "0.12.1" dependencies = [ "bech32", "cargo_toml", @@ -1141,12 +1142,12 @@ checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "resources-tracker-macro" version = "0.1.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "proc-macro2", "quote", "radix-engine-profiling", - "syn 1.0.109", + "syn 1.0.93", ] [[package]] @@ -1194,8 +1195,8 @@ dependencies = [ [[package]] name = "sbor" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "const-sha1", "hex", @@ -1208,8 +1209,8 @@ dependencies = [ [[package]] name = "sbor-derive" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "proc-macro2", "sbor-derive-common", @@ -1217,19 +1218,19 @@ dependencies = [ [[package]] name = "sbor-derive-common" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "const-sha1", "itertools", "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.93", ] [[package]] name = "sbor-json" -version = "0.12.0-rcnetv3.1" +version = "0.12.1" dependencies = [ "bech32", "radix-engine-common", @@ -1283,8 +1284,8 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "scrypto" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "bech32", "const-sha1", @@ -1305,8 +1306,8 @@ dependencies = [ [[package]] name = "scrypto-derive" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "proc-macro2", "quote", @@ -1315,13 +1316,13 @@ dependencies = [ "scrypto-schema", "serde", "serde_json", - "syn 1.0.109", + "syn 1.0.93", ] [[package]] name = "scrypto-schema" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "bitflags 1.3.2", "radix-engine-common", @@ -1517,6 +1518,16 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +[[package]] +name = "syn" +version = "1.0.93" +source = "git+https://github.com/dtolnay/syn.git?tag=1.0.93#2e505a847174ff8939431c4f5ffb565906590ac2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + [[package]] name = "syn" version = "1.0.109" @@ -1642,8 +1653,8 @@ dependencies = [ [[package]] name = "transaction" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "bech32", "ed25519-dalek", @@ -1706,10 +1717,16 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + [[package]] name = "utils" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "indexmap 2.0.0-pre", "serde", diff --git a/radix-engine-toolkit/Cargo.toml b/radix-engine-toolkit/Cargo.toml index 64731182..389e66da 100644 --- a/radix-engine-toolkit/Cargo.toml +++ b/radix-engine-toolkit/Cargo.toml @@ -1,15 +1,15 @@ [package] name = "radix-engine-toolkit" -version = "0.12.0-rcnetv3.1" +version = "0.12.1" edition = "2021" [dependencies] # radixdlt-scrypto dependencies. -sbor = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc", features = ["serde"] } -scrypto = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc", features = ["serde"] } -transaction = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc" } -radix-engine = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc", default-features= false, features = ["std"] } -radix-engine-common = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc", features = ["serde"] } +sbor = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f", features = ["serde"] } +scrypto = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f", features = ["serde"] } +transaction = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f" } +radix-engine = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f", default-features= false, features = ["std"] } +radix-engine-common = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f", features = ["serde"] } # Core Radix Engine Toolkit radix-engine-toolkit-core = { path = "../radix-engine-toolkit-core", default-features = false } diff --git a/radix-engine-toolkit/src/functions/execution.rs b/radix-engine-toolkit/src/functions/execution.rs index f6988b3d..d10ca011 100644 --- a/radix-engine-toolkit/src/functions/execution.rs +++ b/radix-engine-toolkit/src/functions/execution.rs @@ -66,9 +66,13 @@ impl<'f> Function<'f> for ExecutionAnalyze { }: Self::Input, ) -> Result { let instructions = instructions.to_instructions(*network_id)?; - let receipt = scrypto_decode::(&preview_receipt).map_err(|error| { - InvocationHandlingError::DecodeError(debug_string(error), debug_string(preview_receipt)) - })?; + let receipt = + scrypto_decode::(&preview_receipt).map_err(|error| { + InvocationHandlingError::DecodeError( + debug_string(error), + debug_string(preview_receipt), + ) + })?; let execution_analysis = ExecutionAnalysisTransactionReceipt::new(&receipt) .and_then(|receipt| { diff --git a/radix-engine-toolkit/src/functions/manifest_sbor.rs b/radix-engine-toolkit/src/functions/manifest_sbor.rs index fea3ad15..4fa0f94a 100644 --- a/radix-engine-toolkit/src/functions/manifest_sbor.rs +++ b/radix-engine-toolkit/src/functions/manifest_sbor.rs @@ -22,7 +22,7 @@ use crate::prelude::*; use radix_engine_common::prelude::*; use radix_engine_toolkit_core::functions::manifest_sbor::*; use radix_engine_toolkit_core::utils::*; -use sbor::{LocalTypeIndex, Schema}; +use sbor::{LocalTypeId, Schema}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; @@ -65,17 +65,17 @@ impl<'f> Function<'f> for ManifestSborDecodeToString { } }; let schema = if let Some(PayloadSchema { - local_type_index, + local_type_id, schema, }) = schema { - let local_type_index = LocalTypeIndex::from(local_type_index); + let local_type_id = LocalTypeId::from(local_type_id); let schema = scrypto_decode::>(&schema).map_err(|error| { InvocationHandlingError::DecodeError(debug_string(error), debug_string(schema)) })?; - Some((local_type_index, schema)) + Some((local_type_id, schema)) } else { None }; diff --git a/radix-engine-toolkit/src/functions/scrypto_sbor.rs b/radix-engine-toolkit/src/functions/scrypto_sbor.rs index af106f26..92843c61 100644 --- a/radix-engine-toolkit/src/functions/scrypto_sbor.rs +++ b/radix-engine-toolkit/src/functions/scrypto_sbor.rs @@ -21,7 +21,7 @@ use crate::prelude::*; use radix_engine_common::prelude::*; use radix_engine_toolkit_core::utils::*; -use sbor::{LocalTypeIndex, Schema}; +use sbor::{LocalTypeId, Schema}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; @@ -57,17 +57,17 @@ impl<'f> Function<'f> for ScryptoSborDecodeToString { let network_id = *network_id; let representation = representation.into(); let schema = if let Some(PayloadSchema { - local_type_index, + local_type_id, schema, }) = schema { - let local_type_index = LocalTypeIndex::from(local_type_index); + let local_type_id = LocalTypeId::from(local_type_id); let schema = scrypto_decode::>(&schema).map_err(|error| { InvocationHandlingError::DecodeError(debug_string(error), debug_string(schema)) })?; - Some((local_type_index, schema)) + Some((local_type_id, schema)) } else { None }; diff --git a/radix-engine-toolkit/src/models/sbor/local_type_index.rs b/radix-engine-toolkit/src/models/sbor/local_type_id.rs similarity index 63% rename from radix-engine-toolkit/src/models/sbor/local_type_index.rs rename to radix-engine-toolkit/src/models/sbor/local_type_id.rs index 8f7a1d1b..f40cec41 100644 --- a/radix-engine-toolkit/src/models/sbor/local_type_index.rs +++ b/radix-engine-toolkit/src/models/sbor/local_type_id.rs @@ -16,37 +16,35 @@ // under the License. use crate::prelude::*; -use sbor::{LocalTypeIndex, WellKnownTypeIndex}; +use sbor::{LocalTypeId, WellKnownTypeId}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; #[typeshare::typeshare] #[derive(Serialize, Deserialize, JsonSchema, Clone, Debug, PartialEq, Eq)] #[serde(tag = "kind", content = "value")] -pub enum SerializableLocalTypeIndex { +pub enum SerializableLocalTypeId { WellKnown(SerializableU8), SchemaLocalIndex(SerializableU64), } -impl From for SerializableLocalTypeIndex { - fn from(value: LocalTypeIndex) -> Self { +impl From for SerializableLocalTypeId { + fn from(value: LocalTypeId) -> Self { match value { - LocalTypeIndex::SchemaLocalIndex(value) => { - Self::SchemaLocalIndex((value as u64).into()) - } - LocalTypeIndex::WellKnown(value) => Self::WellKnown((value.as_index() as u8).into()), + LocalTypeId::SchemaLocalIndex(value) => Self::SchemaLocalIndex((value as u64).into()), + LocalTypeId::WellKnown(value) => Self::WellKnown((value.as_index() as u8).into()), } } } -impl From for LocalTypeIndex { - fn from(value: SerializableLocalTypeIndex) -> Self { +impl From for LocalTypeId { + fn from(value: SerializableLocalTypeId) -> Self { match value { - SerializableLocalTypeIndex::SchemaLocalIndex(value) => { + SerializableLocalTypeId::SchemaLocalIndex(value) => { Self::SchemaLocalIndex(*value as usize) } - SerializableLocalTypeIndex::WellKnown(value) => { - Self::WellKnown(WellKnownTypeIndex::of(*value)) + SerializableLocalTypeId::WellKnown(value) => { + Self::WellKnown(WellKnownTypeId::of(*value)) } } } diff --git a/radix-engine-toolkit/src/models/sbor/mod.rs b/radix-engine-toolkit/src/models/sbor/mod.rs index c46619d7..d5ef00af 100644 --- a/radix-engine-toolkit/src/models/sbor/mod.rs +++ b/radix-engine-toolkit/src/models/sbor/mod.rs @@ -15,6 +15,6 @@ // specific language governing permissions and limitations // under the License. -pub mod local_type_index; +pub mod local_type_id; pub mod schema; pub mod serialization_mode; diff --git a/radix-engine-toolkit/src/models/sbor/schema.rs b/radix-engine-toolkit/src/models/sbor/schema.rs index 465d4ecd..98fad25e 100644 --- a/radix-engine-toolkit/src/models/sbor/schema.rs +++ b/radix-engine-toolkit/src/models/sbor/schema.rs @@ -23,6 +23,6 @@ use crate::prelude::*; #[typeshare::typeshare] #[derive(Serialize, Deserialize, JsonSchema, Clone, Debug, PartialEq, Eq)] pub struct PayloadSchema { - pub local_type_index: SerializableLocalTypeIndex, + pub local_type_id: SerializableLocalTypeId, pub schema: SerializableBytes, } diff --git a/radix-engine-toolkit/src/prelude.rs b/radix-engine-toolkit/src/prelude.rs index cea2997e..1c4ade89 100644 --- a/radix-engine-toolkit/src/prelude.rs +++ b/radix-engine-toolkit/src/prelude.rs @@ -44,7 +44,7 @@ pub use crate::models::cryptographic::signature::*; pub use crate::models::cryptographic::signature_with_public_key::*; pub use crate::models::manifest::runtime::*; pub use crate::models::olympia::network::*; -pub use crate::models::sbor::local_type_index::*; +pub use crate::models::sbor::local_type_id::*; pub use crate::models::sbor::schema::*; pub use crate::models::sbor::serialization_mode::*; pub use crate::models::scrypto::node_id::*; diff --git a/sbor-json/Cargo.lock b/sbor-json/Cargo.lock index e8ffe6ba..34c726f3 100644 --- a/sbor-json/Cargo.lock +++ b/sbor-json/Cargo.lock @@ -419,8 +419,8 @@ dependencies = [ [[package]] name = "radix-engine-common" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "bech32", "blake2", @@ -440,19 +440,19 @@ dependencies = [ [[package]] name = "radix-engine-derive" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "proc-macro2", "quote", "sbor-derive-common", - "syn 1.0.109", + "syn 1.0.93", ] [[package]] name = "radix-engine-interface" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "bitflags", "const-sha1", @@ -512,8 +512,8 @@ checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "sbor" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "const-sha1", "hex", @@ -526,8 +526,8 @@ dependencies = [ [[package]] name = "sbor-derive" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "proc-macro2", "sbor-derive-common", @@ -535,19 +535,19 @@ dependencies = [ [[package]] name = "sbor-derive-common" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "const-sha1", "itertools", "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.93", ] [[package]] name = "sbor-json" -version = "0.12.0-rcnetv3.1" +version = "0.12.1" dependencies = [ "bech32", "radix-engine-common", @@ -561,8 +561,8 @@ dependencies = [ [[package]] name = "scrypto-schema" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "bitflags", "radix-engine-common", @@ -665,6 +665,16 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +[[package]] +name = "syn" +version = "1.0.93" +source = "git+https://github.com/dtolnay/syn.git?tag=1.0.93#2e505a847174ff8939431c4f5ffb565906590ac2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + [[package]] name = "syn" version = "1.0.109" @@ -727,10 +737,16 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + [[package]] name = "utils" -version = "0.12.0" -source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3-da3dbedc#da3dbedca051c88ddaa1f9baa72d95350eba8cc6" +version = "0.13.0" +source = "git+https://github.com/radixdlt/radixdlt-scrypto?tag=rcnet-v3.1-d8dbe49f#d8dbe49f243c8ff5e6f47fe014d28a20e5d70ce6" dependencies = [ "indexmap 2.0.0-pre", "serde", diff --git a/sbor-json/Cargo.toml b/sbor-json/Cargo.toml index 7605f415..d3749e91 100644 --- a/sbor-json/Cargo.toml +++ b/sbor-json/Cargo.toml @@ -1,14 +1,14 @@ [package] name = "sbor-json" -version = "0.12.0-rcnetv3.1" +version = "0.12.1" edition = "2021" description = "The implementation of the SBOR JSON representations" [dependencies] # The Scrypto dependencies needed. -sbor = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc", features = ["serde"] } -radix-engine-common = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc", features = ["serde"] } -radix-engine-interface = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3-da3dbedc" } +sbor = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f", features = ["serde"] } +radix-engine-common = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f", features = ["serde"] } +radix-engine-interface = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "rcnet-v3.1-d8dbe49f" } # The serde dependenices used for the serialization and deserialization of the JSON representations. serde = { version = "1.0.185", features = ["derive"] } diff --git a/sbor-json/tests/programmatic_scrypto_sbor.rs b/sbor-json/tests/programmatic_scrypto_sbor.rs index 7d7c0f93..81d9cdad 100644 --- a/sbor-json/tests/programmatic_scrypto_sbor.rs +++ b/sbor-json/tests/programmatic_scrypto_sbor.rs @@ -78,7 +78,7 @@ pub fn payload_serialized_with_schema_can_be_deserialized_as_no_schema_programma // Arrange let value = MyEnum::VariantWithFieldNames { field: 1 }; let payload = scrypto_encode(&value).unwrap(); - let (local_type_index, VersionedSchema::V1(schema)) = + let (local_type_id, VersionedSchema::V1(schema)) = generate_full_schema_from_single_type::(); let programmatic_json = { @@ -87,7 +87,7 @@ pub fn payload_serialized_with_schema_can_be_deserialized_as_no_schema_programma mode: SerializationMode::Programmatic, custom_context: ScryptoValueDisplayContext::with_optional_bech32(Some(&encoder)), schema: &schema, - type_index: local_type_index, + type_id: local_type_id, depth_limit: SCRYPTO_SBOR_V1_MAX_DEPTH, }; diff --git a/uniffi-bindgen/Cargo.lock b/uniffi-bindgen/Cargo.lock index a4ee94b1..fdaad921 100644 --- a/uniffi-bindgen/Cargo.lock +++ b/uniffi-bindgen/Cargo.lock @@ -461,7 +461,7 @@ dependencies = [ [[package]] name = "uniffi-bindgen" -version = "0.12.0-rcnetv3.1" +version = "0.12.1" dependencies = [ "uniffi", ] diff --git a/uniffi-bindgen/Cargo.toml b/uniffi-bindgen/Cargo.toml index 3d92c5a5..c6667881 100644 --- a/uniffi-bindgen/Cargo.toml +++ b/uniffi-bindgen/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uniffi-bindgen" -version = "0.12.0-rcnetv3.1" +version = "0.12.1" edition = "2021" [dependencies] diff --git a/update_test_manifests.py b/update_test_manifests.py index 6057604a..30fbceb0 100644 --- a/update_test_manifests.py +++ b/update_test_manifests.py @@ -56,7 +56,7 @@ def read_tag_or_version(manifest_path: str) -> str: with open(manifest_path, 'r') as file: contents: str = file.read() - pattern: str = r'scrypto\s?=\s?\{.*[branch|tag]\s?=\s?"([\w\d\/-]*)".*\}' + pattern: str = r'scrypto\s?=\s?\{.*[branch|tag]\s?=\s?"([\w\d\/.-]*)".*\}' return re.findall(pattern, contents)[0] def get_replacements(radixdlt_scrypto_directory: str) -> dict[str, str]: