@layerzerolabs/protocol-stellar-v2 0.2.40 → 0.2.43

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 (129) hide show
  1. package/.turbo/turbo-build.log +312 -397
  2. package/.turbo/turbo-lint.log +185 -245
  3. package/.turbo/turbo-test.log +1846 -1942
  4. package/Cargo.lock +22 -127
  5. package/Cargo.toml +4 -6
  6. package/contracts/common-macros/src/lib.rs +38 -15
  7. package/contracts/common-macros/src/lz_contract.rs +12 -21
  8. package/contracts/common-macros/src/tests/lz_contract.rs +17 -8
  9. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__lz_contract__snapshot_generated_lz_contract_code.snap +20 -0
  10. package/contracts/common-macros/src/upgradeable.rs +37 -30
  11. package/contracts/endpoint-v2/src/endpoint_v2.rs +4 -3
  12. package/contracts/endpoint-v2/src/errors.rs +2 -2
  13. package/contracts/endpoint-v2/src/messaging_channel.rs +11 -0
  14. package/contracts/endpoint-v2/src/messaging_composer.rs +1 -0
  15. package/contracts/endpoint-v2/src/tests/endpoint_v2/clear.rs +12 -25
  16. package/contracts/endpoint-v2/src/tests/endpoint_v2/initializable.rs +4 -4
  17. package/contracts/endpoint-v2/src/tests/endpoint_v2/verifiable.rs +50 -10
  18. package/contracts/endpoint-v2/src/tests/endpoint_v2/verify.rs +6 -35
  19. package/contracts/endpoint-v2/src/tests/messaging_channel/burn.rs +2 -2
  20. package/contracts/endpoint-v2/src/tests/messaging_channel/clear_payload.rs +50 -1
  21. package/contracts/endpoint-v2/src/tests/messaging_channel/inbound.rs +78 -0
  22. package/contracts/endpoint-v2/src/tests/messaging_channel/insert_and_drain_pending_nonces.rs +272 -0
  23. package/contracts/endpoint-v2/src/tests/messaging_channel/mod.rs +1 -0
  24. package/contracts/endpoint-v2/src/tests/messaging_channel/nilify.rs +10 -5
  25. package/contracts/endpoint-v2/src/tests/messaging_channel/skip.rs +30 -0
  26. package/contracts/macro-integration-tests/tests/runtime/oapp/mod.rs +25 -6
  27. package/contracts/macro-integration-tests/tests/runtime/oapp/oapp_core.rs +13 -11
  28. package/contracts/macro-integration-tests/tests/runtime/oapp/options_type3.rs +13 -10
  29. package/contracts/macro-integration-tests/tests/runtime/oapp/receiver.rs +15 -11
  30. package/contracts/macro-integration-tests/tests/runtime/oapp/sender.rs +5 -3
  31. package/contracts/macro-integration-tests/tests/runtime/ownable/mod.rs +1 -1
  32. package/contracts/macro-integration-tests/tests/runtime/ownable/two_step_transfer.rs +14 -12
  33. package/contracts/macro-integration-tests/tests/runtime/upgradeable/migrate_guard_and_state.rs +3 -9
  34. package/contracts/macro-integration-tests/tests/ui/lz_contract/fail/upgradeable_invalid_inner_option.stderr +24 -1
  35. package/contracts/macro-integration-tests/tests/ui/lz_contract/fail/upgradeable_missing_internal.stderr +3 -3
  36. package/contracts/macro-integration-tests/tests/ui/lz_contract/pass/upgradeable_rbac.rs +44 -0
  37. package/contracts/macro-integration-tests/tests/ui/oapp/fail/missing_auth_trait.rs +28 -0
  38. package/contracts/macro-integration-tests/tests/ui/oapp/fail/missing_auth_trait.stderr +397 -0
  39. package/contracts/macro-integration-tests/tests/ui/oapp/fail/missing_lz_receive_internal.rs +1 -0
  40. package/contracts/macro-integration-tests/tests/ui/oapp/fail/missing_lz_receive_internal.stderr +10 -10
  41. package/contracts/macro-integration-tests/tests/ui/oapp/pass/custom_all.rs +4 -0
  42. package/contracts/macro-integration-tests/tests/ui/oapp/pass/custom_single_trait.rs +7 -0
  43. package/contracts/macro-integration-tests/tests/ui/oapp/pass/minimal_contract.rs +5 -4
  44. package/contracts/macro-integration-tests/tests/ui/oapp/pass/struct_with_fields.rs +2 -0
  45. package/contracts/macro-integration-tests/tests/ui/ownable/pass/basic.rs +1 -1
  46. package/contracts/macro-integration-tests/tests/ui/upgradeable/fail/attr_args.stderr +1 -1
  47. package/contracts/macro-integration-tests/tests/ui/upgradeable/fail/missing_auth_trait.stderr +2 -2
  48. package/contracts/macro-integration-tests/tests/ui/upgradeable/fail/missing_upgradeable_internal.stderr +2 -2
  49. package/contracts/macro-integration-tests/tests/ui/upgradeable/pass/rbac.rs +44 -0
  50. package/contracts/oapps/counter/integration_tests/utils.rs +5 -3
  51. package/contracts/oapps/counter/src/counter.rs +4 -3
  52. package/contracts/oapps/counter/src/tests/mod.rs +16 -1
  53. package/contracts/oapps/counter/src/tests/test_counter.rs +5 -2
  54. package/contracts/oapps/oapp/src/oapp_core.rs +22 -8
  55. package/contracts/oapps/oapp/src/oapp_options_type3.rs +7 -5
  56. package/contracts/oapps/oapp/src/tests/mod.rs +21 -0
  57. package/contracts/oapps/oapp/src/tests/oapp_core.rs +14 -11
  58. package/contracts/oapps/oapp/src/tests/oapp_options_type3.rs +17 -10
  59. package/contracts/oapps/oapp/src/tests/oapp_receiver.rs +6 -3
  60. package/contracts/oapps/oapp/src/tests/oapp_sender.rs +5 -3
  61. package/contracts/oapps/oapp/src/tests/test_macros.rs +25 -0
  62. package/contracts/oapps/oapp-macros/src/generators.rs +12 -9
  63. package/contracts/oapps/oapp-macros/src/lib.rs +1 -1
  64. package/contracts/oapps/oapp-macros/src/tests/snapshots/oapp_macros__tests__oapp__snapshot_generate_oapp.snap +15 -7
  65. package/contracts/oapps/oft/integration-tests/setup.rs +22 -4
  66. package/contracts/oapps/oft/integration-tests/utils.rs +94 -13
  67. package/contracts/oapps/oft/src/extensions/oft_fee.rs +23 -10
  68. package/contracts/oapps/oft/src/extensions/pausable.rs +31 -10
  69. package/contracts/oapps/oft/src/extensions/rate_limiter.rs +9 -4
  70. package/contracts/oapps/oft/src/oft.rs +3 -3
  71. package/contracts/oapps/oft/src/tests/extensions/oft_fee.rs +39 -27
  72. package/contracts/oapps/oft/src/tests/extensions/pausable.rs +38 -24
  73. package/contracts/oapps/oft/src/tests/extensions/rate_limiter.rs +87 -69
  74. package/contracts/oapps/oft/src/tests/oft_types/lock_unlock.rs +1 -0
  75. package/contracts/oapps/oft-core/integration-tests/setup.rs +28 -3
  76. package/contracts/oapps/oft-core/src/oft_core.rs +11 -6
  77. package/contracts/oapps/oft-core/src/tests/test_msg_inspector.rs +20 -20
  78. package/contracts/oapps/oft-core/src/tests/test_utils.rs +33 -3
  79. package/contracts/upgrader/src/lib.rs +67 -30
  80. package/contracts/upgrader/src/tests/test_data/test_upgradeable_contract3.wasm +0 -0
  81. package/contracts/upgrader/src/tests/test_data/test_upgradeable_contract4.wasm +0 -0
  82. package/contracts/upgrader/src/tests/test_upgrader.rs +50 -4
  83. package/contracts/utils/src/ownable.rs +16 -5
  84. package/contracts/utils/src/tests/ownable.rs +39 -39
  85. package/contracts/utils/src/upgradeable.rs +60 -17
  86. package/docs/oapp-guide.md +18 -13
  87. package/package.json +5 -5
  88. package/sdk/.turbo/turbo-test.log +359 -348
  89. package/sdk/dist/generated/bml.d.ts +4 -4
  90. package/sdk/dist/generated/bml.js +6 -6
  91. package/sdk/dist/generated/counter.d.ts +269 -123
  92. package/sdk/dist/generated/counter.js +45 -25
  93. package/sdk/dist/generated/dvn.d.ts +4 -6
  94. package/sdk/dist/generated/dvn.js +8 -8
  95. package/sdk/dist/generated/dvn_fee_lib.d.ts +8 -10
  96. package/sdk/dist/generated/dvn_fee_lib.js +8 -8
  97. package/sdk/dist/generated/endpoint.d.ts +9 -9
  98. package/sdk/dist/generated/endpoint.js +9 -9
  99. package/sdk/dist/generated/executor.d.ts +9 -11
  100. package/sdk/dist/generated/executor.js +11 -11
  101. package/sdk/dist/generated/executor_fee_lib.d.ts +9 -11
  102. package/sdk/dist/generated/executor_fee_lib.js +11 -11
  103. package/sdk/dist/generated/executor_helper.d.ts +4 -4
  104. package/sdk/dist/generated/executor_helper.js +6 -6
  105. package/sdk/dist/generated/layerzero_view.d.ts +9 -11
  106. package/sdk/dist/generated/layerzero_view.js +11 -11
  107. package/sdk/dist/generated/oft.d.ts +323 -156
  108. package/sdk/dist/generated/oft.js +65 -43
  109. package/sdk/dist/generated/price_feed.d.ts +8 -10
  110. package/sdk/dist/generated/price_feed.js +8 -8
  111. package/sdk/dist/generated/sac_manager.d.ts +8 -8
  112. package/sdk/dist/generated/sac_manager.js +6 -6
  113. package/sdk/dist/generated/sml.d.ts +9 -9
  114. package/sdk/dist/generated/sml.js +9 -9
  115. package/sdk/dist/generated/treasury.d.ts +9 -9
  116. package/sdk/dist/generated/treasury.js +9 -9
  117. package/sdk/dist/generated/uln302.d.ts +9 -9
  118. package/sdk/dist/generated/uln302.js +9 -9
  119. package/sdk/dist/generated/upgrader.d.ts +25 -16
  120. package/sdk/dist/generated/upgrader.js +5 -5
  121. package/sdk/package.json +1 -1
  122. package/sdk/test/counter-sml.test.ts +20 -0
  123. package/sdk/test/counter-uln.test.ts +20 -0
  124. package/sdk/test/oft-sml.test.ts +22 -0
  125. package/sdk/test/upgrader.test.ts +1 -0
  126. package/ts-bindings-gen.toml +67 -0
  127. package/turbo.json +1 -8
  128. package/tools/ts-bindings-gen/Cargo.toml +0 -16
  129. package/tools/ts-bindings-gen/src/main.rs +0 -214
