@layerzerolabs/protocol-stellar-v2 0.2.8 → 0.2.9

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.
Files changed (239) hide show
  1. package/.turbo/turbo-build.log +443 -302
  2. package/.turbo/turbo-lint.log +118 -96
  3. package/.turbo/turbo-test.log +853 -731
  4. package/Cargo.lock +120 -37
  5. package/Cargo.toml +8 -5
  6. package/contracts/common-macros/src/contract_impl.rs +44 -0
  7. package/contracts/common-macros/src/lib.rs +86 -40
  8. package/contracts/common-macros/src/ownable.rs +24 -32
  9. package/contracts/common-macros/src/storage.rs +95 -120
  10. package/contracts/common-macros/src/tests/contract_impl.rs +289 -0
  11. package/contracts/common-macros/src/tests/mod.rs +9 -0
  12. package/contracts/common-macros/src/tests/ownable.rs +151 -0
  13. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__contract_impl__snapshot_generated_contract_impl_code.snap +85 -0
  14. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__ownable__snapshot_generated_ownable_code.snap +30 -0
  15. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__ownable__snapshot_only_owner_preserves_function_signature.snap +9 -0
  16. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__storage__snapshot_generated_storage_code.snap +1072 -0
  17. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__ttl_configurable__snapshot_generated_ttl_configurable_code.snap +45 -0
  18. package/contracts/common-macros/src/tests/storage.rs +485 -0
  19. package/contracts/common-macros/src/tests/test_helpers.rs +93 -0
  20. package/contracts/common-macros/src/tests/ttl_configurable.rs +34 -0
  21. package/contracts/common-macros/src/ttl_configurable.rs +31 -14
  22. package/contracts/common-macros/src/utils.rs +27 -0
  23. package/contracts/endpoint-v2/ARCHITECTURE.md +4 -4
  24. package/contracts/endpoint-v2/src/endpoint_v2.rs +18 -15
  25. package/contracts/endpoint-v2/src/interfaces/message_lib.rs +2 -3
  26. package/contracts/endpoint-v2/src/interfaces/message_lib_manager.rs +5 -3
  27. package/contracts/endpoint-v2/src/interfaces/messaging_channel.rs +2 -2
  28. package/contracts/endpoint-v2/src/interfaces/messaging_composer.rs +2 -2
  29. package/contracts/endpoint-v2/src/interfaces/send_lib.rs +4 -4
  30. package/contracts/endpoint-v2/src/lib.rs +6 -5
  31. package/contracts/endpoint-v2/src/message_lib_manager.rs +14 -6
  32. package/contracts/endpoint-v2/src/messaging_channel.rs +6 -2
  33. package/contracts/endpoint-v2/src/messaging_composer.rs +6 -2
  34. package/contracts/endpoint-v2/src/storage.rs +10 -7
  35. package/contracts/endpoint-v2/src/tests/endpoint_v2/pay_messaging_fees.rs +16 -16
  36. package/contracts/endpoint-v2/src/tests/endpoint_v2/ttl_config.rs +46 -46
  37. package/contracts/endpoint-v2/src/tests/mock.rs +2 -2
  38. package/contracts/endpoint-v2/src/util.rs +8 -2
  39. package/contracts/message-libs/block-message-lib/Cargo.toml +1 -0
  40. package/contracts/message-libs/block-message-lib/src/lib.rs +5 -5
  41. package/contracts/message-libs/message-lib-common/src/errors.rs +8 -8
  42. package/contracts/message-libs/message-lib-common/src/interfaces/dvn.rs +0 -1
  43. package/contracts/message-libs/message-lib-common/src/interfaces/mod.rs +3 -3
  44. package/contracts/message-libs/message-lib-common/src/lib.rs +0 -2
  45. package/contracts/message-libs/message-lib-common/src/packet_codec_v1.rs +4 -6
  46. package/contracts/message-libs/message-lib-common/src/tests/packet_codec_v1.rs +2 -2
  47. package/contracts/message-libs/message-lib-common/src/tests/worker_options.rs +11 -11
  48. package/contracts/message-libs/message-lib-common/src/worker_options.rs +10 -16
  49. package/contracts/message-libs/simple-message-lib/src/errors.rs +0 -4
  50. package/contracts/message-libs/simple-message-lib/src/simple_message_lib.rs +49 -34
  51. package/contracts/message-libs/simple-message-lib/src/storage.rs +3 -7
  52. package/contracts/message-libs/simple-message-lib/src/test.rs +3 -3
  53. package/contracts/message-libs/treasury/src/storage.rs +1 -2
  54. package/contracts/message-libs/treasury/src/tests/setup.rs +3 -2
  55. package/contracts/message-libs/treasury/src/tests/treasury_tests.rs +0 -13
  56. package/contracts/message-libs/treasury/src/treasury.rs +18 -21
  57. package/contracts/message-libs/uln-302/Cargo.toml +1 -0
  58. package/contracts/message-libs/uln-302/src/interfaces/mod.rs +4 -4
  59. package/contracts/message-libs/uln-302/src/interfaces/{receive.rs → receive_uln.rs} +3 -3
  60. package/contracts/message-libs/uln-302/src/interfaces/{send.rs → send_uln.rs} +8 -80
  61. package/contracts/message-libs/uln-302/src/lib.rs +5 -4
  62. package/contracts/message-libs/uln-302/src/{receive.rs → receive_uln.rs} +20 -12
  63. package/contracts/message-libs/uln-302/src/{send.rs → send_uln.rs} +19 -13
  64. package/contracts/message-libs/uln-302/src/storage.rs +1 -2
  65. package/contracts/message-libs/uln-302/src/tests/config/uln_config.rs +3 -2
  66. package/contracts/message-libs/uln-302/src/tests/send_uln302/send.rs +30 -30
  67. package/contracts/message-libs/uln-302/src/tests/setup.rs +12 -11
  68. package/contracts/message-libs/uln-302/src/tests/uln302/set_config.rs +1 -1
  69. package/contracts/message-libs/uln-302/src/{config_validation.rs → types.rs} +79 -11
  70. package/contracts/message-libs/uln-302/src/uln302.rs +15 -10
  71. package/contracts/oapp-macros/Cargo.toml +2 -8
  72. package/contracts/oapp-macros/src/lib.rs +57 -311
  73. package/contracts/oapp-macros/src/oapp_core.rs +23 -32
  74. package/contracts/oapp-macros/src/oapp_full.rs +8 -2
  75. package/contracts/oapp-macros/src/oapp_options_type3.rs +21 -36
  76. package/contracts/oapp-macros/src/oapp_receiver.rs +38 -57
  77. package/contracts/oapp-macros/src/oapp_sender.rs +12 -14
  78. package/contracts/oapp-macros/src/util.rs +14 -10
  79. package/contracts/oapps/counter/Cargo.toml +2 -1
  80. package/contracts/oapps/counter/integration_tests/utils.rs +4 -4
  81. package/contracts/oapps/counter/src/codec.rs +8 -9
  82. package/contracts/oapps/counter/src/counter.rs +156 -147
  83. package/contracts/oapps/counter/src/storage.rs +1 -2
  84. package/contracts/oapps/counter/src/tests/test_codec.rs +5 -5
  85. package/contracts/oapps/counter/src/tests/test_counter.rs +11 -13
  86. package/contracts/oapps/oapp/Cargo.toml +1 -0
  87. package/contracts/oapps/oapp/src/errors.rs +1 -1
  88. package/contracts/oapps/oapp/src/lib.rs +3 -0
  89. package/contracts/oapps/oapp/src/macro_tests/mod.rs +1 -0
  90. package/contracts/oapps/oapp/src/macro_tests/test_macros.rs +312 -0
  91. package/contracts/oapps/oapp/src/oapp_core.rs +52 -53
  92. package/contracts/oapps/oapp/src/oapp_options_type3.rs +18 -28
  93. package/contracts/oapps/oapp/src/oapp_receiver.rs +82 -31
  94. package/contracts/oapps/oapp/src/oapp_sender.rs +55 -13
  95. package/contracts/oapps/oapp/src/tests/test_oapp_core.rs +16 -3
  96. package/contracts/oapps/oapp/src/tests/test_oapp_options_type3.rs +33 -8
  97. package/contracts/oapps/oapp/src/tests/test_oapp_receiver.rs +6 -9
  98. package/contracts/oapps/oapp/src/tests/test_oapp_sender.rs +28 -15
  99. package/contracts/oapps/oft/Cargo.toml +27 -0
  100. package/contracts/oapps/oft/integration-tests/mod.rs +3 -0
  101. package/contracts/oapps/oft/integration-tests/setup.rs +320 -0
  102. package/contracts/oapps/oft/integration-tests/test_with_sml.rs +155 -0
  103. package/contracts/oapps/oft/integration-tests/utils.rs +201 -0
  104. package/contracts/oapps/oft/src/codec/mod.rs +2 -0
  105. package/contracts/oapps/oft/src/codec/oft_compose_msg_codec.rs +55 -0
  106. package/contracts/oapps/oft/src/codec/oft_msg_codec.rs +62 -0
  107. package/contracts/oapps/oft/src/constants.rs +5 -0
  108. package/contracts/oapps/oft/src/errors.rs +8 -0
  109. package/contracts/oapps/oft/src/events.rs +19 -0
  110. package/contracts/oapps/oft/src/interfaces/mint_burn_token.rs +23 -0
  111. package/contracts/oapps/oft/src/interfaces/mod.rs +3 -0
  112. package/contracts/oapps/oft/src/lib.rs +22 -0
  113. package/contracts/oapps/oft/src/macro_tests/mod.rs +2 -0
  114. package/contracts/oapps/oft/src/macro_tests/test_all_default.rs +41 -0
  115. package/contracts/oapps/oft/src/macro_tests/test_override.rs +83 -0
  116. package/contracts/oapps/oft/src/oft.rs +320 -0
  117. package/contracts/oapps/oft/src/oft_types/lock_unlock.rs +50 -0
  118. package/contracts/oapps/oft/src/oft_types/mint_burn.rs +50 -0
  119. package/contracts/oapps/oft/src/oft_types/mod.rs +10 -0
  120. package/contracts/oapps/oft/src/storage.rs +11 -0
  121. package/contracts/oapps/oft/src/tests/mod.rs +13 -0
  122. package/contracts/oapps/oft/src/tests/test_decimals.rs +89 -0
  123. package/contracts/oapps/oft/src/tests/test_lz_receive.rs +282 -0
  124. package/contracts/oapps/oft/src/tests/test_oft_compose_msg_codec.rs +68 -0
  125. package/contracts/oapps/oft/src/tests/test_oft_msg_codec.rs +136 -0
  126. package/contracts/oapps/oft/src/tests/test_oft_version.rs +13 -0
  127. package/contracts/oapps/oft/src/tests/test_quote_oft.rs +159 -0
  128. package/contracts/oapps/oft/src/tests/test_quote_send.rs +195 -0
  129. package/contracts/oapps/oft/src/tests/test_resolve_address.rs +37 -0
  130. package/contracts/oapps/oft/src/tests/test_send.rs +915 -0
  131. package/contracts/oapps/oft/src/tests/test_token.rs +47 -0
  132. package/contracts/oapps/oft/src/tests/test_utils.rs +789 -0
  133. package/contracts/oapps/oft/src/types.rs +38 -0
  134. package/contracts/oapps/oft/src/utils.rs +67 -0
  135. package/contracts/oapps/oft-mint-burn/Cargo.toml +26 -0
  136. package/contracts/oapps/oft-mint-burn/src/lib.rs +3 -0
  137. package/contracts/oapps/oft-mint-burn/src/oft.rs +28 -0
  138. package/contracts/oapps/oft-mint-burn/src/tests/mod.rs +1 -0
  139. package/contracts/utils/src/buffer_reader.rs +8 -9
  140. package/contracts/utils/src/buffer_writer.rs +11 -5
  141. package/contracts/utils/src/errors.rs +5 -5
  142. package/contracts/utils/src/ownable.rs +14 -6
  143. package/contracts/utils/src/testing_utils.rs +11 -1
  144. package/contracts/utils/src/tests/buffer_reader.rs +491 -730
  145. package/contracts/utils/src/tests/buffer_writer.rs +336 -148
  146. package/contracts/utils/src/tests/bytes_ext.rs +125 -40
  147. package/contracts/utils/src/tests/mod.rs +3 -0
  148. package/contracts/utils/src/tests/ownable.rs +379 -27
  149. package/contracts/utils/src/tests/test_helper.rs +47 -0
  150. package/contracts/utils/src/tests/testing_utils.rs +555 -0
  151. package/contracts/utils/src/tests/ttl.rs +421 -0
  152. package/contracts/utils/src/ttl.rs +29 -89
  153. package/contracts/workers/dvn/Cargo.toml +31 -0
  154. package/contracts/workers/dvn/src/auth.rs +66 -0
  155. package/contracts/workers/dvn/src/dvn.rs +143 -0
  156. package/contracts/workers/dvn/src/errors.rs +21 -0
  157. package/contracts/workers/dvn/src/events.rs +19 -0
  158. package/contracts/workers/dvn/src/interfaces/dvn.rs +12 -0
  159. package/contracts/workers/dvn/src/interfaces/mod.rs +5 -0
  160. package/contracts/workers/dvn/src/interfaces/multisig.rs +15 -0
  161. package/contracts/workers/dvn/src/lib.rs +24 -0
  162. package/contracts/workers/dvn/src/multisig.rs +127 -0
  163. package/contracts/workers/dvn/src/storage.rs +35 -0
  164. package/contracts/workers/dvn/src/tests/auth.rs +237 -0
  165. package/contracts/workers/dvn/src/tests/dvn.rs +349 -0
  166. package/contracts/workers/dvn/src/tests/key_pair.rs +66 -0
  167. package/contracts/workers/dvn/src/tests/mod.rs +5 -0
  168. package/contracts/workers/dvn/src/tests/multisig/mod.rs +3 -0
  169. package/contracts/workers/dvn/src/tests/multisig/set_signer.rs +133 -0
  170. package/contracts/workers/dvn/src/tests/multisig/set_threshold.rs +108 -0
  171. package/contracts/workers/dvn/src/tests/multisig/verify_signatures.rs +109 -0
  172. package/contracts/workers/dvn/src/tests/setup.rs +109 -0
  173. package/contracts/workers/dvn/src/types.rs +26 -0
  174. package/contracts/workers/dvn-fee-lib/Cargo.toml +24 -0
  175. package/contracts/workers/dvn-fee-lib/src/dvn_fee_lib.rs +113 -0
  176. package/contracts/workers/dvn-fee-lib/src/errors.rs +8 -0
  177. package/contracts/workers/dvn-fee-lib/src/lib.rs +17 -0
  178. package/contracts/workers/dvn-fee-lib/src/tests/dvn_fee_lib.rs +282 -0
  179. package/contracts/workers/dvn-fee-lib/src/tests/mod.rs +1 -0
  180. package/contracts/workers/executor/Cargo.toml +10 -7
  181. package/contracts/workers/executor/src/errors.rs +8 -0
  182. package/contracts/workers/executor/src/events.rs +4 -7
  183. package/contracts/workers/executor/src/interfaces/executor.rs +72 -22
  184. package/contracts/workers/executor/src/interfaces/mod.rs +0 -2
  185. package/contracts/workers/executor/src/lib.rs +16 -7
  186. package/contracts/workers/executor/src/lz_executor.rs +308 -0
  187. package/contracts/workers/executor/src/storage.rs +24 -16
  188. package/contracts/workers/executor-fee-lib/Cargo.toml +22 -0
  189. package/contracts/workers/executor-fee-lib/src/errors.rs +15 -0
  190. package/contracts/workers/executor-fee-lib/src/executor_fee_lib.rs +215 -0
  191. package/contracts/workers/executor-fee-lib/src/executor_option.rs +203 -0
  192. package/contracts/workers/executor-fee-lib/src/lib.rs +7 -0
  193. package/contracts/workers/executor-helper/Cargo.toml +29 -0
  194. package/contracts/workers/executor-helper/src/executor_helper.rs +161 -0
  195. package/contracts/workers/executor-helper/src/lib.rs +11 -0
  196. package/contracts/workers/{worker-common → worker}/Cargo.toml +1 -4
  197. package/contracts/workers/worker/src/errors.rs +24 -0
  198. package/contracts/workers/worker/src/events.rs +62 -0
  199. package/contracts/workers/worker/src/interfaces/dvn_fee_lib.rs +75 -0
  200. package/contracts/workers/worker/src/interfaces/executor_fee_lib.rs +84 -0
  201. package/contracts/workers/{worker-common → worker}/src/interfaces/mod.rs +2 -2
  202. package/contracts/workers/worker/src/interfaces/price_feed.rs +85 -0
  203. package/contracts/workers/worker/src/lib.rs +14 -0
  204. package/contracts/workers/worker/src/storage.rs +63 -0
  205. package/contracts/workers/worker/src/worker.rs +459 -0
  206. package/package.json +3 -3
  207. package/sdk/dist/generated/bml.d.ts +88 -17
  208. package/sdk/dist/generated/bml.js +62 -16
  209. package/sdk/dist/generated/counter.d.ts +281 -102
  210. package/sdk/dist/generated/counter.js +93 -41
  211. package/sdk/dist/generated/endpoint.d.ts +128 -105
  212. package/sdk/dist/generated/endpoint.js +47 -45
  213. package/sdk/dist/generated/sml.d.ts +212 -69
  214. package/sdk/dist/generated/sml.js +103 -53
  215. package/sdk/dist/generated/uln302.d.ts +270 -173
  216. package/sdk/dist/generated/uln302.js +112 -64
  217. package/sdk/package.json +11 -11
  218. package/sdk/test/index.test.ts +147 -42
  219. package/sdk/test/suites/constants.ts +7 -3
  220. package/sdk/test/suites/deploy.ts +65 -42
  221. package/sdk/test/suites/localnet.ts +2 -2
  222. package/sdk/test/suites/scan.ts +28 -25
  223. package/sdk/test/utils.ts +199 -0
  224. package/sdk/tsconfig.json +93 -95
  225. package/tools/ts-bindings-gen/src/main.rs +2 -0
  226. package/contracts/common-macros/src/snapshots/common_macros__tests__tests__snapshot_generated_storage_code.snap +0 -310
  227. package/contracts/common-macros/src/tests.rs +0 -287
  228. package/contracts/oapp-macros/tests/test_macros.rs +0 -522
  229. package/contracts/workers/executor/src/executor.rs +0 -347
  230. package/contracts/workers/executor/src/interfaces/types.rs +0 -51
  231. package/contracts/workers/worker-common/src/constants.rs +0 -17
  232. package/contracts/workers/worker-common/src/errors.rs +0 -6
  233. package/contracts/workers/worker-common/src/events.rs +0 -34
  234. package/contracts/workers/worker-common/src/interfaces/executor_fee_lib.rs +0 -35
  235. package/contracts/workers/worker-common/src/interfaces/price_feed.rs +0 -40
  236. package/contracts/workers/worker-common/src/interfaces/worker.rs +0 -60
  237. package/contracts/workers/worker-common/src/lib.rs +0 -19
  238. package/contracts/workers/worker-common/src/storage.rs +0 -32
  239. package/contracts/workers/worker-common/src/worker_common.rs +0 -166
