@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layerzerolabs/oapp-stellar-contracts",
3
- "version": "0.2.122",
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.122",
15
- "@layerzerolabs/protocol-stellar-v2": "0.2.122",
16
- "@layerzerolabs/common-utils-stellar-contracts": "0.2.122",
17
- "@layerzerolabs/oapp-macros-stellar-contracts": "0.2.122"
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.122",
21
- "@layerzerolabs/vm-tooling-stellar": "0.2.122"
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
- "lint": "pnpm resolve-dependencies && pnpm exec lz-tool --script \"cargo clippy -- -D warnings\" stellar",
46
- "lint:fix": "pnpm resolve-dependencies && pnpm exec lz-tool --script \"cargo clippy --fix --allow-dirty --allow-staged && cargo fmt\" stellar",
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 resolve-dependencies && pnpm exec lz-tool --script \"cargo nextest run -E 'not test(/^ui_/)'\" stellar",
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
- format_macro_bodies = true
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
- # most of these are unstable, so we enable them
15
- unstable_features = true
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::{buffer_reader::BufferReader, rbac::{RoleBasedAccessControl, AUTHORIZER}};
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
- assert_eq!(result, true);
149
+ assert!(result);
150
150
  let different_sender = Address::generate(&env);
151
151
 
152
152
  // Test with different sender address (should return false)
153
- assert_eq!(oapp_client.is_compose_msg_sender(&origin, &message, &different_sender), false);
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
- assert_eq!(oapp_client.allow_initialize_path(&origin_no_peer), false);
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
- assert_eq!(oapp_client.allow_initialize_path(&origin_match), true);
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
- assert_eq!(oapp_client.allow_initialize_path(&origin_non_match), false);
174
+ assert!(!oapp_client.allow_initialize_path(&origin_non_match));
175
175
  }
176
176
 
177
177
  #[test]
@@ -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
- assert_eq!(params.pay_in_zro, false);
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
- assert_eq!(params.pay_in_zro, true);
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);
@@ -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
- assert!(true);
432
+ // This test verifies that all macro combinations compile successfully.
433
+ // Reaching this point means every macro invocation above compiled.
434
434
  }