@@ -0,0 +1,397 @@
1
+ error[E0412]: cannot find type `MyOAppClient` in this scope
2
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:12:1
3
+ |
4
+ 12 | #[oapp]
5
+ | ^^^^^^^ not found in this scope
6
+ |
7
+ = note: this error originates in the attribute macro `soroban_sdk::contractclient` (in Nightly builds, run with -Z macro-backtrace for more info)
8
+
9
+ error[E0412]: cannot find type `MyOAppArgs` in this scope
10
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:12:1
11
+ |
12
+ 12 | #[oapp]
13
+ | ^^^^^^^ not found in this scope
14
+ |
15
+ = note: this error originates in the attribute macro `soroban_sdk::contractargs` (in Nightly builds, run with -Z macro-backtrace for more info)
16
+
17
+ error[E0412]: cannot find type `MyOAppClient` in this scope
18
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:12:1
19
+ |
20
+ 12 | #[oapp]
21
+ | ^^^^^^^ not found in this scope
22
+ |
23
+ = note: this error originates in the macro `soroban_sdk::contractimpl_trait_default_fns_not_overridden` which comes from the expansion of the attribute macro `oapp` (in Nightly builds, run with -Z macro-backtrace for more info)
24
+
25
+ error[E0412]: cannot find type `MyOAppArgs` in this scope
26
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:12:1
27
+ |
28
+ 12 | #[oapp]
29
+ | ^^^^^^^ not found in this scope
30
+ |
31
+ = note: this error originates in the macro `soroban_sdk::contractimpl_trait_default_fns_not_overridden` which comes from the expansion of the attribute macro `oapp` (in Nightly builds, run with -Z macro-backtrace for more info)
32
+
33
+ error[E0412]: cannot find type `MyOAppClient` in this scope
34
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:12:1
35
+ |
36
+ 12 | #[oapp]
37
+ | ^^^^^^^ not found in this scope
38
+ |
39
+ = note: this error originates in the macro `soroban_sdk::contractimpl_trait_default_fns_not_overridden` which comes from the expansion of the attribute macro `oapp` (in Nightly builds, run with -Z macro-backtrace for more info)
40
+
41
+ error[E0412]: cannot find type `MyOAppArgs` in this scope
42
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:12:1
43
+ |
44
+ 12 | #[oapp]
45
+ | ^^^^^^^ not found in this scope
46
+ |
47
+ = note: this error originates in the macro `soroban_sdk::contractimpl_trait_default_fns_not_overridden` which comes from the expansion of the attribute macro `oapp` (in Nightly builds, run with -Z macro-backtrace for more info)
48
+
49
+ error[E0412]: cannot find type `MyOAppClient` in this scope
50
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:12:1
51
+ |
52
+ 12 | #[oapp]
53
+ | ^^^^^^^ not found in this scope
54
+ |
55
+ = note: this error originates in the macro `soroban_sdk::contractimpl_trait_default_fns_not_overridden` which comes from the expansion of the attribute macro `oapp` (in Nightly builds, run with -Z macro-backtrace for more info)
56
+
57
+ error[E0412]: cannot find type `MyOAppArgs` in this scope
58
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:12:1
59
+ |
60
+ 12 | #[oapp]
61
+ | ^^^^^^^ not found in this scope
62
+ |
63
+ = note: this error originates in the macro `soroban_sdk::contractimpl_trait_default_fns_not_overridden` which comes from the expansion of the attribute macro `oapp` (in Nightly builds, run with -Z macro-backtrace for more info)
64
+
65
+ error[E0412]: cannot find type `MyOAppClient` in this scope
66
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:12:1
67
+ |
68
+ 12 | #[oapp]
69
+ | ^^^^^^^ not found in this scope
70
+ |
71
+ = note: this error originates in the macro `soroban_sdk::contractimpl_trait_default_fns_not_overridden` which comes from the expansion of the attribute macro `oapp` (in Nightly builds, run with -Z macro-backtrace for more info)
72
+
73
+ error[E0412]: cannot find type `MyOAppArgs` in this scope
74
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:12:1
75
+ |
76
+ 12 | #[oapp]
77
+ | ^^^^^^^ not found in this scope
78
+ |
79
+ = note: this error originates in the macro `soroban_sdk::contractimpl_trait_default_fns_not_overridden` which comes from the expansion of the attribute macro `oapp` (in Nightly builds, run with -Z macro-backtrace for more info)
80
+
81
+ error[E0277]: the trait bound `MyOApp: Ownable` is not satisfied
82
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:13:12
83
+ |
84
+ 13 | pub struct MyOApp;
85
+ | ^^^^^^ the trait `Ownable` is not implemented for `MyOApp`
86
+ |
87
+ = help: the trait `Ownable` is implemented for `EndpointV2`
88
+ note: required by a bound in `OAppCore`
89
+ --> $WORKSPACE/contracts/oapps/oapp/src/oapp_core.rs
90
+ |
91
+ | pub trait OAppCore: Ownable + RoleBasedAccessControl {
92
+ | ^^^^^^^ required by this bound in `OAppCore`
93
+
94
+ error[E0277]: the trait bound `MyOApp: utils::auth::Auth` is not satisfied
95
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:13:12
96
+ |
97
+ 13 | pub struct MyOApp;
98
+ | ^^^^^^ the trait `utils::auth::Auth` is not implemented for `MyOApp`
99
+ |
100
+ = help: the trait `utils::auth::Auth` is implemented for `EndpointV2`
101
+ note: required by a bound in `RoleBasedAccessControl`
102
+ --> $WORKSPACE/contracts/utils/src/rbac.rs
103
+ |
104
+ | pub trait RoleBasedAccessControl: Auth {
105
+ | ^^^^ required by this bound in `RoleBasedAccessControl`
106
+
107
+ error[E0277]: the trait bound `MyOApp: Ownable` is not satisfied
108
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:13:12
109
+ |
110
+ 13 | pub struct MyOApp;
111
+ | ^^^^^^ the trait `Ownable` is not implemented for `MyOApp`
112
+ |
113
+ = help: the trait `Ownable` is implemented for `EndpointV2`
114
+ = note: required for `MyOApp` to implement `OAppCore`
115
+ note: required by a bound in `OAppSenderInternal`
116
+ --> $WORKSPACE/contracts/oapps/oapp/src/oapp_sender.rs
117
+ |
118
+ | pub trait OAppSenderInternal: OAppCore {
119
+ | ^^^^^^^^ required by this bound in `OAppSenderInternal`
120
+
121
+ error[E0277]: the trait bound `MyOApp: Ownable` is not satisfied
122
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:13:12
123
+ |
124
+ 13 | pub struct MyOApp;
125
+ | ^^^^^^ the trait `Ownable` is not implemented for `MyOApp`
126
+ |
127
+ = help: the trait `Ownable` is implemented for `EndpointV2`
128
+ = note: required for `MyOApp` to implement `OAppCore`
129
+ note: required by a bound in `OAppReceiver`
130
+ --> $WORKSPACE/contracts/oapps/oapp/src/oapp_receiver.rs
131
+ |
132
+ | pub trait OAppReceiver: OAppCore + LzReceiveInternal {
133
+ | ^^^^^^^^ required by this bound in `OAppReceiver`
134
+
135
+ error[E0277]: the trait bound `MyOApp: utils::auth::Auth` is not satisfied
136
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:13:12
137
+ |
138
+ 13 | pub struct MyOApp;
139
+ | ^^^^^^ the trait `utils::auth::Auth` is not implemented for `MyOApp`
140
+ |
141
+ = help: the trait `utils::auth::Auth` is implemented for `EndpointV2`
142
+ = note: required for `MyOApp` to implement `RoleBasedAccessControl`
143
+ note: required by a bound in `OAppOptionsType3`
144
+ --> $WORKSPACE/contracts/oapps/oapp/src/oapp_options_type3.rs
145
+ |
146
+ | pub trait OAppOptionsType3: RoleBasedAccessControl {
147
+ | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `OAppOptionsType3`
148
+
149
+ error[E0277]: the trait bound `MyOApp: Ownable` is not satisfied
150
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:13:12
151
+ |
152
+ 13 | pub struct MyOApp;
153
+ | ^^^^^^ the trait `Ownable` is not implemented for `MyOApp`
154
+ |
155
+ = help: the trait `Ownable` is implemented for `EndpointV2`
156
+ note: required by a bound in `oapp_version`
157
+ --> $WORKSPACE/contracts/oapps/oapp/src/oapp_core.rs
158
+ |
159
+ | pub trait OAppCore: Ownable + RoleBasedAccessControl {
160
+ | ^^^^^^^ required by this bound in `OAppCore::oapp_version`
161
+ ...
162
+ | fn oapp_version(_env: &soroban_sdk::Env) -> (u64, u64) {
163
+ | ------------ required by a bound in this associated function
164
+
165
+ error[E0277]: the trait bound `MyOApp: Ownable` is not satisfied
166
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:13:12
167
+ |
168
+ 13 | pub struct MyOApp;
169
+ | ^^^^^^ the trait `Ownable` is not implemented for `MyOApp`
170
+ |
171
+ = help: the trait `Ownable` is implemented for `EndpointV2`
172
+ note: required by a bound in `endpoint`
173
+ --> $WORKSPACE/contracts/oapps/oapp/src/oapp_core.rs
174
+ |
175
+ | pub trait OAppCore: Ownable + RoleBasedAccessControl {
176
+ | ^^^^^^^ required by this bound in `OAppCore::endpoint`
177
+ ...
178
+ | fn endpoint(env: &soroban_sdk::Env) -> soroban_sdk::Address {
179
+ | -------- required by a bound in this associated function
180
+
181
+ error[E0277]: the trait bound `MyOApp: Ownable` is not satisfied
182
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:13:12
183
+ |
184
+ 13 | pub struct MyOApp;
185
+ | ^^^^^^ the trait `Ownable` is not implemented for `MyOApp`
186
+ |
187
+ = help: the trait `Ownable` is implemented for `EndpointV2`
188
+ note: required by a bound in `peer`
189
+ --> $WORKSPACE/contracts/oapps/oapp/src/oapp_core.rs
190
+ |
191
+ | pub trait OAppCore: Ownable + RoleBasedAccessControl {
192
+ | ^^^^^^^ required by this bound in `OAppCore::peer`
193
+ ...
194
+ | fn peer(env: &soroban_sdk::Env, eid: u32) -> Option<soroban_sdk::BytesN<32>> {
195
+ | ---- required by a bound in this associated function
196
+
197
+ error[E0277]: the trait bound `MyOApp: Ownable` is not satisfied
198
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:13:12
199
+ |
200
+ 13 | pub struct MyOApp;
201
+ | ^^^^^^ the trait `Ownable` is not implemented for `MyOApp`
202
+ |
203
+ = help: the trait `Ownable` is implemented for `EndpointV2`
204
+ note: required by a bound in `set_peer`
205
+ --> $WORKSPACE/contracts/oapps/oapp/src/oapp_core.rs
206
+ |
207
+ | pub trait OAppCore: Ownable + RoleBasedAccessControl {
208
+ | ^^^^^^^ required by this bound in `OAppCore::set_peer`
209
+ ...
210
+ | fn set_peer(
211
+ | -------- required by a bound in this associated function
212
+
213
+ error[E0277]: the trait bound `MyOApp: Ownable` is not satisfied
214
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:13:12
215
+ |
216
+ 13 | pub struct MyOApp;
217
+ | ^^^^^^ the trait `Ownable` is not implemented for `MyOApp`
218
+ |
219
+ = help: the trait `Ownable` is implemented for `EndpointV2`
220
+ note: required by a bound in `oapp::oapp_core::OAppCore::set_delegate`
221
+ --> $WORKSPACE/contracts/oapps/oapp/src/oapp_core.rs
222
+ |
223
+ | pub trait OAppCore: Ownable + RoleBasedAccessControl {
224
+ | ^^^^^^^ required by this bound in `OAppCore::set_delegate`
225
+ ...
226
+ | fn set_delegate(env: &soroban_sdk::Env, delegate: &Option<soroban_sdk::Address>, operator: &soroban_sdk::Address) {
227
+ | ------------ required by a bound in this associated function
228
+
229
+ error[E0277]: the trait bound `MyOApp: ContractFunctionRegister` is not satisfied
230
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:13:12
231
+ |
232
+ 13 | pub struct MyOApp;
233
+ | ^^^^^^ the trait `ContractFunctionRegister` is not implemented for `MyOApp`
234
+ |
235
+ = help: the following other types implement trait `ContractFunctionRegister`:
236
+ EndpointV2
237
+ MockAuthContract
238
+
239
+ error[E0277]: the trait bound `MyOApp: utils::auth::Auth` is not satisfied
240
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:13:12
241
+ |
242
+ 13 | pub struct MyOApp;
243
+ | ^^^^^^ the trait `utils::auth::Auth` is not implemented for `MyOApp`
244
+ |
245
+ = help: the trait `utils::auth::Auth` is implemented for `EndpointV2`
246
+ note: required by a bound in `grant_role`
247
+ --> $WORKSPACE/contracts/utils/src/rbac.rs
248
+ |
249
+ | pub trait RoleBasedAccessControl: Auth {
250
+ | ^^^^ required by this bound in `RoleBasedAccessControl::grant_role`
251
+ ...
252
+ | fn grant_role(
253
+ | ---------- required by a bound in this associated function
254
+
255
+ error[E0277]: the trait bound `MyOApp: utils::auth::Auth` is not satisfied
256
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:13:12
257
+ |
258
+ 13 | pub struct MyOApp;
259
+ | ^^^^^^ the trait `utils::auth::Auth` is not implemented for `MyOApp`
260
+ |
261
+ = help: the trait `utils::auth::Auth` is implemented for `EndpointV2`
262
+ note: required by a bound in `revoke_role`
263
+ --> $WORKSPACE/contracts/utils/src/rbac.rs
264
+ |
265
+ | pub trait RoleBasedAccessControl: Auth {
266
+ | ^^^^ required by this bound in `RoleBasedAccessControl::revoke_role`
267
+ ...
268
+ | fn revoke_role(
269
+ | ----------- required by a bound in this associated function
270
+
271
+ error[E0277]: the trait bound `MyOApp: utils::auth::Auth` is not satisfied
272
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:13:12
273
+ |
274
+ 13 | pub struct MyOApp;
275
+ | ^^^^^^ the trait `utils::auth::Auth` is not implemented for `MyOApp`
276
+ |
277
+ = help: the trait `utils::auth::Auth` is implemented for `EndpointV2`
278
+ note: required by a bound in `renounce_role`
279
+ --> $WORKSPACE/contracts/utils/src/rbac.rs
280
+ |
281
+ | pub trait RoleBasedAccessControl: Auth {
282
+ | ^^^^ required by this bound in `RoleBasedAccessControl::renounce_role`
283
+ ...
284
+ | fn renounce_role(env: &soroban_sdk::Env, role: &soroban_sdk::Symbol, caller: &soroban_sdk::Address) {
285
+ | ------------- required by a bound in this associated function
286
+
287
+ error[E0277]: the trait bound `MyOApp: utils::auth::Auth` is not satisfied
288
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:13:12
289
+ |
290
+ 13 | pub struct MyOApp;
291
+ | ^^^^^^ the trait `utils::auth::Auth` is not implemented for `MyOApp`
292
+ |
293
+ = help: the trait `utils::auth::Auth` is implemented for `EndpointV2`
294
+ note: required by a bound in `set_role_admin`
295
+ --> $WORKSPACE/contracts/utils/src/rbac.rs
296
+ |
297
+ | pub trait RoleBasedAccessControl: Auth {
298
+ | ^^^^ required by this bound in `RoleBasedAccessControl::set_role_admin`
299
+ ...
300
+ | fn set_role_admin(env: &soroban_sdk::Env, role: &soroban_sdk::Symbol, admin_role: &soroban_sdk::Symbol) {
301
+ | -------------- required by a bound in this associated function
302
+
303
+ error[E0277]: the trait bound `MyOApp: utils::auth::Auth` is not satisfied
304
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:13:12
305
+ |
306
+ 13 | pub struct MyOApp;
307
+ | ^^^^^^ the trait `utils::auth::Auth` is not implemented for `MyOApp`
308
+ |
309
+ = help: the trait `utils::auth::Auth` is implemented for `EndpointV2`
310
+ note: required by a bound in `remove_role_admin`
311
+ --> $WORKSPACE/contracts/utils/src/rbac.rs
312
+ |
313
+ | pub trait RoleBasedAccessControl: Auth {
314
+ | ^^^^ required by this bound in `RoleBasedAccessControl::remove_role_admin`
315
+ ...
316
+ | fn remove_role_admin(env: &soroban_sdk::Env, role: &soroban_sdk::Symbol) {
317
+ | ----------------- required by a bound in this associated function
318
+
319
+ error[E0277]: the trait bound `MyOApp: utils::auth::Auth` is not satisfied
320
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:13:12
321
+ |
322
+ 13 | pub struct MyOApp;
323
+ | ^^^^^^ the trait `utils::auth::Auth` is not implemented for `MyOApp`
324
+ |
325
+ = help: the trait `utils::auth::Auth` is implemented for `EndpointV2`
326
+ note: required by a bound in `has_role`
327
+ --> $WORKSPACE/contracts/utils/src/rbac.rs
328
+ |
329
+ | pub trait RoleBasedAccessControl: Auth {
330
+ | ^^^^ required by this bound in `RoleBasedAccessControl::has_role`
331
+ ...
332
+ | fn has_role(env: &soroban_sdk::Env, account: &soroban_sdk::Address, role: &soroban_sdk::Symbol) -> Option<u32> {
333
+ | -------- required by a bound in this associated function
334
+
335
+ error[E0277]: the trait bound `MyOApp: utils::auth::Auth` is not satisfied
336
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:13:12
337
+ |
338
+ 13 | pub struct MyOApp;
339
+ | ^^^^^^ the trait `utils::auth::Auth` is not implemented for `MyOApp`
340
+ |
341
+ = help: the trait `utils::auth::Auth` is implemented for `EndpointV2`
342
+ note: required by a bound in `get_role_admin`
343
+ --> $WORKSPACE/contracts/utils/src/rbac.rs
344
+ |
345
+ | pub trait RoleBasedAccessControl: Auth {
346
+ | ^^^^ required by this bound in `RoleBasedAccessControl::get_role_admin`
347
+ ...
348
+ | fn get_role_admin(env: &soroban_sdk::Env, role: &soroban_sdk::Symbol) -> Option<soroban_sdk::Symbol> {
349
+ | -------------- required by a bound in this associated function
350
+
351
+ error[E0277]: the trait bound `MyOApp: utils::auth::Auth` is not satisfied
352
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:13:12
353
+ |
354
+ 13 | pub struct MyOApp;
355
+ | ^^^^^^ the trait `utils::auth::Auth` is not implemented for `MyOApp`
356
+ |
357
+ = help: the trait `utils::auth::Auth` is implemented for `EndpointV2`
358
+ note: required by a bound in `get_role_member_count`
359
+ --> $WORKSPACE/contracts/utils/src/rbac.rs
360
+ |
361
+ | pub trait RoleBasedAccessControl: Auth {
362
+ | ^^^^ required by this bound in `RoleBasedAccessControl::get_role_member_count`
363
+ ...
364
+ | fn get_role_member_count(env: &soroban_sdk::Env, role: &soroban_sdk::Symbol) -> u32 {
365
+ | --------------------- required by a bound in this associated function
366
+
367
+ error[E0277]: the trait bound `MyOApp: utils::auth::Auth` is not satisfied
368
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:13:12
369
+ |
370
+ 13 | pub struct MyOApp;
371
+ | ^^^^^^ the trait `utils::auth::Auth` is not implemented for `MyOApp`
372
+ |
373
+ = help: the trait `utils::auth::Auth` is implemented for `EndpointV2`
374
+ note: required by a bound in `get_role_member`
375
+ --> $WORKSPACE/contracts/utils/src/rbac.rs
376
+ |
377
+ | pub trait RoleBasedAccessControl: Auth {
378
+ | ^^^^ required by this bound in `RoleBasedAccessControl::get_role_member`
379
+ ...
380
+ | fn get_role_member(env: &soroban_sdk::Env, role: &soroban_sdk::Symbol, index: u32) -> soroban_sdk::Address {
381
+ | --------------- required by a bound in this associated function
382
+
383
+ error[E0277]: the trait bound `MyOApp: utils::auth::Auth` is not satisfied
384
+ --> tests/ui/oapp/fail/missing_auth_trait.rs:13:12
385
+ |
386
+ 13 | pub struct MyOApp;
387
+ | ^^^^^^ the trait `utils::auth::Auth` is not implemented for `MyOApp`
388
+ |
389
+ = help: the trait `utils::auth::Auth` is implemented for `EndpointV2`
390
+ note: required by a bound in `get_existing_roles`
391
+ --> $WORKSPACE/contracts/utils/src/rbac.rs
392
+ |
393
+ | pub trait RoleBasedAccessControl: Auth {
394
+ | ^^^^ required by this bound in `RoleBasedAccessControl::get_existing_roles`
395
+ ...
396
+ | fn get_existing_roles(env: &soroban_sdk::Env) -> soroban_sdk::Vec<soroban_sdk::Symbol> {
397
+ | ------------------ required by a bound in this associated function
@@ -3,6 +3,7 @@
3
3
  use oapp_macros::oapp;
4
4
 
5
5
  #[oapp]
6
+ #[common_macros::lz_contract]
6
7
  pub struct MyOApp;
7
8
 
8
9
  fn main() {}
@@ -1,7 +1,7 @@
1
1
  error[E0277]: the trait bound `MyOApp: LzReceiveInternal` is not satisfied
2
- --> tests/ui/oapp/fail/missing_lz_receive_internal.rs:6:12
2
+ --> tests/ui/oapp/fail/missing_lz_receive_internal.rs:7:12
3
3
  |
4
- 6 | pub struct MyOApp;
4
+ 7 | pub struct MyOApp;
5
5
  | ^^^^^^ the trait `LzReceiveInternal` is not implemented for `MyOApp`
6
6
  |
7
7
  note: required by a bound in `OAppReceiver`
@@ -11,9 +11,9 @@ note: required by a bound in `OAppReceiver`
11
11
  | ^^^^^^^^^^^^^^^^^ required by this bound in `OAppReceiver`
12
12
 
13
13
  error[E0277]: the trait bound `MyOApp: LzReceiveInternal` is not satisfied
14
- --> tests/ui/oapp/fail/missing_lz_receive_internal.rs:6:12
14
+ --> tests/ui/oapp/fail/missing_lz_receive_internal.rs:7:12
15
15
  |
16
- 6 | pub struct MyOApp;
16
+ 7 | pub struct MyOApp;
17
17
  | ^^^^^^ the trait `LzReceiveInternal` is not implemented for `MyOApp`
18
18
  |
19
19
  note: required by a bound in `oapp::oapp_receiver::OAppReceiver::allow_initialize_path`
@@ -26,9 +26,9 @@ note: required by a bound in `oapp::oapp_receiver::OAppReceiver::allow_initializ
26
26
  | --------------------- required by a bound in this associated function
27
27
 
28
28
  error[E0277]: the trait bound `MyOApp: LzReceiveInternal` is not satisfied
29
- --> tests/ui/oapp/fail/missing_lz_receive_internal.rs:6:12
29
+ --> tests/ui/oapp/fail/missing_lz_receive_internal.rs:7:12
30
30
  |
31
- 6 | pub struct MyOApp;
31
+ 7 | pub struct MyOApp;
32
32
  | ^^^^^^ the trait `LzReceiveInternal` is not implemented for `MyOApp`
33
33
  |
34
34
  note: required by a bound in `oapp::oapp_receiver::OAppReceiver::next_nonce`
@@ -41,9 +41,9 @@ note: required by a bound in `oapp::oapp_receiver::OAppReceiver::next_nonce`
41
41
  | ---------- required by a bound in this associated function
42
42
 
43
43
  error[E0277]: the trait bound `MyOApp: LzReceiveInternal` is not satisfied
44
- --> tests/ui/oapp/fail/missing_lz_receive_internal.rs:6:12
44
+ --> tests/ui/oapp/fail/missing_lz_receive_internal.rs:7:12
45
45
  |
46
- 6 | pub struct MyOApp;
46
+ 7 | pub struct MyOApp;
47
47
  | ^^^^^^ the trait `LzReceiveInternal` is not implemented for `MyOApp`
48
48
  |
49
49
  note: required by a bound in `oapp::oapp_receiver::OAppReceiver::lz_receive`
@@ -56,9 +56,9 @@ note: required by a bound in `oapp::oapp_receiver::OAppReceiver::lz_receive`
56
56
  | ---------- required by a bound in this associated function
57
57
 
58
58
  error[E0277]: the trait bound `MyOApp: LzReceiveInternal` is not satisfied
59
- --> tests/ui/oapp/fail/missing_lz_receive_internal.rs:6:12
59
+ --> tests/ui/oapp/fail/missing_lz_receive_internal.rs:7:12
60
60
  |
61
- 6 | pub struct MyOApp;
61
+ 7 | pub struct MyOApp;
62
62
  | ^^^^^^ the trait `LzReceiveInternal` is not implemented for `MyOApp`
63
63
  |
64
64
  note: required by a bound in `is_compose_msg_sender`
@@ -7,8 +7,10 @@ use oapp::oapp_receiver::{LzReceiveInternal, OAppReceiver};
7
7
  use oapp::oapp_sender::OAppSenderInternal;
8
8
  use oapp_macros::oapp;
9
9
  use soroban_sdk::{contractimpl, Address, Bytes, BytesN, Env};
10
+ use utils::rbac::RoleBasedAccessControl;
10
11
 
11
12
  #[oapp(custom = [core, sender, receiver, options_type3])]
13
+ #[common_macros::lz_contract]
12
14
  pub struct MyOApp;
13
15
 
14
16
  impl LzReceiveInternal for MyOApp {
@@ -24,6 +26,8 @@ impl LzReceiveInternal for MyOApp {
24
26
  }
25
27
  }
26
28
 
29
+ impl RoleBasedAccessControl for MyOApp {}
30
+
27
31
  #[contractimpl(contracttrait)]
28
32
  impl OAppCore for MyOApp {}
29
33
 
@@ -13,8 +13,10 @@ use oapp::oapp_receiver::{LzReceiveInternal, OAppReceiver};
13
13
  use oapp::oapp_sender::OAppSenderInternal;
14
14
  use oapp_macros::oapp;
15
15
  use soroban_sdk::{contractimpl, Address, Bytes, BytesN, Env};
16
+ use utils::rbac::RoleBasedAccessControl;
16
17
 
17
18
  #[oapp(custom = [core])]
19
+ #[common_macros::lz_contract]
18
20
  pub struct MyOAppCustomCore;
19
21
 
20
22
  impl LzReceiveInternal for MyOAppCustomCore {
@@ -30,6 +32,8 @@ impl LzReceiveInternal for MyOAppCustomCore {
30
32
  }
31
33
  }
32
34
 
35
+ impl RoleBasedAccessControl for MyOAppCustomCore {}
36
+
33
37
  #[contractimpl(contracttrait)]
34
38
  impl OAppCore for MyOAppCustomCore {
35
39
  fn oapp_version(_env: &Env) -> (u64, u64) {
@@ -38,6 +42,7 @@ impl OAppCore for MyOAppCustomCore {
38
42
  }
39
43
 
40
44
  #[oapp(custom = [sender])]
45
+ #[common_macros::lz_contract]
41
46
  pub struct MyOAppCustomSender;
42
47
 
43
48
  impl LzReceiveInternal for MyOAppCustomSender {
@@ -56,6 +61,7 @@ impl LzReceiveInternal for MyOAppCustomSender {
56
61
  impl OAppSenderInternal for MyOAppCustomSender {}
57
62
 
58
63
  #[oapp(custom = [receiver])]
64
+ #[common_macros::lz_contract]
59
65
  pub struct MyOAppCustomReceiver;
60
66
 
61
67
  impl LzReceiveInternal for MyOAppCustomReceiver {
@@ -75,6 +81,7 @@ impl LzReceiveInternal for MyOAppCustomReceiver {
75
81
  impl OAppReceiver for MyOAppCustomReceiver {}
76
82
 
77
83
  #[oapp(custom = [options_type3])]
84
+ #[common_macros::lz_contract]
78
85
  pub struct MyOAppCustomOptionsType3;
79
86
 
80
87
  impl LzReceiveInternal for MyOAppCustomOptionsType3 {
@@ -1,9 +1,8 @@
1
1
  // UI (trybuild) test: minimal `#[oapp]` usage compiles.
2
2
  //
3
3
  // Purpose:
4
- // - Verifies `#[oapp]` applies `#[common_macros::lz_contract]` and generates default
5
- // contract-trait implementations for `OAppCore`, `OAppReceiver`, and `OAppOptionsType3`.
6
- // - Verifies the user must implement `LzReceiveInternal` and that the implementation is usable.
4
+ // - Verifies `#[oapp]` generates default trait impls. User applies `#[lz_contract]` for contract + TTL + Auth.
5
+ // - Verifies the user must implement `LzReceiveInternal`.
7
6
 
8
7
  use endpoint_v2::Origin;
9
8
  use oapp::oapp_receiver::LzReceiveInternal;
@@ -11,6 +10,7 @@ use oapp_macros::oapp;
11
10
  use soroban_sdk::{contractimpl, Address, Bytes, BytesN, Env};
12
11
 
13
12
  #[oapp]
13
+ #[common_macros::lz_contract]
14
14
  pub struct MyOApp;
15
15
 
16
16
  impl LzReceiveInternal for MyOApp {
@@ -30,7 +30,7 @@ impl LzReceiveInternal for MyOApp {
30
30
  #[contractimpl]
31
31
  impl MyOApp {
32
32
  pub fn init(env: Env, owner: Address, endpoint: Address) {
33
- // `lz_contract` (applied by `#[oapp]`) provides ownable helpers.
33
+ // `#[lz_contract]` (user-provided) provides init_owner and Auth.
34
34
  Self::init_owner(&env, &owner);
35
35
  oapp::oapp_core::OAppCoreStorage::set_endpoint(&env, &endpoint);
36
36
 
@@ -45,6 +45,7 @@ impl MyOApp {
45
45
  }
46
46
 
47
47
  #[oapp(custom = [])]
48
+ #[common_macros::lz_contract]
48
49
  pub struct MyOAppCustomEmpty;
49
50
 
50
51
  impl LzReceiveInternal for MyOAppCustomEmpty {
@@ -6,6 +6,7 @@ use oapp_macros::oapp;
6
6
  use soroban_sdk::{Address, Bytes, BytesN, Env};
7
7
 
8
8
  #[oapp]
9
+ #[common_macros::lz_contract]
9
10
  #[derive(Clone, Debug)]
10
11
  pub struct MyOApp {
11
12
  pub x: u32,
@@ -25,6 +26,7 @@ impl LzReceiveInternal for MyOApp {
25
26
  }
26
27
 
27
28
  #[oapp]
29
+ #[common_macros::lz_contract]
28
30
  pub struct MyOAppTuple(u32, bool);
29
31
 
30
32
  impl LzReceiveInternal for MyOAppTuple {
@@ -30,7 +30,7 @@ impl MyContract {
30
30
 
31
31
  // A couple key Ownable APIs type-check.
32
32
  <Self as utils::ownable::Ownable>::transfer_ownership(&env, &owner);
33
- <Self as utils::ownable::Ownable>::propose_ownership_transfer(&env, &owner, 1);
33
+ <Self as utils::ownable::Ownable>::begin_ownership_transfer(&env, &owner, 1);
34
34
  <Self as utils::ownable::Ownable>::accept_ownership(&env);
35
35
  <Self as utils::ownable::Ownable>::renounce_ownership(&env);
36
36
  }
@@ -4,7 +4,7 @@ error: custom attribute panicked
4
4
  7 | #[common_macros::upgradeable(not_migration)]
5
5
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6
6
  |
7
- = help: message: failed to parse upgradeable config: expected `no_migration`
7
+ = help: message: failed to parse upgradeable config: expected `no_migration` or `rbac`
8
8
 
9
9
  error[E0433]: failed to resolve: could not find `MyContract` in the crate root
10
10
  --> tests/ui/upgradeable/fail/attr_args.rs:6:1
@@ -16,7 +16,7 @@ error[E0277]: the trait bound `MyContract: utils::auth::Auth` is not satisfied
16
16
  12 | pub struct MyContract;
17
17
  | ^^^^^^^^^^ the trait `utils::auth::Auth` is not implemented for `MyContract`
18
18
  |
19
- note: required by a bound in `upgrade`
19
+ note: required by a bound in `utils::upgradeable::Upgradeable::upgrade`
20
20
  --> $WORKSPACE/contracts/utils/src/upgradeable.rs
21
21
  |
22
22
  | pub trait Upgradeable: UpgradeableInternal + Auth {
@@ -31,7 +31,7 @@ error[E0277]: the trait bound `MyContract: utils::auth::Auth` is not satisfied
31
31
  12 | pub struct MyContract;
32
32
  | ^^^^^^^^^^ the trait `utils::auth::Auth` is not implemented for `MyContract`
33
33
  |
34
- note: required by a bound in `migrate`
34
+ note: required by a bound in `utils::upgradeable::Upgradeable::migrate`
35
35
  --> $WORKSPACE/contracts/utils/src/upgradeable.rs
36
36
  |
37
37
  | pub trait Upgradeable: UpgradeableInternal + Auth {
@@ -24,7 +24,7 @@ error[E0277]: the trait bound `MyContract: UpgradeableInternal` is not satisfied
24
24
  8 | pub struct MyContract;
25
25
  | ^^^^^^^^^^ the trait `UpgradeableInternal` is not implemented for `MyContract`
26
26
  |
27
- note: required by a bound in `upgrade`
27
+ note: required by a bound in `utils::upgradeable::Upgradeable::upgrade`
28
28
  --> $WORKSPACE/contracts/utils/src/upgradeable.rs
29
29
  |
30
30
  | pub trait Upgradeable: UpgradeableInternal + Auth {
@@ -39,7 +39,7 @@ error[E0277]: the trait bound `MyContract: UpgradeableInternal` is not satisfied
39
39
  8 | pub struct MyContract;
40
40
  | ^^^^^^^^^^ the trait `UpgradeableInternal` is not implemented for `MyContract`
41
41
  |
42
- note: required by a bound in `migrate`
42
+ note: required by a bound in `utils::upgradeable::Upgradeable::migrate`
43
43
  --> $WORKSPACE/contracts/utils/src/upgradeable.rs
44
44
  |
45
45
  | pub trait Upgradeable: UpgradeableInternal + Auth {