From 5c43fca1f1417a7eed36e30ae0d8bcfe62520c4c Mon Sep 17 00:00:00 2001 From: Dmytro Kozhevin Date: Thu, 5 Sep 2024 14:06:58 -0400 Subject: [PATCH] Support for constructor-related functionality in Soroban SDK. The main non-test changes are updates for the auth-related data structures and a wrapper for the new deployer function (create_contract_with_constructor). The remaining changes concern the test infrastructure support, specifically contract creation utilities that support passing constructor arguments. --- Cargo.lock | 131 +++- Cargo.toml | 28 +- soroban-ledger-snapshot/src/lib.rs | 2 +- soroban-sdk-macros/src/derive_fn.rs | 4 + soroban-sdk/doctest_fixtures/contract.wasm | Bin 0 -> 639 bytes .../contract_with_constructor.wasm | Bin 0 -> 2434 bytes soroban-sdk/src/auth.rs | 20 + soroban-sdk/src/deploy.rs | 53 +- soroban-sdk/src/env.rs | 169 +++++- soroban-sdk/src/tests/contractimport.rs | 12 +- soroban-sdk/src/tests/env.rs | 23 +- soroban-sdk/src/tests/token_spec.rs | 4 +- soroban-sdk/src/testutils/mock_auth.rs | 6 + .../test/test_first_unchecked_panics.1.json | 2 +- .../test/test_get_unchecked_panics.1.json | 2 +- .../bytes/test/test_insert_panic.1.json | 2 +- .../test/test_last_unchecked_panics.1.json | 2 +- .../test/test_pop_unchecked_panics.1.json | 2 +- .../test/test_remove_unchecked_panics.1.json | 2 +- .../bytes/test/test_slice_panic.1.json | 2 +- ...checked_panics_on_key_type_mismatch.1.json | 2 +- .../test/test_remove_unchecked_panic.1.json | 2 +- ...checked_panics_on_key_type_mismatch.1.json | 2 +- .../tests/auth/auth_10_one/test.1.json | 77 ++- .../tests/auth/auth_15_one_repeat/test.1.json | 77 ++- .../test.1.json | 77 ++- .../auth/auth_20_deep_one_address/test.1.json | 77 ++- .../test_auth_tree.1.json | 77 ++- .../test.1.json | 102 +++- .../test_auth_tree.1.json | 77 ++- .../test.1.json | 102 +++- .../test_auth_tree.1.json | 77 ++- .../test_auth_as_tree.1.json | 77 ++- ...uth_not_allowed_with_separated_tree.1.json | 102 +++- .../tests/budget/test_budget.1.json | 27 +- .../contract_add_i32/test_functional.1.json | 27 +- .../test_invoke_expect_error.1.json | 27 +- .../contract_assert/test_try_invoke.1.json | 27 +- .../test_constructor.1.json | 572 ++++++++++++++++++ .../contract_docs/fn_/test_functional.1.json | 27 +- .../contract_duration/test_functional.1.json | 27 +- .../tests/contract_fn/test_functional.1.json | 27 +- .../test_invoke_expect_error.1.json | 27 +- .../test_invoke_expect_string.1.json | 27 +- .../contract_invoke/test_try_invoke.1.json | 27 +- .../test_functional.1.json | 27 +- .../tests/contract_snapshot/test.1.json | 27 +- .../tests/contract_snapshot/test.2.json | 27 +- .../tests/contract_store/test_storage.1.json | 27 +- ...orage_extension_past_max_ttl_panics.1.json | 27 +- .../contract_timepoint/test_functional.1.json | 27 +- .../contract_udt_enum/test_functional.1.json | 27 +- .../test_functional.1.json | 27 +- .../test_error_on_partial_decode.1.json | 2 +- .../test_functional.1.json | 27 +- .../test_long_names_functional.1.json | 27 +- .../test_error_on_partial_decode.1.json | 2 +- .../test_functional.1.json | 27 +- ...test_verify_sig_ed25519_invalid_sig.1.json | 2 +- ...ult_and_from_snapshot_same_settings.1.json | 27 +- ...ult_and_from_snapshot_same_settings.2.json | 27 +- ...ct_deploys_predictable_contract_ids.1.json | 33 +- ...ct_deploys_predictable_contract_ids.2.json | 83 ++- ...ct_deploys_predictable_contract_ids.3.json | 83 ++- .../test_snapshots/tests/max_ttl/max.1.json | 30 +- .../tests/prng/test_prng_fill_array.1.json | 30 +- .../tests/prng/test_prng_fill_bytes.1.json | 30 +- .../tests/prng/test_prng_fill_bytesn.1.json | 30 +- .../tests/prng/test_prng_fill_slice.1.json | 30 +- .../tests/prng/test_prng_fill_u64.1.json | 30 +- .../tests/prng/test_prng_gen_array.1.json | 30 +- .../tests/prng/test_prng_gen_bytesn.1.json | 30 +- .../tests/prng/test_prng_gen_len_bytes.1.json | 30 +- .../tests/prng/test_prng_gen_range_u64.1.json | 30 +- ...en_range_u64_panic_on_invalid_range.1.json | 30 +- .../tests/prng/test_prng_gen_u64.1.json | 30 +- .../tests/prng/test_prng_seed.1.json | 30 +- .../tests/prng/test_prng_seed.2.json | 30 +- .../tests/prng/test_prng_shuffle.1.json | 30 +- .../tests/prng/test_vec_shuffle.1.json | 30 +- .../tests/storage_testutils/all.1.json | 30 +- .../temp_entry_expiration.1.json | 30 +- .../test_persistent_entry_expiration.1.json | 30 +- .../storage_testutils/ttl_getters.1.json | 55 +- .../token_client/test_issuer_flags.1.json | 2 +- .../token_client/test_mock_all_auth.1.json | 27 +- .../tests/token_client/test_mock_auth.1.json | 52 +- ...t_unchecked_panics_on_out_of_bounds.1.json | 2 +- ...k_unchecked_panics_on_out_of_bounds.1.json | 2 +- ...t_unchecked_panics_on_out_of_bounds.1.json | 2 +- .../test/test_remove_unchecked_panics.1.json | 2 +- .../test/test_try_get_unchecked_panics.1.json | 2 +- ...k_unchecked_panics_on_out_of_bounds.1.json | 2 +- ...t_unchecked_panics_on_out_of_bounds.1.json | 2 +- tests/account/test_snapshots/test/test.1.json | 52 +- .../test_snapshots/test/test_add.1.json | 27 +- .../test_snapshots/test/test_add.1.json | 27 +- .../test_snapshots/test/test_add.1.json | 27 +- .../alloc/test_snapshots/test/test_add.1.json | 27 +- .../test_a/test_with_mock_all_auth.1.json | 27 +- .../test_a/test_with_mock_auth.1.json | 52 +- ...est_with_real_contract_auth_approve.1.json | 52 +- ...est_with_real_contract_auth_decline.1.json | 52 +- .../test_b/test_with_mock_all_auth.1.json | 52 +- .../test_b/test_with_mock_auth.1.json | 77 ++- ...est_with_real_contract_auth_approve.1.json | 77 ++- ...est_with_real_contract_auth_decline.1.json | 77 ++- tests/constructor/Cargo.toml | 18 + tests/constructor/src/lib.rs | 85 +++ .../test/test_constructor.1.json | 572 ++++++++++++++++++ ..._constructor_arguments_causes_panic.1.json | 188 ++++++ ..._constructor_arguments_causes_panic.1.json | 204 +++++++ ..._constructor_arguments_causes_panic.1.json | 198 ++++++ ..._constructor_arguments_causes_panic.1.json | 179 ++++++ .../test_snapshots/test/test_hello.1.json | 27 +- .../test_snapshots/test/test_hello.1.json | 33 +- .../test_snapshots/test/hello_ok.1.json | 27 +- .../test/try_hello_error.1.json | 27 +- .../test/try_hello_error_panic.1.json | 27 +- .../test/try_hello_error_panic_string.1.json | 27 +- ...llo_error_unexpected_contract_error.1.json | 27 +- .../test_snapshots/test/try_hello_ok.1.json | 27 +- .../test_snapshots/test/test_pub_event.1.json | 27 +- .../test_snapshots/test/test_add.1.json | 52 +- .../test_snapshots/test/test_logging.1.json | 27 +- .../test_snapshots/test/test_hello.1.json | 27 +- tests/udt/test_snapshots/test/test_add.1.json | 27 +- .../test_snapshots/test/test_add.1.json | 27 +- 128 files changed, 5763 insertions(+), 228 deletions(-) create mode 100644 soroban-sdk/doctest_fixtures/contract_with_constructor.wasm create mode 100644 soroban-sdk/test_snapshots/tests/contract_constructor/test_constructor.1.json create mode 100644 tests/constructor/Cargo.toml create mode 100644 tests/constructor/src/lib.rs create mode 100644 tests/constructor/test_snapshots/test/test_constructor.1.json create mode 100644 tests/constructor/test_snapshots/test_missing_constructor_arguments_causes_panic.1.json create mode 100644 tests/constructor/test_snapshots/test_passing_extra_constructor_arguments_causes_panic.1.json create mode 100644 tests/constructor/test_snapshots/test_passing_incorrectly_typed_constructor_arguments_causes_panic.1.json create mode 100644 tests/constructor/test_snapshots/test_passing_no_constructor_arguments_causes_panic.1.json diff --git a/Cargo.lock b/Cargo.lock index 39bd2ba9b..a995c1708 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,18 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + [[package]] name = "android-tzdata" version = "0.1.1" @@ -41,6 +53,12 @@ dependencies = [ "derive_arbitrary", ] +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + [[package]] name = "autocfg" version = "1.1.0" @@ -525,6 +543,9 @@ name = "hashbrown" version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", +] [[package]] name = "hex" @@ -697,6 +718,12 @@ dependencies = [ "adler", ] +[[package]] +name = "multi-stash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685a9ac4b61f4e728e1d2c6a7844609c16527aeb5e6c865915c08e619c16410f" + [[package]] name = "num-bigint" version = "0.4.4" @@ -1099,15 +1126,14 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.2" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "soroban-builtin-sdk-macros" -version = "21.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f57a68ef8777e28e274de0f3a88ad9a5a41d9a2eb461b4dd800b086f0e83b80" +version = "22.0.0" +source = "git+https://github.com/stellar/rs-soroban-env?rev=75b782119942a4c8be8003f2901db38b30b6db2d#75b782119942a4c8be8003f2901db38b30b6db2d" dependencies = [ "itertools", "proc-macro2", @@ -1117,9 +1143,8 @@ dependencies = [ [[package]] name = "soroban-env-common" -version = "21.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd1c89463835fe6da996318156d39f424b4f167c725ec692e5a7a2d4e694b3d" +version = "22.0.0" +source = "git+https://github.com/stellar/rs-soroban-env?rev=75b782119942a4c8be8003f2901db38b30b6db2d#75b782119942a4c8be8003f2901db38b30b6db2d" dependencies = [ "arbitrary", "crate-git-revision", @@ -1136,9 +1161,8 @@ dependencies = [ [[package]] name = "soroban-env-guest" -version = "21.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bfb2536811045d5cd0c656a324cbe9ce4467eb734c7946b74410d90dea5d0ce" +version = "22.0.0" +source = "git+https://github.com/stellar/rs-soroban-env?rev=75b782119942a4c8be8003f2901db38b30b6db2d#75b782119942a4c8be8003f2901db38b30b6db2d" dependencies = [ "soroban-env-common", "static_assertions", @@ -1146,9 +1170,8 @@ dependencies = [ [[package]] name = "soroban-env-host" -version = "21.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b7a32c28f281c423189f1298960194f0e0fc4eeb72378028171e556d8cd6160" +version = "22.0.0" +source = "git+https://github.com/stellar/rs-soroban-env?rev=75b782119942a4c8be8003f2901db38b30b6db2d#75b782119942a4c8be8003f2901db38b30b6db2d" dependencies = [ "backtrace", "curve25519-dalek", @@ -1179,9 +1202,8 @@ dependencies = [ [[package]] name = "soroban-env-macros" -version = "21.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "242926fe5e0d922f12d3796cd7cd02dd824e5ef1caa088f45fce20b618309f64" +version = "22.0.0" +source = "git+https://github.com/stellar/rs-soroban-env?rev=75b782119942a4c8be8003f2901db38b30b6db2d#75b782119942a4c8be8003f2901db38b30b6db2d" dependencies = [ "itertools", "proc-macro2", @@ -1282,13 +1304,16 @@ dependencies = [ [[package]] name = "soroban-wasmi" -version = "0.31.1-soroban.20.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "710403de32d0e0c35375518cb995d4fc056d0d48966f2e56ea471b8cb8fc9719" +version = "0.36.0-soroban.22.0.0" +source = "git+https://github.com/stellar/wasmi?rev=122a74a7c491929e5ac9de876099154ef7c06d06#122a74a7c491929e5ac9de876099154ef7c06d06" dependencies = [ + "arrayvec", + "multi-stash", + "num-derive", + "num-traits", "smallvec", "spin", - "wasmi_arena", + "wasmi_collections", "wasmi_core", "wasmparser-nostd", ] @@ -1328,9 +1353,8 @@ dependencies = [ [[package]] name = "stellar-xdr" -version = "21.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2675a71212ed39a806e415b0dbf4702879ff288ec7f5ee996dda42a135512b50" +version = "22.0.0" +source = "git+https://github.com/stellar/rs-stellar-xdr?rev=39d7dbb0c12bd422ee43a6e2e3277789da4eaac8#39d7dbb0c12bd422ee43a6e2e3277789da4eaac8" dependencies = [ "arbitrary", "base64 0.13.1", @@ -1342,6 +1366,17 @@ dependencies = [ "stellar-strkey", ] +[[package]] +name = "string-interner" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c6a0d765f5807e98a091107bae0a56ea3799f66a5de47b2c84c94a39c09974e" +dependencies = [ + "cfg-if", + "hashbrown 0.14.3", + "serde", +] + [[package]] name = "strsim" version = "0.10.0" @@ -1420,6 +1455,13 @@ dependencies = [ "soroban-sdk", ] +[[package]] +name = "test_constructor" +version = "21.6.0" +dependencies = [ + "soroban-sdk", +] + [[package]] name = "test_contract_data" version = "21.6.0" @@ -1655,16 +1697,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" [[package]] -name = "wasmi_arena" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "104a7f73be44570cac297b3035d76b169d6599637631cf37a1703326a0727073" +name = "wasmi_collections" +version = "0.36.0-soroban.22.0.0" +source = "git+https://github.com/stellar/wasmi?rev=122a74a7c491929e5ac9de876099154ef7c06d06#122a74a7c491929e5ac9de876099154ef7c06d06" +dependencies = [ + "ahash", + "hashbrown 0.14.3", + "string-interner", +] [[package]] name = "wasmi_core" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf1a7db34bff95b85c261002720c00c3a6168256dcb93041d3fa2054d19856a" +version = "0.36.0-soroban.22.0.0" +source = "git+https://github.com/stellar/wasmi?rev=122a74a7c491929e5ac9de876099154ef7c06d06#122a74a7c491929e5ac9de876099154ef7c06d06" dependencies = [ "downcast-rs", "libm", @@ -1684,9 +1729,9 @@ dependencies = [ [[package]] name = "wasmparser-nostd" -version = "0.100.1" +version = "0.100.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9157cab83003221bfd385833ab587a039f5d6fa7304854042ba358a3b09e0724" +checksum = "d5a015fe95f3504a94bb1462c717aae75253e39b9dd6c3fb1062c934535c64aa" dependencies = [ "indexmap-nostd", ] @@ -1838,6 +1883,26 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "zeroize" version = "1.7.0" diff --git a/Cargo.toml b/Cargo.toml index 8ff938800..ec990f3b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ members = [ [workspace.package] version = "21.6.0" -rust-version = "1.74.0" +rust-version = "1.79.0" [workspace.dependencies] soroban-sdk = { version = "21.6.0", path = "soroban-sdk" } @@ -24,34 +24,34 @@ soroban-ledger-snapshot = { version = "21.6.0", path = "soroban-ledger-snapshot" soroban-token-sdk = { version = "21.6.0", path = "soroban-token-sdk" } [workspace.dependencies.soroban-env-common] -version = "=21.2.1" -# git = "https://github.com/stellar/rs-soroban-env" -# rev = "0c918ac2bd808ba1a850281c6b1c731e7fe50c53" +version = "=22.0.0" +git = "https://github.com/stellar/rs-soroban-env" +rev = "75b782119942a4c8be8003f2901db38b30b6db2d" [workspace.dependencies.soroban-env-guest] -version = "=21.2.1" -# git = "https://github.com/stellar/rs-soroban-env" -# rev = "0c918ac2bd808ba1a850281c6b1c731e7fe50c53" +version = "=22.0.0" +git = "https://github.com/stellar/rs-soroban-env" +rev = "75b782119942a4c8be8003f2901db38b30b6db2d" [workspace.dependencies.soroban-env-host] -version = "=21.2.1" -# git = "https://github.com/stellar/rs-soroban-env" -# rev = "0c918ac2bd808ba1a850281c6b1c731e7fe50c53" +version = "=22.0.0" +git = "https://github.com/stellar/rs-soroban-env" +rev = "75b782119942a4c8be8003f2901db38b30b6db2d" [workspace.dependencies.stellar-strkey] version = "=0.0.8" [workspace.dependencies.stellar-xdr] -version = "=21.2.0" +version = "=22.0.0" default-features = false features = ["curr"] -# git = "https://github.com/stellar/rs-stellar-xdr" -# rev = "d0138770652a615e3cd99447f2f2727658c17450" +git = "https://github.com/stellar/rs-stellar-xdr" +rev = "39d7dbb0c12bd422ee43a6e2e3277789da4eaac8" #[patch."https://github.com/stellar/rs-soroban-env"] #soroban-env-common = { path = "../rs-soroban-env/soroban-env-common" } #soroban-env-guest = { path = "../rs-soroban-env/soroban-env-guest" } -#soroban-env-host = { path = "../rs-soroban-env/soroban-env-host/" } +#soroban-env-host = { path = "../rs-soroban-env/soroban-env-host" } #[patch."https://github.com/stellar/rs-stellar-xdr"] #stellar-xdr = { path = "../rs-stellar-xdr/" } diff --git a/soroban-ledger-snapshot/src/lib.rs b/soroban-ledger-snapshot/src/lib.rs index bcdfeecaf..0aba7bea9 100644 --- a/soroban-ledger-snapshot/src/lib.rs +++ b/soroban-ledger-snapshot/src/lib.rs @@ -168,7 +168,7 @@ impl LedgerSnapshot { impl Default for LedgerSnapshot { fn default() -> Self { Self { - protocol_version: 20, + protocol_version: 22, sequence_number: Default::default(), timestamp: Default::default(), network_id: Default::default(), diff --git a/soroban-sdk-macros/src/derive_fn.rs b/soroban-sdk-macros/src/derive_fn.rs index 168d8b0fc..a645b4b88 100644 --- a/soroban-sdk-macros/src/derive_fn.rs +++ b/soroban-sdk-macros/src/derive_fn.rs @@ -112,6 +112,7 @@ pub fn derive_pub_fn( quote! {} }; let slice_args: Vec = (0..wrap_args.len()).map(|n| quote! { args[#n] }).collect(); + let arg_count = slice_args.len(); let use_trait = if let Some(t) = trait_ident { quote! { use super::#t } } else { @@ -150,6 +151,9 @@ pub fn derive_pub_fn( env: #crate_path::Env, args: &[#crate_path::Val], ) -> #crate_path::Val { + if args.len() != #arg_count { + panic!("invalid number of input arguments: {} expected, got {}", #arg_count, args.len()); + } #[allow(deprecated)] invoke_raw(env, #(#slice_args),*) } diff --git a/soroban-sdk/doctest_fixtures/contract.wasm b/soroban-sdk/doctest_fixtures/contract.wasm index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..275050c9450ce05a46fcfc13d29d92c51f3fa08b 100644 GIT binary patch literal 639 zcmY*W!EVz)5S^K=P3SgYB#_{O)+q-#VB)4pnp^Dy7p{mKa@O`nq*c;jM?nZ=8z_ha z2d;cUf1`g^#!i~5d)Rq1Z|2R@F6exQ0Dup7##mr6rm}!B6*UB)HsKVzOiwWa5VnOR zgs=pHV?Plk232(lvV`05&MV8Fnb}$PnLy|?1;NwyZWN_@sUtH_1D7b{zZQue0HiHmd5&rmFRTa9pM^a(f`t4!}uGm9a2Zau^ z6}TuBC>)9w2Qd^N{~=p}q}GcZpIgYZ7*k_!9Mjyj@Nk_7T0+S?@g`{ z^De)J`3i4gz6rU4WZ{4onRg|w(R&Q@Nn)N%Y&D(Vfyqj^evQ}+Y={dl7Ay=`BO1!kyssD`s(CeUxEns>4@xThiQdW+1S-s85^+&SdtY@r9WL^y@(oAc zVUZ&$>QVM(FdRVJp(6W+44>B?27O+W|EidwNVIt7Tm4z5y_6>?yn`saU%;v0W9Z3$ z2|`%=QWi!9pW9IfpU8N|f5ZT*lCxNKC=51A>J>XR{5UcPk+Waa5{M0k#x$`aU--l3 zTyS3w6&(Z+-m@ZSAYwnfZ$(~T2qCBmP2Gh&5kWJdJ;bcSpw@G*{hxs> zaoX6);m9I5qoOk4&A_9Y*Yid%PG20NT{L?t);qerqEUabl5VeX10-3@-U=&tSPwD`q4MZn!8jQ0|7;Faxm2JusQa(KFuLhkG5iYe3+HTtnF8%Led0 zX8GVAAiNluYxLUj@qP07@!_77EY+2;whtSDr7 z<|Z_J5K(V8pz5S#P2mu70`)A&)YFii1yO z*-I)6P&YN?70EV{|N6(lu>2qYWidFR=Z^hr>tCD<`=`Et;nvikrIQd$H?=hm2)H-@ zLxG%qdXoQfbu|yggnsWBgR&UZ2@I-_0c93GfgNl+31YsR8hg8lUP5V$lPNkq_Zte? zLc4CeokCs(s#gMraW#sj0N>Jj1roB*OLTA~d>4@{+$XNhDoV0;RhoSPfK1`z@0**`>!Vv{_EjT2#_%0jKX@U`oGv<*RYMvEFFL z+s&nTYv&3+an, } +/// Authorization context for `create_contract` host function that creates a +/// new contract on behalf of authorizer address. +/// This is the same as `CreateContractHostFnContext`, but also has +/// contract constructor arguments. +#[derive(Clone)] +#[contracttype(crate_path = "crate", export = false)] +pub struct CreateContractWithConstructorHostFnContext { + pub executable: ContractExecutable, + pub salt: BytesN<32>, + pub constructor_args: Vec, +} + /// Contract executable used for creating a new contract and used in /// `CreateContractHostFnContext`. #[derive(Clone)] @@ -53,8 +69,12 @@ pub enum ContractExecutable { #[derive(Clone)] #[contracttype(crate_path = "crate", export = false)] pub enum InvokerContractAuthEntry { + /// Invoke a contract. Contract(SubContractInvocation), + /// Create a contract passing 0 arguments to constructor. CreateContractHostFn(CreateContractHostFnContext), + /// Create a contract passing 0 or more arguments to constructor. + CreateContractWithCtorHostFn(CreateContractWithConstructorHostFnContext), } /// Value of contract node in InvokerContractAuthEntry tree. diff --git a/soroban-sdk/src/deploy.rs b/soroban-sdk/src/deploy.rs index 2e3953b72..1471f0e72 100644 --- a/soroban-sdk/src/deploy.rs +++ b/soroban-sdk/src/deploy.rs @@ -12,14 +12,16 @@ //! ### Examples //! //! ``` -//! # use soroban_sdk::{contract, contractimpl, BytesN, Env, Symbol}; +//! # use soroban_sdk::{contract, contractimpl, BytesN, Env, Symbol, IntoVal}; //! # +//! # const DEPLOYED_WASM: &[u8] = include_bytes!("../doctest_fixtures/contract.wasm"); +//! # const DEPLOYED_WASM_WITH_CTOR: &[u8] = include_bytes!("../doctest_fixtures/contract_with_constructor.wasm"); //! # #[contract] //! # pub struct Contract; //! # //! # #[contractimpl] //! # impl Contract { -//! # pub fn f(env: Env, wasm_hash: BytesN<32>) { +//! # pub fn deploy(env: Env, wasm_hash: BytesN<32>) { //! # let salt = [0u8; 32]; //! # let deployer = env.deployer().with_current_contract(salt); //! # // Deployed contract address is deterministic and can be accessed @@ -27,23 +29,37 @@ //! # let _ = deployer.deployed_address(); //! # let contract_address = deployer.deploy(wasm_hash); //! # } +//! # +//! # pub fn deploy_with_constructor(env: Env, wasm_hash: BytesN<32>) { +//! # let salt = [1u8; 32]; +//! # let deployer = env.deployer().with_current_contract(salt); +//! # // Deployed contract address is deterministic and can be accessed +//! # // before deploying the contract. +//! # let _ = deployer.deployed_address(); +//! # let contract_address = deployer.deploy_with_constructor( +//! # wasm_hash, (1_u32, 2_i64).into_val(&env)); +//! # } //! # } //! # //! # #[cfg(feature = "testutils")] //! # fn main() { //! # let env = Env::default(); //! # let contract_address = env.register_contract(None, Contract); +//! # let contract = ContractClient::new(&env, &contract_address); //! # // Install the contract code before deploying its instance. -//! # let mock_wasm = [0u8; 0]; -//! # let wasm_hash = env.deployer().upload_contract_wasm(mock_wasm.as_slice()); -//! # ContractClient::new(&env, &contract_address).f(&wasm_hash); +//! # let wasm_hash = env.deployer().upload_contract_wasm(DEPLOYED_WASM); +//! # contract.deploy(&wasm_hash); +//! # // Now deploy a contract that has a constructor. +//! # let wasm_hash = env.deployer().upload_contract_wasm(DEPLOYED_WASM_WITH_CTOR); +//! # contract.deploy_with_constructor(&wasm_hash); //! # } //! # #[cfg(not(feature = "testutils"))] //! # fn main() { } //! ``` use crate::{ - env::internal::Env as _, unwrap::UnwrapInfallible, Address, Bytes, BytesN, Env, IntoVal, + env::internal::Env as _, unwrap::UnwrapInfallible, Address, Bytes, BytesN, Env, IntoVal, Val, + Vec, }; /// Deployer provides access to deploying contracts. @@ -229,6 +245,31 @@ impl DeployerWithAddress { .unwrap_infallible(); unsafe { Address::unchecked_new(env.clone(), address_obj) } } + + /// Deploy a contract that uses Wasm executable with provided hash. + /// + /// `constructor_args` will be passed to the contract's constructor. + /// + /// The address of the deployed contract is defined by the deployer address + /// and provided salt. + /// + /// Returns the deployed contract's address. + pub fn deploy_with_constructor( + &self, + wasm_hash: impl IntoVal>, + constructor_args: Vec, + ) -> Address { + let env = &self.env; + let address_obj = env + .create_contract_with_constructor( + self.address.to_object(), + wasm_hash.into_val(env).to_object(), + self.salt.to_object(), + constructor_args.to_object(), + ) + .unwrap_infallible(); + unsafe { Address::unchecked_new(env.clone(), address_obj) } + } } pub struct DeployerWithAsset { diff --git a/soroban-sdk/src/env.rs b/soroban-sdk/src/env.rs index 0b815e1ca..f54fd902e 100644 --- a/soroban-sdk/src/env.rs +++ b/soroban-sdk/src/env.rs @@ -504,7 +504,7 @@ impl Env { let rf = Rc::new(EmptySnapshotSource()); let info = internal::LedgerInfo { - protocol_version: 21, + protocol_version: 22, sequence_number: 0, timestamp: 0, network_id: [0; 32], @@ -582,9 +582,18 @@ impl Env { /// with that contract ID. Providing `None` causes the Env to generate a new /// contract ID that is assigned to the contract. /// + /// If a contract has a constructor defined, then it will be called with + /// no arguments. In case if constructor has to take some arguments, use + /// `register_contract_with_constructor`. + /// /// Registering a contract that is already registered replaces it. + /// Use re-registration with caution as it does not exist in the real + /// (on-chain) environment. Specifically, new contract's constructor will be + /// called again during re-registration. That behavior only exists for this + /// test utility and is not reproducible on-chain, where contract Wasm + /// updates don't cause constructor to be called. /// - /// Returns the contract ID of the registered contract. + /// Returns the address of the registered contract. /// /// ### Examples /// ``` @@ -612,6 +621,55 @@ impl Env { &self, contract_id: impl Into>, contract: T, + ) -> Address { + self.register_contract_with_constructor(contract_id, contract, crate::vec![&self]) + } + + /// Register a contract with the [Env] for testing. + /// + /// This acts the in the same fashion as `register_contract`, but allows + /// passing arguments to the contract's constructor. + /// + /// Passing a contract ID for the first arguments registers the contract + /// with that contract ID. Providing `None` causes the Env to generate a new + /// contract ID that is assigned to the contract. + /// + /// Registering a contract that is already registered replaces it. + /// Use re-registration with caution as it does not exist in the real + /// (on-chain) environment. Specifically, new contract's constructor will be + /// called again during re-registration. That behavior only exists for this + /// test utility and is not reproducible on-chain, where contract Wasm + /// updates don't cause constructor to be called. + /// + /// Returns the address of the registered contract. + /// + /// ### Examples + /// ``` + /// use soroban_sdk::{contract, contractimpl, BytesN, Env, Symbol, IntoVal}; + /// + /// #[contract] + /// pub struct Contract; + /// + /// #[contractimpl] + /// impl Contract { + /// pub fn __constructor(_env: Env, _input: u32) { + /// } + /// } + /// + /// #[test] + /// fn test() { + /// # } + /// # fn main() { + /// let env = Env::default(); + /// let contract_id = env.register_contract_with_constructor( + /// None, Contract, (123_u32,).into_val(&env)); + /// } + /// ``` + pub fn register_contract_with_constructor<'a, T: ContractFunctionSet + 'static>( + &self, + contract_id: impl Into>, + contract: T, + constructor_args: Vec, ) -> Address { struct InternalContractFunctionSet(pub(crate) T); impl internal::ContractFunctionSet for InternalContractFunctionSet { @@ -642,23 +700,29 @@ impl Env { Address::generate(self) }; self.env_impl - .register_test_contract( + .register_test_contract_with_constructor( contract_id.to_object(), Rc::new(InternalContractFunctionSet(contract)), + constructor_args.to_object(), ) .unwrap(); contract_id } - /// Register a contract in a WASM file with the [Env] for testing. + /// Register a contract in a Wasm file with the [Env] for testing. /// /// Passing a contract ID for the first arguments registers the contract /// with that contract ID. Providing `None` causes the Env to generate a new /// contract ID that is assigned to the contract. /// /// Registering a contract that is already registered replaces it. + /// Use re-registration with caution as it does not exist in the real + /// (on-chain) environment. Specifically, new contract's constructor will be + /// called again during re-registration. That behavior only exists for this + /// test utility and is not reproducible on-chain, where contract Wasm + /// updates don't cause constructor to be called. /// - /// Returns the contract ID of the registered contract. + /// Returns the address of the registered contract. /// /// ### Examples /// ``` @@ -683,6 +747,54 @@ impl Env { self.register_contract_with_optional_contract_id_and_executable( contract_id, xdr::ContractExecutable::Wasm(xdr::Hash(wasm_hash.into())), + crate::vec![&self], + ) + } + + /// Register a contract in a Wasm file with the [Env] for testing. + /// + /// This acts the in the same fashion as `register_contract`, but allows + /// passing arguments to the contract's constructor. + /// + /// Passing a contract ID for the first arguments registers the contract + /// with that contract ID. Providing `None` causes the Env to generate a new + /// contract ID that is assigned to the contract. + /// + /// Registering a contract that is already registered replaces it. + /// Use re-registration with caution as it does not exist in the real + /// (on-chain) environment. Specifically, new contract's constructor will be + /// called again during re-registration. That behavior only exists for this + /// test utility and is not reproducible on-chain, where contract Wasm + /// updates don't cause constructor to be called. + /// + /// Returns the address of the registered contract. + /// + /// ### Examples + /// ``` + /// use soroban_sdk::{BytesN, Env, IntoVal}; + /// // This is Wasm for `constructor` test contract from this repo. + /// const WASM: &[u8] = include_bytes!("../doctest_fixtures/contract_with_constructor.wasm"); + /// + /// #[test] + /// fn test() { + /// # } + /// # fn main() { + /// let env = Env::default(); + /// env.register_contract_wasm_with_constructor( + /// None, WASM, (10_u32, 100_i64).into_val(&env)); + /// } + /// ``` + pub fn register_contract_wasm_with_constructor<'a>( + &self, + contract_id: impl Into>, + contract_wasm: impl IntoVal, + constructor_args: Vec, + ) -> Address { + let wasm_hash: BytesN<32> = self.deployer().upload_contract_wasm(contract_wasm); + self.register_contract_with_optional_contract_id_and_executable( + contract_id, + xdr::ContractExecutable::Wasm(xdr::Hash(wasm_hash.into())), + constructor_args, ) } @@ -783,32 +895,45 @@ impl Env { &self, contract_id: impl Into>, executable: xdr::ContractExecutable, + constructor_args: Vec, ) -> Address { if let Some(contract_id) = contract_id.into() { - self.register_contract_with_contract_id_and_executable(contract_id, executable); + self.register_contract_with_contract_id_and_executable( + contract_id, + executable, + constructor_args, + ); contract_id.clone() } else { - self.register_contract_with_source(executable) + self.register_contract_with_source(executable, constructor_args) } } - fn register_contract_with_source(&self, executable: xdr::ContractExecutable) -> Address { + fn register_contract_with_source( + &self, + executable: xdr::ContractExecutable, + constructor_args: Vec, + ) -> Address { let prev_auth_manager = self.env_impl.snapshot_auth_manager().unwrap(); self.env_impl.switch_to_recording_auth(true).unwrap(); - + let args_vec: std::vec::Vec = + constructor_args.iter().map(|v| v.into_val(self)).collect(); let contract_id: Address = self .env_impl - .invoke_function(xdr::HostFunction::CreateContract(xdr::CreateContractArgs { - contract_id_preimage: xdr::ContractIdPreimage::Address( - xdr::ContractIdPreimageFromAddress { - address: xdr::ScAddress::Contract(xdr::Hash( - self.with_generator(|mut g| g.address()), - )), - salt: xdr::Uint256([0; 32]), - }, - ), - executable, - })) + .invoke_function(xdr::HostFunction::CreateContractV2( + xdr::CreateContractArgsV2 { + contract_id_preimage: xdr::ContractIdPreimage::Address( + xdr::ContractIdPreimageFromAddress { + address: xdr::ScAddress::Contract(xdr::Hash( + self.with_generator(|mut g| g.address()), + )), + salt: xdr::Uint256([0; 32]), + }, + ), + executable, + constructor_args: args_vec.try_into().unwrap(), + }, + )) .unwrap() .try_into_val(self) .unwrap(); @@ -1207,6 +1332,7 @@ impl Env { &self, contract_address: &Address, executable: xdr::ContractExecutable, + constructor_args: Vec, ) { let contract_id = contract_address.contract_id(); let data_key = xdr::ScVal::LedgerKeyContractInstance; @@ -1243,6 +1369,9 @@ impl Env { ) }) .unwrap(); + self.env_impl + .call_constructor_for_stored_contract_unsafe(&contract_id, constructor_args.to_object()) + .unwrap(); } /// Run the function as if executed by the given contract ID. diff --git a/soroban-sdk/src/tests/contractimport.rs b/soroban-sdk/src/tests/contractimport.rs index 338567992..064188346 100644 --- a/soroban-sdk/src/tests/contractimport.rs +++ b/soroban-sdk/src/tests/contractimport.rs @@ -10,6 +10,13 @@ mod addcontract { ); } +mod addcontract_u128 { + use crate as soroban_sdk; + soroban_sdk::contractimport!( + file = "../target/wasm32-unknown-unknown/release/test_add_u128.wasm" + ); +} + mod subcontract { use crate as soroban_sdk; #[soroban_sdk::contract] @@ -69,10 +76,7 @@ fn test_register_at_id() { #[test] fn test_reregister_wasm() { let e = Env::default(); - - // Register a contract with code that will fail, to ensure this code isn't - // the code that gets activated when invoked. - let add_contract_id = e.register_contract_wasm(None, []); + let add_contract_id = e.register_contract_wasm(None, addcontract_u128::WASM); // Reregister the contract with different code replacing the code. This is // the contract we expect to be executed. e.register_contract_wasm(&add_contract_id, addcontract::WASM); diff --git a/soroban-sdk/src/tests/env.rs b/soroban-sdk/src/tests/env.rs index 3eb4a1e0e..1042045d0 100644 --- a/soroban-sdk/src/tests/env.rs +++ b/soroban-sdk/src/tests/env.rs @@ -2,6 +2,7 @@ use crate::{ self as soroban_sdk, contract, contractimpl, env::EnvTestConfig, testutils::{Address as _, Logs as _}, + xdr::{ScErrorCode, ScErrorType}, Address, Env, Error, }; @@ -59,15 +60,15 @@ fn default_and_from_snapshot_same_settings() { assert_eq!( r1, Err(Ok(Error::from_type_and_code( - stellar_xdr::curr::ScErrorType::Context, - stellar_xdr::curr::ScErrorCode::InvalidAction + ScErrorType::Context, + ScErrorCode::InvalidAction ))) ); assert_eq!( r2, Err(Ok(Error::from_type_and_code( - stellar_xdr::curr::ScErrorType::Context, - stellar_xdr::curr::ScErrorCode::InvalidAction + ScErrorType::Context, + ScErrorCode::InvalidAction ))) ); @@ -115,8 +116,8 @@ fn test_snapshot_file() { .join("test_snapshot_file"); let p1 = p.with_extension("1.json"); let p2 = p.with_extension("2.json"); - assert!(!p1.exists()); - assert!(!p2.exists()); + let _ = std::fs::remove_file(&p1); + let _ = std::fs::remove_file(&p2); { let e1 = Env::default(); assert!(!p1.exists()); @@ -157,9 +158,9 @@ fn test_snapshot_file_disabled() { .join("env") .join("test_snapshot_file_disabled"); let p1 = p.with_extension("1.json"); - assert!(!p1.exists()); let p2 = p.with_extension("2.json"); - assert!(!p2.exists()); + let _ = std::fs::remove_file(&p1); + let _ = std::fs::remove_file(&p2); { let e1 = Env::default(); let _ = e1.register_contract(None, Contract); @@ -173,7 +174,6 @@ fn test_snapshot_file_disabled() { assert!(p1.exists()); assert!(!p2.exists()); let _ = std::fs::remove_file(&p1); - let _ = std::fs::remove_file(&p2); } /// Test that the test snapshot file is not written when disabled after @@ -185,9 +185,9 @@ fn test_snapshot_file_disabled_after_creation() { .join("env") .join("test_snapshot_file_disabled_after_creation"); let p1 = p.with_extension("1.json"); - assert!(!p1.exists()); let p2 = p.with_extension("2.json"); - assert!(!p2.exists()); + let _ = std::fs::remove_file(&p1); + let _ = std::fs::remove_file(&p2); { let e1 = Env::default(); let _ = e1.register_contract(None, Contract); @@ -202,5 +202,4 @@ fn test_snapshot_file_disabled_after_creation() { assert!(p1.exists()); assert!(!p2.exists()); let _ = std::fs::remove_file(&p1); - let _ = std::fs::remove_file(&p2); } diff --git a/soroban-sdk/src/tests/token_spec.rs b/soroban-sdk/src/tests/token_spec.rs index d1df16e13..62e2d28ed 100644 --- a/soroban-sdk/src/tests/token_spec.rs +++ b/soroban-sdk/src/tests/token_spec.rs @@ -2,10 +2,8 @@ use crate as soroban_sdk; use soroban_sdk::{ token::{StellarAssetSpec, SPEC_XDR_INPUT, SPEC_XDR_LEN}, - xdr::{Error, ReadXdr, ScSpecEntry}, + xdr::{Error, Limited, Limits, ReadXdr, ScSpecEntry}, }; -use stellar_xdr::curr as stellar_xdr; -use stellar_xdr::{Limited, Limits}; extern crate std; diff --git a/soroban-sdk/src/testutils/mock_auth.rs b/soroban-sdk/src/testutils/mock_auth.rs index 1dc4b006f..ba2446d93 100644 --- a/soroban-sdk/src/testutils/mock_auth.rs +++ b/soroban-sdk/src/testutils/mock_auth.rs @@ -98,6 +98,9 @@ pub enum AuthorizedFunction { /// Create contract host function with arguments specified as the respective /// XDR. CreateContractHostFn(xdr::CreateContractArgs), + /// Create contract host function with arguments specified as the respective + /// XDR. Supports passing constructor arguments. + CreateContractV2HostFn(xdr::CreateContractArgsV2), } impl AuthorizedFunction { @@ -121,6 +124,9 @@ impl AuthorizedFunction { xdr::SorobanAuthorizedFunction::CreateContractHostFn(create_contract) => { Self::CreateContractHostFn(create_contract.clone()) } + xdr::SorobanAuthorizedFunction::CreateContractV2HostFn(create_contract) => { + Self::CreateContractV2HostFn(create_contract.clone()) + } } } } diff --git a/soroban-sdk/test_snapshots/bytes/test/test_first_unchecked_panics.1.json b/soroban-sdk/test_snapshots/bytes/test/test_first_unchecked_panics.1.json index 027f84d50..06c5515c0 100644 --- a/soroban-sdk/test_snapshots/bytes/test/test_first_unchecked_panics.1.json +++ b/soroban-sdk/test_snapshots/bytes/test/test_first_unchecked_panics.1.json @@ -5,7 +5,7 @@ }, "auth": [], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/bytes/test/test_get_unchecked_panics.1.json b/soroban-sdk/test_snapshots/bytes/test/test_get_unchecked_panics.1.json index da2725b91..21793fb33 100644 --- a/soroban-sdk/test_snapshots/bytes/test/test_get_unchecked_panics.1.json +++ b/soroban-sdk/test_snapshots/bytes/test/test_get_unchecked_panics.1.json @@ -5,7 +5,7 @@ }, "auth": [], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/bytes/test/test_insert_panic.1.json b/soroban-sdk/test_snapshots/bytes/test/test_insert_panic.1.json index a9484f33a..213e18be8 100644 --- a/soroban-sdk/test_snapshots/bytes/test/test_insert_panic.1.json +++ b/soroban-sdk/test_snapshots/bytes/test/test_insert_panic.1.json @@ -5,7 +5,7 @@ }, "auth": [], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/bytes/test/test_last_unchecked_panics.1.json b/soroban-sdk/test_snapshots/bytes/test/test_last_unchecked_panics.1.json index da303c7a4..e78f65366 100644 --- a/soroban-sdk/test_snapshots/bytes/test/test_last_unchecked_panics.1.json +++ b/soroban-sdk/test_snapshots/bytes/test/test_last_unchecked_panics.1.json @@ -5,7 +5,7 @@ }, "auth": [], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/bytes/test/test_pop_unchecked_panics.1.json b/soroban-sdk/test_snapshots/bytes/test/test_pop_unchecked_panics.1.json index da303c7a4..e78f65366 100644 --- a/soroban-sdk/test_snapshots/bytes/test/test_pop_unchecked_panics.1.json +++ b/soroban-sdk/test_snapshots/bytes/test/test_pop_unchecked_panics.1.json @@ -5,7 +5,7 @@ }, "auth": [], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/bytes/test/test_remove_unchecked_panics.1.json b/soroban-sdk/test_snapshots/bytes/test/test_remove_unchecked_panics.1.json index cce06fe84..21d95ad18 100644 --- a/soroban-sdk/test_snapshots/bytes/test/test_remove_unchecked_panics.1.json +++ b/soroban-sdk/test_snapshots/bytes/test/test_remove_unchecked_panics.1.json @@ -5,7 +5,7 @@ }, "auth": [], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/bytes/test/test_slice_panic.1.json b/soroban-sdk/test_snapshots/bytes/test/test_slice_panic.1.json index 7a5a85ab4..4d23c1f9d 100644 --- a/soroban-sdk/test_snapshots/bytes/test/test_slice_panic.1.json +++ b/soroban-sdk/test_snapshots/bytes/test/test_slice_panic.1.json @@ -5,7 +5,7 @@ }, "auth": [], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/map/test/test_get_unchecked_panics_on_key_type_mismatch.1.json b/soroban-sdk/test_snapshots/map/test/test_get_unchecked_panics_on_key_type_mismatch.1.json index 478043979..18d58098c 100644 --- a/soroban-sdk/test_snapshots/map/test/test_get_unchecked_panics_on_key_type_mismatch.1.json +++ b/soroban-sdk/test_snapshots/map/test/test_get_unchecked_panics_on_key_type_mismatch.1.json @@ -5,7 +5,7 @@ }, "auth": [], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/map/test/test_remove_unchecked_panic.1.json b/soroban-sdk/test_snapshots/map/test/test_remove_unchecked_panic.1.json index 1087c18af..ae81a7271 100644 --- a/soroban-sdk/test_snapshots/map/test/test_remove_unchecked_panic.1.json +++ b/soroban-sdk/test_snapshots/map/test/test_remove_unchecked_panic.1.json @@ -5,7 +5,7 @@ }, "auth": [], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/map/test/test_try_get_unchecked_panics_on_key_type_mismatch.1.json b/soroban-sdk/test_snapshots/map/test/test_try_get_unchecked_panics_on_key_type_mismatch.1.json index 478043979..18d58098c 100644 --- a/soroban-sdk/test_snapshots/map/test/test_try_get_unchecked_panics_on_key_type_mismatch.1.json +++ b/soroban-sdk/test_snapshots/map/test/test_try_get_unchecked_panics_on_key_type_mismatch.1.json @@ -5,7 +5,7 @@ }, "auth": [], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/auth/auth_10_one/test.1.json b/soroban-sdk/test_snapshots/tests/auth/auth_10_one/test.1.json index 0bc673cab..ce85fe717 100644 --- a/soroban-sdk/test_snapshots/tests/auth/auth_10_one/test.1.json +++ b/soroban-sdk/test_snapshots/tests/auth/auth_10_one/test.1.json @@ -4,6 +4,8 @@ "nonce": 2 }, "auth": [ + [], + [], [ [ "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", @@ -29,6 +31,7 @@ } ] ], + [], [ [ "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", @@ -56,7 +59,7 @@ ] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -219,6 +222,54 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000002" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", @@ -379,6 +430,30 @@ }, "failed_call": false }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000002" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/auth/auth_15_one_repeat/test.1.json b/soroban-sdk/test_snapshots/tests/auth/auth_15_one_repeat/test.1.json index ecc3fd3cd..9c0b44e05 100644 --- a/soroban-sdk/test_snapshots/tests/auth/auth_15_one_repeat/test.1.json +++ b/soroban-sdk/test_snapshots/tests/auth/auth_15_one_repeat/test.1.json @@ -4,6 +4,9 @@ "nonce": 2 }, "auth": [ + [], + [], + [], [ [ "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", @@ -54,7 +57,7 @@ ] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -217,6 +220,78 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000002" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000002" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/auth/auth_17_no_consume_requirement/test.1.json b/soroban-sdk/test_snapshots/tests/auth/auth_17_no_consume_requirement/test.1.json index d49547637..2beb38f86 100644 --- a/soroban-sdk/test_snapshots/tests/auth/auth_17_no_consume_requirement/test.1.json +++ b/soroban-sdk/test_snapshots/tests/auth/auth_17_no_consume_requirement/test.1.json @@ -4,6 +4,9 @@ "nonce": 2 }, "auth": [ + [], + [], + [], [ [ "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", @@ -31,7 +34,7 @@ ] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -161,6 +164,78 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000002" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000002" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/auth/auth_20_deep_one_address/test.1.json b/soroban-sdk/test_snapshots/tests/auth/auth_20_deep_one_address/test.1.json index fa6af8b71..c9a06c04e 100644 --- a/soroban-sdk/test_snapshots/tests/auth/auth_20_deep_one_address/test.1.json +++ b/soroban-sdk/test_snapshots/tests/auth/auth_20_deep_one_address/test.1.json @@ -4,6 +4,9 @@ "nonce": 1 }, "auth": [ + [], + [], + [], [ [ "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", @@ -25,7 +28,7 @@ ] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -187,6 +190,78 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000002" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000003" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/auth/auth_20_deep_one_address/test_auth_tree.1.json b/soroban-sdk/test_snapshots/tests/auth/auth_20_deep_one_address/test_auth_tree.1.json index 50a5f4fc8..a91ddf4a4 100644 --- a/soroban-sdk/test_snapshots/tests/auth/auth_20_deep_one_address/test_auth_tree.1.json +++ b/soroban-sdk/test_snapshots/tests/auth/auth_20_deep_one_address/test_auth_tree.1.json @@ -4,10 +4,13 @@ "nonce": 1 }, "auth": [ + [], + [], + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -136,6 +139,78 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000002" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000003" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/auth/auth_30_deep_one_address_repeat/test.1.json b/soroban-sdk/test_snapshots/tests/auth/auth_30_deep_one_address_repeat/test.1.json index 64b33dbb6..09a1053f4 100644 --- a/soroban-sdk/test_snapshots/tests/auth/auth_30_deep_one_address_repeat/test.1.json +++ b/soroban-sdk/test_snapshots/tests/auth/auth_30_deep_one_address_repeat/test.1.json @@ -4,6 +4,10 @@ "nonce": 2 }, "auth": [ + [], + [], + [], + [], [ [ "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", @@ -42,7 +46,7 @@ ] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -237,6 +241,102 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000002" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000003" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000003" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/auth/auth_30_deep_one_address_repeat/test_auth_tree.1.json b/soroban-sdk/test_snapshots/tests/auth/auth_30_deep_one_address_repeat/test_auth_tree.1.json index 50a5f4fc8..a91ddf4a4 100644 --- a/soroban-sdk/test_snapshots/tests/auth/auth_30_deep_one_address_repeat/test_auth_tree.1.json +++ b/soroban-sdk/test_snapshots/tests/auth/auth_30_deep_one_address_repeat/test_auth_tree.1.json @@ -4,10 +4,13 @@ "nonce": 1 }, "auth": [ + [], + [], + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -136,6 +139,78 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000002" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000003" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/auth/auth_35_deep_one_address_repeat_grouped/test.1.json b/soroban-sdk/test_snapshots/tests/auth/auth_35_deep_one_address_repeat_grouped/test.1.json index 64b33dbb6..09a1053f4 100644 --- a/soroban-sdk/test_snapshots/tests/auth/auth_35_deep_one_address_repeat_grouped/test.1.json +++ b/soroban-sdk/test_snapshots/tests/auth/auth_35_deep_one_address_repeat_grouped/test.1.json @@ -4,6 +4,10 @@ "nonce": 2 }, "auth": [ + [], + [], + [], + [], [ [ "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", @@ -42,7 +46,7 @@ ] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -237,6 +241,102 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000002" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000003" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000003" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/auth/auth_35_deep_one_address_repeat_grouped/test_auth_tree.1.json b/soroban-sdk/test_snapshots/tests/auth/auth_35_deep_one_address_repeat_grouped/test_auth_tree.1.json index 50a5f4fc8..a91ddf4a4 100644 --- a/soroban-sdk/test_snapshots/tests/auth/auth_35_deep_one_address_repeat_grouped/test_auth_tree.1.json +++ b/soroban-sdk/test_snapshots/tests/auth/auth_35_deep_one_address_repeat_grouped/test_auth_tree.1.json @@ -4,10 +4,13 @@ "nonce": 1 }, "auth": [ + [], + [], + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -136,6 +139,78 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000002" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000003" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/auth/auth_40_multi_one_address/test_auth_as_tree.1.json b/soroban-sdk/test_snapshots/tests/auth/auth_40_multi_one_address/test_auth_as_tree.1.json index a1631f20d..bad4a1c67 100644 --- a/soroban-sdk/test_snapshots/tests/auth/auth_40_multi_one_address/test_auth_as_tree.1.json +++ b/soroban-sdk/test_snapshots/tests/auth/auth_40_multi_one_address/test_auth_as_tree.1.json @@ -4,6 +4,9 @@ "nonce": 1 }, "auth": [ + [], + [], + [], [ [ "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", @@ -40,7 +43,7 @@ ] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -202,6 +205,78 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000002" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000003" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/auth/auth_40_multi_one_address/test_auth_not_allowed_with_separated_tree.1.json b/soroban-sdk/test_snapshots/tests/auth/auth_40_multi_one_address/test_auth_not_allowed_with_separated_tree.1.json index 10192dacb..f1a5cd6c4 100644 --- a/soroban-sdk/test_snapshots/tests/auth/auth_40_multi_one_address/test_auth_not_allowed_with_separated_tree.1.json +++ b/soroban-sdk/test_snapshots/tests/auth/auth_40_multi_one_address/test_auth_not_allowed_with_separated_tree.1.json @@ -4,10 +4,14 @@ "nonce": 2 }, "auth": [ + [], + [], + [], + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -136,6 +140,102 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000002" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000003" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000003" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/budget/test_budget.1.json b/soroban-sdk/test_snapshots/tests/budget/test_budget.1.json index eff0c9a3d..a68dc04fe 100644 --- a/soroban-sdk/test_snapshots/tests/budget/test_budget.1.json +++ b/soroban-sdk/test_snapshots/tests/budget/test_budget.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -72,6 +73,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/contract_add_i32/test_functional.1.json b/soroban-sdk/test_snapshots/tests/contract_add_i32/test_functional.1.json index 527824c83..9de7e0839 100644 --- a/soroban-sdk/test_snapshots/tests/contract_add_i32/test_functional.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_add_i32/test_functional.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -72,6 +73,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/contract_assert/test_invoke_expect_error.1.json b/soroban-sdk/test_snapshots/tests/contract_assert/test_invoke_expect_error.1.json index 2f7ca74cd..61fea5bac 100644 --- a/soroban-sdk/test_snapshots/tests/contract_assert/test_invoke_expect_error.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_assert/test_invoke_expect_error.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -72,6 +73,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/contract_assert/test_try_invoke.1.json b/soroban-sdk/test_snapshots/tests/contract_assert/test_try_invoke.1.json index 3ada95c7a..3fac9a80e 100644 --- a/soroban-sdk/test_snapshots/tests/contract_assert/test_try_invoke.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_assert/test_try_invoke.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -72,6 +73,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/contract_constructor/test_constructor.1.json b/soroban-sdk/test_snapshots/tests/contract_constructor/test_constructor.1.json new file mode 100644 index 000000000..330634091 --- /dev/null +++ b/soroban-sdk/test_snapshots/tests/contract_constructor/test_constructor.1.json @@ -0,0 +1,572 @@ +{ + "generators": { + "address": 1, + "nonce": 0 + }, + "auth": [ + [], + [], + [], + [], + [], + [], + [] + ], + "ledger": { + "protocol_version": 22, + "sequence_number": 0, + "timestamp": 0, + "network_id": "0000000000000000000000000000000000000000000000000000000000000000", + "base_reserve": 0, + "min_persistent_entry_ttl": 4096, + "min_temp_entry_ttl": 16, + "max_entry_ttl": 6312000, + "ledger_entries": [ + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "Persistent" + }, + { + "u32": 100 + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "Persistent" + }, + { + "u32": 100 + } + ] + }, + "durability": "persistent", + "val": { + "i64": 1000 + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "Temp" + }, + { + "u32": 200 + } + ] + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "Temp" + }, + { + "u32": 200 + } + ] + }, + "durability": "temporary", + "val": { + "i64": 2000 + } + } + }, + "ext": "v0" + }, + 15 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": { + "wasm": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "storage": [ + { + "key": { + "vec": [ + { + "symbol": "Instance" + }, + { + "u32": 300 + } + ] + }, + "val": { + "i64": 3000 + } + } + ] + } + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_code": { + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_code": { + "ext": "v0", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "code": "" + } + }, + "ext": "v0" + }, + 4095 + ] + ] + ] + }, + "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": { + "vec": [ + { + "u32": 100 + }, + { + "i64": 1000 + } + ] + } + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": "0000000000000000000000000000000000000000000000000000000000000001", + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_return" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "get_data" + } + ], + "data": { + "vec": [ + { + "symbol": "Persistent" + }, + { + "u32": 100 + } + ] + } + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": "0000000000000000000000000000000000000000000000000000000000000001", + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_return" + }, + { + "symbol": "get_data" + } + ], + "data": { + "i64": 1000 + } + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "get_data" + } + ], + "data": { + "vec": [ + { + "symbol": "Temp" + }, + { + "u32": 200 + } + ] + } + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": "0000000000000000000000000000000000000000000000000000000000000001", + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_return" + }, + { + "symbol": "get_data" + } + ], + "data": { + "i64": 2000 + } + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "get_data" + } + ], + "data": { + "vec": [ + { + "symbol": "Instance" + }, + { + "u32": 300 + } + ] + } + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": "0000000000000000000000000000000000000000000000000000000000000001", + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_return" + }, + { + "symbol": "get_data" + } + ], + "data": { + "i64": 3000 + } + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "get_data" + } + ], + "data": { + "vec": [ + { + "symbol": "Persistent" + }, + { + "u32": 10 + } + ] + } + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": "0000000000000000000000000000000000000000000000000000000000000001", + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_return" + }, + { + "symbol": "get_data" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "get_data" + } + ], + "data": { + "vec": [ + { + "symbol": "Temp" + }, + { + "u32": 20 + } + ] + } + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": "0000000000000000000000000000000000000000000000000000000000000001", + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_return" + }, + { + "symbol": "get_data" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "get_data" + } + ], + "data": { + "vec": [ + { + "symbol": "Instance" + }, + { + "u32": 30 + } + ] + } + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": "0000000000000000000000000000000000000000000000000000000000000001", + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_return" + }, + { + "symbol": "get_data" + } + ], + "data": "void" + } + } + }, + "failed_call": false + } + ] +} \ No newline at end of file diff --git a/soroban-sdk/test_snapshots/tests/contract_docs/fn_/test_functional.1.json b/soroban-sdk/test_snapshots/tests/contract_docs/fn_/test_functional.1.json index 4dc2bfde5..af8f11937 100644 --- a/soroban-sdk/test_snapshots/tests/contract_docs/fn_/test_functional.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_docs/fn_/test_functional.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -72,6 +73,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/contract_duration/test_functional.1.json b/soroban-sdk/test_snapshots/tests/contract_duration/test_functional.1.json index c17018e5c..5be49b012 100644 --- a/soroban-sdk/test_snapshots/tests/contract_duration/test_functional.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_duration/test_functional.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -72,6 +73,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/contract_fn/test_functional.1.json b/soroban-sdk/test_snapshots/tests/contract_fn/test_functional.1.json index 527824c83..9de7e0839 100644 --- a/soroban-sdk/test_snapshots/tests/contract_fn/test_functional.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_fn/test_functional.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -72,6 +73,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/contract_invoke/test_invoke_expect_error.1.json b/soroban-sdk/test_snapshots/tests/contract_invoke/test_invoke_expect_error.1.json index 39bd24f50..501d34616 100644 --- a/soroban-sdk/test_snapshots/tests/contract_invoke/test_invoke_expect_error.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_invoke/test_invoke_expect_error.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -72,6 +73,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/contract_invoke/test_invoke_expect_string.1.json b/soroban-sdk/test_snapshots/tests/contract_invoke/test_invoke_expect_string.1.json index 39bd24f50..501d34616 100644 --- a/soroban-sdk/test_snapshots/tests/contract_invoke/test_invoke_expect_string.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_invoke/test_invoke_expect_string.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -72,6 +73,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/contract_invoke/test_try_invoke.1.json b/soroban-sdk/test_snapshots/tests/contract_invoke/test_try_invoke.1.json index 68ad1f6cb..878894489 100644 --- a/soroban-sdk/test_snapshots/tests/contract_invoke/test_try_invoke.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_invoke/test_try_invoke.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -72,6 +73,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/contract_overlapping_type_fn_names/test_functional.1.json b/soroban-sdk/test_snapshots/tests/contract_overlapping_type_fn_names/test_functional.1.json index 84b82a808..49002b38e 100644 --- a/soroban-sdk/test_snapshots/tests/contract_overlapping_type_fn_names/test_functional.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_overlapping_type_fn_names/test_functional.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -72,6 +73,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/contract_snapshot/test.1.json b/soroban-sdk/test_snapshots/tests/contract_snapshot/test.1.json index 8168b7713..a6c18a73d 100644 --- a/soroban-sdk/test_snapshots/tests/contract_snapshot/test.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_snapshot/test.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -103,6 +104,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/contract_snapshot/test.2.json b/soroban-sdk/test_snapshots/tests/contract_snapshot/test.2.json index b1d4826ac..98956a678 100644 --- a/soroban-sdk/test_snapshots/tests/contract_snapshot/test.2.json +++ b/soroban-sdk/test_snapshots/tests/contract_snapshot/test.2.json @@ -4,11 +4,12 @@ "nonce": 0 }, "auth": [ + [], [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -104,6 +105,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/contract_store/test_storage.1.json b/soroban-sdk/test_snapshots/tests/contract_store/test_storage.1.json index 96ae62905..2353d179d 100644 --- a/soroban-sdk/test_snapshots/tests/contract_store/test_storage.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_store/test_storage.1.json @@ -37,10 +37,11 @@ [], [], [], + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -316,6 +317,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/contract_store/test_temp_storage_extension_past_max_ttl_panics.1.json b/soroban-sdk/test_snapshots/tests/contract_store/test_temp_storage_extension_past_max_ttl_panics.1.json index 678ebbf76..cfdc8b328 100644 --- a/soroban-sdk/test_snapshots/tests/contract_store/test_temp_storage_extension_past_max_ttl_panics.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_store/test_temp_storage_extension_past_max_ttl_panics.1.json @@ -4,11 +4,12 @@ "nonce": 0 }, "auth": [ + [], [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -118,6 +119,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/contract_timepoint/test_functional.1.json b/soroban-sdk/test_snapshots/tests/contract_timepoint/test_functional.1.json index 6105e64e0..3ff893143 100644 --- a/soroban-sdk/test_snapshots/tests/contract_timepoint/test_functional.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_timepoint/test_functional.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -72,6 +73,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/contract_udt_enum/test_functional.1.json b/soroban-sdk/test_snapshots/tests/contract_udt_enum/test_functional.1.json index cbea43c52..346661af3 100644 --- a/soroban-sdk/test_snapshots/tests/contract_udt_enum/test_functional.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_udt_enum/test_functional.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -72,6 +73,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/contract_udt_option/test_functional.1.json b/soroban-sdk/test_snapshots/tests/contract_udt_option/test_functional.1.json index a6d5533a1..1164081d0 100644 --- a/soroban-sdk/test_snapshots/tests/contract_udt_option/test_functional.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_udt_option/test_functional.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -72,6 +73,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/contract_udt_struct/test_error_on_partial_decode.1.json b/soroban-sdk/test_snapshots/tests/contract_udt_struct/test_error_on_partial_decode.1.json index d20344a9a..571fc657e 100644 --- a/soroban-sdk/test_snapshots/tests/contract_udt_struct/test_error_on_partial_decode.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_udt_struct/test_error_on_partial_decode.1.json @@ -5,7 +5,7 @@ }, "auth": [], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_udt_struct/test_functional.1.json b/soroban-sdk/test_snapshots/tests/contract_udt_struct/test_functional.1.json index e4257ad18..4f11f5976 100644 --- a/soroban-sdk/test_snapshots/tests/contract_udt_struct/test_functional.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_udt_struct/test_functional.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -72,6 +73,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/contract_udt_struct/test_long_names_functional.1.json b/soroban-sdk/test_snapshots/tests/contract_udt_struct/test_long_names_functional.1.json index a2193ae62..92ff9f77f 100644 --- a/soroban-sdk/test_snapshots/tests/contract_udt_struct/test_long_names_functional.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_udt_struct/test_long_names_functional.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -72,6 +73,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/contract_udt_struct_tuple/test_error_on_partial_decode.1.json b/soroban-sdk/test_snapshots/tests/contract_udt_struct_tuple/test_error_on_partial_decode.1.json index 07703559f..bf78f8aa1 100644 --- a/soroban-sdk/test_snapshots/tests/contract_udt_struct_tuple/test_error_on_partial_decode.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_udt_struct_tuple/test_error_on_partial_decode.1.json @@ -5,7 +5,7 @@ }, "auth": [], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_udt_struct_tuple/test_functional.1.json b/soroban-sdk/test_snapshots/tests/contract_udt_struct_tuple/test_functional.1.json index 146bb84ba..ade4aa57a 100644 --- a/soroban-sdk/test_snapshots/tests/contract_udt_struct_tuple/test_functional.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_udt_struct_tuple/test_functional.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -72,6 +73,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/crypto_ed25519/test_verify_sig_ed25519_invalid_sig.1.json b/soroban-sdk/test_snapshots/tests/crypto_ed25519/test_verify_sig_ed25519_invalid_sig.1.json index 91da61ac2..4b402aa40 100644 --- a/soroban-sdk/test_snapshots/tests/crypto_ed25519/test_verify_sig_ed25519_invalid_sig.1.json +++ b/soroban-sdk/test_snapshots/tests/crypto_ed25519/test_verify_sig_ed25519_invalid_sig.1.json @@ -5,7 +5,7 @@ }, "auth": [], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/env/default_and_from_snapshot_same_settings.1.json b/soroban-sdk/test_snapshots/tests/env/default_and_from_snapshot_same_settings.1.json index f05af2ab7..08e8df210 100644 --- a/soroban-sdk/test_snapshots/tests/env/default_and_from_snapshot_same_settings.1.json +++ b/soroban-sdk/test_snapshots/tests/env/default_and_from_snapshot_same_settings.1.json @@ -4,11 +4,12 @@ "nonce": 0 }, "auth": [ + [], [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -73,6 +74,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/env/default_and_from_snapshot_same_settings.2.json b/soroban-sdk/test_snapshots/tests/env/default_and_from_snapshot_same_settings.2.json index f05af2ab7..08e8df210 100644 --- a/soroban-sdk/test_snapshots/tests/env/default_and_from_snapshot_same_settings.2.json +++ b/soroban-sdk/test_snapshots/tests/env/default_and_from_snapshot_same_settings.2.json @@ -4,11 +4,12 @@ "nonce": 0 }, "auth": [ + [], [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -73,6 +74,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/env/register_contract_deploys_predictable_contract_ids.1.json b/soroban-sdk/test_snapshots/tests/env/register_contract_deploys_predictable_contract_ids.1.json index da87fad36..eeba6aaa8 100644 --- a/soroban-sdk/test_snapshots/tests/env/register_contract_deploys_predictable_contract_ids.1.json +++ b/soroban-sdk/test_snapshots/tests/env/register_contract_deploys_predictable_contract_ids.1.json @@ -3,9 +3,11 @@ "address": 3, "nonce": 0 }, - "auth": [], + "auth": [ + [] + ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -133,5 +135,30 @@ ] ] }, - "events": [] + "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000003" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + } + ] } \ No newline at end of file diff --git a/soroban-sdk/test_snapshots/tests/env/register_contract_deploys_predictable_contract_ids.2.json b/soroban-sdk/test_snapshots/tests/env/register_contract_deploys_predictable_contract_ids.2.json index 8e89d5f7a..f5d8d693b 100644 --- a/soroban-sdk/test_snapshots/tests/env/register_contract_deploys_predictable_contract_ids.2.json +++ b/soroban-sdk/test_snapshots/tests/env/register_contract_deploys_predictable_contract_ids.2.json @@ -3,9 +3,13 @@ "address": 3, "nonce": 0 }, - "auth": [], + "auth": [ + [], + [], + [] + ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -133,5 +137,78 @@ ] ] }, - "events": [] + "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000002" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000003" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + } + ] } \ No newline at end of file diff --git a/soroban-sdk/test_snapshots/tests/env/register_contract_deploys_predictable_contract_ids.3.json b/soroban-sdk/test_snapshots/tests/env/register_contract_deploys_predictable_contract_ids.3.json index 8e89d5f7a..f5d8d693b 100644 --- a/soroban-sdk/test_snapshots/tests/env/register_contract_deploys_predictable_contract_ids.3.json +++ b/soroban-sdk/test_snapshots/tests/env/register_contract_deploys_predictable_contract_ids.3.json @@ -3,9 +3,13 @@ "address": 3, "nonce": 0 }, - "auth": [], + "auth": [ + [], + [], + [] + ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -133,5 +137,78 @@ ] ] }, - "events": [] + "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000002" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000003" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + } + ] } \ No newline at end of file diff --git a/soroban-sdk/test_snapshots/tests/max_ttl/max.1.json b/soroban-sdk/test_snapshots/tests/max_ttl/max.1.json index c7b77d6a8..b99642f31 100644 --- a/soroban-sdk/test_snapshots/tests/max_ttl/max.1.json +++ b/soroban-sdk/test_snapshots/tests/max_ttl/max.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 1, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -71,5 +72,30 @@ ] ] }, - "events": [] + "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + } + ] } \ No newline at end of file diff --git a/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_array.1.json b/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_array.1.json index 4a934efea..61bf62183 100644 --- a/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_array.1.json +++ b/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_array.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -71,5 +72,30 @@ ] ] }, - "events": [] + "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + } + ] } \ No newline at end of file diff --git a/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_bytes.1.json b/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_bytes.1.json index 4a934efea..61bf62183 100644 --- a/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_bytes.1.json +++ b/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_bytes.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -71,5 +72,30 @@ ] ] }, - "events": [] + "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + } + ] } \ No newline at end of file diff --git a/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_bytesn.1.json b/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_bytesn.1.json index 4a934efea..61bf62183 100644 --- a/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_bytesn.1.json +++ b/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_bytesn.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -71,5 +72,30 @@ ] ] }, - "events": [] + "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + } + ] } \ No newline at end of file diff --git a/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_slice.1.json b/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_slice.1.json index 4a934efea..61bf62183 100644 --- a/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_slice.1.json +++ b/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_slice.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -71,5 +72,30 @@ ] ] }, - "events": [] + "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + } + ] } \ No newline at end of file diff --git a/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_u64.1.json b/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_u64.1.json index 4a934efea..61bf62183 100644 --- a/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_u64.1.json +++ b/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_u64.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -71,5 +72,30 @@ ] ] }, - "events": [] + "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + } + ] } \ No newline at end of file diff --git a/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_array.1.json b/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_array.1.json index 4a934efea..61bf62183 100644 --- a/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_array.1.json +++ b/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_array.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -71,5 +72,30 @@ ] ] }, - "events": [] + "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + } + ] } \ No newline at end of file diff --git a/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_bytesn.1.json b/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_bytesn.1.json index 4a934efea..61bf62183 100644 --- a/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_bytesn.1.json +++ b/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_bytesn.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -71,5 +72,30 @@ ] ] }, - "events": [] + "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + } + ] } \ No newline at end of file diff --git a/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_len_bytes.1.json b/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_len_bytes.1.json index 4a934efea..61bf62183 100644 --- a/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_len_bytes.1.json +++ b/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_len_bytes.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -71,5 +72,30 @@ ] ] }, - "events": [] + "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + } + ] } \ No newline at end of file diff --git a/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_range_u64.1.json b/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_range_u64.1.json index 4a934efea..61bf62183 100644 --- a/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_range_u64.1.json +++ b/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_range_u64.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -71,5 +72,30 @@ ] ] }, - "events": [] + "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + } + ] } \ No newline at end of file diff --git a/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_range_u64_panic_on_invalid_range.1.json b/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_range_u64_panic_on_invalid_range.1.json index 48fb8a082..ba887f196 100644 --- a/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_range_u64_panic_on_invalid_range.1.json +++ b/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_range_u64_panic_on_invalid_range.1.json @@ -3,9 +3,11 @@ "address": 1, "nonce": 0 }, - "auth": [], + "auth": [ + [] + ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -70,6 +72,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_u64.1.json b/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_u64.1.json index 4a934efea..61bf62183 100644 --- a/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_u64.1.json +++ b/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_u64.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -71,5 +72,30 @@ ] ] }, - "events": [] + "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + } + ] } \ No newline at end of file diff --git a/soroban-sdk/test_snapshots/tests/prng/test_prng_seed.1.json b/soroban-sdk/test_snapshots/tests/prng/test_prng_seed.1.json index 4a934efea..61bf62183 100644 --- a/soroban-sdk/test_snapshots/tests/prng/test_prng_seed.1.json +++ b/soroban-sdk/test_snapshots/tests/prng/test_prng_seed.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -71,5 +72,30 @@ ] ] }, - "events": [] + "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + } + ] } \ No newline at end of file diff --git a/soroban-sdk/test_snapshots/tests/prng/test_prng_seed.2.json b/soroban-sdk/test_snapshots/tests/prng/test_prng_seed.2.json index 4a934efea..61bf62183 100644 --- a/soroban-sdk/test_snapshots/tests/prng/test_prng_seed.2.json +++ b/soroban-sdk/test_snapshots/tests/prng/test_prng_seed.2.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -71,5 +72,30 @@ ] ] }, - "events": [] + "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + } + ] } \ No newline at end of file diff --git a/soroban-sdk/test_snapshots/tests/prng/test_prng_shuffle.1.json b/soroban-sdk/test_snapshots/tests/prng/test_prng_shuffle.1.json index af654ea29..8bc8cc04d 100644 --- a/soroban-sdk/test_snapshots/tests/prng/test_prng_shuffle.1.json +++ b/soroban-sdk/test_snapshots/tests/prng/test_prng_shuffle.1.json @@ -4,11 +4,12 @@ "nonce": 0 }, "auth": [ + [], [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -72,5 +73,30 @@ ] ] }, - "events": [] + "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + } + ] } \ No newline at end of file diff --git a/soroban-sdk/test_snapshots/tests/prng/test_vec_shuffle.1.json b/soroban-sdk/test_snapshots/tests/prng/test_vec_shuffle.1.json index af654ea29..8bc8cc04d 100644 --- a/soroban-sdk/test_snapshots/tests/prng/test_vec_shuffle.1.json +++ b/soroban-sdk/test_snapshots/tests/prng/test_vec_shuffle.1.json @@ -4,11 +4,12 @@ "nonce": 0 }, "auth": [ + [], [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -72,5 +73,30 @@ ] ] }, - "events": [] + "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + } + ] } \ No newline at end of file diff --git a/soroban-sdk/test_snapshots/tests/storage_testutils/all.1.json b/soroban-sdk/test_snapshots/tests/storage_testutils/all.1.json index 1fd4d130b..1623c9bfa 100644 --- a/soroban-sdk/test_snapshots/tests/storage_testutils/all.1.json +++ b/soroban-sdk/test_snapshots/tests/storage_testutils/all.1.json @@ -4,11 +4,12 @@ "nonce": 0 }, "auth": [ + [], [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -211,5 +212,30 @@ ] ] }, - "events": [] + "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + } + ] } \ No newline at end of file diff --git a/soroban-sdk/test_snapshots/tests/storage_testutils/temp_entry_expiration.1.json b/soroban-sdk/test_snapshots/tests/storage_testutils/temp_entry_expiration.1.json index 0f6ac424c..7282f9d39 100644 --- a/soroban-sdk/test_snapshots/tests/storage_testutils/temp_entry_expiration.1.json +++ b/soroban-sdk/test_snapshots/tests/storage_testutils/temp_entry_expiration.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 2000, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -102,5 +103,30 @@ ] ] }, - "events": [] + "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + } + ] } \ No newline at end of file diff --git a/soroban-sdk/test_snapshots/tests/storage_testutils/test_persistent_entry_expiration.1.json b/soroban-sdk/test_snapshots/tests/storage_testutils/test_persistent_entry_expiration.1.json index 887578848..fea6c0bf6 100644 --- a/soroban-sdk/test_snapshots/tests/storage_testutils/test_persistent_entry_expiration.1.json +++ b/soroban-sdk/test_snapshots/tests/storage_testutils/test_persistent_entry_expiration.1.json @@ -3,9 +3,11 @@ "address": 1, "nonce": 0 }, - "auth": [], + "auth": [ + [] + ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 1100, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -101,6 +103,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/storage_testutils/ttl_getters.1.json b/soroban-sdk/test_snapshots/tests/storage_testutils/ttl_getters.1.json index 9bfeafb32..b3e4a5f66 100644 --- a/soroban-sdk/test_snapshots/tests/storage_testutils/ttl_getters.1.json +++ b/soroban-sdk/test_snapshots/tests/storage_testutils/ttl_getters.1.json @@ -12,10 +12,12 @@ [], [], [], + [], + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 1000, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -235,5 +237,54 @@ ] ] }, - "events": [] + "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000002" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + } + ] } \ No newline at end of file diff --git a/soroban-sdk/test_snapshots/tests/token_client/test_issuer_flags.1.json b/soroban-sdk/test_snapshots/tests/token_client/test_issuer_flags.1.json index 680eeac45..24d5bedfe 100644 --- a/soroban-sdk/test_snapshots/tests/token_client/test_issuer_flags.1.json +++ b/soroban-sdk/test_snapshots/tests/token_client/test_issuer_flags.1.json @@ -25,7 +25,7 @@ ] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/token_client/test_mock_all_auth.1.json b/soroban-sdk/test_snapshots/tests/token_client/test_mock_all_auth.1.json index f1f70a18d..656edbec9 100644 --- a/soroban-sdk/test_snapshots/tests/token_client/test_mock_all_auth.1.json +++ b/soroban-sdk/test_snapshots/tests/token_client/test_mock_all_auth.1.json @@ -27,6 +27,7 @@ [], [], [], + [], [ [ "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAITA4", @@ -61,7 +62,7 @@ [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -590,6 +591,30 @@ }, "failed_call": false }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000003" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/tests/token_client/test_mock_auth.1.json b/soroban-sdk/test_snapshots/tests/token_client/test_mock_auth.1.json index 3e380b061..39be11258 100644 --- a/soroban-sdk/test_snapshots/tests/token_client/test_mock_auth.1.json +++ b/soroban-sdk/test_snapshots/tests/token_client/test_mock_auth.1.json @@ -26,6 +26,8 @@ [], [], [], + [], + [], [ [ "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAITA4", @@ -60,7 +62,7 @@ [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -621,6 +623,30 @@ }, "failed_call": false }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000003" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", @@ -762,6 +788,30 @@ }, "failed_call": false }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000004" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/soroban-sdk/test_snapshots/vec/test/test_get_unchecked_panics_on_out_of_bounds.1.json b/soroban-sdk/test_snapshots/vec/test/test_get_unchecked_panics_on_out_of_bounds.1.json index 7a5a85ab4..4d23c1f9d 100644 --- a/soroban-sdk/test_snapshots/vec/test/test_get_unchecked_panics_on_out_of_bounds.1.json +++ b/soroban-sdk/test_snapshots/vec/test/test_get_unchecked_panics_on_out_of_bounds.1.json @@ -5,7 +5,7 @@ }, "auth": [], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/vec/test/test_pop_back_unchecked_panics_on_out_of_bounds.1.json b/soroban-sdk/test_snapshots/vec/test/test_pop_back_unchecked_panics_on_out_of_bounds.1.json index 69499ccea..6817fc85d 100644 --- a/soroban-sdk/test_snapshots/vec/test/test_pop_back_unchecked_panics_on_out_of_bounds.1.json +++ b/soroban-sdk/test_snapshots/vec/test/test_pop_back_unchecked_panics_on_out_of_bounds.1.json @@ -5,7 +5,7 @@ }, "auth": [], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/vec/test/test_pop_front_unchecked_panics_on_out_of_bounds.1.json b/soroban-sdk/test_snapshots/vec/test/test_pop_front_unchecked_panics_on_out_of_bounds.1.json index 69499ccea..6817fc85d 100644 --- a/soroban-sdk/test_snapshots/vec/test/test_pop_front_unchecked_panics_on_out_of_bounds.1.json +++ b/soroban-sdk/test_snapshots/vec/test/test_pop_front_unchecked_panics_on_out_of_bounds.1.json @@ -5,7 +5,7 @@ }, "auth": [], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/vec/test/test_remove_unchecked_panics.1.json b/soroban-sdk/test_snapshots/vec/test/test_remove_unchecked_panics.1.json index 7a5a85ab4..4d23c1f9d 100644 --- a/soroban-sdk/test_snapshots/vec/test/test_remove_unchecked_panics.1.json +++ b/soroban-sdk/test_snapshots/vec/test/test_remove_unchecked_panics.1.json @@ -5,7 +5,7 @@ }, "auth": [], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/vec/test/test_try_get_unchecked_panics.1.json b/soroban-sdk/test_snapshots/vec/test/test_try_get_unchecked_panics.1.json index 7a5a85ab4..4d23c1f9d 100644 --- a/soroban-sdk/test_snapshots/vec/test/test_try_get_unchecked_panics.1.json +++ b/soroban-sdk/test_snapshots/vec/test/test_try_get_unchecked_panics.1.json @@ -5,7 +5,7 @@ }, "auth": [], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/vec/test/test_try_pop_back_unchecked_panics_on_out_of_bounds.1.json b/soroban-sdk/test_snapshots/vec/test/test_try_pop_back_unchecked_panics_on_out_of_bounds.1.json index 69499ccea..6817fc85d 100644 --- a/soroban-sdk/test_snapshots/vec/test/test_try_pop_back_unchecked_panics_on_out_of_bounds.1.json +++ b/soroban-sdk/test_snapshots/vec/test/test_try_pop_back_unchecked_panics_on_out_of_bounds.1.json @@ -5,7 +5,7 @@ }, "auth": [], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/vec/test/test_try_pop_front_unchecked_panics_on_out_of_bounds.1.json b/soroban-sdk/test_snapshots/vec/test/test_try_pop_front_unchecked_panics_on_out_of_bounds.1.json index 69499ccea..6817fc85d 100644 --- a/soroban-sdk/test_snapshots/vec/test/test_try_pop_front_unchecked_panics_on_out_of_bounds.1.json +++ b/soroban-sdk/test_snapshots/vec/test/test_try_pop_front_unchecked_panics_on_out_of_bounds.1.json @@ -5,7 +5,7 @@ }, "auth": [], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/account/test_snapshots/test/test.1.json b/tests/account/test_snapshots/test/test.1.json index cf124af58..85d5a7be0 100644 --- a/tests/account/test_snapshots/test/test.1.json +++ b/tests/account/test_snapshots/test/test.1.json @@ -4,6 +4,8 @@ "nonce": 1 }, "auth": [ + [], + [], [ [ "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", @@ -21,7 +23,7 @@ ] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -151,6 +153,54 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000002" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/tests/add_i128/test_snapshots/test/test_add.1.json b/tests/add_i128/test_snapshots/test/test_add.1.json index b67eb63f9..d6e20d3c9 100644 --- a/tests/add_i128/test_snapshots/test/test_add.1.json +++ b/tests/add_i128/test_snapshots/test/test_add.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -72,6 +73,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/tests/add_u128/test_snapshots/test/test_add.1.json b/tests/add_u128/test_snapshots/test/test_add.1.json index bff12f920..c64d76c67 100644 --- a/tests/add_u128/test_snapshots/test/test_add.1.json +++ b/tests/add_u128/test_snapshots/test/test_add.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -72,6 +73,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/tests/add_u64/test_snapshots/test/test_add.1.json b/tests/add_u64/test_snapshots/test/test_add.1.json index 606b3638f..f499591f5 100644 --- a/tests/add_u64/test_snapshots/test/test_add.1.json +++ b/tests/add_u64/test_snapshots/test/test_add.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -72,6 +73,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/tests/alloc/test_snapshots/test/test_add.1.json b/tests/alloc/test_snapshots/test/test_add.1.json index 42f0b0c15..be04b5177 100644 --- a/tests/alloc/test_snapshots/test/test_add.1.json +++ b/tests/alloc/test_snapshots/test/test_add.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -72,6 +73,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/tests/auth/test_snapshots/test_a/test_with_mock_all_auth.1.json b/tests/auth/test_snapshots/test_a/test_with_mock_all_auth.1.json index c13cd551f..5f5678503 100644 --- a/tests/auth/test_snapshots/test_a/test_with_mock_all_auth.1.json +++ b/tests/auth/test_snapshots/test_a/test_with_mock_all_auth.1.json @@ -4,6 +4,7 @@ "nonce": 0 }, "auth": [ + [], [ [ "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", @@ -25,7 +26,7 @@ ] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -123,6 +124,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/tests/auth/test_snapshots/test_a/test_with_mock_auth.1.json b/tests/auth/test_snapshots/test_a/test_with_mock_auth.1.json index b751d418e..610171372 100644 --- a/tests/auth/test_snapshots/test_a/test_with_mock_auth.1.json +++ b/tests/auth/test_snapshots/test_a/test_with_mock_auth.1.json @@ -4,6 +4,8 @@ "nonce": 1 }, "auth": [ + [], + [], [ [ "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", @@ -25,7 +27,7 @@ ] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -155,6 +157,54 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000002" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/tests/auth/test_snapshots/test_a/test_with_real_contract_auth_approve.1.json b/tests/auth/test_snapshots/test_a/test_with_real_contract_auth_approve.1.json index 5d7cf6747..a2d217a92 100644 --- a/tests/auth/test_snapshots/test_a/test_with_real_contract_auth_approve.1.json +++ b/tests/auth/test_snapshots/test_a/test_with_real_contract_auth_approve.1.json @@ -4,6 +4,8 @@ "nonce": 0 }, "auth": [ + [], + [], [ [ "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4", @@ -25,7 +27,7 @@ ] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -155,6 +157,54 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000002" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/tests/auth/test_snapshots/test_a/test_with_real_contract_auth_decline.1.json b/tests/auth/test_snapshots/test_a/test_with_real_contract_auth_decline.1.json index 2ca569b28..0778898d1 100644 --- a/tests/auth/test_snapshots/test_a/test_with_real_contract_auth_decline.1.json +++ b/tests/auth/test_snapshots/test_a/test_with_real_contract_auth_decline.1.json @@ -4,10 +4,12 @@ "nonce": 0 }, "auth": [ + [], + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -104,6 +106,54 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000002" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/tests/auth/test_snapshots/test_b/test_with_mock_all_auth.1.json b/tests/auth/test_snapshots/test_b/test_with_mock_all_auth.1.json index 41feb264a..15fa5011d 100644 --- a/tests/auth/test_snapshots/test_b/test_with_mock_all_auth.1.json +++ b/tests/auth/test_snapshots/test_b/test_with_mock_all_auth.1.json @@ -4,6 +4,8 @@ "nonce": 0 }, "auth": [ + [], + [], [ [ "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", @@ -43,7 +45,7 @@ ] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -173,6 +175,54 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000002" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/tests/auth/test_snapshots/test_b/test_with_mock_auth.1.json b/tests/auth/test_snapshots/test_b/test_with_mock_auth.1.json index 253f9b48e..9453770f6 100644 --- a/tests/auth/test_snapshots/test_b/test_with_mock_auth.1.json +++ b/tests/auth/test_snapshots/test_b/test_with_mock_auth.1.json @@ -4,6 +4,9 @@ "nonce": 1 }, "auth": [ + [], + [], + [], [ [ "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", @@ -43,7 +46,7 @@ ] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -205,6 +208,78 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000002" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000003" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/tests/auth/test_snapshots/test_b/test_with_real_contract_auth_approve.1.json b/tests/auth/test_snapshots/test_b/test_with_real_contract_auth_approve.1.json index 7243c9a81..4141e6ef8 100644 --- a/tests/auth/test_snapshots/test_b/test_with_real_contract_auth_approve.1.json +++ b/tests/auth/test_snapshots/test_b/test_with_real_contract_auth_approve.1.json @@ -4,6 +4,9 @@ "nonce": 0 }, "auth": [ + [], + [], + [], [ [ "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M", @@ -43,7 +46,7 @@ ] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -205,6 +208,78 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000002" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000003" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/tests/auth/test_snapshots/test_b/test_with_real_contract_auth_decline.1.json b/tests/auth/test_snapshots/test_b/test_with_real_contract_auth_decline.1.json index 3df3cc2b3..c609c75ec 100644 --- a/tests/auth/test_snapshots/test_b/test_with_real_contract_auth_decline.1.json +++ b/tests/auth/test_snapshots/test_b/test_with_real_contract_auth_decline.1.json @@ -4,10 +4,13 @@ "nonce": 0 }, "auth": [ + [], + [], + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -136,6 +139,78 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000002" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000003" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/tests/constructor/Cargo.toml b/tests/constructor/Cargo.toml new file mode 100644 index 000000000..ea1bf21a1 --- /dev/null +++ b/tests/constructor/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "test_constructor" +version.workspace = true +authors = ["Stellar Development Foundation "] +license = "Apache-2.0" +edition = "2021" +publish = false +rust-version.workspace = true + +[lib] +crate-type = ["cdylib"] +doctest = false + +[dependencies] +soroban-sdk = {path = "../../soroban-sdk"} + +[dev-dependencies] +soroban-sdk = {path = "../../soroban-sdk", features = ["testutils"]} diff --git a/tests/constructor/src/lib.rs b/tests/constructor/src/lib.rs new file mode 100644 index 000000000..dd7a82eab --- /dev/null +++ b/tests/constructor/src/lib.rs @@ -0,0 +1,85 @@ +#![no_std] +#[cfg(test)] +use soroban_sdk::IntoVal; +use soroban_sdk::{contract, contractimpl, contracttype, Env}; + +#[contract] +pub struct Contract; + +#[contracttype] +pub enum DataKey { + Persistent(u32), + Temp(u32), + Instance(u32), +} + +#[contractimpl] +impl Contract { + pub fn __constructor(env: Env, init_key: u32, init_value: i64) { + env.storage() + .persistent() + .set(&DataKey::Persistent(init_key), &init_value); + env.storage() + .temporary() + .set(&DataKey::Temp(init_key * 2), &(init_value * 2)); + env.storage() + .instance() + .set(&DataKey::Instance(init_key * 3), &(init_value * 3)); + } + + pub fn get_data(env: Env, key: DataKey) -> Option { + match key { + DataKey::Persistent(_) => env.storage().persistent().get(&key), + DataKey::Temp(_) => env.storage().temporary().get(&key), + DataKey::Instance(_) => env.storage().instance().get(&key), + } + } +} + +#[test] +fn test_constructor() { + let env = Env::default(); + let contract_id = + env.register_contract_with_constructor(None, Contract, (100_u32, 1000_i64).into_val(&env)); + let client = ContractClient::new(&env, &contract_id); + assert_eq!(client.get_data(&DataKey::Persistent(100)), Some(1000)); + assert_eq!(client.get_data(&DataKey::Temp(200)), Some(2000)); + assert_eq!(client.get_data(&DataKey::Instance(300)), Some(3000)); + + assert_eq!(client.get_data(&DataKey::Persistent(10)), None); + assert_eq!(client.get_data(&DataKey::Temp(20)), None); + assert_eq!(client.get_data(&DataKey::Instance(30)), None) +} + +#[test] +#[should_panic(expected = "constructor invocation has failed with error")] +fn test_passing_no_constructor_arguments_causes_panic() { + let env = Env::default(); + let _ = env.register_contract(None, Contract); +} + +#[test] +#[should_panic(expected = "constructor invocation has failed with error")] +fn test_missing_constructor_arguments_causes_panic() { + let env = Env::default(); + let _ = env.register_contract_with_constructor(None, Contract, (100_u32,).into_val(&env)); +} + +#[test] +#[should_panic(expected = "constructor invocation has failed with error")] +fn test_passing_extra_constructor_arguments_causes_panic() { + let env = Env::default(); + let _ = env.register_contract_with_constructor( + None, + Contract, + (100_u32, 1000_i64, 123_u32).into_val(&env), + ); +} + +#[test] +#[should_panic(expected = "constructor invocation has failed with error")] +fn test_passing_incorrectly_typed_constructor_arguments_causes_panic() { + let env = Env::default(); + let _ = + env.register_contract_with_constructor(None, Contract, (100_u32, 1000_u32).into_val(&env)); +} diff --git a/tests/constructor/test_snapshots/test/test_constructor.1.json b/tests/constructor/test_snapshots/test/test_constructor.1.json new file mode 100644 index 000000000..330634091 --- /dev/null +++ b/tests/constructor/test_snapshots/test/test_constructor.1.json @@ -0,0 +1,572 @@ +{ + "generators": { + "address": 1, + "nonce": 0 + }, + "auth": [ + [], + [], + [], + [], + [], + [], + [] + ], + "ledger": { + "protocol_version": 22, + "sequence_number": 0, + "timestamp": 0, + "network_id": "0000000000000000000000000000000000000000000000000000000000000000", + "base_reserve": 0, + "min_persistent_entry_ttl": 4096, + "min_temp_entry_ttl": 16, + "max_entry_ttl": 6312000, + "ledger_entries": [ + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "Persistent" + }, + { + "u32": 100 + } + ] + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "Persistent" + }, + { + "u32": 100 + } + ] + }, + "durability": "persistent", + "val": { + "i64": 1000 + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "Temp" + }, + { + "u32": 200 + } + ] + }, + "durability": "temporary" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "vec": [ + { + "symbol": "Temp" + }, + { + "u32": 200 + } + ] + }, + "durability": "temporary", + "val": { + "i64": 2000 + } + } + }, + "ext": "v0" + }, + 15 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": { + "wasm": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "storage": [ + { + "key": { + "vec": [ + { + "symbol": "Instance" + }, + { + "u32": 300 + } + ] + }, + "val": { + "i64": 3000 + } + } + ] + } + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_code": { + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_code": { + "ext": "v0", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "code": "" + } + }, + "ext": "v0" + }, + 4095 + ] + ] + ] + }, + "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": { + "vec": [ + { + "u32": 100 + }, + { + "i64": 1000 + } + ] + } + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": "0000000000000000000000000000000000000000000000000000000000000001", + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_return" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "get_data" + } + ], + "data": { + "vec": [ + { + "symbol": "Persistent" + }, + { + "u32": 100 + } + ] + } + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": "0000000000000000000000000000000000000000000000000000000000000001", + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_return" + }, + { + "symbol": "get_data" + } + ], + "data": { + "i64": 1000 + } + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "get_data" + } + ], + "data": { + "vec": [ + { + "symbol": "Temp" + }, + { + "u32": 200 + } + ] + } + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": "0000000000000000000000000000000000000000000000000000000000000001", + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_return" + }, + { + "symbol": "get_data" + } + ], + "data": { + "i64": 2000 + } + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "get_data" + } + ], + "data": { + "vec": [ + { + "symbol": "Instance" + }, + { + "u32": 300 + } + ] + } + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": "0000000000000000000000000000000000000000000000000000000000000001", + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_return" + }, + { + "symbol": "get_data" + } + ], + "data": { + "i64": 3000 + } + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "get_data" + } + ], + "data": { + "vec": [ + { + "symbol": "Persistent" + }, + { + "u32": 10 + } + ] + } + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": "0000000000000000000000000000000000000000000000000000000000000001", + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_return" + }, + { + "symbol": "get_data" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "get_data" + } + ], + "data": { + "vec": [ + { + "symbol": "Temp" + }, + { + "u32": 20 + } + ] + } + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": "0000000000000000000000000000000000000000000000000000000000000001", + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_return" + }, + { + "symbol": "get_data" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "get_data" + } + ], + "data": { + "vec": [ + { + "symbol": "Instance" + }, + { + "u32": 30 + } + ] + } + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": "0000000000000000000000000000000000000000000000000000000000000001", + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_return" + }, + { + "symbol": "get_data" + } + ], + "data": "void" + } + } + }, + "failed_call": false + } + ] +} \ No newline at end of file diff --git a/tests/constructor/test_snapshots/test_missing_constructor_arguments_causes_panic.1.json b/tests/constructor/test_snapshots/test_missing_constructor_arguments_causes_panic.1.json new file mode 100644 index 000000000..bd6313155 --- /dev/null +++ b/tests/constructor/test_snapshots/test_missing_constructor_arguments_causes_panic.1.json @@ -0,0 +1,188 @@ +{ + "generators": { + "address": 1, + "nonce": 0 + }, + "auth": [ + [] + ], + "ledger": { + "protocol_version": 22, + "sequence_number": 0, + "timestamp": 0, + "network_id": "0000000000000000000000000000000000000000000000000000000000000000", + "base_reserve": 0, + "min_persistent_entry_ttl": 4096, + "min_temp_entry_ttl": 16, + "max_entry_ttl": 6312000, + "ledger_entries": [ + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": { + "wasm": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "storage": null + } + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_code": { + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_code": { + "ext": "v0", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "code": "" + } + }, + "ext": "v0" + }, + 4095 + ] + ] + ] + }, + "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": { + "u32": 100 + } + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": "0000000000000000000000000000000000000000000000000000000000000001", + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "log" + } + ], + "data": { + "vec": [ + { + "string": "caught panic 'invalid number of input arguments: 2 expected, got 1' from contract function 'Symbol(obj#7)'" + }, + { + "u32": 100 + } + ] + } + } + } + }, + "failed_call": true + }, + { + "event": { + "ext": "v0", + "contract_id": "0000000000000000000000000000000000000000000000000000000000000001", + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "error" + }, + { + "error": { + "wasm_vm": "invalid_action" + } + } + ], + "data": { + "string": "caught error from function" + } + } + } + }, + "failed_call": true + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "error" + }, + { + "error": { + "context": "invalid_action" + } + } + ], + "data": { + "vec": [ + { + "string": "constructor invocation has failed with error" + }, + { + "error": { + "wasm_vm": "invalid_action" + } + } + ] + } + } + } + }, + "failed_call": false + } + ] +} \ No newline at end of file diff --git a/tests/constructor/test_snapshots/test_passing_extra_constructor_arguments_causes_panic.1.json b/tests/constructor/test_snapshots/test_passing_extra_constructor_arguments_causes_panic.1.json new file mode 100644 index 000000000..d2902128a --- /dev/null +++ b/tests/constructor/test_snapshots/test_passing_extra_constructor_arguments_causes_panic.1.json @@ -0,0 +1,204 @@ +{ + "generators": { + "address": 1, + "nonce": 0 + }, + "auth": [ + [] + ], + "ledger": { + "protocol_version": 22, + "sequence_number": 0, + "timestamp": 0, + "network_id": "0000000000000000000000000000000000000000000000000000000000000000", + "base_reserve": 0, + "min_persistent_entry_ttl": 4096, + "min_temp_entry_ttl": 16, + "max_entry_ttl": 6312000, + "ledger_entries": [ + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": { + "wasm": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "storage": null + } + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_code": { + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_code": { + "ext": "v0", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "code": "" + } + }, + "ext": "v0" + }, + 4095 + ] + ] + ] + }, + "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": { + "vec": [ + { + "u32": 100 + }, + { + "i64": 1000 + }, + { + "u32": 123 + } + ] + } + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": "0000000000000000000000000000000000000000000000000000000000000001", + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "log" + } + ], + "data": { + "vec": [ + { + "string": "caught panic 'invalid number of input arguments: 2 expected, got 3' from contract function 'Symbol(obj#7)'" + }, + { + "u32": 100 + }, + { + "i64": 1000 + }, + { + "u32": 123 + } + ] + } + } + } + }, + "failed_call": true + }, + { + "event": { + "ext": "v0", + "contract_id": "0000000000000000000000000000000000000000000000000000000000000001", + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "error" + }, + { + "error": { + "wasm_vm": "invalid_action" + } + } + ], + "data": { + "string": "caught error from function" + } + } + } + }, + "failed_call": true + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "error" + }, + { + "error": { + "context": "invalid_action" + } + } + ], + "data": { + "vec": [ + { + "string": "constructor invocation has failed with error" + }, + { + "error": { + "wasm_vm": "invalid_action" + } + } + ] + } + } + } + }, + "failed_call": false + } + ] +} \ No newline at end of file diff --git a/tests/constructor/test_snapshots/test_passing_incorrectly_typed_constructor_arguments_causes_panic.1.json b/tests/constructor/test_snapshots/test_passing_incorrectly_typed_constructor_arguments_causes_panic.1.json new file mode 100644 index 000000000..704a91992 --- /dev/null +++ b/tests/constructor/test_snapshots/test_passing_incorrectly_typed_constructor_arguments_causes_panic.1.json @@ -0,0 +1,198 @@ +{ + "generators": { + "address": 1, + "nonce": 0 + }, + "auth": [ + [] + ], + "ledger": { + "protocol_version": 22, + "sequence_number": 0, + "timestamp": 0, + "network_id": "0000000000000000000000000000000000000000000000000000000000000000", + "base_reserve": 0, + "min_persistent_entry_ttl": 4096, + "min_temp_entry_ttl": 16, + "max_entry_ttl": 6312000, + "ledger_entries": [ + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": { + "wasm": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "storage": null + } + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_code": { + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_code": { + "ext": "v0", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "code": "" + } + }, + "ext": "v0" + }, + 4095 + ] + ] + ] + }, + "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": { + "vec": [ + { + "u32": 100 + }, + { + "u32": 1000 + } + ] + } + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": "0000000000000000000000000000000000000000000000000000000000000001", + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "log" + } + ], + "data": { + "vec": [ + { + "string": "caught panic 'called `Result::unwrap()` on an `Err` value: Error(Value, UnexpectedType)' from contract function 'Symbol(obj#7)'" + }, + { + "u32": 100 + }, + { + "u32": 1000 + } + ] + } + } + } + }, + "failed_call": true + }, + { + "event": { + "ext": "v0", + "contract_id": "0000000000000000000000000000000000000000000000000000000000000001", + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "error" + }, + { + "error": { + "wasm_vm": "invalid_action" + } + } + ], + "data": { + "string": "caught error from function" + } + } + } + }, + "failed_call": true + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "error" + }, + { + "error": { + "context": "invalid_action" + } + } + ], + "data": { + "vec": [ + { + "string": "constructor invocation has failed with error" + }, + { + "error": { + "wasm_vm": "invalid_action" + } + } + ] + } + } + } + }, + "failed_call": false + } + ] +} \ No newline at end of file diff --git a/tests/constructor/test_snapshots/test_passing_no_constructor_arguments_causes_panic.1.json b/tests/constructor/test_snapshots/test_passing_no_constructor_arguments_causes_panic.1.json new file mode 100644 index 000000000..84b708ad5 --- /dev/null +++ b/tests/constructor/test_snapshots/test_passing_no_constructor_arguments_causes_panic.1.json @@ -0,0 +1,179 @@ +{ + "generators": { + "address": 1, + "nonce": 0 + }, + "auth": [ + [] + ], + "ledger": { + "protocol_version": 22, + "sequence_number": 0, + "timestamp": 0, + "network_id": "0000000000000000000000000000000000000000000000000000000000000000", + "base_reserve": 0, + "min_persistent_entry_ttl": 4096, + "min_temp_entry_ttl": 16, + "max_entry_ttl": 6312000, + "ledger_entries": [ + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": { + "wasm": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "storage": null + } + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_code": { + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_code": { + "ext": "v0", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "code": "" + } + }, + "ext": "v0" + }, + 4095 + ] + ] + ] + }, + "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": "0000000000000000000000000000000000000000000000000000000000000001", + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "log" + } + ], + "data": { + "string": "caught panic 'invalid number of input arguments: 2 expected, got 0' from contract function 'Symbol(obj#7)'" + } + } + } + }, + "failed_call": true + }, + { + "event": { + "ext": "v0", + "contract_id": "0000000000000000000000000000000000000000000000000000000000000001", + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "error" + }, + { + "error": { + "wasm_vm": "invalid_action" + } + } + ], + "data": { + "string": "caught error from function" + } + } + } + }, + "failed_call": true + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "error" + }, + { + "error": { + "context": "invalid_action" + } + } + ], + "data": { + "vec": [ + { + "string": "constructor invocation has failed with error" + }, + { + "error": { + "wasm_vm": "invalid_action" + } + } + ] + } + } + } + }, + "failed_call": false + } + ] +} \ No newline at end of file diff --git a/tests/empty/test_snapshots/test/test_hello.1.json b/tests/empty/test_snapshots/test/test_hello.1.json index 21049c75b..a1bc290f8 100644 --- a/tests/empty/test_snapshots/test/test_hello.1.json +++ b/tests/empty/test_snapshots/test/test_hello.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -72,6 +73,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/tests/empty2/test_snapshots/test/test_hello.1.json b/tests/empty2/test_snapshots/test/test_hello.1.json index a9c9276f9..b2f09122b 100644 --- a/tests/empty2/test_snapshots/test/test_hello.1.json +++ b/tests/empty2/test_snapshots/test/test_hello.1.json @@ -3,9 +3,11 @@ "address": 1, "nonce": 0 }, - "auth": [], + "auth": [ + [] + ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -69,5 +71,30 @@ ] ] }, - "events": [] + "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + } + ] } \ No newline at end of file diff --git a/tests/errors/test_snapshots/test/hello_ok.1.json b/tests/errors/test_snapshots/test/hello_ok.1.json index 09d9d3ab0..9040706b0 100644 --- a/tests/errors/test_snapshots/test/hello_ok.1.json +++ b/tests/errors/test_snapshots/test/hello_ok.1.json @@ -4,11 +4,12 @@ "nonce": 0 }, "auth": [ + [], [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -104,6 +105,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/tests/errors/test_snapshots/test/try_hello_error.1.json b/tests/errors/test_snapshots/test/try_hello_error.1.json index bc8d10299..d30e75747 100644 --- a/tests/errors/test_snapshots/test/try_hello_error.1.json +++ b/tests/errors/test_snapshots/test/try_hello_error.1.json @@ -4,11 +4,12 @@ "nonce": 0 }, "auth": [ + [], [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -73,6 +74,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/tests/errors/test_snapshots/test/try_hello_error_panic.1.json b/tests/errors/test_snapshots/test/try_hello_error_panic.1.json index 89b76c30b..2a64a0242 100644 --- a/tests/errors/test_snapshots/test/try_hello_error_panic.1.json +++ b/tests/errors/test_snapshots/test/try_hello_error_panic.1.json @@ -4,11 +4,12 @@ "nonce": 0 }, "auth": [ + [], [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -73,6 +74,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/tests/errors/test_snapshots/test/try_hello_error_panic_string.1.json b/tests/errors/test_snapshots/test/try_hello_error_panic_string.1.json index ed3afa788..05af76eee 100644 --- a/tests/errors/test_snapshots/test/try_hello_error_panic_string.1.json +++ b/tests/errors/test_snapshots/test/try_hello_error_panic_string.1.json @@ -4,11 +4,12 @@ "nonce": 0 }, "auth": [ + [], [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -73,6 +74,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/tests/errors/test_snapshots/test/try_hello_error_unexpected_contract_error.1.json b/tests/errors/test_snapshots/test/try_hello_error_unexpected_contract_error.1.json index 6825a47bb..076431c14 100644 --- a/tests/errors/test_snapshots/test/try_hello_error_unexpected_contract_error.1.json +++ b/tests/errors/test_snapshots/test/try_hello_error_unexpected_contract_error.1.json @@ -4,11 +4,12 @@ "nonce": 0 }, "auth": [ + [], [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -73,6 +74,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/tests/errors/test_snapshots/test/try_hello_ok.1.json b/tests/errors/test_snapshots/test/try_hello_ok.1.json index 09d9d3ab0..9040706b0 100644 --- a/tests/errors/test_snapshots/test/try_hello_ok.1.json +++ b/tests/errors/test_snapshots/test/try_hello_ok.1.json @@ -4,11 +4,12 @@ "nonce": 0 }, "auth": [ + [], [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -104,6 +105,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/tests/events/test_snapshots/test/test_pub_event.1.json b/tests/events/test_snapshots/test/test_pub_event.1.json index f113fabe9..a5f4a020d 100644 --- a/tests/events/test_snapshots/test/test_pub_event.1.json +++ b/tests/events/test_snapshots/test/test_pub_event.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -72,6 +73,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/tests/invoke_contract/test_snapshots/test/test_add.1.json b/tests/invoke_contract/test_snapshots/test/test_add.1.json index c1a85ba11..d4b21d010 100644 --- a/tests/invoke_contract/test_snapshots/test/test_add.1.json +++ b/tests/invoke_contract/test_snapshots/test/test_add.1.json @@ -4,10 +4,12 @@ "nonce": 0 }, "auth": [ + [], + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -104,6 +106,54 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000002" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/tests/logging/test_snapshots/test/test_logging.1.json b/tests/logging/test_snapshots/test/test_logging.1.json index 882b2bf42..b6e6e2f64 100644 --- a/tests/logging/test_snapshots/test/test_logging.1.json +++ b/tests/logging/test_snapshots/test/test_logging.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -72,6 +73,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/tests/multiimpl/test_snapshots/test/test_hello.1.json b/tests/multiimpl/test_snapshots/test/test_hello.1.json index 5cd9dc09b..bc2819204 100644 --- a/tests/multiimpl/test_snapshots/test/test_hello.1.json +++ b/tests/multiimpl/test_snapshots/test/test_hello.1.json @@ -4,12 +4,13 @@ "nonce": 0 }, "auth": [ + [], [], [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -74,6 +75,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/tests/udt/test_snapshots/test/test_add.1.json b/tests/udt/test_snapshots/test/test_add.1.json index 42b5be82c..14d487e1e 100644 --- a/tests/udt/test_snapshots/test/test_add.1.json +++ b/tests/udt/test_snapshots/test/test_add.1.json @@ -4,11 +4,12 @@ "nonce": 0 }, "auth": [ + [], [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -73,6 +74,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0", diff --git a/tests/workspace_contract/test_snapshots/test/test_add.1.json b/tests/workspace_contract/test_snapshots/test/test_add.1.json index 7bfe976a6..972d82299 100644 --- a/tests/workspace_contract/test_snapshots/test/test_add.1.json +++ b/tests/workspace_contract/test_snapshots/test/test_add.1.json @@ -4,10 +4,11 @@ "nonce": 0 }, "auth": [ + [], [] ], "ledger": { - "protocol_version": 21, + "protocol_version": 22, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -72,6 +73,30 @@ ] }, "events": [ + { + "event": { + "ext": "v0", + "contract_id": null, + "type_": "diagnostic", + "body": { + "v0": { + "topics": [ + { + "symbol": "fn_call" + }, + { + "bytes": "0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "symbol": "__constructor" + } + ], + "data": "void" + } + } + }, + "failed_call": false + }, { "event": { "ext": "v0",