@layerzerolabs/oapp-stellar-contracts 0.2.122 → 0.2.124
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/package.json +12 -10
- package/rustfmt.toml +8 -11
- package/src/oapp_options_type3.rs +4 -1
- package/src/tests/oapp_receiver.rs +5 -5
- package/src/tests/oapp_sender.rs +2 -2
- package/src/tests/test_macros.rs +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@layerzerolabs/oapp-stellar-contracts",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.124",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
"clippy.toml"
|
|
12
12
|
],
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@layerzerolabs/common-utils-macros-stellar-contracts": "0.2.
|
|
15
|
-
"@layerzerolabs/
|
|
16
|
-
"@layerzerolabs/
|
|
17
|
-
"@layerzerolabs/
|
|
14
|
+
"@layerzerolabs/common-utils-macros-stellar-contracts": "0.2.124",
|
|
15
|
+
"@layerzerolabs/common-utils-stellar-contracts": "0.2.124",
|
|
16
|
+
"@layerzerolabs/oapp-macros-stellar-contracts": "0.2.124",
|
|
17
|
+
"@layerzerolabs/protocol-stellar-v2": "0.2.124"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@layerzerolabs/build-utils-rust": "0.2.
|
|
21
|
-
"@layerzerolabs/vm-tooling-stellar": "0.2.
|
|
20
|
+
"@layerzerolabs/build-utils-rust": "0.2.124",
|
|
21
|
+
"@layerzerolabs/vm-tooling-stellar": "0.2.124"
|
|
22
22
|
},
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"access": "public",
|
|
@@ -42,10 +42,12 @@
|
|
|
42
42
|
"build": "pnpm resolve-dependencies && pnpm exec lz-tool --script \"cargo build --release\" stellar",
|
|
43
43
|
"clean": "rm -rf ./dependencies ./target ./node_modules",
|
|
44
44
|
"format": "pnpm exec lz-tool --script \"cargo fmt\" stellar",
|
|
45
|
-
"
|
|
46
|
-
"lint
|
|
45
|
+
"format:check": "pnpm exec lz-tool --script \"cargo fmt -- --check\" stellar",
|
|
46
|
+
"lint": "pnpm resolve-dependencies && pnpm exec lz-tool --script \"cargo fmt -- --check && cargo clippy --all-targets -- -D warnings\" stellar",
|
|
47
|
+
"lint:fix": "pnpm resolve-dependencies && pnpm exec lz-tool --script \"cargo clippy --all-targets --fix --allow-dirty --allow-staged && cargo fmt\" stellar",
|
|
47
48
|
"resolve-dependencies": "pnpm exec build-utils-rust resolve",
|
|
48
|
-
"test": "pnpm
|
|
49
|
+
"test": "pnpm test:non-ui && pnpm test:ui",
|
|
50
|
+
"test:non-ui": "pnpm resolve-dependencies && pnpm exec lz-tool --script \"cargo nextest run -E 'not test(/^ui_/)'\" stellar",
|
|
49
51
|
"test:snapshot:check": "pnpm exec turbo-snapshot check",
|
|
50
52
|
"test:snapshot:update": "pnpm exec turbo-snapshot update",
|
|
51
53
|
"test:ui": "pnpm resolve-dependencies && pnpm exec lz-tool --script \"cargo nextest run -E 'test(/^ui_/)'\" stellar"
|
package/rustfmt.toml
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
# Only stable rustfmt options are kept here: the Stellar docker toolchain runs
|
|
2
|
+
# rustfmt on the stable channel (rust 1.90.0), which silently drops unstable
|
|
3
|
+
# options (they only apply on nightly). Do not re-add unstable options unless the
|
|
4
|
+
# tooling is switched to a pinned nightly (see the Solana packages for that setup).
|
|
2
5
|
max_width = 120
|
|
3
|
-
format_macro_matchers = true
|
|
4
|
-
format_strings = true
|
|
5
|
-
imports_granularity = "Crate"
|
|
6
|
-
match_arm_blocks = false
|
|
7
|
-
reorder_impl_items = true
|
|
8
|
-
group_imports = "StdExternalCrate"
|
|
9
6
|
use_field_init_shorthand = true
|
|
10
7
|
use_small_heuristics = "Max"
|
|
11
|
-
wrap_comments = true
|
|
12
|
-
format_code_in_doc_comments = true
|
|
13
8
|
|
|
14
|
-
#
|
|
15
|
-
|
|
9
|
+
# style_edition is a stable option honored by the docker toolchain. Pin it to
|
|
10
|
+
# 2021 to match every crate's `edition = "2021"` so formatting stays stable
|
|
11
|
+
# across rustfmt versions (setting it to 2024 would reformat the code).
|
|
12
|
+
style_edition = "2021"
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
use crate::{self as oapp, errors::OAppError};
|
|
2
2
|
use common_macros::{contract_trait, only_role, storage};
|
|
3
3
|
use soroban_sdk::{assert_with_error, contractevent, contracttype, panic_with_error, Bytes, Env, Vec};
|
|
4
|
-
use utils::{
|
|
4
|
+
use utils::{
|
|
5
|
+
buffer_reader::BufferReader,
|
|
6
|
+
rbac::{RoleBasedAccessControl, AUTHORIZER},
|
|
7
|
+
};
|
|
5
8
|
|
|
6
9
|
pub const OPTION_TYPE3: u16 = 3;
|
|
7
10
|
|
|
@@ -146,11 +146,11 @@ fn test_is_compose_msg_sender() {
|
|
|
146
146
|
|
|
147
147
|
// Test with same contract address (should return true)
|
|
148
148
|
let result = oapp_client.is_compose_msg_sender(&origin, &message, &oapp_client.address);
|
|
149
|
-
|
|
149
|
+
assert!(result);
|
|
150
150
|
let different_sender = Address::generate(&env);
|
|
151
151
|
|
|
152
152
|
// Test with different sender address (should return false)
|
|
153
|
-
|
|
153
|
+
assert!(!oapp_client.is_compose_msg_sender(&origin, &message, &different_sender));
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
#[test]
|
|
@@ -159,7 +159,7 @@ fn test_allow_initialize_path_cases() {
|
|
|
159
159
|
|
|
160
160
|
// no peer set -> false
|
|
161
161
|
let origin_no_peer = Origin { src_eid: UNSET_EID, sender: BytesN::from_array(&env, &[5; 32]), nonce: 1 };
|
|
162
|
-
|
|
162
|
+
assert!(!oapp_client.allow_initialize_path(&origin_no_peer));
|
|
163
163
|
|
|
164
164
|
// set peer for REMOTE_EID
|
|
165
165
|
let peer_bytes: BytesN<32> = BytesN::from_array(&env, &[5; 32]);
|
|
@@ -167,11 +167,11 @@ fn test_allow_initialize_path_cases() {
|
|
|
167
167
|
|
|
168
168
|
// matching -> true
|
|
169
169
|
let origin_match = Origin { src_eid: REMOTE_EID, sender: peer_bytes.clone(), nonce: 1 };
|
|
170
|
-
|
|
170
|
+
assert!(oapp_client.allow_initialize_path(&origin_match));
|
|
171
171
|
|
|
172
172
|
// non-matching -> false
|
|
173
173
|
let origin_non_match = Origin { src_eid: REMOTE_EID, sender: BytesN::from_array(&env, &[6; 32]), nonce: 1 };
|
|
174
|
-
|
|
174
|
+
assert!(!oapp_client.allow_initialize_path(&origin_non_match));
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
#[test]
|
package/src/tests/oapp_sender.rs
CHANGED
|
@@ -347,7 +347,7 @@ fn test_lz_send_native_only() {
|
|
|
347
347
|
assert_eq!(params.receiver, peer);
|
|
348
348
|
assert_eq!(params.message, message);
|
|
349
349
|
assert_eq!(params.options, options);
|
|
350
|
-
|
|
350
|
+
assert!(!params.pay_in_zro);
|
|
351
351
|
assert_eq!(refund, refund_address);
|
|
352
352
|
|
|
353
353
|
assert_eq!(native_token_client.balance(&sender), 0);
|
|
@@ -411,7 +411,7 @@ fn test_lz_send_with_zro() {
|
|
|
411
411
|
assert_eq!(params.receiver, peer);
|
|
412
412
|
assert_eq!(params.message, message);
|
|
413
413
|
assert_eq!(params.options, options);
|
|
414
|
-
|
|
414
|
+
assert!(params.pay_in_zro);
|
|
415
415
|
assert_eq!(refund, refund_address);
|
|
416
416
|
|
|
417
417
|
assert_eq!(native_token_client.balance(&sender), 0);
|
package/src/tests/test_macros.rs
CHANGED
|
@@ -429,6 +429,6 @@ mod test_full_manual_all {
|
|
|
429
429
|
|
|
430
430
|
#[test]
|
|
431
431
|
fn test_macros_compile() {
|
|
432
|
-
// This test verifies that all macro combinations compile successfully
|
|
433
|
-
|
|
432
|
+
// This test verifies that all macro combinations compile successfully.
|
|
433
|
+
// Reaching this point means every macro invocation above compiled.
|
|
434
434
|
}
|