@layerzerolabs/protocol-stellar-v2 0.2.20 → 0.2.21
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/.turbo/turbo-build.log +783 -802
- package/.turbo/turbo-lint.log +320 -157
- package/.turbo/turbo-test.log +1414 -1457
- package/Cargo.lock +109 -108
- package/Cargo.toml +32 -18
- package/contracts/common-macros/Cargo.toml +7 -7
- package/contracts/common-macros/src/auth.rs +18 -37
- package/contracts/common-macros/src/contract_ttl.rs +2 -2
- package/contracts/common-macros/src/lib.rs +27 -10
- package/contracts/common-macros/src/lz_contract.rs +38 -7
- package/contracts/common-macros/src/storage.rs +251 -292
- package/contracts/common-macros/src/tests/snapshots/common_macros__tests__auth__snapshot_generated_multisig_code.snap +6 -12
- package/contracts/common-macros/src/tests/snapshots/common_macros__tests__auth__snapshot_generated_ownable_code.snap +12 -17
- package/contracts/common-macros/src/tests/snapshots/common_macros__tests__ttl_configurable__snapshot_generated_ttl_configurable_code.snap +2 -7
- package/contracts/common-macros/src/tests/snapshots/common_macros__tests__upgradeable__snapshot_generated_upgradeable_code.snap +20 -9
- package/contracts/common-macros/src/tests/upgradeable.rs +26 -4
- package/contracts/common-macros/src/ttl_configurable.rs +2 -10
- package/contracts/common-macros/src/ttl_extendable.rs +2 -10
- package/contracts/common-macros/src/upgradeable.rs +56 -15
- package/contracts/common-macros/src/utils.rs +0 -9
- package/contracts/endpoint-v2/src/lib.rs +3 -2
- package/contracts/endpoint-v2/src/tests/endpoint_v2/clear.rs +2 -2
- package/contracts/endpoint-v2/src/tests/endpoint_v2/lz_receive_alert.rs +3 -3
- package/contracts/endpoint-v2/src/tests/endpoint_v2/send.rs +4 -4
- package/contracts/endpoint-v2/src/tests/endpoint_v2/set_delegate.rs +17 -5
- package/contracts/endpoint-v2/src/tests/endpoint_v2/set_zro.rs +4 -4
- package/contracts/endpoint-v2/src/tests/endpoint_v2/verify.rs +2 -2
- package/contracts/endpoint-v2/src/tests/message_lib_manager/register_library.rs +2 -2
- package/contracts/endpoint-v2/src/tests/message_lib_manager/set_default_receive_lib_timeout.rs +6 -6
- package/contracts/endpoint-v2/src/tests/message_lib_manager/set_default_receive_library.rs +67 -37
- package/contracts/endpoint-v2/src/tests/message_lib_manager/set_default_send_library.rs +5 -5
- package/contracts/endpoint-v2/src/tests/message_lib_manager/set_receive_library.rs +44 -54
- package/contracts/endpoint-v2/src/tests/message_lib_manager/set_receive_library_timeout.rs +7 -7
- package/contracts/endpoint-v2/src/tests/message_lib_manager/set_send_library.rs +8 -8
- package/contracts/endpoint-v2/src/tests/messaging_channel/burn.rs +3 -3
- package/contracts/endpoint-v2/src/tests/messaging_channel/nilify.rs +4 -4
- package/contracts/endpoint-v2/src/tests/messaging_channel/skip.rs +3 -3
- package/contracts/endpoint-v2/src/tests/messaging_composer/clear_compose.rs +2 -2
- package/contracts/endpoint-v2/src/tests/messaging_composer/lz_compose_alert.rs +3 -3
- package/contracts/endpoint-v2/src/tests/messaging_composer/send_compose.rs +2 -2
- package/contracts/layerzero-views/Cargo.toml +0 -1
- package/contracts/layerzero-views/src/layerzero_view.rs +1 -13
- package/contracts/macro-integration-tests/Cargo.toml +5 -15
- package/contracts/macro-integration-tests/tests/runtime/oapp/mod.rs +48 -0
- package/contracts/macro-integration-tests/tests/runtime/oapp/oapp_core.rs +170 -0
- package/contracts/macro-integration-tests/tests/runtime/oapp/options_type3.rs +154 -0
- package/contracts/macro-integration-tests/tests/runtime/oapp/receiver.rs +338 -0
- package/contracts/macro-integration-tests/tests/runtime/oapp/sender.rs +435 -0
- package/contracts/macro-integration-tests/tests/runtime.rs +1 -0
- package/contracts/macro-integration-tests/tests/ui/oapp/fail/custom_wrong_value.rs +8 -0
- package/contracts/macro-integration-tests/tests/ui/oapp/fail/custom_wrong_value.stderr +5 -0
- package/contracts/macro-integration-tests/tests/ui/oapp/fail/missing_lz_receive_internal.rs +8 -0
- package/contracts/macro-integration-tests/tests/ui/oapp/fail/missing_lz_receive_internal.stderr +71 -0
- package/contracts/macro-integration-tests/tests/ui/oapp/fail/non_struct_input.rs +10 -0
- package/contracts/macro-integration-tests/tests/ui/oapp/fail/non_struct_input.stderr +5 -0
- package/contracts/macro-integration-tests/tests/ui/oapp/fail/unknown_custom_option.rs +8 -0
- package/contracts/macro-integration-tests/tests/ui/oapp/fail/unknown_custom_option.stderr +5 -0
- package/contracts/macro-integration-tests/tests/ui/oapp/fail/wrong_key.rs +8 -0
- package/contracts/macro-integration-tests/tests/ui/oapp/fail/wrong_key.stderr +5 -0
- package/contracts/macro-integration-tests/tests/ui/oapp/pass/custom_all.rs +38 -0
- package/contracts/macro-integration-tests/tests/ui/oapp/pass/custom_single_trait.rs +96 -0
- package/contracts/macro-integration-tests/tests/ui/oapp/pass/minimal_contract.rs +64 -0
- package/contracts/macro-integration-tests/tests/ui/oapp/pass/struct_with_fields.rs +46 -0
- package/contracts/macro-integration-tests/tests/ui/ownable/fail/only_auth_missing_env.stderr +8 -0
- package/contracts/macro-integration-tests/tests/ui/ownable/pass/namespacing_and_imports.rs +1 -1
- package/contracts/macro-integration-tests/tests/ui/ownable/pass/only_auth_env_param_variants.rs +1 -1
- package/contracts/macro-integration-tests/tests/ui_oapp.rs +11 -0
- package/contracts/message-libs/message-lib-common/Cargo.toml +0 -1
- package/contracts/message-libs/message-lib-common/src/errors.rs +1 -1
- package/contracts/message-libs/treasury/Cargo.toml +0 -2
- package/contracts/message-libs/treasury/src/tests/treasury_tests.rs +2 -2
- package/contracts/message-libs/uln-302/src/tests/receive_uln302/effective_receive_uln_config.rs +2 -2
- package/contracts/message-libs/uln-302/src/tests/receive_uln302/set_default_receive_uln_configs.rs +2 -2
- package/contracts/message-libs/uln-302/src/tests/receive_uln302/verify.rs +2 -2
- package/contracts/message-libs/uln-302/src/tests/send_uln302/effective_executor_config.rs +2 -2
- package/contracts/message-libs/uln-302/src/tests/send_uln302/effective_send_uln_config.rs +2 -2
- package/contracts/message-libs/uln-302/src/tests/send_uln302/send.rs +7 -27
- package/contracts/message-libs/uln-302/src/tests/send_uln302/set_default_executor_configs.rs +2 -2
- package/contracts/message-libs/uln-302/src/tests/send_uln302/set_default_send_uln_configs.rs +2 -2
- package/contracts/oapps/counter/Cargo.toml +4 -6
- package/contracts/oapps/counter/integration_tests/utils.rs +19 -12
- package/contracts/oapps/oapp/src/errors.rs +1 -1
- package/contracts/oapps/oapp/src/interfaces/mod.rs +3 -0
- package/contracts/oapps/oapp/src/interfaces/oapp_msg_inspector.rs +47 -0
- package/contracts/oapps/oapp/src/lib.rs +1 -0
- package/contracts/oapps/oapp/src/macro_tests/test_macros.rs +4 -4
- package/contracts/oapps/oapp/src/oapp_core.rs +5 -5
- package/contracts/oapps/oapp/src/oapp_options_type3.rs +12 -4
- package/contracts/oapps/oapp/src/oapp_receiver.rs +14 -9
- package/contracts/oapps/oapp/src/tests/mod.rs +4 -4
- package/contracts/oapps/oapp/src/tests/{test_oapp_core.rs → oapp_core.rs} +4 -4
- package/contracts/oapps/oapp/src/tests/{test_oapp_options_type3.rs → oapp_options_type3.rs} +3 -4
- package/contracts/oapps/oapp-macros/Cargo.toml +8 -4
- package/contracts/oapps/oapp-macros/src/generators.rs +9 -34
- package/contracts/oapps/oapp-macros/src/lib.rs +3 -0
- package/contracts/oapps/oapp-macros/src/tests/mod.rs +2 -0
- package/contracts/oapps/oapp-macros/src/tests/oapp.rs +88 -0
- package/contracts/oapps/oapp-macros/src/tests/parse_custom_impls.rs +86 -0
- package/contracts/oapps/oapp-macros/src/tests/snapshots/oapp_macros__tests__oapp__snapshot_generate_oapp.snap +103 -0
- package/contracts/oapps/oft/integration-tests/utils.rs +28 -8
- package/contracts/oapps/oft/src/extensions/oft_fee.rs +136 -74
- package/contracts/oapps/oft/src/extensions/pausable.rs +44 -10
- package/contracts/oapps/oft/src/extensions/rate_limiter.rs +170 -130
- package/contracts/oapps/oft/src/oft.rs +19 -12
- package/contracts/oapps/oft/src/oft_types/lock_unlock.rs +1 -1
- package/contracts/oapps/oft/src/oft_types/mint_burn.rs +1 -1
- package/contracts/oapps/oft-core/Cargo.toml +1 -4
- package/contracts/oapps/oft-core/integration-tests/setup.rs +2 -2
- package/contracts/oapps/oft-core/integration-tests/utils.rs +21 -3
- package/contracts/oapps/oft-core/src/errors.rs +3 -2
- package/contracts/oapps/oft-core/src/events.rs +6 -0
- package/contracts/oapps/oft-core/src/lib.rs +1 -1
- package/contracts/oapps/oft-core/src/oft_core.rs +115 -60
- package/contracts/oapps/oft-core/src/storage.rs +7 -3
- package/contracts/oapps/oft-core/src/tests/mod.rs +1 -0
- package/contracts/oapps/oft-core/src/tests/test_decimals.rs +37 -2
- package/contracts/oapps/oft-core/src/tests/test_lz_receive.rs +2 -2
- package/contracts/oapps/oft-core/src/tests/test_msg_inspector.rs +323 -0
- package/contracts/oapps/oft-core/src/tests/test_send.rs +2 -2
- package/contracts/oapps/oft-core/src/tests/test_utils.rs +59 -14
- package/contracts/utils/Cargo.toml +0 -1
- package/contracts/utils/src/errors.rs +1 -1
- package/contracts/utils/src/multisig.rs +17 -8
- package/contracts/utils/src/ownable.rs +6 -6
- package/contracts/utils/src/testing_utils.rs +124 -54
- package/contracts/utils/src/tests/multisig.rs +12 -12
- package/contracts/utils/src/tests/ownable.rs +6 -6
- package/contracts/utils/src/tests/testing_utils.rs +50 -167
- package/contracts/utils/src/tests/ttl_configurable.rs +5 -5
- package/contracts/utils/src/tests/upgradeable.rs +1 -1
- package/contracts/utils/src/ttl_configurable.rs +10 -4
- package/contracts/utils/src/upgradeable.rs +5 -5
- package/contracts/workers/dvn/Cargo.toml +5 -6
- package/contracts/workers/dvn/src/dvn.rs +2 -12
- package/contracts/workers/dvn-fee-lib/Cargo.toml +1 -1
- package/contracts/workers/dvn-fee-lib/src/dvn_fee_lib.rs +37 -19
- package/contracts/workers/dvn-fee-lib/src/lib.rs +12 -2
- package/contracts/workers/dvn-fee-lib/src/tests/dvn_fee_lib.rs +15 -13
- package/contracts/workers/executor/Cargo.toml +3 -0
- package/contracts/workers/executor/src/executor.rs +2 -12
- package/contracts/workers/executor/src/lib.rs +2 -2
- package/contracts/workers/executor/src/tests/auth.rs +394 -0
- package/contracts/workers/executor/src/tests/executor.rs +410 -0
- package/contracts/workers/executor/src/tests/mod.rs +3 -0
- package/contracts/workers/executor/src/tests/setup.rs +250 -0
- package/contracts/workers/executor-fee-lib/Cargo.toml +5 -0
- package/contracts/workers/executor-fee-lib/src/executor_fee_lib.rs +1 -12
- package/contracts/workers/executor-fee-lib/src/lib.rs +8 -2
- package/contracts/workers/executor-helper/Cargo.toml +0 -1
- package/contracts/workers/price-feed/Cargo.toml +5 -0
- package/contracts/workers/price-feed/src/lib.rs +9 -4
- package/contracts/workers/price-feed/src/price_feed.rs +1 -11
- package/contracts/workers/worker/src/errors.rs +1 -1
- package/contracts/workers/worker/src/tests/setup.rs +1 -1
- package/contracts/workers/worker/src/tests/worker.rs +55 -41
- package/contracts/workers/worker/src/worker.rs +34 -25
- package/docs/error-spec.md +55 -0
- package/docs/layerzero-v2-on-stellar.md +447 -0
- package/docs/oapp-guide.md +212 -0
- package/docs/oft-guide.md +314 -0
- package/package.json +3 -3
- package/sdk/.turbo/turbo-test.log +260 -257
- package/sdk/dist/generated/bml.d.ts +3 -3
- package/sdk/dist/generated/bml.js +4 -4
- package/sdk/dist/generated/counter.d.ts +295 -295
- package/sdk/dist/generated/counter.js +43 -43
- package/sdk/dist/generated/dvn.d.ts +91 -91
- package/sdk/dist/generated/dvn.js +24 -24
- package/sdk/dist/generated/dvn_fee_lib.d.ts +92 -92
- package/sdk/dist/generated/dvn_fee_lib.js +25 -25
- package/sdk/dist/generated/endpoint.d.ts +99 -99
- package/sdk/dist/generated/endpoint.js +16 -16
- package/sdk/dist/generated/executor.d.ts +91 -91
- package/sdk/dist/generated/executor.js +24 -24
- package/sdk/dist/generated/executor_fee_lib.d.ts +92 -92
- package/sdk/dist/generated/executor_fee_lib.js +25 -25
- package/sdk/dist/generated/executor_helper.d.ts +3 -3
- package/sdk/dist/generated/executor_helper.js +4 -4
- package/sdk/dist/generated/layerzero_view.d.ts +186 -186
- package/sdk/dist/generated/layerzero_view.js +35 -35
- package/sdk/dist/generated/oft.d.ts +366 -352
- package/sdk/dist/generated/oft.js +74 -79
- package/sdk/dist/generated/price_feed.d.ts +198 -198
- package/sdk/dist/generated/price_feed.js +39 -39
- package/sdk/dist/generated/sml.d.ts +99 -99
- package/sdk/dist/generated/sml.js +16 -16
- package/sdk/dist/generated/treasury.d.ts +99 -99
- package/sdk/dist/generated/treasury.js +16 -16
- package/sdk/dist/generated/uln302.d.ts +99 -99
- package/sdk/dist/generated/uln302.js +16 -16
- package/sdk/dist/generated/upgrader.d.ts +3 -3
- package/sdk/dist/generated/upgrader.js +3 -3
- package/sdk/package.json +1 -1
- package/sdk/test/suites/localnet.ts +84 -20
- package/contracts/ERROR_SPEC.md +0 -51
- package/contracts/endpoint-v2/ARCHITECTURE.md +0 -233
- /package/contracts/oapps/oapp/src/tests/{test_oapp_receiver.rs → oapp_receiver.rs} +0 -0
- /package/contracts/oapps/oapp/src/tests/{test_oapp_sender.rs → oapp_sender.rs} +0 -0
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
source: contracts/common-macros/src/tests/auth.rs
|
|
3
|
-
assertion_line: 33
|
|
4
3
|
expression: formatted
|
|
5
4
|
---
|
|
6
5
|
pub struct MyContract;
|
|
7
6
|
use utils::{auth::Auth as _, multisig::Multisig as _};
|
|
8
|
-
#[
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
#[common_macros::contract_impl]
|
|
13
|
-
impl Auth for MyContract {
|
|
14
|
-
fn authorizer(env: &soroban_sdk::Env) -> soroban_sdk::Address {
|
|
15
|
-
env.current_contract_address()
|
|
16
|
-
}
|
|
7
|
+
#[common_macros::contract_impl]
|
|
8
|
+
impl utils::auth::Auth for MyContract {
|
|
9
|
+
fn authorizer(env: &soroban_sdk::Env) -> soroban_sdk::Address {
|
|
10
|
+
env.current_contract_address()
|
|
17
11
|
}
|
|
18
|
-
#[common_macros::contract_impl(contracttrait)]
|
|
19
|
-
impl Multisig for MyContract {}
|
|
20
12
|
}
|
|
13
|
+
#[common_macros::contract_impl(contracttrait)]
|
|
14
|
+
impl utils::multisig::Multisig for MyContract {}
|
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
---
|
|
2
2
|
source: contracts/common-macros/src/tests/auth.rs
|
|
3
|
-
assertion_line: 18
|
|
4
3
|
expression: formatted
|
|
5
4
|
---
|
|
6
5
|
pub struct MyContract;
|
|
7
|
-
use utils::{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
impl Auth for MyContract {
|
|
18
|
-
fn authorizer(env: &soroban_sdk::Env) -> soroban_sdk::Address {
|
|
19
|
-
<Self as Ownable>::owner(env).unwrap_or_panic(env, OwnableError::OwnerNotSet)
|
|
20
|
-
}
|
|
6
|
+
use utils::{
|
|
7
|
+
auth::Auth as _, option_ext::OptionExt as _,
|
|
8
|
+
ownable::{Ownable as _, OwnableInitializer as _},
|
|
9
|
+
};
|
|
10
|
+
impl utils::ownable::OwnableInitializer for MyContract {}
|
|
11
|
+
#[common_macros::contract_impl]
|
|
12
|
+
impl utils::auth::Auth for MyContract {
|
|
13
|
+
fn authorizer(env: &soroban_sdk::Env) -> soroban_sdk::Address {
|
|
14
|
+
<Self as utils::ownable::Ownable>::owner(env)
|
|
15
|
+
.unwrap_or_panic(env, utils::errors::OwnableError::OwnerNotSet)
|
|
21
16
|
}
|
|
22
|
-
#[common_macros::contract_impl(contracttrait)]
|
|
23
|
-
impl Ownable for MyContract {}
|
|
24
17
|
}
|
|
18
|
+
#[common_macros::contract_impl(contracttrait)]
|
|
19
|
+
impl utils::ownable::Ownable for MyContract {}
|
|
@@ -6,10 +6,5 @@ pub struct MyContract {
|
|
|
6
6
|
some_field: u32,
|
|
7
7
|
}
|
|
8
8
|
use utils::ttl_configurable::TtlConfigurable as _;
|
|
9
|
-
#[
|
|
10
|
-
|
|
11
|
-
use super::*;
|
|
12
|
-
use utils::ttl_configurable::{TtlConfig, TtlConfigurable};
|
|
13
|
-
#[common_macros::contract_impl(contracttrait)]
|
|
14
|
-
impl TtlConfigurable for MyContract {}
|
|
15
|
-
}
|
|
9
|
+
#[common_macros::contract_impl(contracttrait)]
|
|
10
|
+
impl utils::ttl_configurable::TtlConfigurable for MyContract {}
|
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
---
|
|
2
2
|
source: contracts/common-macros/src/tests/upgradeable.rs
|
|
3
|
-
|
|
4
|
-
expression: formatted
|
|
3
|
+
expression: combined
|
|
5
4
|
---
|
|
5
|
+
// ============================================
|
|
6
|
+
// Default: requires manual UpgradeableInternal
|
|
7
|
+
// ============================================
|
|
8
|
+
|
|
6
9
|
pub struct MyContract;
|
|
7
10
|
use utils::upgradeable::Upgradeable as _;
|
|
8
11
|
soroban_sdk::contractmeta!(key = "binver", val = "0.0.1");
|
|
9
|
-
#[
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
#[common_macros::contract_impl(contracttrait)]
|
|
13
|
+
impl utils::upgradeable::Upgradeable for MyContract {}
|
|
14
|
+
|
|
15
|
+
// ============================================
|
|
16
|
+
// With no_migration: auto-generates impl
|
|
17
|
+
// ============================================
|
|
18
|
+
|
|
19
|
+
pub struct MyContract;
|
|
20
|
+
use utils::upgradeable::Upgradeable as _;
|
|
21
|
+
soroban_sdk::contractmeta!(key = "binver", val = "0.0.1");
|
|
22
|
+
impl utils::upgradeable::UpgradeableInternal for MyContract {
|
|
23
|
+
type MigrationData = ();
|
|
24
|
+
fn __migrate(_env: &soroban_sdk::Env, _migration_data: &Self::MigrationData) {}
|
|
16
25
|
}
|
|
26
|
+
#[common_macros::contract_impl(contracttrait)]
|
|
27
|
+
impl utils::upgradeable::Upgradeable for MyContract {}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
use proc_macro2::TokenStream;
|
|
1
2
|
use quote::quote;
|
|
2
3
|
|
|
3
4
|
use crate::tests::test_helpers::{assert_panics_contains, non_struct_item_inputs};
|
|
@@ -11,10 +12,29 @@ fn snapshot_generated_upgradeable_code() {
|
|
|
11
12
|
let input = quote! {
|
|
12
13
|
pub struct MyContract;
|
|
13
14
|
};
|
|
14
|
-
let result = crate::upgradeable::generate_upgradeable_impl(input);
|
|
15
|
-
let formatted = prettyplease::unparse(&syn::parse2::<syn::File>(result).expect("failed to parse generated code"));
|
|
16
15
|
|
|
17
|
-
|
|
16
|
+
// Test default behavior (requires manual UpgradeableInternal impl)
|
|
17
|
+
let default_result = crate::upgradeable::generate_upgradeable_impl(TokenStream::new(), input.clone());
|
|
18
|
+
let default_formatted =
|
|
19
|
+
prettyplease::unparse(&syn::parse2::<syn::File>(default_result).expect("failed to parse generated code"));
|
|
20
|
+
|
|
21
|
+
// Test with no_migration (auto-generates UpgradeableInternal impl)
|
|
22
|
+
let no_migration_result = crate::upgradeable::generate_upgradeable_impl(quote! { no_migration }, input);
|
|
23
|
+
let no_migration_formatted =
|
|
24
|
+
prettyplease::unparse(&syn::parse2::<syn::File>(no_migration_result).expect("failed to parse generated code"));
|
|
25
|
+
|
|
26
|
+
let combined = format!(
|
|
27
|
+
"// ============================================\n\
|
|
28
|
+
// Default: requires manual UpgradeableInternal\n\
|
|
29
|
+
// ============================================\n\n\
|
|
30
|
+
{default_formatted}\n\
|
|
31
|
+
// ============================================\n\
|
|
32
|
+
// With no_migration: auto-generates impl\n\
|
|
33
|
+
// ============================================\n\n\
|
|
34
|
+
{no_migration_formatted}"
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
insta::assert_snapshot!(combined);
|
|
18
38
|
}
|
|
19
39
|
|
|
20
40
|
// ============================================
|
|
@@ -23,9 +43,11 @@ fn snapshot_generated_upgradeable_code() {
|
|
|
23
43
|
|
|
24
44
|
#[test]
|
|
25
45
|
fn test_upgradeable_rejects_non_struct_inputs() {
|
|
46
|
+
let attr = TokenStream::new();
|
|
26
47
|
for (case, input) in non_struct_item_inputs() {
|
|
48
|
+
let attr_clone = attr.clone();
|
|
27
49
|
assert_panics_contains(case, "failed to parse struct", || {
|
|
28
|
-
crate::upgradeable::generate_upgradeable_impl(input.clone());
|
|
50
|
+
crate::upgradeable::generate_upgradeable_impl(attr_clone, input.clone());
|
|
29
51
|
});
|
|
30
52
|
}
|
|
31
53
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
//! TtlConfigurable macro for Stellar smart contracts.
|
|
2
2
|
|
|
3
|
-
use crate::utils;
|
|
4
3
|
use proc_macro2::TokenStream;
|
|
5
4
|
use quote::quote;
|
|
6
5
|
use syn::ItemStruct;
|
|
@@ -16,20 +15,13 @@ use syn::ItemStruct;
|
|
|
16
15
|
pub fn generate_ttl_configurable_impl(input: TokenStream) -> TokenStream {
|
|
17
16
|
let item_struct: ItemStruct = syn::parse2(input).unwrap_or_else(|e| panic!("failed to parse struct: {}", e));
|
|
18
17
|
let name = &item_struct.ident;
|
|
19
|
-
let impl_mod = utils::impl_mod_ident(name, "ttl_configurable");
|
|
20
18
|
|
|
21
19
|
quote! {
|
|
22
20
|
#item_struct
|
|
23
21
|
|
|
24
22
|
use utils::ttl_configurable::TtlConfigurable as _;
|
|
25
23
|
|
|
26
|
-
#[
|
|
27
|
-
|
|
28
|
-
use super::*;
|
|
29
|
-
use utils::ttl_configurable::{TtlConfig, TtlConfigurable};
|
|
30
|
-
|
|
31
|
-
#[common_macros::contract_impl(contracttrait)]
|
|
32
|
-
impl TtlConfigurable for #name {}
|
|
33
|
-
}
|
|
24
|
+
#[common_macros::contract_impl(contracttrait)]
|
|
25
|
+
impl utils::ttl_configurable::TtlConfigurable for #name {}
|
|
34
26
|
}
|
|
35
27
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
//! TtlExtendable macro for Stellar smart contracts.
|
|
2
2
|
|
|
3
|
-
use crate::utils;
|
|
4
3
|
use proc_macro2::TokenStream;
|
|
5
4
|
use quote::quote;
|
|
6
5
|
use syn::ItemStruct;
|
|
@@ -17,20 +16,13 @@ use syn::ItemStruct;
|
|
|
17
16
|
pub fn generate_ttl_extendable_impl(input: TokenStream) -> TokenStream {
|
|
18
17
|
let item_struct: ItemStruct = syn::parse2(input).unwrap_or_else(|e| panic!("failed to parse struct: {}", e));
|
|
19
18
|
let name = &item_struct.ident;
|
|
20
|
-
let impl_mod = utils::impl_mod_ident(name, "ttl_extendable");
|
|
21
19
|
|
|
22
20
|
quote! {
|
|
23
21
|
#item_struct
|
|
24
22
|
|
|
25
23
|
use utils::ttl_extendable::TtlExtendable as _;
|
|
26
24
|
|
|
27
|
-
#[
|
|
28
|
-
|
|
29
|
-
use super::*;
|
|
30
|
-
use utils::ttl_extendable::TtlExtendable;
|
|
31
|
-
|
|
32
|
-
#[soroban_sdk::contractimpl(contracttrait)]
|
|
33
|
-
impl TtlExtendable for #name {}
|
|
34
|
-
}
|
|
25
|
+
#[soroban_sdk::contractimpl(contracttrait)]
|
|
26
|
+
impl utils::ttl_extendable::TtlExtendable for #name {}
|
|
35
27
|
}
|
|
36
28
|
}
|
|
@@ -1,9 +1,34 @@
|
|
|
1
1
|
//! Upgradeable macro for Stellar smart contracts.
|
|
2
2
|
|
|
3
|
-
use crate::utils;
|
|
4
3
|
use proc_macro2::TokenStream;
|
|
5
4
|
use quote::quote;
|
|
6
|
-
use syn::
|
|
5
|
+
use syn::{
|
|
6
|
+
parse::{Parse, ParseStream},
|
|
7
|
+
Ident, ItemStruct,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
/// Configuration options for the `#[upgradeable]` macro.
|
|
11
|
+
#[derive(Debug, Default)]
|
|
12
|
+
pub struct UpgradeableConfig {
|
|
13
|
+
/// If true, generates a default no-op `UpgradeableInternal` implementation.
|
|
14
|
+
/// Use this for initial deployments when no migration logic is needed yet.
|
|
15
|
+
pub no_migration: bool,
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
impl Parse for UpgradeableConfig {
|
|
19
|
+
fn parse(input: ParseStream) -> syn::Result<Self> {
|
|
20
|
+
if input.is_empty() {
|
|
21
|
+
return Ok(Self::default());
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
let ident: Ident = input.parse()?;
|
|
25
|
+
if ident == "no_migration" {
|
|
26
|
+
Ok(Self { no_migration: true })
|
|
27
|
+
} else {
|
|
28
|
+
Err(syn::Error::new(ident.span(), "expected `no_migration`"))
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
7
32
|
|
|
8
33
|
/// Generates the upgradeable implementation from the `#[upgradeable]` attribute macro.
|
|
9
34
|
///
|
|
@@ -18,21 +43,42 @@ use syn::ItemStruct;
|
|
|
18
43
|
/// `soroban_sdk::contractmeta!`. Gets the crate version via the env variable
|
|
19
44
|
/// `CARGO_PKG_VERSION` which corresponds to the "version" attribute in
|
|
20
45
|
/// Cargo.toml. If no such attribute or if it is "0.0.0", skips this step.
|
|
21
|
-
/// -
|
|
46
|
+
/// - By default, requires the contract to implement `UpgradeableInternal` trait.
|
|
47
|
+
/// - With `no_migration` flag, generates a default no-op `UpgradeableInternal` impl.
|
|
22
48
|
///
|
|
23
49
|
/// # Example
|
|
24
50
|
/// ```ignore
|
|
25
|
-
///
|
|
51
|
+
/// // Requires manual UpgradeableInternal implementation (default, safety first)
|
|
52
|
+
/// #[ownable]
|
|
26
53
|
/// #[upgradeable]
|
|
27
54
|
/// pub struct MyContract;
|
|
55
|
+
///
|
|
56
|
+
/// // Auto-generates no-op UpgradeableInternal (for initial deployment)
|
|
57
|
+
/// #[ownable]
|
|
58
|
+
/// #[upgradeable(no_migration)]
|
|
59
|
+
/// pub struct MyContract;
|
|
28
60
|
/// ```
|
|
29
|
-
pub fn generate_upgradeable_impl(input: TokenStream) -> TokenStream {
|
|
30
|
-
let
|
|
61
|
+
pub fn generate_upgradeable_impl(attr: TokenStream, input: TokenStream) -> TokenStream {
|
|
62
|
+
let config: UpgradeableConfig =
|
|
63
|
+
syn::parse2(attr).unwrap_or_else(|e| panic!("failed to parse upgradeable config: {}", e));
|
|
64
|
+
let item_struct: ItemStruct =
|
|
65
|
+
syn::parse2(input).unwrap_or_else(|e| panic!("failed to parse struct: {}", e));
|
|
31
66
|
let name = &item_struct.ident;
|
|
32
|
-
let impl_mod = utils::impl_mod_ident(name, "upgradeable");
|
|
33
67
|
|
|
34
68
|
let binver = set_binver_from_env();
|
|
35
69
|
|
|
70
|
+
// Generate default UpgradeableInternal impl only when no_migration is set
|
|
71
|
+
let default_internal_impl = if config.no_migration {
|
|
72
|
+
quote! {
|
|
73
|
+
impl utils::upgradeable::UpgradeableInternal for #name {
|
|
74
|
+
type MigrationData = ();
|
|
75
|
+
fn __migrate(_env: &soroban_sdk::Env, _migration_data: &Self::MigrationData) {}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
} else {
|
|
79
|
+
quote! {}
|
|
80
|
+
};
|
|
81
|
+
|
|
36
82
|
quote! {
|
|
37
83
|
#item_struct
|
|
38
84
|
|
|
@@ -40,15 +86,10 @@ pub fn generate_upgradeable_impl(input: TokenStream) -> TokenStream {
|
|
|
40
86
|
|
|
41
87
|
#binver
|
|
42
88
|
|
|
43
|
-
#
|
|
44
|
-
mod #impl_mod {
|
|
45
|
-
use super::*;
|
|
46
|
-
use soroban_sdk::{Bytes, BytesN};
|
|
47
|
-
use utils::upgradeable::{Upgradeable, UpgradeableInternal};
|
|
89
|
+
#default_internal_impl
|
|
48
90
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
91
|
+
#[common_macros::contract_impl(contracttrait)]
|
|
92
|
+
impl utils::upgradeable::Upgradeable for #name {}
|
|
52
93
|
}
|
|
53
94
|
}
|
|
54
95
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
use heck::ToSnakeCase;
|
|
2
1
|
use proc_macro2::TokenStream;
|
|
3
2
|
use quote::quote;
|
|
4
3
|
use syn::{punctuated::Punctuated, token::Comma, FnArg, Ident, Pat, Type, TypePath};
|
|
@@ -55,11 +54,3 @@ pub fn is_env_type(ty: &Type) -> bool {
|
|
|
55
54
|
fn is_reference_type(ty: &Type) -> bool {
|
|
56
55
|
matches!(ty, Type::Reference(_))
|
|
57
56
|
}
|
|
58
|
-
|
|
59
|
-
/// Creates a unique hidden module identifier for trait implementations.
|
|
60
|
-
///
|
|
61
|
-
/// Generates a module name in the format `__{trait_name}_impl_{struct_name}` to avoid
|
|
62
|
-
/// name collisions when multiple traits are implemented for the same struct.
|
|
63
|
-
pub fn impl_mod_ident(struct_name: &Ident, trait_name: &str) -> Ident {
|
|
64
|
-
Ident::new(&format!("__{}_impl_{}", trait_name, struct_name.to_string().to_snake_case()), struct_name.span())
|
|
65
|
-
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
use soroban_sdk::{testutils::Address as _, Address, Bytes, BytesN};
|
|
2
|
-
use utils::testing_utils::
|
|
2
|
+
use utils::testing_utils::assert_eq_event;
|
|
3
3
|
|
|
4
4
|
use crate::{
|
|
5
5
|
errors::EndpointError,
|
|
@@ -116,7 +116,7 @@ fn test_clear_emits_packet_delivered_event() {
|
|
|
116
116
|
|
|
117
117
|
clear_packet_with_auth(&context, &receiver, &origin, &receiver, &guid, &message);
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
assert_eq_event(env, &endpoint_client.address, PacketDelivered { origin: origin.clone(), receiver: receiver.clone() });
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
// Lazy inbound nonce updates
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
use soroban_sdk::{testutils::Address as _, Address, Bytes, BytesN, Env};
|
|
2
|
-
use utils::testing_utils::
|
|
2
|
+
use utils::testing_utils::assert_eq_event;
|
|
3
3
|
|
|
4
4
|
use crate::{
|
|
5
5
|
endpoint_v2::EndpointV2Client, events::LzReceiveAlert, tests::endpoint_setup::setup,
|
|
@@ -87,7 +87,7 @@ fn test_lz_receive_alert_auth() {
|
|
|
87
87
|
&f.reason,
|
|
88
88
|
);
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
assert_eq_event(
|
|
91
91
|
env,
|
|
92
92
|
&endpoint_client.address,
|
|
93
93
|
LzReceiveAlert {
|
|
@@ -155,7 +155,7 @@ fn test_lz_receive_alert_with_empty_data() {
|
|
|
155
155
|
&f.reason,
|
|
156
156
|
);
|
|
157
157
|
|
|
158
|
-
|
|
158
|
+
assert_eq_event(
|
|
159
159
|
env,
|
|
160
160
|
&endpoint_client.address,
|
|
161
161
|
LzReceiveAlert {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
use soroban_sdk::{testutils::Address as _, vec, Address, Bytes, BytesN, Env};
|
|
2
|
-
use utils::testing_utils::
|
|
2
|
+
use utils::testing_utils::assert_contains_event;
|
|
3
3
|
|
|
4
4
|
use crate::{
|
|
5
5
|
errors::EndpointError,
|
|
@@ -53,7 +53,7 @@ fn test_send_with_native_fee_exact_payment() {
|
|
|
53
53
|
|
|
54
54
|
// Verify PacketSent event was published
|
|
55
55
|
// MockSendLib::send returns encoded_packet = packet.message.clone()
|
|
56
|
-
|
|
56
|
+
assert_contains_event(
|
|
57
57
|
env,
|
|
58
58
|
&endpoint_client.address,
|
|
59
59
|
PacketSent {
|
|
@@ -146,7 +146,7 @@ fn test_send_with_zro_fee() {
|
|
|
146
146
|
assert_eq!(receipt.fee.zro_fee, 25);
|
|
147
147
|
|
|
148
148
|
// Verify PacketSent event was published
|
|
149
|
-
|
|
149
|
+
assert_contains_event(
|
|
150
150
|
env,
|
|
151
151
|
&endpoint_client.address,
|
|
152
152
|
PacketSent {
|
|
@@ -436,7 +436,7 @@ fn test_send_with_non_empty_options_emits_event_and_charges_fee() {
|
|
|
436
436
|
assert_eq!(receipt.fee.zro_fee, 0);
|
|
437
437
|
|
|
438
438
|
// Verify PacketSent event captures options and encoded packet.
|
|
439
|
-
|
|
439
|
+
assert_contains_event(
|
|
440
440
|
env,
|
|
441
441
|
&endpoint_client.address,
|
|
442
442
|
PacketSent { encoded_packet: params.message.clone(), options: options.clone(), send_library: send_lib.clone() },
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
use soroban_sdk::{testutils::Address as _, Address};
|
|
2
|
-
use utils::testing_utils::
|
|
2
|
+
use utils::testing_utils::assert_eq_event;
|
|
3
3
|
|
|
4
4
|
use crate::{events::DelegateSet, tests::endpoint_setup::setup};
|
|
5
5
|
|
|
@@ -21,7 +21,11 @@ fn test_set_delegate() {
|
|
|
21
21
|
context.set_delegate_with_auth(&oapp, &delegate_option);
|
|
22
22
|
|
|
23
23
|
// Verify event emission.
|
|
24
|
-
|
|
24
|
+
assert_eq_event(
|
|
25
|
+
env,
|
|
26
|
+
&endpoint_client.address,
|
|
27
|
+
DelegateSet { oapp: oapp.clone(), delegate: Some(delegate.clone()) },
|
|
28
|
+
);
|
|
25
29
|
|
|
26
30
|
// Verify state update via public interface.
|
|
27
31
|
let actual_delegate = endpoint_client.delegate(&oapp);
|
|
@@ -41,13 +45,21 @@ fn test_set_delegate_overwrites_existing_delegate() {
|
|
|
41
45
|
// Set delegate to A.
|
|
42
46
|
let delegate_a_opt = Some(delegate_a.clone());
|
|
43
47
|
context.set_delegate_with_auth(&oapp, &delegate_a_opt);
|
|
44
|
-
|
|
48
|
+
assert_eq_event(
|
|
49
|
+
env,
|
|
50
|
+
&endpoint_client.address,
|
|
51
|
+
DelegateSet { oapp: oapp.clone(), delegate: Some(delegate_a.clone()) },
|
|
52
|
+
);
|
|
45
53
|
assert_eq!(endpoint_client.delegate(&oapp), Some(delegate_a.clone()));
|
|
46
54
|
|
|
47
55
|
// Overwrite delegate with B.
|
|
48
56
|
let delegate_b_opt = Some(delegate_b.clone());
|
|
49
57
|
context.set_delegate_with_auth(&oapp, &delegate_b_opt);
|
|
50
|
-
|
|
58
|
+
assert_eq_event(
|
|
59
|
+
env,
|
|
60
|
+
&endpoint_client.address,
|
|
61
|
+
DelegateSet { oapp: oapp.clone(), delegate: Some(delegate_b.clone()) },
|
|
62
|
+
);
|
|
51
63
|
assert_eq!(endpoint_client.delegate(&oapp), Some(delegate_b.clone()));
|
|
52
64
|
}
|
|
53
65
|
|
|
@@ -91,7 +103,7 @@ fn test_set_delegate_remove() {
|
|
|
91
103
|
context.set_delegate_with_auth(&oapp, &remove_option);
|
|
92
104
|
|
|
93
105
|
// Verify event emission.
|
|
94
|
-
|
|
106
|
+
assert_eq_event(env, &endpoint_client.address, DelegateSet { oapp: oapp.clone(), delegate: None });
|
|
95
107
|
|
|
96
108
|
// Verify state update via public interface.
|
|
97
109
|
let stored_delegate_after = endpoint_client.delegate(&oapp);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
use soroban_sdk::{testutils::Address as _, Address};
|
|
2
|
-
use utils::testing_utils::
|
|
2
|
+
use utils::testing_utils::assert_eq_event;
|
|
3
3
|
|
|
4
4
|
use crate::{events::ZroSet, tests::endpoint_setup::setup, tests::endpoint_setup::TestSetup};
|
|
5
5
|
|
|
@@ -23,7 +23,7 @@ fn test_set_zro() {
|
|
|
23
23
|
set_zro_with_auth(&context, &context.zro_token_client.address);
|
|
24
24
|
|
|
25
25
|
// Verify event emission.
|
|
26
|
-
|
|
26
|
+
assert_eq_event(env, &endpoint_client.address, ZroSet { zro: context.zro_token_client.address.clone() });
|
|
27
27
|
|
|
28
28
|
// Verify state update via public interface.
|
|
29
29
|
let zro_token = endpoint_client.zro();
|
|
@@ -43,12 +43,12 @@ fn test_set_zro_overwrites_existing_zro() {
|
|
|
43
43
|
|
|
44
44
|
// Set ZRO to the first address.
|
|
45
45
|
set_zro_with_auth(&context, &context.zro_token_client.address);
|
|
46
|
-
|
|
46
|
+
assert_eq_event(env, &endpoint_client.address, ZroSet { zro: context.zro_token_client.address.clone() });
|
|
47
47
|
assert_eq!(endpoint_client.zro(), Some(context.zro_token_client.address.clone()));
|
|
48
48
|
|
|
49
49
|
// Overwrite ZRO with the second address.
|
|
50
50
|
set_zro_with_auth(&context, &zro_addr_2);
|
|
51
|
-
|
|
51
|
+
assert_eq_event(env, &endpoint_client.address, ZroSet { zro: zro_addr_2.clone() });
|
|
52
52
|
assert_eq!(endpoint_client.zro(), Some(zro_addr_2));
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
use soroban_sdk::{vec, Bytes, BytesN, Env};
|
|
2
|
-
use utils::testing_utils::
|
|
2
|
+
use utils::testing_utils::assert_eq_event;
|
|
3
3
|
|
|
4
4
|
use crate::{
|
|
5
5
|
errors::EndpointError,
|
|
@@ -51,7 +51,7 @@ fn test_verify_success() {
|
|
|
51
51
|
endpoint_client.verify(&receive_lib, &origin, &receiver, &payload_hash);
|
|
52
52
|
|
|
53
53
|
// Verify PacketVerified event was published
|
|
54
|
-
|
|
54
|
+
assert_eq_event(
|
|
55
55
|
env,
|
|
56
56
|
&endpoint_client.address,
|
|
57
57
|
PacketVerified { origin: origin.clone(), receiver: receiver.clone(), payload_hash: payload_hash.clone() },
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
use soroban_sdk::{testutils::Address as _, vec, Address};
|
|
2
|
-
use utils::testing_utils::
|
|
2
|
+
use utils::testing_utils::assert_eq_event;
|
|
3
3
|
|
|
4
4
|
use crate::{
|
|
5
5
|
errors::EndpointError,
|
|
@@ -27,7 +27,7 @@ fn test_register_library() {
|
|
|
27
27
|
context.register_library_with_auth(&lib);
|
|
28
28
|
|
|
29
29
|
// Verify event emission.
|
|
30
|
-
|
|
30
|
+
assert_eq_event(env, &endpoint_client.address, LibraryRegistered { new_lib: lib.clone() });
|
|
31
31
|
|
|
32
32
|
// Verify state update via public interface.
|
|
33
33
|
assert!(endpoint_client.is_registered_library(&lib));
|
package/contracts/endpoint-v2/src/tests/message_lib_manager/set_default_receive_lib_timeout.rs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
use soroban_sdk::{testutils::Address as _, testutils::Ledger, vec, Address};
|
|
2
|
-
use utils::testing_utils::
|
|
2
|
+
use utils::testing_utils::assert_eq_event;
|
|
3
3
|
|
|
4
4
|
use crate::{
|
|
5
5
|
errors::EndpointError,
|
|
@@ -171,7 +171,7 @@ fn test_set_default_receive_lib_timeout_success() {
|
|
|
171
171
|
set_default_receive_lib_timeout_with_auth(&context, context.eid, &timeout);
|
|
172
172
|
|
|
173
173
|
// Verify event emission.
|
|
174
|
-
|
|
174
|
+
assert_eq_event(
|
|
175
175
|
env,
|
|
176
176
|
&endpoint_client.address,
|
|
177
177
|
DefaultReceiveLibTimeoutSet { src_eid: context.eid, timeout: timeout.clone() },
|
|
@@ -203,7 +203,7 @@ fn test_set_default_receive_lib_timeout_success_with_send_and_receive_type() {
|
|
|
203
203
|
set_default_receive_lib_timeout_with_auth(&context, context.eid, &timeout);
|
|
204
204
|
|
|
205
205
|
// Verify event emission.
|
|
206
|
-
|
|
206
|
+
assert_eq_event(
|
|
207
207
|
env,
|
|
208
208
|
&endpoint_client.address,
|
|
209
209
|
DefaultReceiveLibTimeoutSet { src_eid: context.eid, timeout: timeout.clone() },
|
|
@@ -224,7 +224,7 @@ fn test_set_default_receive_lib_timeout_success_with_none() {
|
|
|
224
224
|
set_default_receive_lib_timeout_with_auth(&context, context.eid, &None);
|
|
225
225
|
|
|
226
226
|
// Verify event emission.
|
|
227
|
-
|
|
227
|
+
assert_eq_event(env, &endpoint_client.address, DefaultReceiveLibTimeoutSet { src_eid: context.eid, timeout: None });
|
|
228
228
|
|
|
229
229
|
// Verify state update via public interface.
|
|
230
230
|
assert_eq!(endpoint_client.default_receive_library_timeout(&context.eid), None);
|
|
@@ -250,7 +250,7 @@ fn test_set_default_receive_lib_timeout_clears_existing_timeout() {
|
|
|
250
250
|
|
|
251
251
|
// First set a timeout.
|
|
252
252
|
set_default_receive_lib_timeout_with_auth(&context, context.eid, &timeout);
|
|
253
|
-
|
|
253
|
+
assert_eq_event(
|
|
254
254
|
env,
|
|
255
255
|
&endpoint_client.address,
|
|
256
256
|
DefaultReceiveLibTimeoutSet { src_eid: context.eid, timeout: timeout.clone() },
|
|
@@ -259,6 +259,6 @@ fn test_set_default_receive_lib_timeout_clears_existing_timeout() {
|
|
|
259
259
|
|
|
260
260
|
// Then clear it.
|
|
261
261
|
set_default_receive_lib_timeout_with_auth(&context, context.eid, &None);
|
|
262
|
-
|
|
262
|
+
assert_eq_event(env, &endpoint_client.address, DefaultReceiveLibTimeoutSet { src_eid: context.eid, timeout: None });
|
|
263
263
|
assert_eq!(endpoint_client.default_receive_library_timeout(&context.eid), None);
|
|
264
264
|
}
|