@@ -1,522 +0,0 @@
1
- use common_macros::ownable;
2
- use endpoint_v2::Origin;
3
- use oapp::{
4
- oapp_core::OAppCoreOverrides, oapp_options_type3::OAppOptionsType3Overrides, oapp_receiver::OAppReceiverOverrides,
5
- oapp_sender::OAppSenderOverrides,
6
- };
7
- use oapp_macros::{oapp, oapp_core, oapp_manual_impl, oapp_options_type3, oapp_receiver, oapp_sender};
8
- use soroban_sdk::{contract, Address, Bytes, BytesN, Env};
9
-
10
- // ============================================================================
11
- // Test 1: oapp_core with manual core implementation
12
- // ============================================================================
13
- #[oapp_core]
14
- #[oapp_manual_impl(core)]
15
- struct TestCoreManual;
16
-
17
- impl OAppCoreOverrides for TestCoreManual {
18
- fn __oapp_version(_env: &Env) -> (u64, u64) {
19
- (1, 1)
20
- }
21
- }
22
-
23
- // ============================================================================
24
- // Test 2: oapp_core with default implementation (no manual impl)
25
- // ============================================================================
26
- #[oapp_core]
27
- struct TestCoreDefault;
28
-
29
- // ============================================================================
30
- // Test 3: oapp_sender with default implementation
31
- // ============================================================================
32
- #[oapp_sender]
33
- struct TestSender;
34
-
35
- // ============================================================================
36
- // Test 4: oapp_sender with manual sender implementation
37
- // ============================================================================
38
- #[oapp_sender]
39
- #[oapp_manual_impl(sender)]
40
- struct TestSenderManual;
41
-
42
- impl OAppSenderOverrides for TestSenderManual {
43
- // Custom sender implementation
44
- }
45
-
46
- // ============================================================================
47
- // Test 5: oapp_receiver with default implementation
48
- // ============================================================================
49
- #[oapp_receiver]
50
- struct TestReceiver;
51
-
52
- impl OAppReceiverOverrides for TestReceiver {
53
- fn __lz_receive(
54
- _env: &Env,
55
- _executor: &Address,
56
- _origin: &Origin,
57
- _guid: &BytesN<32>,
58
- _message: &Bytes,
59
- _extra_data: &Bytes,
60
- _value: i128,
61
- ) {
62
- // Required implementation
63
- }
64
- }
65
-
66
- // ============================================================================
67
- // Test 6: oapp_receiver with manual receiver implementation
68
- // ============================================================================
69
- #[oapp_receiver]
70
- struct TestReceiverManual;
71
-
72
- impl OAppReceiverOverrides for TestReceiverManual {
73
- fn __is_compose_msg_sender(_env: &Env, _origin: &Origin, _message: &Bytes, _sender: &Address) -> bool {
74
- // Custom authorization logic
75
- true
76
- }
77
-
78
- fn __allow_initialize_path(_env: &Env, _origin: &Origin) -> bool {
79
- // Custom path initialization logic
80
- true
81
- }
82
-
83
- fn __next_nonce(_env: &Env, _src_eid: u32, _sender: &BytesN<32>) -> u64 {
84
- // Custom nonce ordering - enable ordered delivery
85
- 1
86
- }
87
-
88
- fn __lz_receive(
89
- _env: &Env,
90
- _executor: &Address,
91
- _origin: &Origin,
92
- _guid: &BytesN<32>,
93
- _message: &Bytes,
94
- _extra_data: &Bytes,
95
- _value: i128,
96
- ) {
97
- // Custom implementation
98
- }
99
- }
100
-
101
- // ============================================================================
102
- // Test 7: Standalone oapp_options_type3 with default implementation
103
- // ============================================================================
104
- #[contract]
105
- #[ownable]
106
- #[oapp_options_type3]
107
- struct TestOptionsDefault;
108
-
109
- // ============================================================================
110
- // Test 8: Standalone oapp_options_type3 with manual implementation
111
- // ============================================================================
112
- #[contract]
113
- #[ownable]
114
- #[oapp_options_type3]
115
- #[oapp_manual_impl(options_type3)]
116
- struct TestOptionsManual;
117
-
118
- impl OAppOptionsType3Overrides for TestOptionsManual {
119
- fn __enforced_options(env: &Env, _eid: u32, _msg_type: u32) -> Bytes {
120
- Bytes::new(env)
121
- }
122
- }
123
-
124
- // ============================================================================
125
- // Test 9: Full OApp with all defaults
126
- // ============================================================================
127
- #[oapp]
128
- struct TestFullDefault;
129
-
130
- impl OAppReceiverOverrides for TestFullDefault {
131
- fn __lz_receive(
132
- _env: &Env,
133
- _executor: &Address,
134
- _origin: &Origin,
135
- _guid: &BytesN<32>,
136
- _message: &Bytes,
137
- _extra_data: &Bytes,
138
- _value: i128,
139
- ) {
140
- // Default behavior
141
- }
142
- }
143
-
144
- // ============================================================================
145
- // Test 10: Full OApp with manual core implementation
146
- // ============================================================================
147
- #[oapp]
148
- #[oapp_manual_impl(core)]
149
- struct TestFullManualCore;
150
-
151
- impl OAppCoreOverrides for TestFullManualCore {
152
- fn __oapp_version(_env: &Env) -> (u64, u64) {
153
- (2, 0)
154
- }
155
- }
156
-
157
- impl OAppReceiverOverrides for TestFullManualCore {
158
- fn __lz_receive(
159
- _env: &Env,
160
- _executor: &Address,
161
- _origin: &Origin,
162
- _guid: &BytesN<32>,
163
- _message: &Bytes,
164
- _extra_data: &Bytes,
165
- _value: i128,
166
- ) {
167
- // Custom logic
168
- }
169
- }
170
-
171
- // ============================================================================
172
- // Test 11: Full OApp with manual sender implementation
173
- // ============================================================================
174
- #[oapp]
175
- #[oapp_manual_impl(sender)]
176
- struct TestFullManualSender;
177
-
178
- impl OAppSenderOverrides for TestFullManualSender {
179
- // Custom sender implementation
180
- }
181
-
182
- impl OAppReceiverOverrides for TestFullManualSender {
183
- fn __lz_receive(
184
- _env: &Env,
185
- _executor: &Address,
186
- _origin: &Origin,
187
- _guid: &BytesN<32>,
188
- _message: &Bytes,
189
- _extra_data: &Bytes,
190
- _value: i128,
191
- ) {
192
- // Implementation
193
- }
194
- }
195
-
196
- // ============================================================================
197
- // Test 12: Full OApp with manual receiver implementation
198
- // ============================================================================
199
- #[oapp]
200
- struct TestFullManualReceiver;
201
-
202
- impl OAppReceiverOverrides for TestFullManualReceiver {
203
- fn __lz_receive(
204
- _env: &Env,
205
- _executor: &Address,
206
- _origin: &Origin,
207
- _guid: &BytesN<32>,
208
- _message: &Bytes,
209
- _extra_data: &Bytes,
210
- _value: i128,
211
- ) {
212
- // Implementation
213
- }
214
- }
215
-
216
- // ============================================================================
217
- // Test 13: Full OApp with manual core + sender
218
- // ============================================================================
219
- #[oapp]
220
- #[oapp_manual_impl(core, sender)]
221
- struct TestFullManualCoreSender;
222
-
223
- impl OAppCoreOverrides for TestFullManualCoreSender {
224
- fn __oapp_version(_env: &Env) -> (u64, u64) {
225
- (6, 0)
226
- }
227
- }
228
-
229
- impl OAppSenderOverrides for TestFullManualCoreSender {
230
- // Custom sender implementation
231
- }
232
-
233
- impl OAppReceiverOverrides for TestFullManualCoreSender {
234
- fn __lz_receive(
235
- _env: &Env,
236
- _executor: &Address,
237
- _origin: &Origin,
238
- _guid: &BytesN<32>,
239
- _message: &Bytes,
240
- _extra_data: &Bytes,
241
- _value: i128,
242
- ) {
243
- // Implementation
244
- }
245
- }
246
-
247
- // ============================================================================
248
- // Test 14: Full OApp with manual core + receiver
249
- // ============================================================================
250
- #[oapp]
251
- #[oapp_manual_impl(core)]
252
- struct TestFullManualCoreReceiver;
253
-
254
- impl OAppCoreOverrides for TestFullManualCoreReceiver {
255
- fn __oapp_version(_env: &Env) -> (u64, u64) {
256
- (7, 0)
257
- }
258
- }
259
-
260
- impl OAppReceiverOverrides for TestFullManualCoreReceiver {
261
- fn __lz_receive(
262
- _env: &Env,
263
- _executor: &Address,
264
- _origin: &Origin,
265
- _guid: &BytesN<32>,
266
- _message: &Bytes,
267
- _extra_data: &Bytes,
268
- _value: i128,
269
- ) {
270
- // Implementation
271
- }
272
- }
273
-
274
- // ============================================================================
275
- // Test 15: Full OApp with manual sender + receiver
276
- // ============================================================================
277
- #[oapp]
278
- #[oapp_manual_impl(sender)]
279
- struct TestFullManualSenderReceiver;
280
-
281
- impl OAppSenderOverrides for TestFullManualSenderReceiver {
282
- // Custom sender implementation
283
- }
284
-
285
- impl OAppReceiverOverrides for TestFullManualSenderReceiver {
286
- fn __lz_receive(
287
- _env: &Env,
288
- _executor: &Address,
289
- _origin: &Origin,
290
- _guid: &BytesN<32>,
291
- _message: &Bytes,
292
- _extra_data: &Bytes,
293
- _value: i128,
294
- ) {
295
- // Implementation
296
- }
297
- }
298
-
299
- // ============================================================================
300
- // Test 16: Full OApp with manual core + sender + receiver
301
- // ============================================================================
302
- #[oapp]
303
- #[oapp_manual_impl(core, sender)]
304
- struct TestFullManualAll;
305
-
306
- impl OAppCoreOverrides for TestFullManualAll {
307
- fn __oapp_version(_env: &Env) -> (u64, u64) {
308
- (8, 0)
309
- }
310
- }
311
-
312
- impl OAppSenderOverrides for TestFullManualAll {
313
- // Custom sender implementation
314
- }
315
-
316
- impl OAppReceiverOverrides for TestFullManualAll {
317
- fn __lz_receive(
318
- _env: &Env,
319
- _executor: &Address,
320
- _origin: &Origin,
321
- _guid: &BytesN<32>,
322
- _message: &Bytes,
323
- _extra_data: &Bytes,
324
- _value: i128,
325
- ) {
326
- // Implementation
327
- }
328
- }
329
-
330
- // ============================================================================
331
- // Test 17: Full OApp with options_type3 (both default)
332
- // ============================================================================
333
- #[oapp]
334
- #[oapp_options_type3]
335
- struct TestFullWithOptionsDefault;
336
-
337
- impl OAppReceiverOverrides for TestFullWithOptionsDefault {
338
- fn __lz_receive(
339
- _env: &Env,
340
- _executor: &Address,
341
- _origin: &Origin,
342
- _guid: &BytesN<32>,
343
- _message: &Bytes,
344
- _extra_data: &Bytes,
345
- _value: i128,
346
- ) {
347
- // Implementation
348
- }
349
- }
350
-
351
- // ============================================================================
352
- // Test 18: Full OApp with options_type3 (manual options implementation)
353
- // ============================================================================
354
- #[oapp]
355
- #[oapp_options_type3]
356
- #[oapp_manual_impl(options_type3)]
357
- struct TestFullWithOptionsManual;
358
-
359
- impl OAppReceiverOverrides for TestFullWithOptionsManual {
360
- fn __lz_receive(
361
- _env: &Env,
362
- _executor: &Address,
363
- _origin: &Origin,
364
- _guid: &BytesN<32>,
365
- _message: &Bytes,
366
- _extra_data: &Bytes,
367
- _value: i128,
368
- ) {
369
- // Implementation
370
- }
371
- }
372
-
373
- impl OAppOptionsType3Overrides for TestFullWithOptionsManual {
374
- // Custom options implementation
375
- }
376
-
377
- // ============================================================================
378
- // Test 19: Full OApp with options_type3 (manual receiver)
379
- // ============================================================================
380
- #[oapp]
381
- #[oapp_options_type3]
382
- struct TestFullWithOptionsManualReceiver;
383
-
384
- impl OAppReceiverOverrides for TestFullWithOptionsManualReceiver {
385
- fn __lz_receive(
386
- _env: &Env,
387
- _executor: &Address,
388
- _origin: &Origin,
389
- _guid: &BytesN<32>,
390
- _message: &Bytes,
391
- _extra_data: &Bytes,
392
- _value: i128,
393
- ) {
394
- // Implementation
395
- }
396
- }
397
-
398
- // ============================================================================
399
- // Test 20: Core + Options with manual core
400
- // ============================================================================
401
- #[oapp_core]
402
- #[oapp_options_type3]
403
- #[oapp_manual_impl(core)]
404
- struct TestCoreOptionsManualCore;
405
-
406
- impl OAppCoreOverrides for TestCoreOptionsManualCore {
407
- fn __oapp_version(_env: &Env) -> (u64, u64) {
408
- (3, 0)
409
- }
410
- }
411
-
412
- // ============================================================================
413
- // Test 21: Core + Options with manual options
414
- // ============================================================================
415
- #[oapp_core]
416
- #[oapp_options_type3]
417
- #[oapp_manual_impl(options_type3)]
418
- struct TestCoreOptionsManualOptions;
419
-
420
- impl OAppOptionsType3Overrides for TestCoreOptionsManualOptions {
421
- // Custom options implementation
422
- }
423
-
424
- // ============================================================================
425
- // Test 22: Core + Options with both manual implementations
426
- // ============================================================================
427
- #[oapp_core]
428
- #[oapp_options_type3]
429
- #[oapp_manual_impl(core, options_type3)]
430
- struct TestCoreOptionsBothManual;
431
-
432
- impl OAppCoreOverrides for TestCoreOptionsBothManual {
433
- fn __oapp_version(_env: &Env) -> (u64, u64) {
434
- (4, 0)
435
- }
436
- }
437
-
438
- impl OAppOptionsType3Overrides for TestCoreOptionsBothManual {
439
- // Custom options implementation
440
- }
441
-
442
- // ============================================================================
443
- // Test 23: Full OApp with all manual implementations (without receiver)
444
- // ============================================================================
445
- #[oapp]
446
- #[oapp_options_type3]
447
- #[oapp_manual_impl(core, sender, options_type3)]
448
- struct TestFullWithOptionsAllManualExceptReceiver;
449
-
450
- impl OAppCoreOverrides for TestFullWithOptionsAllManualExceptReceiver {
451
- fn __oapp_version(_env: &Env) -> (u64, u64) {
452
- (5, 0)
453
- }
454
- }
455
-
456
- impl OAppSenderOverrides for TestFullWithOptionsAllManualExceptReceiver {
457
- // Custom sender implementation
458
- }
459
-
460
- impl OAppReceiverOverrides for TestFullWithOptionsAllManualExceptReceiver {
461
- fn __lz_receive(
462
- _env: &Env,
463
- _executor: &Address,
464
- _origin: &Origin,
465
- _guid: &BytesN<32>,
466
- _message: &Bytes,
467
- _extra_data: &Bytes,
468
- _value: i128,
469
- ) {
470
- // Custom receiver implementation
471
- }
472
- }
473
-
474
- impl OAppOptionsType3Overrides for TestFullWithOptionsAllManualExceptReceiver {
475
- // Custom options implementation
476
- }
477
-
478
- // ============================================================================
479
- // Test 24: Full OApp with absolutely all manual implementations
480
- // ============================================================================
481
- #[oapp]
482
- #[oapp_options_type3]
483
- #[oapp_manual_impl(core, sender, options_type3)]
484
- struct TestFullWithOptionsAllManual;
485
-
486
- impl OAppCoreOverrides for TestFullWithOptionsAllManual {
487
- fn __oapp_version(_env: &Env) -> (u64, u64) {
488
- (6, 0)
489
- }
490
- }
491
-
492
- impl OAppSenderOverrides for TestFullWithOptionsAllManual {
493
- // Custom sender implementation
494
- }
495
-
496
- impl OAppReceiverOverrides for TestFullWithOptionsAllManual {
497
- fn __lz_receive(
498
- _env: &Env,
499
- _executor: &Address,
500
- _origin: &Origin,
501
- _guid: &BytesN<32>,
502
- _message: &Bytes,
503
- _extra_data: &Bytes,
504
- _value: i128,
505
- ) {
506
- // Custom receiver implementation
507
- }
508
- }
509
-
510
- impl OAppOptionsType3Overrides for TestFullWithOptionsAllManual {
511
- // Custom options implementation
512
- }
513
-
514
- // ============================================================================
515
- // Tests
516
- // ============================================================================
517
-
518
- #[test]
519
- fn test_macros_compile() {
520
- // This test verifies that all macro combinations compile successfully
521
- assert!(true);
522
- }