@layerzerolabs/protocol-stellar-v2 0.2.121 → 0.2.122
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.toml +22 -37
- package/docs/error-spec.md +24 -24
- package/docs/layerzero-v2-on-stellar.md +8 -6
- package/docs/oapp-guide.md +2 -402
- package/docs/oft-guide.md +2 -401
- package/{contracts/endpoint-v2 → endpoint-v2}/Cargo.toml +3 -2
- package/{contracts/layerzero-views → layerzero-views}/Cargo.toml +1 -6
- package/{contracts/message-libs → message-libs}/blocked-message-lib/Cargo.toml +0 -1
- package/{contracts/message-libs → message-libs}/message-lib-common/Cargo.toml +2 -2
- package/{contracts/message-libs → message-libs}/simple-message-lib/Cargo.toml +1 -2
- package/{contracts/message-libs → message-libs}/treasury/Cargo.toml +1 -2
- package/{contracts/message-libs → message-libs}/uln-302/Cargo.toml +3 -2
- package/package.json +32 -15
- package/rustfmt.toml +0 -2
- package/{contracts/upgrader → upgrader}/Cargo.toml +0 -1
- package/{contracts/workers → workers}/dvn/Cargo.toml +1 -2
- package/{contracts/workers → workers}/dvn-fee-lib/Cargo.toml +1 -2
- package/{contracts/workers → workers}/executor/Cargo.toml +3 -2
- package/{contracts/workers → workers}/executor-fee-lib/Cargo.toml +1 -2
- package/{contracts/workers → workers}/executor-helper/Cargo.toml +0 -1
- package/{contracts/workers → workers}/fee-lib-interfaces/Cargo.toml +0 -1
- package/{contracts/workers → workers}/price-feed/Cargo.toml +1 -2
- package/{contracts/workers → workers}/worker/Cargo.toml +0 -1
- package/.turbo/turbo-build.log +0 -1363
- package/.turbo/turbo-lint.log +0 -401
- package/.turbo/turbo-test.log +0 -1952
- package/Cargo.lock +0 -2357
- package/contracts/common-macros/Cargo.toml +0 -20
- package/contracts/common-macros/src/auth.rs +0 -95
- package/contracts/common-macros/src/contract_ttl.rs +0 -92
- package/contracts/common-macros/src/error.rs +0 -43
- package/contracts/common-macros/src/lib.rs +0 -585
- package/contracts/common-macros/src/lz_contract.rs +0 -105
- package/contracts/common-macros/src/rbac.rs +0 -90
- package/contracts/common-macros/src/storage.rs +0 -522
- package/contracts/common-macros/src/tests/auth.rs +0 -230
- package/contracts/common-macros/src/tests/contract_ttl.rs +0 -695
- package/contracts/common-macros/src/tests/error.rs +0 -156
- package/contracts/common-macros/src/tests/lz_contract.rs +0 -87
- package/contracts/common-macros/src/tests/mod.rs +0 -11
- package/contracts/common-macros/src/tests/rbac.rs +0 -523
- package/contracts/common-macros/src/tests/snapshots/common_macros__tests__auth__snapshot_generated_multisig_code.snap +0 -31
- package/contracts/common-macros/src/tests/snapshots/common_macros__tests__auth__snapshot_generated_ownable_code.snap +0 -39
- package/contracts/common-macros/src/tests/snapshots/common_macros__tests__auth__snapshot_only_auth_preserves_function_signature.snap +0 -19
- package/contracts/common-macros/src/tests/snapshots/common_macros__tests__contract_ttl__snapshot_generated_contractimpl_code.snap +0 -77
- package/contracts/common-macros/src/tests/snapshots/common_macros__tests__contract_ttl__snapshot_generated_contracttrait_code.snap +0 -46
- package/contracts/common-macros/src/tests/snapshots/common_macros__tests__error__snapshot_generated_contract_error_code.snap +0 -20
- package/contracts/common-macros/src/tests/snapshots/common_macros__tests__lz_contract__snapshot_generated_lz_contract_code.snap +0 -51
- package/contracts/common-macros/src/tests/snapshots/common_macros__tests__rbac__snapshot_authorizer_role.snap +0 -21
- package/contracts/common-macros/src/tests/snapshots/common_macros__tests__rbac__snapshot_preserve_function_signature.snap +0 -21
- package/contracts/common-macros/src/tests/snapshots/common_macros__tests__ttl_configurable__snapshot_generated_ttl_configurable_code.snap +0 -10
- package/contracts/common-macros/src/tests/snapshots/common_macros__tests__ttl_extendable__snapshot_generated_ttl_extendable_code.snap +0 -8
- package/contracts/common-macros/src/tests/snapshots/common_macros__tests__upgradeable__snapshot_generated_upgradeable_code.snap +0 -28
- package/contracts/common-macros/src/tests/storage/extract_fields.rs +0 -87
- package/contracts/common-macros/src/tests/storage/gen_accessor_methods.rs +0 -223
- package/contracts/common-macros/src/tests/storage/gen_args.rs +0 -65
- package/contracts/common-macros/src/tests/storage/gen_enum_variant.rs +0 -78
- package/contracts/common-macros/src/tests/storage/gen_key.rs +0 -108
- package/contracts/common-macros/src/tests/storage/gen_params.rs +0 -105
- package/contracts/common-macros/src/tests/storage/generate_storage.rs +0 -410
- package/contracts/common-macros/src/tests/storage/is_primitive_type.rs +0 -48
- package/contracts/common-macros/src/tests/storage/mod.rs +0 -16
- package/contracts/common-macros/src/tests/storage/parse_default.rs +0 -164
- package/contracts/common-macros/src/tests/storage/parse_name.rs +0 -158
- package/contracts/common-macros/src/tests/storage/parse_no_ttl_extension.rs +0 -124
- package/contracts/common-macros/src/tests/storage/parse_storage_type.rs +0 -174
- package/contracts/common-macros/src/tests/storage/snapshots/common_macros__tests__storage__generate_storage__snapshot_generated_storage_code.snap +0 -412
- package/contracts/common-macros/src/tests/storage/storage_kind.rs +0 -39
- package/contracts/common-macros/src/tests/storage/test_setup.rs +0 -25
- package/contracts/common-macros/src/tests/storage/validate_attrs.rs +0 -138
- package/contracts/common-macros/src/tests/storage/variant_config.rs +0 -226
- package/contracts/common-macros/src/tests/test_helpers.rs +0 -87
- package/contracts/common-macros/src/tests/ttl_configurable.rs +0 -34
- package/contracts/common-macros/src/tests/ttl_extendable.rs +0 -32
- package/contracts/common-macros/src/tests/upgradeable.rs +0 -169
- package/contracts/common-macros/src/tests/utils.rs +0 -267
- package/contracts/common-macros/src/ttl_configurable.rs +0 -24
- package/contracts/common-macros/src/ttl_extendable.rs +0 -28
- package/contracts/common-macros/src/upgradeable.rs +0 -136
- package/contracts/common-macros/src/utils.rs +0 -56
- package/contracts/macro-integration-tests/Cargo.toml +0 -20
- package/contracts/macro-integration-tests/src/lib.rs +0 -1
- package/contracts/macro-integration-tests/tests/runtime/contract_ttl/constructor.rs +0 -61
- package/contracts/macro-integration-tests/tests/runtime/contract_ttl/contract_impl_ttl_extension.rs +0 -97
- package/contracts/macro-integration-tests/tests/runtime/contract_ttl/contract_trait_ttl_extension.rs +0 -99
- package/contracts/macro-integration-tests/tests/runtime/contract_ttl/mod.rs +0 -3
- package/contracts/macro-integration-tests/tests/runtime/lz_contract/mod.rs +0 -5
- package/contracts/macro-integration-tests/tests/runtime/lz_contract/wrapper_default.rs +0 -86
- package/contracts/macro-integration-tests/tests/runtime/lz_contract/wrapper_multisig.rs +0 -47
- package/contracts/macro-integration-tests/tests/runtime/lz_contract/wrapper_multisig_upgradeable.rs +0 -77
- package/contracts/macro-integration-tests/tests/runtime/lz_contract/wrapper_upgradeable.rs +0 -114
- package/contracts/macro-integration-tests/tests/runtime/lz_contract/wrapper_upgradeable_no_migration.rs +0 -105
- package/contracts/macro-integration-tests/tests/runtime/multisig/admin_entrypoints.rs +0 -242
- package/contracts/macro-integration-tests/tests/runtime/multisig/mod.rs +0 -9
- package/contracts/macro-integration-tests/tests/runtime/multisig/self_auth.rs +0 -54
- package/contracts/macro-integration-tests/tests/runtime/oapp/mod.rs +0 -46
- package/contracts/macro-integration-tests/tests/runtime/oapp/oapp_core.rs +0 -170
- package/contracts/macro-integration-tests/tests/runtime/oapp/options_type3.rs +0 -154
- package/contracts/macro-integration-tests/tests/runtime/oapp/receiver.rs +0 -338
- package/contracts/macro-integration-tests/tests/runtime/oapp/sender.rs +0 -437
- package/contracts/macro-integration-tests/tests/runtime/ownable/initialization.rs +0 -78
- package/contracts/macro-integration-tests/tests/runtime/ownable/mod.rs +0 -23
- package/contracts/macro-integration-tests/tests/runtime/ownable/only_auth_guard.rs +0 -97
- package/contracts/macro-integration-tests/tests/runtime/ownable/ownership_transfer.rs +0 -170
- package/contracts/macro-integration-tests/tests/runtime/ownable/two_step_transfer.rs +0 -221
- package/contracts/macro-integration-tests/tests/runtime/rbac/guard_behavior.rs +0 -91
- package/contracts/macro-integration-tests/tests/runtime/rbac/mod.rs +0 -30
- package/contracts/macro-integration-tests/tests/runtime/storage/keyed_roundtrip.rs +0 -266
- package/contracts/macro-integration-tests/tests/runtime/storage/mod.rs +0 -4
- package/contracts/macro-integration-tests/tests/runtime/storage/name_override_runtime.rs +0 -52
- package/contracts/macro-integration-tests/tests/runtime/storage/ttl_extension.rs +0 -293
- package/contracts/macro-integration-tests/tests/runtime/storage/unkeyed_roundtrip.rs +0 -147
- package/contracts/macro-integration-tests/tests/runtime/ttl_configurable/configuration.rs +0 -206
- package/contracts/macro-integration-tests/tests/runtime/ttl_configurable/freeze.rs +0 -143
- package/contracts/macro-integration-tests/tests/runtime/ttl_configurable/mod.rs +0 -2
- package/contracts/macro-integration-tests/tests/runtime/ttl_extendable/extend_instance_ttl.rs +0 -64
- package/contracts/macro-integration-tests/tests/runtime/ttl_extendable/mod.rs +0 -16
- package/contracts/macro-integration-tests/tests/runtime/upgradeable/migrate_guard_and_state.rs +0 -243
- package/contracts/macro-integration-tests/tests/runtime/upgradeable/mod.rs +0 -3
- package/contracts/macro-integration-tests/tests/runtime/upgradeable/no_migration.rs +0 -59
- package/contracts/macro-integration-tests/tests/runtime/upgradeable/upgrade_then_migrate.rs +0 -88
- package/contracts/macro-integration-tests/tests/runtime.rs +0 -11
- package/contracts/macro-integration-tests/tests/ui/contract_impl/fail/not_impl_item.rs +0 -6
- package/contracts/macro-integration-tests/tests/ui/contract_impl/fail/not_impl_item.stderr +0 -7
- package/contracts/macro-integration-tests/tests/ui/contract_impl/pass/basic.rs +0 -102
- package/contracts/macro-integration-tests/tests/ui/contract_trait/fail/not_a_trait.rs +0 -6
- package/contracts/macro-integration-tests/tests/ui/contract_trait/fail/not_a_trait.stderr +0 -7
- package/contracts/macro-integration-tests/tests/ui/contract_trait/pass/basic.rs +0 -83
- package/contracts/macro-integration-tests/tests/ui/error/fail/decreasing_discriminant.rs +0 -12
- package/contracts/macro-integration-tests/tests/ui/error/fail/decreasing_discriminant.stderr +0 -7
- package/contracts/macro-integration-tests/tests/ui/error/fail/discriminant_too_large.rs +0 -11
- package/contracts/macro-integration-tests/tests/ui/error/fail/discriminant_too_large.stderr +0 -7
- package/contracts/macro-integration-tests/tests/ui/error/fail/non_enum_input.rs +0 -11
- package/contracts/macro-integration-tests/tests/ui/error/fail/non_enum_input.stderr +0 -7
- package/contracts/macro-integration-tests/tests/ui/error/fail/non_int_discriminant.rs +0 -21
- package/contracts/macro-integration-tests/tests/ui/error/fail/non_int_discriminant.stderr +0 -7
- package/contracts/macro-integration-tests/tests/ui/error/fail/non_unit_variant.rs +0 -13
- package/contracts/macro-integration-tests/tests/ui/error/fail/non_unit_variant.stderr +0 -7
- package/contracts/macro-integration-tests/tests/ui/error/pass/basic.rs +0 -22
- package/contracts/macro-integration-tests/tests/ui/lz_contract/fail/invalid_option.rs +0 -6
- package/contracts/macro-integration-tests/tests/ui/lz_contract/fail/invalid_option.stderr +0 -7
- package/contracts/macro-integration-tests/tests/ui/lz_contract/fail/multisig_rejects_ownable_api.rs +0 -20
- package/contracts/macro-integration-tests/tests/ui/lz_contract/fail/multisig_rejects_ownable_api.stderr +0 -20
- package/contracts/macro-integration-tests/tests/ui/lz_contract/fail/not_a_struct.rs +0 -8
- package/contracts/macro-integration-tests/tests/ui/lz_contract/fail/not_a_struct.stderr +0 -7
- package/contracts/macro-integration-tests/tests/ui/lz_contract/fail/upgradeable_invalid_inner_option.rs +0 -10
- package/contracts/macro-integration-tests/tests/ui/lz_contract/fail/upgradeable_invalid_inner_option.stderr +0 -30
- package/contracts/macro-integration-tests/tests/ui/lz_contract/fail/upgradeable_missing_internal.rs +0 -20
- package/contracts/macro-integration-tests/tests/ui/lz_contract/fail/upgradeable_missing_internal.stderr +0 -56
- package/contracts/macro-integration-tests/tests/ui/lz_contract/pass/basic.rs +0 -45
- package/contracts/macro-integration-tests/tests/ui/lz_contract/pass/multisig.rs +0 -34
- package/contracts/macro-integration-tests/tests/ui/lz_contract/pass/multisig_upgradeable.rs +0 -30
- package/contracts/macro-integration-tests/tests/ui/lz_contract/pass/upgradeable.rs +0 -39
- package/contracts/macro-integration-tests/tests/ui/lz_contract/pass/upgradeable_no_migration.rs +0 -28
- package/contracts/macro-integration-tests/tests/ui/lz_contract/pass/upgradeable_rbac.rs +0 -44
- package/contracts/macro-integration-tests/tests/ui/multisig/fail/non_struct_input.rs +0 -8
- package/contracts/macro-integration-tests/tests/ui/multisig/fail/non_struct_input.stderr +0 -7
- package/contracts/macro-integration-tests/tests/ui/multisig/fail/rejects_ownable_api.rs +0 -20
- package/contracts/macro-integration-tests/tests/ui/multisig/fail/rejects_ownable_api.stderr +0 -12
- package/contracts/macro-integration-tests/tests/ui/multisig/fail/rejects_ownable_trait.rs +0 -20
- package/contracts/macro-integration-tests/tests/ui/multisig/fail/rejects_ownable_trait.stderr +0 -5
- package/contracts/macro-integration-tests/tests/ui/multisig/pass/basic.rs +0 -49
- package/contracts/macro-integration-tests/tests/ui/oapp/fail/custom_wrong_value.rs +0 -8
- package/contracts/macro-integration-tests/tests/ui/oapp/fail/custom_wrong_value.stderr +0 -7
- package/contracts/macro-integration-tests/tests/ui/oapp/fail/missing_auth_trait.rs +0 -28
- package/contracts/macro-integration-tests/tests/ui/oapp/fail/missing_auth_trait.stderr +0 -397
- package/contracts/macro-integration-tests/tests/ui/oapp/fail/missing_lz_receive_internal.rs +0 -9
- package/contracts/macro-integration-tests/tests/ui/oapp/fail/missing_lz_receive_internal.stderr +0 -71
- package/contracts/macro-integration-tests/tests/ui/oapp/fail/non_struct_input.rs +0 -10
- package/contracts/macro-integration-tests/tests/ui/oapp/fail/non_struct_input.stderr +0 -7
- package/contracts/macro-integration-tests/tests/ui/oapp/fail/unknown_custom_option.rs +0 -8
- package/contracts/macro-integration-tests/tests/ui/oapp/fail/unknown_custom_option.stderr +0 -7
- package/contracts/macro-integration-tests/tests/ui/oapp/fail/wrong_key.rs +0 -8
- package/contracts/macro-integration-tests/tests/ui/oapp/fail/wrong_key.stderr +0 -7
- package/contracts/macro-integration-tests/tests/ui/oapp/pass/custom_all.rs +0 -42
- package/contracts/macro-integration-tests/tests/ui/oapp/pass/custom_single_trait.rs +0 -103
- package/contracts/macro-integration-tests/tests/ui/oapp/pass/minimal_contract.rs +0 -65
- package/contracts/macro-integration-tests/tests/ui/oapp/pass/struct_with_fields.rs +0 -48
- package/contracts/macro-integration-tests/tests/ui/ownable/fail/non_struct_input.rs +0 -8
- package/contracts/macro-integration-tests/tests/ui/ownable/fail/non_struct_input.stderr +0 -7
- package/contracts/macro-integration-tests/tests/ui/ownable/fail/only_auth_missing_auth.rs +0 -19
- package/contracts/macro-integration-tests/tests/ui/ownable/fail/only_auth_missing_auth.stderr +0 -12
- package/contracts/macro-integration-tests/tests/ui/ownable/fail/only_auth_missing_env.rs +0 -22
- package/contracts/macro-integration-tests/tests/ui/ownable/fail/only_auth_missing_env.stderr +0 -16
- package/contracts/macro-integration-tests/tests/ui/ownable/pass/basic.rs +0 -39
- package/contracts/macro-integration-tests/tests/ui/ownable/pass/only_auth_env_param_variants.rs +0 -52
- package/contracts/macro-integration-tests/tests/ui/rbac/fail/missing_env.rs +0 -18
- package/contracts/macro-integration-tests/tests/ui/rbac/fail/missing_env.stderr +0 -16
- package/contracts/macro-integration-tests/tests/ui/rbac/fail/param_not_address.rs +0 -18
- package/contracts/macro-integration-tests/tests/ui/rbac/fail/param_not_address.stderr +0 -24
- package/contracts/macro-integration-tests/tests/ui/rbac/fail/param_not_found.rs +0 -18
- package/contracts/macro-integration-tests/tests/ui/rbac/fail/param_not_found.stderr +0 -24
- package/contracts/macro-integration-tests/tests/ui/rbac/pass/basic.rs +0 -80
- package/contracts/macro-integration-tests/tests/ui/storage/fail/invalid_storage_type_param.rs +0 -13
- package/contracts/macro-integration-tests/tests/ui/storage/fail/invalid_storage_type_param.stderr +0 -7
- package/contracts/macro-integration-tests/tests/ui/storage/fail/missing_storage_type_param.rs +0 -13
- package/contracts/macro-integration-tests/tests/ui/storage/fail/missing_storage_type_param.stderr +0 -7
- package/contracts/macro-integration-tests/tests/ui/storage/fail/multiple_default_values.rs +0 -11
- package/contracts/macro-integration-tests/tests/ui/storage/fail/multiple_default_values.stderr +0 -7
- package/contracts/macro-integration-tests/tests/ui/storage/fail/multiple_name_attrs.rs +0 -11
- package/contracts/macro-integration-tests/tests/ui/storage/fail/multiple_name_attrs.stderr +0 -7
- package/contracts/macro-integration-tests/tests/ui/storage/fail/multiple_no_ttl_extension.rs +0 -11
- package/contracts/macro-integration-tests/tests/ui/storage/fail/multiple_no_ttl_extension.stderr +0 -7
- package/contracts/macro-integration-tests/tests/ui/storage/fail/multiple_storage_kinds.rs +0 -10
- package/contracts/macro-integration-tests/tests/ui/storage/fail/multiple_storage_kinds.stderr +0 -7
- package/contracts/macro-integration-tests/tests/ui/storage/fail/multiple_type_params.rs +0 -12
- package/contracts/macro-integration-tests/tests/ui/storage/fail/multiple_type_params.stderr +0 -7
- package/contracts/macro-integration-tests/tests/ui/storage/fail/no_ttl_extension_on_non_persistent.rs +0 -10
- package/contracts/macro-integration-tests/tests/ui/storage/fail/no_ttl_extension_on_non_persistent.stderr +0 -7
- package/contracts/macro-integration-tests/tests/ui/storage/fail/no_ttl_extension_rejects_args.rs +0 -13
- package/contracts/macro-integration-tests/tests/ui/storage/fail/no_ttl_extension_rejects_args.stderr +0 -7
- package/contracts/macro-integration-tests/tests/ui/storage/fail/non_enum_input.rs +0 -10
- package/contracts/macro-integration-tests/tests/ui/storage/fail/non_enum_input.stderr +0 -7
- package/contracts/macro-integration-tests/tests/ui/storage/fail/tuple_variant_rejected.rs +0 -13
- package/contracts/macro-integration-tests/tests/ui/storage/fail/tuple_variant_rejected.stderr +0 -7
- package/contracts/macro-integration-tests/tests/ui/storage/fail/unknown_variant_attr.rs +0 -13
- package/contracts/macro-integration-tests/tests/ui/storage/fail/unknown_variant_attr.stderr +0 -7
- package/contracts/macro-integration-tests/tests/ui/storage/pass/api_surface.rs +0 -102
- package/contracts/macro-integration-tests/tests/ui/storage/pass/basic.rs +0 -43
- package/contracts/macro-integration-tests/tests/ui/storage/pass/multi_key.rs +0 -38
- package/contracts/macro-integration-tests/tests/ui/ttl_configurable/fail/missing_auth_trait.rs +0 -14
- package/contracts/macro-integration-tests/tests/ui/ttl_configurable/fail/missing_auth_trait.stderr +0 -71
- package/contracts/macro-integration-tests/tests/ui/ttl_configurable/fail/non_struct_input.rs +0 -8
- package/contracts/macro-integration-tests/tests/ui/ttl_configurable/fail/non_struct_input.stderr +0 -7
- package/contracts/macro-integration-tests/tests/ui/ttl_configurable/pass/basic.rs +0 -46
- package/contracts/macro-integration-tests/tests/ui/ttl_configurable/pass/multisig_contract.rs +0 -28
- package/contracts/macro-integration-tests/tests/ui/ttl_configurable/pass/ownable_contract.rs +0 -32
- package/contracts/macro-integration-tests/tests/ui/ttl_extendable/fail/non_struct_input.rs +0 -8
- package/contracts/macro-integration-tests/tests/ui/ttl_extendable/fail/non_struct_input.stderr +0 -7
- package/contracts/macro-integration-tests/tests/ui/ttl_extendable/pass/basic.rs +0 -23
- package/contracts/macro-integration-tests/tests/ui/ttl_extendable/pass/no_user_contractimpl.rs +0 -21
- package/contracts/macro-integration-tests/tests/ui/upgradeable/fail/attr_args.rs +0 -11
- package/contracts/macro-integration-tests/tests/ui/upgradeable/fail/attr_args.stderr +0 -29
- package/contracts/macro-integration-tests/tests/ui/upgradeable/fail/missing_auth_trait.rs +0 -20
- package/contracts/macro-integration-tests/tests/ui/upgradeable/fail/missing_auth_trait.stderr +0 -41
- package/contracts/macro-integration-tests/tests/ui/upgradeable/fail/missing_upgradeable_internal.rs +0 -10
- package/contracts/macro-integration-tests/tests/ui/upgradeable/fail/missing_upgradeable_internal.stderr +0 -49
- package/contracts/macro-integration-tests/tests/ui/upgradeable/fail/non_struct_input.rs +0 -8
- package/contracts/macro-integration-tests/tests/ui/upgradeable/fail/non_struct_input.stderr +0 -7
- package/contracts/macro-integration-tests/tests/ui/upgradeable/pass/basic.rs +0 -41
- package/contracts/macro-integration-tests/tests/ui/upgradeable/pass/multisig_contract.rs +0 -33
- package/contracts/macro-integration-tests/tests/ui/upgradeable/pass/no_migration.rs +0 -28
- package/contracts/macro-integration-tests/tests/ui/upgradeable/pass/no_user_contractimpl.rs +0 -27
- package/contracts/macro-integration-tests/tests/ui/upgradeable/pass/rbac.rs +0 -44
- package/contracts/macro-integration-tests/tests/ui_contract_impl.rs +0 -12
- package/contracts/macro-integration-tests/tests/ui_contract_trait.rs +0 -12
- package/contracts/macro-integration-tests/tests/ui_error.rs +0 -11
- package/contracts/macro-integration-tests/tests/ui_lz_contract.rs +0 -11
- package/contracts/macro-integration-tests/tests/ui_multisig.rs +0 -11
- package/contracts/macro-integration-tests/tests/ui_oapp.rs +0 -11
- package/contracts/macro-integration-tests/tests/ui_ownable.rs +0 -11
- package/contracts/macro-integration-tests/tests/ui_rbac.rs +0 -12
- package/contracts/macro-integration-tests/tests/ui_storage.rs +0 -11
- package/contracts/macro-integration-tests/tests/ui_ttl_configurable.rs +0 -12
- package/contracts/macro-integration-tests/tests/ui_ttl_extendable.rs +0 -12
- package/contracts/macro-integration-tests/tests/ui_upgradeable.rs +0 -11
- package/contracts/message-libs/Cargo.toml +0 -12
- package/contracts/message-libs/lib.rs +0 -2
- package/contracts/oapps/Cargo.toml +0 -12
- package/contracts/oapps/counter/Cargo.toml +0 -39
- package/contracts/oapps/counter/integration_tests/mod.rs +0 -7
- package/contracts/oapps/counter/integration_tests/setup_sml.rs +0 -171
- package/contracts/oapps/counter/integration_tests/setup_uln.rs +0 -1019
- package/contracts/oapps/counter/integration_tests/signing.rs +0 -62
- package/contracts/oapps/counter/integration_tests/test_with_blocked.rs +0 -67
- package/contracts/oapps/counter/integration_tests/test_with_sml.rs +0 -135
- package/contracts/oapps/counter/integration_tests/test_with_uln.rs +0 -314
- package/contracts/oapps/counter/integration_tests/utils.rs +0 -294
- package/contracts/oapps/counter/src/codec.rs +0 -62
- package/contracts/oapps/counter/src/counter.rs +0 -274
- package/contracts/oapps/counter/src/errors.rs +0 -9
- package/contracts/oapps/counter/src/lib.rs +0 -16
- package/contracts/oapps/counter/src/options.rs +0 -30
- package/contracts/oapps/counter/src/storage.rs +0 -32
- package/contracts/oapps/counter/src/tests/mod.rs +0 -24
- package/contracts/oapps/counter/src/tests/test_codec.rs +0 -64
- package/contracts/oapps/counter/src/tests/test_counter.rs +0 -387
- package/contracts/oapps/counter/src/tests/test_u256_ext.rs +0 -48
- package/contracts/oapps/counter/src/u256_ext.rs +0 -21
- package/contracts/oapps/lib.rs +0 -2
- package/contracts/oapps/oapp/Cargo.toml +0 -22
- package/contracts/oapps/oapp/src/errors.rs +0 -13
- package/contracts/oapps/oapp/src/interfaces/mod.rs +0 -3
- package/contracts/oapps/oapp/src/interfaces/oapp_msg_inspector.rs +0 -70
- package/contracts/oapps/oapp/src/lib.rs +0 -15
- package/contracts/oapps/oapp/src/oapp_core.rs +0 -143
- package/contracts/oapps/oapp/src/oapp_options_type3.rs +0 -133
- package/contracts/oapps/oapp/src/oapp_receiver.rs +0 -195
- package/contracts/oapps/oapp/src/oapp_sender.rs +0 -152
- package/contracts/oapps/oapp/src/tests/mod.rs +0 -5
- package/contracts/oapps/oapp/src/tests/oapp_core.rs +0 -225
- package/contracts/oapps/oapp/src/tests/oapp_options_type3.rs +0 -246
- package/contracts/oapps/oapp/src/tests/oapp_receiver.rs +0 -383
- package/contracts/oapps/oapp/src/tests/oapp_sender.rs +0 -570
- package/contracts/oapps/oapp/src/tests/test_macros.rs +0 -434
- package/contracts/oapps/oapp-macros/Cargo.toml +0 -18
- package/contracts/oapps/oapp-macros/src/generators.rs +0 -147
- package/contracts/oapps/oapp-macros/src/lib.rs +0 -166
- package/contracts/oapps/oapp-macros/src/tests/mod.rs +0 -2
- package/contracts/oapps/oapp-macros/src/tests/oapp.rs +0 -74
- package/contracts/oapps/oapp-macros/src/tests/parse_custom_impls.rs +0 -90
- package/contracts/oapps/oapp-macros/src/tests/snapshots/oapp_macros__tests__oapp__snapshot_generate_oapp.snap +0 -111
- package/contracts/oapps/oft/Cargo.toml +0 -30
- package/contracts/oapps/oft/integration-tests/extensions/mod.rs +0 -3
- package/contracts/oapps/oft/integration-tests/extensions/test_oft_fee.rs +0 -172
- package/contracts/oapps/oft/integration-tests/extensions/test_pausable.rs +0 -161
- package/contracts/oapps/oft/integration-tests/extensions/test_rate_limiter.rs +0 -336
- package/contracts/oapps/oft/integration-tests/mod.rs +0 -3
- package/contracts/oapps/oft/integration-tests/setup.rs +0 -306
- package/contracts/oapps/oft/integration-tests/utils.rs +0 -609
- package/contracts/oapps/oft/src/extensions/mod.rs +0 -3
- package/contracts/oapps/oft/src/extensions/oft_fee.rs +0 -281
- package/contracts/oapps/oft/src/extensions/pausable.rs +0 -119
- package/contracts/oapps/oft/src/extensions/rate_limiter.rs +0 -286
- package/contracts/oapps/oft/src/interfaces/mintable.rs +0 -14
- package/contracts/oapps/oft/src/interfaces/mod.rs +0 -3
- package/contracts/oapps/oft/src/lib.rs +0 -24
- package/contracts/oapps/oft/src/oft.rs +0 -176
- package/contracts/oapps/oft/src/oft_types/lock_unlock.rs +0 -50
- package/contracts/oapps/oft/src/oft_types/mint_burn.rs +0 -51
- package/contracts/oapps/oft/src/oft_types/mod.rs +0 -24
- package/contracts/oapps/oft/src/tests/extensions/mod.rs +0 -3
- package/contracts/oapps/oft/src/tests/extensions/oft_fee.rs +0 -260
- package/contracts/oapps/oft/src/tests/extensions/pausable.rs +0 -155
- package/contracts/oapps/oft/src/tests/extensions/rate_limiter.rs +0 -601
- package/contracts/oapps/oft/src/tests/mod.rs +0 -2
- package/contracts/oapps/oft/src/tests/oft_types/lock_unlock.rs +0 -185
- package/contracts/oapps/oft/src/tests/oft_types/mod.rs +0 -1
- package/contracts/oapps/oft-core/Cargo.toml +0 -24
- package/contracts/oapps/oft-core/integration-tests/mod.rs +0 -3
- package/contracts/oapps/oft-core/integration-tests/setup.rs +0 -346
- package/contracts/oapps/oft-core/integration-tests/test_with_sml.rs +0 -156
- package/contracts/oapps/oft-core/integration-tests/utils.rs +0 -220
- package/contracts/oapps/oft-core/src/codec/mod.rs +0 -2
- package/contracts/oapps/oft-core/src/codec/oft_compose_msg_codec.rs +0 -55
- package/contracts/oapps/oft-core/src/codec/oft_msg_codec.rs +0 -58
- package/contracts/oapps/oft-core/src/errors.rs +0 -15
- package/contracts/oapps/oft-core/src/events.rs +0 -32
- package/contracts/oapps/oft-core/src/lib.rs +0 -22
- package/contracts/oapps/oft-core/src/oft_core.rs +0 -594
- package/contracts/oapps/oft-core/src/storage.rs +0 -19
- package/contracts/oapps/oft-core/src/tests/mod.rs +0 -14
- package/contracts/oapps/oft-core/src/tests/test_decimals.rs +0 -124
- package/contracts/oapps/oft-core/src/tests/test_lz_receive.rs +0 -282
- package/contracts/oapps/oft-core/src/tests/test_msg_inspector.rs +0 -324
- package/contracts/oapps/oft-core/src/tests/test_oft_compose_msg_codec.rs +0 -68
- package/contracts/oapps/oft-core/src/tests/test_oft_msg_codec.rs +0 -64
- package/contracts/oapps/oft-core/src/tests/test_oft_version_and_approval.rs +0 -22
- package/contracts/oapps/oft-core/src/tests/test_quote_oft.rs +0 -159
- package/contracts/oapps/oft-core/src/tests/test_quote_send.rs +0 -195
- package/contracts/oapps/oft-core/src/tests/test_resolve_address.rs +0 -37
- package/contracts/oapps/oft-core/src/tests/test_send.rs +0 -915
- package/contracts/oapps/oft-core/src/tests/test_token.rs +0 -47
- package/contracts/oapps/oft-core/src/tests/test_utils.rs +0 -870
- package/contracts/oapps/oft-core/src/types.rs +0 -58
- package/contracts/oapps/oft-core/src/utils.rs +0 -71
- package/contracts/oapps/sac-manager/Cargo.toml +0 -24
- package/contracts/oapps/sac-manager/src/interfaces/mod.rs +0 -3
- package/contracts/oapps/sac-manager/src/interfaces/sac_admin_wrapper.rs +0 -49
- package/contracts/oapps/sac-manager/src/lib.rs +0 -19
- package/contracts/oapps/sac-manager/src/sac_manager.rs +0 -95
- package/contracts/oapps/sac-manager/src/storage.rs +0 -13
- package/contracts/oapps/sac-manager/src/tests/mod.rs +0 -10
- package/contracts/oapps/sac-manager/src/tests/sac_manager/clawback.rs +0 -84
- package/contracts/oapps/sac-manager/src/tests/sac_manager/mint.rs +0 -53
- package/contracts/oapps/sac-manager/src/tests/sac_manager/mod.rs +0 -6
- package/contracts/oapps/sac-manager/src/tests/sac_manager/set_admin.rs +0 -46
- package/contracts/oapps/sac-manager/src/tests/sac_manager/set_authorized.rs +0 -53
- package/contracts/oapps/sac-manager/src/tests/sac_manager/test_helper.rs +0 -35
- package/contracts/oapps/sac-manager/src/tests/sac_manager/view_functions.rs +0 -13
- package/contracts/oapps/sac-manager/src/tests/test_helper.rs +0 -138
- package/contracts/utils/Cargo.toml +0 -20
- package/contracts/utils/src/auth.rs +0 -48
- package/contracts/utils/src/buffer_reader.rs +0 -194
- package/contracts/utils/src/buffer_writer.rs +0 -138
- package/contracts/utils/src/bytes_ext.rs +0 -18
- package/contracts/utils/src/errors.rs +0 -82
- package/contracts/utils/src/lib.rs +0 -20
- package/contracts/utils/src/multisig.rs +0 -247
- package/contracts/utils/src/option_ext.rs +0 -38
- package/contracts/utils/src/ownable.rs +0 -227
- package/contracts/utils/src/rbac.rs +0 -438
- package/contracts/utils/src/testing_utils.rs +0 -180
- package/contracts/utils/src/tests/auth.rs +0 -179
- package/contracts/utils/src/tests/buffer_reader.rs +0 -969
- package/contracts/utils/src/tests/buffer_writer.rs +0 -689
- package/contracts/utils/src/tests/bytes_ext.rs +0 -160
- package/contracts/utils/src/tests/mod.rs +0 -13
- package/contracts/utils/src/tests/multisig.rs +0 -760
- package/contracts/utils/src/tests/option_ext.rs +0 -18
- package/contracts/utils/src/tests/ownable.rs +0 -822
- package/contracts/utils/src/tests/rbac.rs +0 -559
- package/contracts/utils/src/tests/test_helper.rs +0 -67
- package/contracts/utils/src/tests/testing_utils.rs +0 -522
- package/contracts/utils/src/tests/ttl_configurable.rs +0 -586
- package/contracts/utils/src/tests/ttl_extendable.rs +0 -64
- package/contracts/utils/src/tests/upgradeable.rs +0 -529
- package/contracts/utils/src/ttl_configurable.rs +0 -169
- package/contracts/utils/src/ttl_extendable.rs +0 -25
- package/contracts/utils/src/upgradeable.rs +0 -103
- package/contracts/workers/Cargo.toml +0 -13
- package/contracts/workers/lib.rs +0 -2
- package/sdk/.turbo/turbo-build.log +0 -5
- package/sdk/.turbo/turbo-test.log +0 -1507
- package/sdk/LICENSE +0 -23
- package/sdk/dist/generated/bml.d.ts +0 -670
- package/sdk/dist/generated/bml.d.ts.map +0 -1
- package/sdk/dist/generated/bml.js +0 -292
- package/sdk/dist/generated/bml.js.map +0 -1
- package/sdk/dist/generated/counter.d.ts +0 -1253
- package/sdk/dist/generated/counter.d.ts.map +0 -1
- package/sdk/dist/generated/counter.js +0 -391
- package/sdk/dist/generated/counter.js.map +0 -1
- package/sdk/dist/generated/dvn.d.ts +0 -1569
- package/sdk/dist/generated/dvn.d.ts.map +0 -1
- package/sdk/dist/generated/dvn.js +0 -459
- package/sdk/dist/generated/dvn.js.map +0 -1
- package/sdk/dist/generated/dvn_fee_lib.d.ts +0 -587
- package/sdk/dist/generated/dvn_fee_lib.d.ts.map +0 -1
- package/sdk/dist/generated/dvn_fee_lib.js +0 -186
- package/sdk/dist/generated/dvn_fee_lib.js.map +0 -1
- package/sdk/dist/generated/endpoint.d.ts +0 -1304
- package/sdk/dist/generated/endpoint.d.ts.map +0 -1
- package/sdk/dist/generated/endpoint.js +0 -396
- package/sdk/dist/generated/endpoint.js.map +0 -1
- package/sdk/dist/generated/executor.d.ts +0 -1554
- package/sdk/dist/generated/executor.d.ts.map +0 -1
- package/sdk/dist/generated/executor.js +0 -447
- package/sdk/dist/generated/executor.js.map +0 -1
- package/sdk/dist/generated/executor_fee_lib.d.ts +0 -1037
- package/sdk/dist/generated/executor_fee_lib.d.ts.map +0 -1
- package/sdk/dist/generated/executor_fee_lib.js +0 -351
- package/sdk/dist/generated/executor_fee_lib.js.map +0 -1
- package/sdk/dist/generated/executor_helper.d.ts +0 -883
- package/sdk/dist/generated/executor_helper.d.ts.map +0 -1
- package/sdk/dist/generated/executor_helper.js +0 -354
- package/sdk/dist/generated/executor_helper.js.map +0 -1
- package/sdk/dist/generated/layerzero_view.d.ts +0 -1153
- package/sdk/dist/generated/layerzero_view.d.ts.map +0 -1
- package/sdk/dist/generated/layerzero_view.js +0 -457
- package/sdk/dist/generated/layerzero_view.js.map +0 -1
- package/sdk/dist/generated/oft.d.ts +0 -1638
- package/sdk/dist/generated/oft.d.ts.map +0 -1
- package/sdk/dist/generated/oft.js +0 -463
- package/sdk/dist/generated/oft.js.map +0 -1
- package/sdk/dist/generated/price_feed.d.ts +0 -787
- package/sdk/dist/generated/price_feed.d.ts.map +0 -1
- package/sdk/dist/generated/price_feed.js +0 -231
- package/sdk/dist/generated/price_feed.js.map +0 -1
- package/sdk/dist/generated/sac_manager.d.ts +0 -567
- package/sdk/dist/generated/sac_manager.d.ts.map +0 -1
- package/sdk/dist/generated/sac_manager.js +0 -198
- package/sdk/dist/generated/sac_manager.js.map +0 -1
- package/sdk/dist/generated/sml.d.ts +0 -934
- package/sdk/dist/generated/sml.d.ts.map +0 -1
- package/sdk/dist/generated/sml.js +0 -366
- package/sdk/dist/generated/sml.js.map +0 -1
- package/sdk/dist/generated/treasury.d.ts +0 -892
- package/sdk/dist/generated/treasury.d.ts.map +0 -1
- package/sdk/dist/generated/treasury.js +0 -352
- package/sdk/dist/generated/treasury.js.map +0 -1
- package/sdk/dist/generated/uln302.d.ts +0 -1268
- package/sdk/dist/generated/uln302.d.ts.map +0 -1
- package/sdk/dist/generated/uln302.js +0 -477
- package/sdk/dist/generated/uln302.js.map +0 -1
- package/sdk/dist/generated/upgrader.d.ts +0 -292
- package/sdk/dist/generated/upgrader.d.ts.map +0 -1
- package/sdk/dist/generated/upgrader.js +0 -144
- package/sdk/dist/generated/upgrader.js.map +0 -1
- package/sdk/dist/index.d.ts +0 -17
- package/sdk/dist/index.d.ts.map +0 -1
- package/sdk/dist/index.js +0 -21
- package/sdk/dist/index.js.map +0 -1
- package/sdk/node_modules/.bin/tsc +0 -21
- package/sdk/node_modules/.bin/tsserver +0 -21
- package/sdk/node_modules/.bin/vitest +0 -21
- package/sdk/package.json +0 -50
- package/sdk/src/index.ts +0 -23
- package/sdk/test/counter-sml.test.ts +0 -480
- package/sdk/test/counter-uln.test.ts +0 -584
- package/sdk/test/oft-sml.test.ts +0 -750
- package/sdk/test/sac-manager.test.ts +0 -464
- package/sdk/test/secp256k1.ts +0 -59
- package/sdk/test/suites/constants.ts +0 -51
- package/sdk/test/suites/deploy.ts +0 -312
- package/sdk/test/suites/dummyContractClient.ts +0 -168
- package/sdk/test/suites/globalSetup.ts +0 -604
- package/sdk/test/suites/localnet.ts +0 -192
- package/sdk/test/suites/scan.ts +0 -202
- package/sdk/test/test_data/test_upgradeable_dvn.wasm +0 -0
- package/sdk/test/upgrader.test.ts +0 -194
- package/sdk/test/utils.ts +0 -671
- package/sdk/tsconfig.json +0 -21
- package/sdk/tsconfig.test.json +0 -10
- package/sdk/turbo.json +0 -15
- package/sdk/vitest.config.ts +0 -21
- package/ts-bindings-gen.toml +0 -67
- package/turbo-snapshot.lock.json +0 -194
- package/turbo.json +0 -26
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/endpoint_v2.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/errors.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/events.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/interfaces/layerzero_composer.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/interfaces/layerzero_endpoint_v2.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/interfaces/layerzero_receiver.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/interfaces/message_lib.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/interfaces/message_lib_manager.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/interfaces/messaging_channel.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/interfaces/messaging_composer.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/interfaces/mod.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/interfaces/send_lib.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/lib.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/message_lib_manager.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/messaging_channel.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/messaging_composer.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/storage.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/endpoint_setup.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/endpoint_v2/build_outbound_packet.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/endpoint_v2/clear.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/endpoint_v2/delegate.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/endpoint_v2/initializable.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/endpoint_v2/lz_receive_alert.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/endpoint_v2/mod.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/endpoint_v2/native_token.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/endpoint_v2/owner.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/endpoint_v2/pay_messaging_fees.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/endpoint_v2/quote.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/endpoint_v2/recover_token.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/endpoint_v2/require_oapp_auth.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/endpoint_v2/send.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/endpoint_v2/set_delegate.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/endpoint_v2/set_zro.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/endpoint_v2/transfer_ownership.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/endpoint_v2/ttl_config.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/endpoint_v2/verifiable.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/endpoint_v2/verify.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/endpoint_v2/zro.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/message_lib_manager/default_receive_library.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/message_lib_manager/default_receive_library_timeout.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/message_lib_manager/default_send_library.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/message_lib_manager/get_config.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/message_lib_manager/get_library_index.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/message_lib_manager/get_receive_library.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/message_lib_manager/get_registered_libraries.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/message_lib_manager/get_send_library.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/message_lib_manager/is_registered_library.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/message_lib_manager/is_supported_eid.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/message_lib_manager/is_valid_receive_library.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/message_lib_manager/mod.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/message_lib_manager/receive_library_timeout.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/message_lib_manager/register_library.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/message_lib_manager/registered_libraries_count.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/message_lib_manager/require_receive_lib_for_eid.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/message_lib_manager/require_registered.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/message_lib_manager/require_send_lib_for_eid.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/message_lib_manager/require_supported_eid.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/message_lib_manager/set_config.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/message_lib_manager/set_default_receive_lib_timeout.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/message_lib_manager/set_default_receive_library.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/message_lib_manager/set_default_send_library.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/message_lib_manager/set_receive_library.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/message_lib_manager/set_receive_library_timeout.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/message_lib_manager/set_send_library.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/message_lib_manager/timeout.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/messaging_channel/burn.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/messaging_channel/clear_payload.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/messaging_channel/inbound.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/messaging_channel/inbound_nonce.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/messaging_channel/inbound_payload_hash.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/messaging_channel/insert_and_drain_pending_nonces.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/messaging_channel/mod.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/messaging_channel/next_guid.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/messaging_channel/nilify.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/messaging_channel/outbound.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/messaging_channel/outbound_nonce.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/messaging_channel/pending_inbound_nonces.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/messaging_channel/skip.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/messaging_composer/clear_compose.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/messaging_composer/compose_queue.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/messaging_composer/lz_compose_alert.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/messaging_composer/mod.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/messaging_composer/send_compose.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/mock.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/mod.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/util/build_payload.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/util/compute_guid.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/util/keccak256.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/tests/util/mod.rs +0 -0
- /package/{contracts/endpoint-v2 → endpoint-v2}/src/util.rs +0 -0
- /package/{contracts/layerzero-views → layerzero-views}/src/errors.rs +0 -0
- /package/{contracts/layerzero-views → layerzero-views}/src/layerzero_view.rs +0 -0
- /package/{contracts/layerzero-views → layerzero-views}/src/lib.rs +0 -0
- /package/{contracts/layerzero-views → layerzero-views}/src/storage.rs +0 -0
- /package/{contracts/layerzero-views → layerzero-views}/src/tests/layerzero_view_tests.rs +0 -0
- /package/{contracts/layerzero-views → layerzero-views}/src/tests/mod.rs +0 -0
- /package/{contracts/layerzero-views → layerzero-views}/src/tests/setup.rs +0 -0
- /package/{contracts/layerzero-views → layerzero-views}/src/tests/types_tests.rs +0 -0
- /package/{contracts/layerzero-views → layerzero-views}/src/types.rs +0 -0
- /package/{contracts/message-libs → message-libs}/blocked-message-lib/src/lib.rs +0 -0
- /package/{contracts/message-libs → message-libs}/blocked-message-lib/src/tests/blocked_message_lib_tests.rs +0 -0
- /package/{contracts/message-libs → message-libs}/blocked-message-lib/src/tests/mod.rs +0 -0
- /package/{contracts/message-libs → message-libs}/blocked-message-lib/src/tests/setup.rs +0 -0
- /package/{contracts/message-libs → message-libs}/message-lib-common/src/errors.rs +0 -0
- /package/{contracts/message-libs → message-libs}/message-lib-common/src/interfaces/dvn.rs +0 -0
- /package/{contracts/message-libs → message-libs}/message-lib-common/src/interfaces/executor.rs +0 -0
- /package/{contracts/message-libs → message-libs}/message-lib-common/src/interfaces/mod.rs +0 -0
- /package/{contracts/message-libs → message-libs}/message-lib-common/src/interfaces/treasury.rs +0 -0
- /package/{contracts/message-libs → message-libs}/message-lib-common/src/lib.rs +0 -0
- /package/{contracts/message-libs → message-libs}/message-lib-common/src/packet_codec_v1.rs +0 -0
- /package/{contracts/message-libs → message-libs}/message-lib-common/src/testing_utils.rs +0 -0
- /package/{contracts/message-libs → message-libs}/message-lib-common/src/tests/mod.rs +0 -0
- /package/{contracts/message-libs → message-libs}/message-lib-common/src/tests/packet_codec_v1/decode_packet_header.rs +0 -0
- /package/{contracts/message-libs → message-libs}/message-lib-common/src/tests/packet_codec_v1/encode_packet.rs +0 -0
- /package/{contracts/message-libs → message-libs}/message-lib-common/src/tests/packet_codec_v1/encode_packet_header.rs +0 -0
- /package/{contracts/message-libs → message-libs}/message-lib-common/src/tests/packet_codec_v1/mod.rs +0 -0
- /package/{contracts/message-libs → message-libs}/message-lib-common/src/tests/packet_codec_v1/payload.rs +0 -0
- /package/{contracts/message-libs → message-libs}/message-lib-common/src/tests/packet_codec_v1/payload_hash.rs +0 -0
- /package/{contracts/message-libs → message-libs}/message-lib-common/src/tests/packet_codec_v1/test_helper.rs +0 -0
- /package/{contracts/message-libs → message-libs}/message-lib-common/src/tests/worker_options/append_dvn_option.rs +0 -0
- /package/{contracts/message-libs → message-libs}/message-lib-common/src/tests/worker_options/append_lz_receive_option.rs +0 -0
- /package/{contracts/message-libs → message-libs}/message-lib-common/src/tests/worker_options/append_native_drop_option.rs +0 -0
- /package/{contracts/message-libs → message-libs}/message-lib-common/src/tests/worker_options/convert_legacy_options.rs +0 -0
- /package/{contracts/message-libs → message-libs}/message-lib-common/src/tests/worker_options/extract_type_3_options.rs +0 -0
- /package/{contracts/message-libs → message-libs}/message-lib-common/src/tests/worker_options/left_pad_to_bytes32.rs +0 -0
- /package/{contracts/message-libs → message-libs}/message-lib-common/src/tests/worker_options/mod.rs +0 -0
- /package/{contracts/message-libs → message-libs}/message-lib-common/src/tests/worker_options/split_worker_options.rs +0 -0
- /package/{contracts/message-libs → message-libs}/message-lib-common/src/worker_options.rs +0 -0
- /package/{contracts/message-libs → message-libs}/simple-message-lib/src/errors.rs +0 -0
- /package/{contracts/message-libs → message-libs}/simple-message-lib/src/lib.rs +0 -0
- /package/{contracts/message-libs → message-libs}/simple-message-lib/src/simple_message_lib.rs +0 -0
- /package/{contracts/message-libs → message-libs}/simple-message-lib/src/storage.rs +0 -0
- /package/{contracts/message-libs → message-libs}/simple-message-lib/src/tests/mod.rs +0 -0
- /package/{contracts/message-libs → message-libs}/simple-message-lib/src/tests/setup.rs +0 -0
- /package/{contracts/message-libs → message-libs}/simple-message-lib/src/tests/simple_message_lib_tests.rs +0 -0
- /package/{contracts/message-libs → message-libs}/treasury/src/errors.rs +0 -0
- /package/{contracts/message-libs → message-libs}/treasury/src/events.rs +0 -0
- /package/{contracts/message-libs → message-libs}/treasury/src/interfaces/mod.rs +0 -0
- /package/{contracts/message-libs → message-libs}/treasury/src/interfaces/zro_fee_lib.rs +0 -0
- /package/{contracts/message-libs → message-libs}/treasury/src/lib.rs +0 -0
- /package/{contracts/message-libs → message-libs}/treasury/src/storage.rs +0 -0
- /package/{contracts/message-libs → message-libs}/treasury/src/tests/mod.rs +0 -0
- /package/{contracts/message-libs → message-libs}/treasury/src/tests/setup.rs +0 -0
- /package/{contracts/message-libs → message-libs}/treasury/src/tests/treasury_tests.rs +0 -0
- /package/{contracts/message-libs → message-libs}/treasury/src/treasury.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/errors.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/events.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/interfaces/mod.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/interfaces/receive_uln.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/interfaces/send_uln.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/lib.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/receive_uln.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/send_uln.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/storage.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/tests/config/mod.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/tests/config/oapp_uln_config.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/tests/config/uln_config.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/tests/mod.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/tests/receive_uln302/commit_verification.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/tests/receive_uln302/confirmations.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/tests/receive_uln302/effective_receive_uln_config.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/tests/receive_uln302/mod.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/tests/receive_uln302/set_default_receive_uln_configs.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/tests/receive_uln302/verifiable.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/tests/receive_uln302/verify.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/tests/send_uln302/effective_executor_config.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/tests/send_uln302/effective_send_uln_config.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/tests/send_uln302/mod.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/tests/send_uln302/quote.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/tests/send_uln302/send.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/tests/send_uln302/set_default_executor_configs.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/tests/send_uln302/set_default_send_uln_configs.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/tests/setup.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/tests/testing_utils.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/tests/uln302/get_app_receive_uln_config.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/tests/uln302/get_app_send_uln_config.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/tests/uln302/get_config.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/tests/uln302/get_oapp_executor_config.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/tests/uln302/mod.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/tests/uln302/set_config.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/types.rs +0 -0
- /package/{contracts/message-libs → message-libs}/uln-302/src/uln302.rs +0 -0
- /package/{contracts/upgrader → upgrader}/src/lib.rs +0 -0
- /package/{contracts/upgrader → upgrader}/src/tests/mod.rs +0 -0
- /package/{contracts/upgrader → upgrader}/src/tests/test_data/test_upgradeable_contract1.wasm +0 -0
- /package/{contracts/upgrader → upgrader}/src/tests/test_data/test_upgradeable_contract2.wasm +0 -0
- /package/{contracts/upgrader → upgrader}/src/tests/test_data/test_upgradeable_contract3.wasm +0 -0
- /package/{contracts/upgrader → upgrader}/src/tests/test_data/test_upgradeable_contract4.wasm +0 -0
- /package/{contracts/upgrader → upgrader}/src/tests/test_upgrader.rs +0 -0
- /package/{contracts/workers → workers}/dvn/src/auth.rs +0 -0
- /package/{contracts/workers → workers}/dvn/src/dvn.rs +0 -0
- /package/{contracts/workers → workers}/dvn/src/errors.rs +0 -0
- /package/{contracts/workers → workers}/dvn/src/events.rs +0 -0
- /package/{contracts/workers → workers}/dvn/src/interfaces/dvn.rs +0 -0
- /package/{contracts/workers → workers}/dvn/src/interfaces/mod.rs +0 -0
- /package/{contracts/workers → workers}/dvn/src/lib.rs +0 -0
- /package/{contracts/workers → workers}/dvn/src/storage.rs +0 -0
- /package/{contracts/workers → workers}/dvn/src/tests/auth.rs +0 -0
- /package/{contracts/workers → workers}/dvn/src/tests/dvn.rs +0 -0
- /package/{contracts/workers → workers}/dvn/src/tests/key_pair.rs +0 -0
- /package/{contracts/workers → workers}/dvn/src/tests/mod.rs +0 -0
- /package/{contracts/workers → workers}/dvn/src/tests/setup.rs +0 -0
- /package/{contracts/workers → workers}/dvn-fee-lib/src/dvn_fee_lib.rs +0 -0
- /package/{contracts/workers → workers}/dvn-fee-lib/src/errors.rs +0 -0
- /package/{contracts/workers → workers}/dvn-fee-lib/src/lib.rs +0 -0
- /package/{contracts/workers → workers}/dvn-fee-lib/src/tests/dvn_fee_lib.rs +0 -0
- /package/{contracts/workers → workers}/dvn-fee-lib/src/tests/mod.rs +0 -0
- /package/{contracts/workers → workers}/executor/src/auth.rs +0 -0
- /package/{contracts/workers → workers}/executor/src/errors.rs +0 -0
- /package/{contracts/workers → workers}/executor/src/events.rs +0 -0
- /package/{contracts/workers → workers}/executor/src/executor.rs +0 -0
- /package/{contracts/workers → workers}/executor/src/interfaces/executor.rs +0 -0
- /package/{contracts/workers → workers}/executor/src/interfaces/mod.rs +0 -0
- /package/{contracts/workers → workers}/executor/src/lib.rs +0 -0
- /package/{contracts/workers → workers}/executor/src/storage.rs +0 -0
- /package/{contracts/workers → workers}/executor/src/tests/auth.rs +0 -0
- /package/{contracts/workers → workers}/executor/src/tests/executor.rs +0 -0
- /package/{contracts/workers → workers}/executor/src/tests/mod.rs +0 -0
- /package/{contracts/workers → workers}/executor/src/tests/setup.rs +0 -0
- /package/{contracts/workers → workers}/executor-fee-lib/src/errors.rs +0 -0
- /package/{contracts/workers → workers}/executor-fee-lib/src/executor_fee_lib.rs +0 -0
- /package/{contracts/workers → workers}/executor-fee-lib/src/executor_option.rs +0 -0
- /package/{contracts/workers → workers}/executor-fee-lib/src/lib.rs +0 -0
- /package/{contracts/workers → workers}/executor-fee-lib/src/tests/executor_fee_lib.rs +0 -0
- /package/{contracts/workers → workers}/executor-fee-lib/src/tests/executor_option.rs +0 -0
- /package/{contracts/workers → workers}/executor-fee-lib/src/tests/mod.rs +0 -0
- /package/{contracts/workers → workers}/executor-fee-lib/src/tests/setup.rs +0 -0
- /package/{contracts/workers → workers}/executor-helper/src/executor_helper.rs +0 -0
- /package/{contracts/workers → workers}/executor-helper/src/lib.rs +0 -0
- /package/{contracts/workers → workers}/executor-helper/src/tests/executor_helper.rs +0 -0
- /package/{contracts/workers → workers}/executor-helper/src/tests/mod.rs +0 -0
- /package/{contracts/workers → workers}/executor-helper/src/tests/setup.rs +0 -0
- /package/{contracts/workers → workers}/fee-lib-interfaces/src/dvn_fee_lib.rs +0 -0
- /package/{contracts/workers → workers}/fee-lib-interfaces/src/executor_fee_lib.rs +0 -0
- /package/{contracts/workers → workers}/fee-lib-interfaces/src/lib.rs +0 -0
- /package/{contracts/workers → workers}/fee-lib-interfaces/src/price_feed.rs +0 -0
- /package/{contracts/workers → workers}/price-feed/src/errors.rs +0 -0
- /package/{contracts/workers → workers}/price-feed/src/events.rs +0 -0
- /package/{contracts/workers → workers}/price-feed/src/lib.rs +0 -0
- /package/{contracts/workers → workers}/price-feed/src/price_feed.rs +0 -0
- /package/{contracts/workers → workers}/price-feed/src/storage.rs +0 -0
- /package/{contracts/workers → workers}/price-feed/src/tests/mod.rs +0 -0
- /package/{contracts/workers → workers}/price-feed/src/tests/price_feed.rs +0 -0
- /package/{contracts/workers → workers}/price-feed/src/tests/setup.rs +0 -0
- /package/{contracts/workers → workers}/price-feed/src/types.rs +0 -0
- /package/{contracts/workers → workers}/worker/src/errors.rs +0 -0
- /package/{contracts/workers → workers}/worker/src/events.rs +0 -0
- /package/{contracts/workers → workers}/worker/src/lib.rs +0 -0
- /package/{contracts/workers → workers}/worker/src/storage.rs +0 -0
- /package/{contracts/workers → workers}/worker/src/tests/mod.rs +0 -0
- /package/{contracts/workers → workers}/worker/src/tests/setup.rs +0 -0
- /package/{contracts/workers → workers}/worker/src/tests/worker.rs +0 -0
- /package/{contracts/workers → workers}/worker/src/worker.rs +0 -0
|
@@ -1,1019 +0,0 @@
|
|
|
1
|
-
extern crate std;
|
|
2
|
-
|
|
3
|
-
use crate::{
|
|
4
|
-
counter::{Counter, CounterClient},
|
|
5
|
-
integration_tests::{
|
|
6
|
-
signing::{Ed25519KeyPair, Secp256k1KeyPair},
|
|
7
|
-
utils::{address_to_bytes32, decode_packet, register_library, set_peer, set_zro, ChainSetupCommon},
|
|
8
|
-
},
|
|
9
|
-
};
|
|
10
|
-
use dvn::{DVNClient, DstConfig as DvnDstConfig, DstConfigParam as DvnDstConfigParam, LzDVN};
|
|
11
|
-
use dvn_fee_lib::DvnFeeLib;
|
|
12
|
-
use endpoint_v2::{EndpointV2, EndpointV2Client};
|
|
13
|
-
use executor::{DstConfig as ExecutorDstConfig, ExecutorClient, LzExecutor, LzExecutorClient, SetDstConfigParam};
|
|
14
|
-
use executor_fee_lib::ExecutorFeeLib;
|
|
15
|
-
use executor_helper::{ExecutorHelper, ExecutorHelperClient};
|
|
16
|
-
use fee_lib_interfaces::Price;
|
|
17
|
-
use price_feed::{types::UpdatePrice, LzPriceFeed};
|
|
18
|
-
use soroban_sdk::{
|
|
19
|
-
testutils::{Address as _, MockAuth, MockAuthInvoke},
|
|
20
|
-
token::TokenClient,
|
|
21
|
-
vec, Address, BytesN, Env, IntoVal, Symbol, Vec,
|
|
22
|
-
};
|
|
23
|
-
use treasury::Treasury;
|
|
24
|
-
use uln302::{
|
|
25
|
-
ExecutorConfig, ReceiveUln302Client, SendUln302Client, SetDefaultExecutorConfigParam, SetDefaultUlnConfigParam,
|
|
26
|
-
Uln302, Uln302Client, UlnConfig,
|
|
27
|
-
};
|
|
28
|
-
use utils::{buffer_reader::BufferReader, buffer_writer::BufferWriter};
|
|
29
|
-
|
|
30
|
-
pub const CONFIRMATIONS: u64 = 1;
|
|
31
|
-
pub const MAX_MESSAGE_SIZE: u32 = 10000;
|
|
32
|
-
pub const DVN_VID: u32 = 1; // DVN Verifier ID
|
|
33
|
-
|
|
34
|
-
// Price feed constants for testing
|
|
35
|
-
const PRICE_RATIO_DENOMINATOR: u128 = 10_u128.pow(20);
|
|
36
|
-
const DEFAULT_GAS_PRICE: u64 = 100;
|
|
37
|
-
const DEFAULT_GAS_PER_BYTE: u32 = 1;
|
|
38
|
-
const DEFAULT_MULTIPLIER_BPS: u32 = 10000; // 100%
|
|
39
|
-
|
|
40
|
-
// Worker options constants
|
|
41
|
-
const OPTIONS_TYPE_3: u16 = 3;
|
|
42
|
-
const EXECUTOR_WORKER_ID: u8 = 1;
|
|
43
|
-
const EXECUTOR_OPTION_TYPE_LZRECEIVE: u8 = 1;
|
|
44
|
-
|
|
45
|
-
#[allow(dead_code)]
|
|
46
|
-
const EXECUTOR_OPTION_TYPE_NATIVE_DROP: u8 = 2;
|
|
47
|
-
|
|
48
|
-
const EXECUTOR_OPTION_TYPE_LZCOMPOSE: u8 = 3;
|
|
49
|
-
|
|
50
|
-
// ============================================================================
|
|
51
|
-
// Options Creation Functions
|
|
52
|
-
// ============================================================================
|
|
53
|
-
|
|
54
|
-
/// Creates default ULN302 options with Type 3 format and basic lzReceive gas (no lzCompose).
|
|
55
|
-
/// This is required because ULN302 expects at least 2 bytes for the options type header.
|
|
56
|
-
pub fn create_default_options(env: &Env) -> soroban_sdk::Bytes {
|
|
57
|
-
create_options_with_gas(env, 100000, 0)
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/// Extracts the executor value (native token amount) from Type 3 options.
|
|
61
|
-
/// Returns 0 if no value is specified in the options.
|
|
62
|
-
pub fn get_executor_value_from_options(_env: &Env, options: &soroban_sdk::Bytes) -> i128 {
|
|
63
|
-
let mut reader = BufferReader::new(options);
|
|
64
|
-
|
|
65
|
-
// Skip options type header (2 bytes)
|
|
66
|
-
let _options_type = reader.read_u16();
|
|
67
|
-
|
|
68
|
-
// Parse options until we find lzReceive with value
|
|
69
|
-
while reader.remaining_len() > 0 {
|
|
70
|
-
let _worker_id = reader.read_u8();
|
|
71
|
-
let option_size = reader.read_u16();
|
|
72
|
-
let option_type = reader.read_u8();
|
|
73
|
-
|
|
74
|
-
if option_type == EXECUTOR_OPTION_TYPE_LZRECEIVE {
|
|
75
|
-
// option_size includes option_type(1) + data
|
|
76
|
-
// If data is 32 bytes (gas + value), extract value
|
|
77
|
-
// If data is 16 bytes (gas only), value is 0
|
|
78
|
-
let data_size = option_size - 1; // subtract option_type byte
|
|
79
|
-
let _gas = reader.read_u128();
|
|
80
|
-
if data_size == 32 {
|
|
81
|
-
return reader.read_u128() as i128;
|
|
82
|
-
}
|
|
83
|
-
return 0;
|
|
84
|
-
} else {
|
|
85
|
-
// Skip this option's data (option_size - 1 for option_type already read)
|
|
86
|
-
reader.skip((option_size - 1).into());
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
0
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/// Extracts the lzCompose value (native token amount) from Type 3 options.
|
|
94
|
-
/// Returns 0 if no lzCompose value is specified in the options.
|
|
95
|
-
pub fn get_compose_value_from_options(_env: &Env, options: &soroban_sdk::Bytes) -> i128 {
|
|
96
|
-
let mut reader = BufferReader::new(options);
|
|
97
|
-
|
|
98
|
-
// Skip options type header (2 bytes)
|
|
99
|
-
let _options_type = reader.read_u16();
|
|
100
|
-
|
|
101
|
-
// Parse options until we find lzCompose with value
|
|
102
|
-
while reader.remaining_len() > 0 {
|
|
103
|
-
let _worker_id = reader.read_u8();
|
|
104
|
-
let option_size = reader.read_u16();
|
|
105
|
-
let option_type = reader.read_u8();
|
|
106
|
-
|
|
107
|
-
if option_type == EXECUTOR_OPTION_TYPE_LZCOMPOSE {
|
|
108
|
-
// option_size includes option_type(1) + data
|
|
109
|
-
// lzCompose format: [index: u16][gas: u128] (18 bytes) or [index: u16][gas: u128][value: u128] (34 bytes)
|
|
110
|
-
// So data_size is 18 or 34
|
|
111
|
-
let data_size = option_size - 1; // subtract option_type byte
|
|
112
|
-
let _index = reader.read_u16();
|
|
113
|
-
let _gas = reader.read_u128();
|
|
114
|
-
if data_size == 34 {
|
|
115
|
-
return reader.read_u128() as i128;
|
|
116
|
-
}
|
|
117
|
-
return 0;
|
|
118
|
-
} else {
|
|
119
|
-
// Skip this option's data (option_size - 1 for option_type already read)
|
|
120
|
-
reader.skip((option_size - 1).into());
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
0
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/// Creates ULN302 options with lzReceive gas and optional lzCompose gas.
|
|
128
|
-
/// Format: [options_type(2)][lzReceive option][lzCompose option (if lz_compose_gas > 0)]
|
|
129
|
-
///
|
|
130
|
-
/// # Arguments
|
|
131
|
-
/// * `env` - Soroban environment
|
|
132
|
-
/// * `gas` - Gas limit for lzReceive execution (always required)
|
|
133
|
-
/// * `lz_compose_gas` - Gas limit for lzCompose execution (only added if > 0)
|
|
134
|
-
pub fn create_options_with_gas(env: &Env, gas: u128, lz_compose_gas: u128) -> soroban_sdk::Bytes {
|
|
135
|
-
create_options_with_gas_and_value(env, gas, 0, lz_compose_gas, 0)
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/// Creates ULN302 options with lzReceive gas/value and optional lzCompose gas/value.
|
|
139
|
-
/// Format: [options_type(2)][lzReceive option][lzCompose option (if lz_compose_gas > 0)]
|
|
140
|
-
///
|
|
141
|
-
/// # Arguments
|
|
142
|
-
/// * `env` - Soroban environment
|
|
143
|
-
/// * `gas` - Gas limit for lzReceive execution (always required)
|
|
144
|
-
/// * `value` - Native value for lzReceive (only added if > 0)
|
|
145
|
-
/// * `lz_compose_gas` - Gas limit for lzCompose execution (only added if > 0)
|
|
146
|
-
/// * `lz_compose_value` - Native value for lzCompose (only added if > 0)
|
|
147
|
-
pub fn create_options_with_gas_and_value(
|
|
148
|
-
env: &Env,
|
|
149
|
-
gas: u128,
|
|
150
|
-
value: u128,
|
|
151
|
-
lz_compose_gas: u128,
|
|
152
|
-
lz_compose_value: u128,
|
|
153
|
-
) -> soroban_sdk::Bytes {
|
|
154
|
-
let mut writer = BufferWriter::new(env);
|
|
155
|
-
|
|
156
|
-
// Type 3 options header
|
|
157
|
-
writer.write_u16(OPTIONS_TYPE_3);
|
|
158
|
-
|
|
159
|
-
// Add lzReceive option - include value only if > 0
|
|
160
|
-
if value > 0 {
|
|
161
|
-
writer
|
|
162
|
-
.write_u8(EXECUTOR_WORKER_ID) // worker_id (1 byte)
|
|
163
|
-
.write_u16(33) // option_size: option_type(1) + gas(16) + value(16) = 33 bytes
|
|
164
|
-
.write_u8(EXECUTOR_OPTION_TYPE_LZRECEIVE) // option_type (1 byte)
|
|
165
|
-
.write_u128(gas) // execution gas (16 bytes)
|
|
166
|
-
.write_u128(value); // value (16 bytes)
|
|
167
|
-
} else {
|
|
168
|
-
writer
|
|
169
|
-
.write_u8(EXECUTOR_WORKER_ID) // worker_id (1 byte)
|
|
170
|
-
.write_u16(17) // option_size: option_type(1) + gas(16) = 17 bytes
|
|
171
|
-
.write_u8(EXECUTOR_OPTION_TYPE_LZRECEIVE) // option_type (1 byte)
|
|
172
|
-
.write_u128(gas); // execution gas (16 bytes)
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
// Add lzCompose option only if lz_compose_gas > 0
|
|
176
|
-
if lz_compose_gas > 0 {
|
|
177
|
-
if lz_compose_value > 0 {
|
|
178
|
-
// lzCompose with gas and value: [index: u16][gas: u128][value: u128] = 34 bytes
|
|
179
|
-
writer
|
|
180
|
-
.write_u8(EXECUTOR_WORKER_ID) // worker_id (1 byte)
|
|
181
|
-
.write_u16(35) // option_size: option_type(1) + index(2) + gas(16) + value(16) = 35 bytes
|
|
182
|
-
.write_u8(EXECUTOR_OPTION_TYPE_LZCOMPOSE) // option_type (1 byte)
|
|
183
|
-
.write_u16(0) // compose index (2 bytes)
|
|
184
|
-
.write_u128(lz_compose_gas) // compose gas (16 bytes)
|
|
185
|
-
.write_u128(lz_compose_value); // compose value (16 bytes)
|
|
186
|
-
} else {
|
|
187
|
-
// lzCompose with gas only: [index: u16][gas: u128] = 18 bytes
|
|
188
|
-
writer
|
|
189
|
-
.write_u8(EXECUTOR_WORKER_ID) // worker_id (1 byte)
|
|
190
|
-
.write_u16(19) // option_size: option_type(1) + index(2) + gas(16) = 19 bytes
|
|
191
|
-
.write_u8(EXECUTOR_OPTION_TYPE_LZCOMPOSE) // option_type (1 byte)
|
|
192
|
-
.write_u16(0) // compose index (2 bytes)
|
|
193
|
-
.write_u128(lz_compose_gas); // compose gas (16 bytes)
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
writer.to_bytes()
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
/// Creates ULN302 options with lzReceive gas and value (for ABA return messages).
|
|
201
|
-
/// Format: [options_type(2)][lzReceive option with gas and value]
|
|
202
|
-
pub fn create_aba_return_options(env: &Env) -> soroban_sdk::Bytes {
|
|
203
|
-
let mut writer = BufferWriter::new(env);
|
|
204
|
-
|
|
205
|
-
// Type 3 options header
|
|
206
|
-
writer.write_u16(OPTIONS_TYPE_3);
|
|
207
|
-
|
|
208
|
-
// Add lzReceive option with gas=200000 and value=10 (matching Counter's ABA return)
|
|
209
|
-
writer
|
|
210
|
-
.write_u8(EXECUTOR_WORKER_ID) // worker_id (1 byte)
|
|
211
|
-
.write_u16(33) // option_size: option_type(1) + gas(16) + value(16) = 33 bytes
|
|
212
|
-
.write_u8(EXECUTOR_OPTION_TYPE_LZRECEIVE) // option_type (1 byte)
|
|
213
|
-
.write_u128(200000) // execution gas (16 bytes)
|
|
214
|
-
.write_u128(10); // value (16 bytes)
|
|
215
|
-
|
|
216
|
-
writer.to_bytes()
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
/// Creates ULN302 options for ComposedABA return (gas=200000, no lzCompose).
|
|
220
|
-
pub fn create_composed_aba_return_options(env: &Env) -> soroban_sdk::Bytes {
|
|
221
|
-
create_options_with_gas(env, 200000, 0)
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
/// Creates ULN302 options with native drop included.
|
|
225
|
-
/// Format: [options_type(2)][lzReceive option][native drop option]
|
|
226
|
-
#[allow(dead_code)]
|
|
227
|
-
pub fn create_options_with_native_drop(env: &Env, amount: u128, receiver: &BytesN<32>) -> soroban_sdk::Bytes {
|
|
228
|
-
let mut writer = BufferWriter::new(env);
|
|
229
|
-
|
|
230
|
-
// Type 3 options header
|
|
231
|
-
writer.write_u16(OPTIONS_TYPE_3);
|
|
232
|
-
|
|
233
|
-
// Add a basic lzReceive option with default gas (100000)
|
|
234
|
-
writer
|
|
235
|
-
.write_u8(EXECUTOR_WORKER_ID) // worker_id (1 byte)
|
|
236
|
-
.write_u16(17) // option_size: option_type(1) + data(16) = 17 bytes
|
|
237
|
-
.write_u8(EXECUTOR_OPTION_TYPE_LZRECEIVE) // option_type (1 byte)
|
|
238
|
-
.write_u128(100000); // execution gas data (16 bytes)
|
|
239
|
-
|
|
240
|
-
// Add native drop option
|
|
241
|
-
writer
|
|
242
|
-
.write_u8(EXECUTOR_WORKER_ID) // worker_id (1 byte)
|
|
243
|
-
.write_u16(49) // option_size: option_type(1) + amount(16) + receiver(32) = 49 bytes
|
|
244
|
-
.write_u8(EXECUTOR_OPTION_TYPE_NATIVE_DROP) // option_type (1 byte)
|
|
245
|
-
.write_u128(amount) // drop amount (16 bytes)
|
|
246
|
-
.write_bytes_n(receiver); // receiver address (32 bytes)
|
|
247
|
-
|
|
248
|
-
writer.to_bytes()
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
// ============================================================================
|
|
252
|
-
// Test Setup
|
|
253
|
-
// ============================================================================
|
|
254
|
-
|
|
255
|
-
/// DVN credentials for initialization (addresses for signers and admin).
|
|
256
|
-
pub struct DvnCredentials {
|
|
257
|
-
/// secp256k1 addresses for DVN multisig
|
|
258
|
-
pub signers: std::vec::Vec<Secp256k1KeyPair>,
|
|
259
|
-
/// Ed25519 key pair for DVN admin address
|
|
260
|
-
pub admin_keypair: Ed25519KeyPair,
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
impl DvnCredentials {
|
|
264
|
-
/// Generate new DVN credentials with the specified number of signers.
|
|
265
|
-
pub fn generate(num_signers: usize) -> Self {
|
|
266
|
-
Self {
|
|
267
|
-
signers: (0..num_signers).map(|_| Secp256k1KeyPair::generate()).collect(),
|
|
268
|
-
admin_keypair: Ed25519KeyPair::generate(),
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
/// Get the signer addresses as a Soroban Vec<BytesN<20>>.
|
|
273
|
-
pub fn signer_addresses(&self, env: &Env) -> Vec<BytesN<20>> {
|
|
274
|
-
let mut addrs: Vec<BytesN<20>> = vec![env];
|
|
275
|
-
for kp in &self.signers {
|
|
276
|
-
addrs.push_back(kp.signer(env));
|
|
277
|
-
}
|
|
278
|
-
addrs
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
/// Get the admin address for DVN registration.
|
|
282
|
-
pub fn admin_address(&self, env: &Env) -> Address {
|
|
283
|
-
self.admin_keypair.address(env)
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
pub struct ChainSetup<'a> {
|
|
288
|
-
pub eid: u32,
|
|
289
|
-
pub owner: Address,
|
|
290
|
-
pub admin: Address, // Worker admin
|
|
291
|
-
pub native_token: Address,
|
|
292
|
-
pub endpoint: EndpointV2Client<'a>,
|
|
293
|
-
pub uln302: Uln302Client<'a>,
|
|
294
|
-
pub dvn: DVNClient<'a>,
|
|
295
|
-
pub dvn2: DVNClient<'a>, // Second DVN for multi-DVN tests
|
|
296
|
-
pub executor: ExecutorClient<'a>,
|
|
297
|
-
pub executor_helper: ExecutorHelperClient<'a>,
|
|
298
|
-
pub price_feed: Address,
|
|
299
|
-
pub counter: CounterClient<'a>,
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
impl<'a> ChainSetupCommon<'a> for ChainSetup<'a> {
|
|
303
|
-
fn counter(&self) -> &CounterClient<'a> {
|
|
304
|
-
&self.counter
|
|
305
|
-
}
|
|
306
|
-
fn endpoint(&self) -> &EndpointV2Client<'a> {
|
|
307
|
-
&self.endpoint
|
|
308
|
-
}
|
|
309
|
-
fn native_token(&self) -> &Address {
|
|
310
|
-
&self.native_token
|
|
311
|
-
}
|
|
312
|
-
fn owner(&self) -> &Address {
|
|
313
|
-
&self.owner
|
|
314
|
-
}
|
|
315
|
-
fn validate_packet(
|
|
316
|
-
&self,
|
|
317
|
-
env: &Env,
|
|
318
|
-
packet_event: &(soroban_sdk::Bytes, soroban_sdk::Bytes, Address),
|
|
319
|
-
) -> endpoint_v2::OutboundPacket {
|
|
320
|
-
use message_lib_common::packet_codec_v1;
|
|
321
|
-
|
|
322
|
-
let packet = decode_packet(env, &packet_event.0);
|
|
323
|
-
let encoded_header = packet_codec_v1::encode_packet_header(env, &packet);
|
|
324
|
-
let payload_hash = packet_codec_v1::payload_hash(env, &packet);
|
|
325
|
-
|
|
326
|
-
// DVN verify with mock_auths
|
|
327
|
-
let receive_uln302 = ReceiveUln302Client::new(env, &self.uln302.address);
|
|
328
|
-
|
|
329
|
-
env.mock_auths(&[soroban_sdk::testutils::MockAuth {
|
|
330
|
-
address: &self.dvn.address,
|
|
331
|
-
invoke: &soroban_sdk::testutils::MockAuthInvoke {
|
|
332
|
-
contract: &self.uln302.address,
|
|
333
|
-
fn_name: "verify",
|
|
334
|
-
args: (&self.dvn.address, &encoded_header, &payload_hash, &CONFIRMATIONS).into_val(env),
|
|
335
|
-
sub_invokes: &[],
|
|
336
|
-
},
|
|
337
|
-
}]);
|
|
338
|
-
receive_uln302.verify(&self.dvn.address, &encoded_header, &payload_hash, &CONFIRMATIONS);
|
|
339
|
-
|
|
340
|
-
// Commit verification (permissionless)
|
|
341
|
-
receive_uln302.commit_verification(&encoded_header, &payload_hash);
|
|
342
|
-
|
|
343
|
-
packet
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
pub struct TestSetup<'a> {
|
|
348
|
-
pub env: Env,
|
|
349
|
-
pub chain_a: ChainSetup<'a>,
|
|
350
|
-
pub chain_b: ChainSetup<'a>,
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
/// Intermediate structure to hold chain infrastructure before DVN/Executor creation
|
|
354
|
-
struct ChainInfra {
|
|
355
|
-
eid: u32,
|
|
356
|
-
endpoint_address: Address,
|
|
357
|
-
uln302_address: Address,
|
|
358
|
-
#[allow(dead_code)]
|
|
359
|
-
treasury_address: Address,
|
|
360
|
-
price_feed_address: Address,
|
|
361
|
-
dvn_fee_lib_address: Address,
|
|
362
|
-
executor_fee_lib_address: Address,
|
|
363
|
-
native_token: Address,
|
|
364
|
-
zro_token: Address,
|
|
365
|
-
admin: Address,
|
|
366
|
-
deposit_address: Address,
|
|
367
|
-
/// DVN credentials (addresses for initialization)
|
|
368
|
-
dvn_credentials: DvnCredentials,
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
/// Phase 1: Create basic chain infrastructure (Endpoint, ULN302, Treasury, etc.)
|
|
372
|
-
fn setup_chain_infrastructure(env: &Env, owner: &Address) -> ChainInfra {
|
|
373
|
-
// Create native token for endpoint fees
|
|
374
|
-
let native_sac = env.register_stellar_asset_contract_v2(owner.clone());
|
|
375
|
-
let native_token = native_sac.address();
|
|
376
|
-
|
|
377
|
-
// Create ZRO token
|
|
378
|
-
let zro_sac = env.register_stellar_asset_contract_v2(owner.clone());
|
|
379
|
-
let zro_token = zro_sac.address();
|
|
380
|
-
|
|
381
|
-
// Register endpoint
|
|
382
|
-
let eid: u32 = 30400; // Test EID
|
|
383
|
-
let endpoint_address = env.register(EndpointV2, (owner, eid, &native_token));
|
|
384
|
-
|
|
385
|
-
// Register Treasury (real)
|
|
386
|
-
let treasury_address = env.register(Treasury, (owner,));
|
|
387
|
-
|
|
388
|
-
// Register PriceFeed (real)
|
|
389
|
-
let price_updater = Address::generate(env);
|
|
390
|
-
let price_feed_address = env.register(LzPriceFeed, (owner, &price_updater));
|
|
391
|
-
|
|
392
|
-
// Register fee libs
|
|
393
|
-
let dvn_fee_lib_address = env.register(DvnFeeLib, (owner,));
|
|
394
|
-
let executor_fee_lib_address = env.register(ExecutorFeeLib, (owner,));
|
|
395
|
-
|
|
396
|
-
// Register ULN302
|
|
397
|
-
let uln302_address = env.register(Uln302, (owner, &endpoint_address, &treasury_address));
|
|
398
|
-
|
|
399
|
-
// Create admin for workers
|
|
400
|
-
let admin = Address::generate(env);
|
|
401
|
-
|
|
402
|
-
// Deposit address for fee collection
|
|
403
|
-
let deposit_address = Address::generate(env);
|
|
404
|
-
|
|
405
|
-
// Generate real DVN credentials (1 signer with threshold 1)
|
|
406
|
-
let dvn_credentials = DvnCredentials::generate(1);
|
|
407
|
-
|
|
408
|
-
ChainInfra {
|
|
409
|
-
eid,
|
|
410
|
-
endpoint_address,
|
|
411
|
-
uln302_address,
|
|
412
|
-
treasury_address: treasury_address.clone(),
|
|
413
|
-
price_feed_address,
|
|
414
|
-
dvn_fee_lib_address,
|
|
415
|
-
executor_fee_lib_address,
|
|
416
|
-
native_token,
|
|
417
|
-
zro_token,
|
|
418
|
-
admin,
|
|
419
|
-
deposit_address,
|
|
420
|
-
dvn_credentials,
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
/// Phase 2: Create DVN, Executor, and ExecutorHelper with cross-chain ULN302 support
|
|
425
|
-
fn setup_chain_workers<'a>(
|
|
426
|
-
env: &Env,
|
|
427
|
-
owner: &Address,
|
|
428
|
-
infra: &ChainInfra,
|
|
429
|
-
all_uln302_addresses: &Vec<Address>, // All ULN302 addresses across chains
|
|
430
|
-
) -> (DVNClient<'a>, DVNClient<'a>, ExecutorClient<'a>, ExecutorHelperClient<'a>) {
|
|
431
|
-
// Use the DVN admin address from credentials, plus the worker admin
|
|
432
|
-
let admins = vec![env, infra.admin.clone(), infra.dvn_credentials.admin_address(env)];
|
|
433
|
-
|
|
434
|
-
// Use real secp256k1 signers from credentials
|
|
435
|
-
let signers = infra.dvn_credentials.signer_addresses(env);
|
|
436
|
-
let threshold: u32 = infra.dvn_credentials.signers.len() as u32;
|
|
437
|
-
|
|
438
|
-
// Register first DVN with ALL ULN302 addresses as supported message libs
|
|
439
|
-
let dvn_address = env.register(
|
|
440
|
-
LzDVN,
|
|
441
|
-
(
|
|
442
|
-
DVN_VID, // vid
|
|
443
|
-
&signers, // signers (real secp256k1 addresses)
|
|
444
|
-
threshold, // threshold
|
|
445
|
-
&admins, // admins
|
|
446
|
-
all_uln302_addresses, // supported_msglibs - ALL chains' ULN302s
|
|
447
|
-
&infra.price_feed_address, // price_feed
|
|
448
|
-
DEFAULT_MULTIPLIER_BPS, // default_multiplier_bps
|
|
449
|
-
&infra.dvn_fee_lib_address, // worker_fee_lib
|
|
450
|
-
&infra.deposit_address, // deposit_address
|
|
451
|
-
),
|
|
452
|
-
);
|
|
453
|
-
|
|
454
|
-
// Register second DVN for multi-DVN verification tests
|
|
455
|
-
let dvn2_credentials = DvnCredentials::generate(1);
|
|
456
|
-
let admins2 = vec![env, infra.admin.clone(), dvn2_credentials.admin_address(env)];
|
|
457
|
-
let signers2 = dvn2_credentials.signer_addresses(env);
|
|
458
|
-
let dvn2_address = env.register(
|
|
459
|
-
LzDVN,
|
|
460
|
-
(
|
|
461
|
-
DVN_VID + 1, // Different vid for second DVN
|
|
462
|
-
&signers2,
|
|
463
|
-
1u32, // threshold
|
|
464
|
-
&admins2,
|
|
465
|
-
all_uln302_addresses,
|
|
466
|
-
&infra.price_feed_address,
|
|
467
|
-
DEFAULT_MULTIPLIER_BPS,
|
|
468
|
-
&infra.dvn_fee_lib_address,
|
|
469
|
-
&infra.deposit_address,
|
|
470
|
-
),
|
|
471
|
-
);
|
|
472
|
-
|
|
473
|
-
// Register ExecutorHelper (stateless entry point for executor AA workflow)
|
|
474
|
-
let executor_helper_address = env.register(ExecutorHelper, ());
|
|
475
|
-
|
|
476
|
-
// Register real Executor with ALL ULN302 addresses as supported message libs
|
|
477
|
-
let executor_address = env.register(
|
|
478
|
-
LzExecutor,
|
|
479
|
-
(
|
|
480
|
-
&infra.endpoint_address,
|
|
481
|
-
owner,
|
|
482
|
-
&admins,
|
|
483
|
-
all_uln302_addresses, // supported_msglibs - ALL chains' ULN302s
|
|
484
|
-
&infra.price_feed_address,
|
|
485
|
-
DEFAULT_MULTIPLIER_BPS,
|
|
486
|
-
&infra.executor_fee_lib_address, // worker_fee_lib
|
|
487
|
-
&infra.deposit_address, // deposit_address
|
|
488
|
-
),
|
|
489
|
-
);
|
|
490
|
-
|
|
491
|
-
let dvn = DVNClient::new(env, &dvn_address);
|
|
492
|
-
let dvn2 = DVNClient::new(env, &dvn2_address);
|
|
493
|
-
let executor = ExecutorClient::new(env, &executor_address);
|
|
494
|
-
let executor_helper = ExecutorHelperClient::new(env, &executor_helper_address);
|
|
495
|
-
|
|
496
|
-
// Register the executor helper with the executor (address + allowed function names)
|
|
497
|
-
let allowed_functions: Vec<Symbol> =
|
|
498
|
-
vec![env, Symbol::new(env, "execute"), Symbol::new(env, "compose")];
|
|
499
|
-
let lz_executor = LzExecutorClient::new(env, &executor_address);
|
|
500
|
-
env.mock_auths(&[MockAuth {
|
|
501
|
-
address: owner,
|
|
502
|
-
invoke: &MockAuthInvoke {
|
|
503
|
-
contract: &executor_address,
|
|
504
|
-
fn_name: "set_executor_helper",
|
|
505
|
-
args: (&executor_helper_address, &allowed_functions).into_val(env),
|
|
506
|
-
sub_invokes: &[],
|
|
507
|
-
},
|
|
508
|
-
}]);
|
|
509
|
-
lz_executor.set_executor_helper(&executor_helper_address, &allowed_functions);
|
|
510
|
-
|
|
511
|
-
(dvn, dvn2, executor, executor_helper)
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
/// Phase 3: Complete chain setup by creating Counter and finalizing configuration
|
|
515
|
-
fn finalize_chain_setup<'a>(
|
|
516
|
-
env: &Env,
|
|
517
|
-
owner: &Address,
|
|
518
|
-
infra: ChainInfra,
|
|
519
|
-
dvn: DVNClient<'a>,
|
|
520
|
-
dvn2: DVNClient<'a>,
|
|
521
|
-
executor: ExecutorClient<'a>,
|
|
522
|
-
executor_helper: ExecutorHelperClient<'a>,
|
|
523
|
-
) -> ChainSetup<'a> {
|
|
524
|
-
// Register Counter OApp
|
|
525
|
-
let counter_address = env.register(Counter, (owner, &infra.endpoint_address, owner));
|
|
526
|
-
|
|
527
|
-
// Create clients
|
|
528
|
-
let endpoint = EndpointV2Client::new(env, &infra.endpoint_address);
|
|
529
|
-
let uln302 = Uln302Client::new(env, &infra.uln302_address);
|
|
530
|
-
let counter = CounterClient::new(env, &counter_address);
|
|
531
|
-
|
|
532
|
-
set_zro(env, owner, &endpoint, &infra.zro_token);
|
|
533
|
-
register_library(env, owner, &endpoint, &uln302.address);
|
|
534
|
-
|
|
535
|
-
let eid = infra.eid;
|
|
536
|
-
let native_token = infra.native_token.clone();
|
|
537
|
-
|
|
538
|
-
// Set up price feed with initial prices for this chain's eid
|
|
539
|
-
setup_price_feed(env, owner, &infra.price_feed_address, eid);
|
|
540
|
-
|
|
541
|
-
let chain_setup = ChainSetup {
|
|
542
|
-
owner: owner.clone(),
|
|
543
|
-
admin: infra.admin,
|
|
544
|
-
endpoint,
|
|
545
|
-
uln302,
|
|
546
|
-
dvn,
|
|
547
|
-
dvn2,
|
|
548
|
-
executor,
|
|
549
|
-
executor_helper,
|
|
550
|
-
price_feed: infra.price_feed_address,
|
|
551
|
-
counter,
|
|
552
|
-
eid,
|
|
553
|
-
native_token,
|
|
554
|
-
};
|
|
555
|
-
|
|
556
|
-
// Allow executor self-spend so transfer_from succeeds in compose tests.
|
|
557
|
-
env.mock_all_auths();
|
|
558
|
-
TokenClient::new(env, &chain_setup.native_token).approve(
|
|
559
|
-
&chain_setup.executor.address,
|
|
560
|
-
&chain_setup.executor.address,
|
|
561
|
-
&i128::MAX,
|
|
562
|
-
&10_u32,
|
|
563
|
-
);
|
|
564
|
-
|
|
565
|
-
chain_setup
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
/// Set up price feed with test prices
|
|
569
|
-
fn setup_price_feed(env: &Env, owner: &Address, price_feed: &Address, eid: u32) {
|
|
570
|
-
let client = price_feed::LzPriceFeedClient::new(env, price_feed);
|
|
571
|
-
|
|
572
|
-
// Set price ratio denominator
|
|
573
|
-
env.mock_auths(&[MockAuth {
|
|
574
|
-
address: owner,
|
|
575
|
-
invoke: &MockAuthInvoke {
|
|
576
|
-
contract: price_feed,
|
|
577
|
-
fn_name: "set_price_ratio_denominator",
|
|
578
|
-
args: (&PRICE_RATIO_DENOMINATOR,).into_val(env),
|
|
579
|
-
sub_invokes: &[],
|
|
580
|
-
},
|
|
581
|
-
}]);
|
|
582
|
-
client.set_price_ratio_denominator(&PRICE_RATIO_DENOMINATOR);
|
|
583
|
-
|
|
584
|
-
// Set native token price in USD (1 XLM = 1 USD for simplicity, scaled)
|
|
585
|
-
let native_price_usd: u128 = 10_000_000; // 1 USD with 7 decimals
|
|
586
|
-
env.mock_auths(&[MockAuth {
|
|
587
|
-
address: owner,
|
|
588
|
-
invoke: &MockAuthInvoke {
|
|
589
|
-
contract: price_feed,
|
|
590
|
-
fn_name: "set_native_token_price_usd",
|
|
591
|
-
args: (owner, &native_price_usd).into_val(env),
|
|
592
|
-
sub_invokes: &[],
|
|
593
|
-
},
|
|
594
|
-
}]);
|
|
595
|
-
client.set_native_token_price_usd(owner, &native_price_usd);
|
|
596
|
-
|
|
597
|
-
// Set price for this eid (for testing, use 1:1 price ratio)
|
|
598
|
-
// Price feed internally uses eid % 30000 for lookups, so we need to normalize
|
|
599
|
-
let normalized_eid = eid % 30_000;
|
|
600
|
-
let price = Price {
|
|
601
|
-
price_ratio: PRICE_RATIO_DENOMINATOR,
|
|
602
|
-
gas_price_in_unit: DEFAULT_GAS_PRICE,
|
|
603
|
-
gas_per_byte: DEFAULT_GAS_PER_BYTE,
|
|
604
|
-
};
|
|
605
|
-
|
|
606
|
-
// Note: STELLAR_EID (30111) normalizes to 111, which is the Optimism mainnet EID.
|
|
607
|
-
// The Optimism fee model requires prices for BOTH L2 (111) AND L1 Ethereum (101).
|
|
608
|
-
// So we set prices for both.
|
|
609
|
-
let mut prices = vec![env, UpdatePrice { eid: normalized_eid, price: price.clone() }];
|
|
610
|
-
|
|
611
|
-
// If this is an Optimism-style chain (111, 10132, 20132), also set L1 Ethereum price
|
|
612
|
-
if normalized_eid == 111 {
|
|
613
|
-
prices.push_back(UpdatePrice { eid: 101, price: price.clone() }); // Ethereum mainnet
|
|
614
|
-
} else if normalized_eid == 10132 {
|
|
615
|
-
prices.push_back(UpdatePrice { eid: 10121, price: price.clone() }); // Ethereum Goerli
|
|
616
|
-
} else if normalized_eid == 20132 {
|
|
617
|
-
prices.push_back(UpdatePrice { eid: 20121, price: price.clone() }); // Ethereum Goerli
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
env.mock_auths(&[MockAuth {
|
|
621
|
-
address: owner,
|
|
622
|
-
invoke: &MockAuthInvoke {
|
|
623
|
-
contract: price_feed,
|
|
624
|
-
fn_name: "set_price",
|
|
625
|
-
args: (owner, &prices).into_val(env),
|
|
626
|
-
sub_invokes: &[],
|
|
627
|
-
},
|
|
628
|
-
}]);
|
|
629
|
-
client.set_price(owner, &prices);
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
pub fn setup<'a>() -> TestSetup<'a> {
|
|
633
|
-
let env = Env::default();
|
|
634
|
-
env.mock_all_auths(); // Required for contract registration (DVN multisig init, etc.)
|
|
635
|
-
let owner = Address::generate(&env);
|
|
636
|
-
|
|
637
|
-
// Phase 1: Create basic infrastructure for both chains
|
|
638
|
-
let infra_a = setup_chain_infrastructure(&env, &owner);
|
|
639
|
-
let infra_b = setup_chain_infrastructure(&env, &owner);
|
|
640
|
-
|
|
641
|
-
// Collect all ULN302 addresses for cross-chain support
|
|
642
|
-
let all_uln302_addresses: Vec<Address> = vec![&env, infra_a.uln302_address.clone(), infra_b.uln302_address.clone()];
|
|
643
|
-
|
|
644
|
-
// Phase 2: Create workers with cross-chain ULN302 support
|
|
645
|
-
let (dvn_a, dvn2_a, executor_a, executor_helper_a) =
|
|
646
|
-
setup_chain_workers(&env, &owner, &infra_a, &all_uln302_addresses);
|
|
647
|
-
let (dvn_b, dvn2_b, executor_b, executor_helper_b) =
|
|
648
|
-
setup_chain_workers(&env, &owner, &infra_b, &all_uln302_addresses);
|
|
649
|
-
|
|
650
|
-
// Phase 3: Finalize chain setup
|
|
651
|
-
let chain_a = finalize_chain_setup(&env, &owner, infra_a, dvn_a, dvn2_a, executor_a, executor_helper_a);
|
|
652
|
-
let chain_b = finalize_chain_setup(&env, &owner, infra_b, dvn_b, dvn2_b, executor_b, executor_helper_b);
|
|
653
|
-
|
|
654
|
-
TestSetup { env, chain_a, chain_b }
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
/// DVN configuration mode for endpoint wiring.
|
|
658
|
-
#[derive(Clone, Copy)]
|
|
659
|
-
pub enum DvnMode {
|
|
660
|
-
/// Single DVN: required = [dvn], no optional
|
|
661
|
-
Single,
|
|
662
|
-
/// Two required DVNs: required = [dvn, dvn2], no optional
|
|
663
|
-
TwoRequired,
|
|
664
|
-
/// Duplicate DVN in optional: required = [dvn], optional = [dvn, dvn2], threshold = 1
|
|
665
|
-
DuplicateOptional,
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
/// Creates a fully wired test setup with the specified DVN mode.
|
|
669
|
-
pub fn wired_setup_with_dvn_mode<'a>(mode: DvnMode) -> TestSetup<'a> {
|
|
670
|
-
let test_setup = setup();
|
|
671
|
-
wire_endpoint(&test_setup.env, &[&test_setup.chain_a, &test_setup.chain_b], mode);
|
|
672
|
-
wire_counter(&test_setup.env, &[&test_setup.chain_a, &test_setup.chain_b]);
|
|
673
|
-
test_setup
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
// ============================================================================
|
|
677
|
-
// Wire functions
|
|
678
|
-
// ============================================================================
|
|
679
|
-
|
|
680
|
-
pub fn wire_endpoint(env: &Env, chains: &[&ChainSetup<'_>], mode: DvnMode) {
|
|
681
|
-
// First pass: Set up price feeds with cross-chain prices
|
|
682
|
-
for chain in chains {
|
|
683
|
-
for other_chain in chains {
|
|
684
|
-
if chain.endpoint.address == other_chain.endpoint.address {
|
|
685
|
-
continue;
|
|
686
|
-
}
|
|
687
|
-
setup_price_feed(env, &chain.owner, &chain.price_feed, other_chain.eid);
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
// Second pass: Set up DVN and Executor dst configs
|
|
692
|
-
for chain in chains {
|
|
693
|
-
for other_chain in chains {
|
|
694
|
-
if chain.endpoint.address == other_chain.endpoint.address {
|
|
695
|
-
continue;
|
|
696
|
-
}
|
|
697
|
-
set_dvn_dst_config(env, &chain.admin, &chain.dvn, other_chain.eid);
|
|
698
|
-
// For multi-DVN modes, also configure dvn2
|
|
699
|
-
if matches!(mode, DvnMode::TwoRequired | DvnMode::DuplicateOptional) {
|
|
700
|
-
set_dvn_dst_config(env, &chain.admin, &chain.dvn2, other_chain.eid);
|
|
701
|
-
}
|
|
702
|
-
set_executor_dst_config(env, &chain.admin, &chain.executor, other_chain.eid);
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
// Third pass: Set up ULN configs based on DVN mode
|
|
707
|
-
for chain in chains {
|
|
708
|
-
for other_chain in chains {
|
|
709
|
-
if chain.endpoint.address == other_chain.endpoint.address {
|
|
710
|
-
continue;
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
let (send_required, recv_required, send_optional, recv_optional, optional_threshold) = match mode {
|
|
714
|
-
DvnMode::Single => (
|
|
715
|
-
vec![env, other_chain.dvn.address.clone()],
|
|
716
|
-
vec![env, chain.dvn.address.clone()],
|
|
717
|
-
vec![env],
|
|
718
|
-
vec![env],
|
|
719
|
-
0,
|
|
720
|
-
),
|
|
721
|
-
DvnMode::TwoRequired => (
|
|
722
|
-
vec![env, other_chain.dvn.address.clone(), other_chain.dvn2.address.clone()],
|
|
723
|
-
vec![env, chain.dvn.address.clone(), chain.dvn2.address.clone()],
|
|
724
|
-
vec![env],
|
|
725
|
-
vec![env],
|
|
726
|
-
0,
|
|
727
|
-
),
|
|
728
|
-
DvnMode::DuplicateOptional => (
|
|
729
|
-
vec![env, other_chain.dvn.address.clone()],
|
|
730
|
-
vec![env, chain.dvn.address.clone()],
|
|
731
|
-
vec![env, other_chain.dvn.address.clone(), other_chain.dvn2.address.clone()],
|
|
732
|
-
vec![env, chain.dvn.address.clone(), chain.dvn2.address.clone()],
|
|
733
|
-
1,
|
|
734
|
-
),
|
|
735
|
-
};
|
|
736
|
-
|
|
737
|
-
set_default_send_uln_config_with_optional(
|
|
738
|
-
env,
|
|
739
|
-
&chain.owner,
|
|
740
|
-
&chain.uln302,
|
|
741
|
-
other_chain.eid,
|
|
742
|
-
&send_required,
|
|
743
|
-
&send_optional,
|
|
744
|
-
optional_threshold,
|
|
745
|
-
);
|
|
746
|
-
|
|
747
|
-
set_default_receive_uln_config_with_optional(
|
|
748
|
-
env,
|
|
749
|
-
&chain.owner,
|
|
750
|
-
&chain.uln302,
|
|
751
|
-
other_chain.eid,
|
|
752
|
-
&recv_required,
|
|
753
|
-
&recv_optional,
|
|
754
|
-
optional_threshold,
|
|
755
|
-
);
|
|
756
|
-
|
|
757
|
-
set_default_executor_config(env, &chain.owner, &chain.uln302, other_chain.eid, &chain.executor.address);
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
|
|
761
|
-
// Fourth pass: Set default send and receive libraries
|
|
762
|
-
for chain in chains {
|
|
763
|
-
for other_chain in chains {
|
|
764
|
-
if chain.endpoint.address == other_chain.endpoint.address {
|
|
765
|
-
continue;
|
|
766
|
-
}
|
|
767
|
-
|
|
768
|
-
set_default_send_library(env, &chain.owner, &chain.endpoint, other_chain.eid, &chain.uln302.address);
|
|
769
|
-
set_default_receive_library(env, &chain.owner, &chain.endpoint, other_chain.eid, &chain.uln302.address);
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
/// Set DVN destination config
|
|
775
|
-
fn set_dvn_dst_config(env: &Env, admin: &Address, dvn: &DVNClient<'_>, dst_eid: u32) {
|
|
776
|
-
let config = DvnDstConfig {
|
|
777
|
-
gas: 100_000, // Gas for verification
|
|
778
|
-
multiplier_bps: 10000, // 100%
|
|
779
|
-
floor_margin_usd: 0, // No floor margin for tests
|
|
780
|
-
};
|
|
781
|
-
let params = vec![env, DvnDstConfigParam { dst_eid, config }];
|
|
782
|
-
|
|
783
|
-
env.mock_auths(&[MockAuth {
|
|
784
|
-
address: admin,
|
|
785
|
-
invoke: &MockAuthInvoke {
|
|
786
|
-
contract: &dvn.address,
|
|
787
|
-
fn_name: "set_dst_config",
|
|
788
|
-
args: (admin, ¶ms).into_val(env),
|
|
789
|
-
sub_invokes: &[],
|
|
790
|
-
},
|
|
791
|
-
}]);
|
|
792
|
-
dvn.set_dst_config(admin, ¶ms);
|
|
793
|
-
}
|
|
794
|
-
|
|
795
|
-
/// Set Executor destination config
|
|
796
|
-
fn set_executor_dst_config(env: &Env, admin: &Address, executor: &ExecutorClient<'_>, dst_eid: u32) {
|
|
797
|
-
let config = ExecutorDstConfig {
|
|
798
|
-
lz_receive_base_gas: 50_000, // Base gas for lz_receive
|
|
799
|
-
multiplier_bps: 10000, // 100%
|
|
800
|
-
floor_margin_usd: 0, // No floor margin for tests
|
|
801
|
-
native_cap: 1_000_000_000, // Max native drop
|
|
802
|
-
lz_compose_base_gas: 30_000, // Base gas for lz_compose
|
|
803
|
-
};
|
|
804
|
-
let params = vec![env, SetDstConfigParam { dst_eid, dst_config: config }];
|
|
805
|
-
|
|
806
|
-
env.mock_auths(&[MockAuth {
|
|
807
|
-
address: admin,
|
|
808
|
-
invoke: &MockAuthInvoke {
|
|
809
|
-
contract: &executor.address,
|
|
810
|
-
fn_name: "set_dst_config",
|
|
811
|
-
args: (admin, ¶ms).into_val(env),
|
|
812
|
-
sub_invokes: &[],
|
|
813
|
-
},
|
|
814
|
-
}]);
|
|
815
|
-
executor.set_dst_config(admin, ¶ms);
|
|
816
|
-
}
|
|
817
|
-
|
|
818
|
-
pub fn wire_counter(env: &Env, chains: &[&ChainSetup<'_>]) {
|
|
819
|
-
for chain in chains {
|
|
820
|
-
for other_chain in chains {
|
|
821
|
-
if chain.endpoint.address == other_chain.endpoint.address {
|
|
822
|
-
continue;
|
|
823
|
-
}
|
|
824
|
-
set_peer(
|
|
825
|
-
env,
|
|
826
|
-
&chain.owner,
|
|
827
|
-
&chain.counter,
|
|
828
|
-
other_chain.eid,
|
|
829
|
-
&address_to_bytes32(&other_chain.counter.address),
|
|
830
|
-
);
|
|
831
|
-
}
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
pub fn set_default_send_library(
|
|
836
|
-
env: &Env,
|
|
837
|
-
owner: &Address,
|
|
838
|
-
endpoint: &EndpointV2Client<'_>,
|
|
839
|
-
dst_eid: u32,
|
|
840
|
-
lib: &Address,
|
|
841
|
-
) {
|
|
842
|
-
env.mock_auths(&[MockAuth {
|
|
843
|
-
address: owner,
|
|
844
|
-
invoke: &MockAuthInvoke {
|
|
845
|
-
contract: &endpoint.address,
|
|
846
|
-
fn_name: "set_default_send_library",
|
|
847
|
-
args: (&dst_eid, lib).into_val(env),
|
|
848
|
-
sub_invokes: &[],
|
|
849
|
-
},
|
|
850
|
-
}]);
|
|
851
|
-
endpoint.set_default_send_library(&dst_eid, lib);
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
pub fn set_default_receive_library(
|
|
855
|
-
env: &Env,
|
|
856
|
-
owner: &Address,
|
|
857
|
-
endpoint: &EndpointV2Client<'_>,
|
|
858
|
-
src_eid: u32,
|
|
859
|
-
lib: &Address,
|
|
860
|
-
) {
|
|
861
|
-
env.mock_auths(&[MockAuth {
|
|
862
|
-
address: owner,
|
|
863
|
-
invoke: &MockAuthInvoke {
|
|
864
|
-
contract: &endpoint.address,
|
|
865
|
-
fn_name: "set_default_receive_library",
|
|
866
|
-
args: (&src_eid, lib, &0u64).into_val(env),
|
|
867
|
-
sub_invokes: &[],
|
|
868
|
-
},
|
|
869
|
-
}]);
|
|
870
|
-
endpoint.set_default_receive_library(&src_eid, lib, &0u64);
|
|
871
|
-
}
|
|
872
|
-
|
|
873
|
-
pub fn set_default_send_uln_config_with_optional(
|
|
874
|
-
env: &Env,
|
|
875
|
-
owner: &Address,
|
|
876
|
-
uln302: &Uln302Client<'_>,
|
|
877
|
-
dst_eid: u32,
|
|
878
|
-
required_dvns: &soroban_sdk::Vec<Address>,
|
|
879
|
-
optional_dvns: &soroban_sdk::Vec<Address>,
|
|
880
|
-
optional_dvn_threshold: u32,
|
|
881
|
-
) {
|
|
882
|
-
let config = UlnConfig {
|
|
883
|
-
confirmations: CONFIRMATIONS,
|
|
884
|
-
required_dvns: required_dvns.clone(),
|
|
885
|
-
optional_dvns: optional_dvns.clone(),
|
|
886
|
-
optional_dvn_threshold,
|
|
887
|
-
};
|
|
888
|
-
let params = vec![env, SetDefaultUlnConfigParam { eid: dst_eid, config }];
|
|
889
|
-
|
|
890
|
-
env.mock_auths(&[MockAuth {
|
|
891
|
-
address: owner,
|
|
892
|
-
invoke: &MockAuthInvoke {
|
|
893
|
-
contract: &uln302.address,
|
|
894
|
-
fn_name: "set_default_send_uln_configs",
|
|
895
|
-
args: (¶ms,).into_val(env),
|
|
896
|
-
sub_invokes: &[],
|
|
897
|
-
},
|
|
898
|
-
}]);
|
|
899
|
-
SendUln302Client::new(env, &uln302.address).set_default_send_uln_configs(¶ms);
|
|
900
|
-
}
|
|
901
|
-
|
|
902
|
-
pub fn set_default_receive_uln_config_with_optional(
|
|
903
|
-
env: &Env,
|
|
904
|
-
owner: &Address,
|
|
905
|
-
uln302: &Uln302Client<'_>,
|
|
906
|
-
src_eid: u32,
|
|
907
|
-
required_dvns: &soroban_sdk::Vec<Address>,
|
|
908
|
-
optional_dvns: &soroban_sdk::Vec<Address>,
|
|
909
|
-
optional_dvn_threshold: u32,
|
|
910
|
-
) {
|
|
911
|
-
let config = UlnConfig {
|
|
912
|
-
confirmations: CONFIRMATIONS,
|
|
913
|
-
required_dvns: required_dvns.clone(),
|
|
914
|
-
optional_dvns: optional_dvns.clone(),
|
|
915
|
-
optional_dvn_threshold,
|
|
916
|
-
};
|
|
917
|
-
let params = vec![env, SetDefaultUlnConfigParam { eid: src_eid, config }];
|
|
918
|
-
|
|
919
|
-
env.mock_auths(&[MockAuth {
|
|
920
|
-
address: owner,
|
|
921
|
-
invoke: &MockAuthInvoke {
|
|
922
|
-
contract: &uln302.address,
|
|
923
|
-
fn_name: "set_default_receive_uln_configs",
|
|
924
|
-
args: (¶ms,).into_val(env),
|
|
925
|
-
sub_invokes: &[],
|
|
926
|
-
},
|
|
927
|
-
}]);
|
|
928
|
-
ReceiveUln302Client::new(env, &uln302.address).set_default_receive_uln_configs(¶ms);
|
|
929
|
-
}
|
|
930
|
-
|
|
931
|
-
pub fn set_default_executor_config(
|
|
932
|
-
env: &Env,
|
|
933
|
-
owner: &Address,
|
|
934
|
-
uln302: &Uln302Client<'_>,
|
|
935
|
-
dst_eid: u32,
|
|
936
|
-
executor: &Address,
|
|
937
|
-
) {
|
|
938
|
-
let config = ExecutorConfig { max_message_size: MAX_MESSAGE_SIZE, executor: executor.clone() };
|
|
939
|
-
let params = vec![env, SetDefaultExecutorConfigParam { dst_eid, config }];
|
|
940
|
-
|
|
941
|
-
env.mock_auths(&[MockAuth {
|
|
942
|
-
address: owner,
|
|
943
|
-
invoke: &MockAuthInvoke {
|
|
944
|
-
contract: &uln302.address,
|
|
945
|
-
fn_name: "set_default_executor_configs",
|
|
946
|
-
args: (¶ms,).into_val(env),
|
|
947
|
-
sub_invokes: &[],
|
|
948
|
-
},
|
|
949
|
-
}]);
|
|
950
|
-
SendUln302Client::new(env, &uln302.address).set_default_executor_configs(¶ms);
|
|
951
|
-
}
|
|
952
|
-
|
|
953
|
-
// ============================================================================
|
|
954
|
-
// Executor Helper Functions
|
|
955
|
-
// ============================================================================
|
|
956
|
-
|
|
957
|
-
use crate::tests::mint_to;
|
|
958
|
-
use endpoint_v2::{Origin, OutboundPacket};
|
|
959
|
-
use executor_helper::{ComposeParams, ExecutionParams};
|
|
960
|
-
use soroban_sdk::Bytes;
|
|
961
|
-
|
|
962
|
-
/// Execute lz_receive via ExecutorHelper (executor AA workflow).
|
|
963
|
-
/// Automatically mints native tokens to the admin if value > 0.
|
|
964
|
-
pub fn lz_receive_via_executor(
|
|
965
|
-
env: &Env,
|
|
966
|
-
chain: &ChainSetup<'_>,
|
|
967
|
-
admin: &Address,
|
|
968
|
-
packet: &OutboundPacket,
|
|
969
|
-
value: i128,
|
|
970
|
-
) {
|
|
971
|
-
// Mint native tokens to admin if value > 0
|
|
972
|
-
if value > 0 {
|
|
973
|
-
mint_to(env, &chain.owner, &chain.native_token, admin, value);
|
|
974
|
-
}
|
|
975
|
-
|
|
976
|
-
let origin = Origin { src_eid: packet.src_eid, sender: address_to_bytes32(&packet.sender), nonce: packet.nonce };
|
|
977
|
-
|
|
978
|
-
let params = ExecutionParams {
|
|
979
|
-
receiver: chain.counter.address.clone(),
|
|
980
|
-
origin: origin.clone(),
|
|
981
|
-
guid: packet.guid.clone(),
|
|
982
|
-
message: packet.message.clone(),
|
|
983
|
-
extra_data: Bytes::new(env),
|
|
984
|
-
value,
|
|
985
|
-
gas_limit: 1_000_000, // Arbitrary gas limit for tests
|
|
986
|
-
};
|
|
987
|
-
|
|
988
|
-
env.mock_all_auths_allowing_non_root_auth();
|
|
989
|
-
chain.executor_helper.execute(&chain.executor.address, ¶ms, admin);
|
|
990
|
-
}
|
|
991
|
-
|
|
992
|
-
/// Execute lz_compose via ExecutorHelper (executor AA workflow).
|
|
993
|
-
/// Automatically mints native tokens to the admin if value > 0.
|
|
994
|
-
pub fn lz_compose_via_executor(
|
|
995
|
-
env: &Env,
|
|
996
|
-
chain: &ChainSetup<'_>,
|
|
997
|
-
admin: &Address,
|
|
998
|
-
packet: &OutboundPacket,
|
|
999
|
-
value: i128,
|
|
1000
|
-
) {
|
|
1001
|
-
// Mint native tokens to admin if value > 0
|
|
1002
|
-
if value > 0 {
|
|
1003
|
-
mint_to(env, &chain.owner, &chain.native_token, admin, value);
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
let params = ComposeParams {
|
|
1007
|
-
from: chain.counter.address.clone(),
|
|
1008
|
-
to: chain.counter.address.clone(),
|
|
1009
|
-
guid: packet.guid.clone(),
|
|
1010
|
-
index: 0,
|
|
1011
|
-
message: packet.message.clone(),
|
|
1012
|
-
extra_data: Bytes::new(env),
|
|
1013
|
-
value,
|
|
1014
|
-
gas_limit: 1_000_000, // Arbitrary gas limit for tests
|
|
1015
|
-
};
|
|
1016
|
-
|
|
1017
|
-
env.mock_all_auths_allowing_non_root_auth();
|
|
1018
|
-
chain.executor_helper.compose(&chain.executor.address, ¶ms, admin);
|
|
1019
|
-
}
|