@layerzerolabs/layerzero-v2-ton 3.0.27 → 3.0.28
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/CHANGELOG.md +6 -0
- package/build/ActionsSerde.test.compiled.json +1 -0
- package/build/AllStorages.compiled.json +1 -1
- package/build/AllStorages.test.compiled.json +1 -1
- package/build/BaseContract.test.compiled.json +1 -1
- package/build/Channel.compiled.json +1 -1
- package/build/Channel.permissions.test.compiled.json +1 -1
- package/build/ChannelBurn.test.compiled.json +1 -1
- package/build/ChannelCommitPacket.test.compiled.json +1 -1
- package/build/ChannelConfig.test.compiled.json +1 -1
- package/build/ChannelInitialize.test.compiled.json +1 -1
- package/build/ChannelMsglibIntegration.test.compiled.json +1 -1
- package/build/ChannelMsglibSendCallback.test.compiled.json +1 -1
- package/build/ChannelNilify.test.compiled.json +1 -1
- package/build/ChannelReceive.test.compiled.json +1 -1
- package/build/ChannelReceiveCallback.test.compiled.json +1 -1
- package/build/ChannelReceiveView.test.compiled.json +1 -1
- package/build/ChannelSend.test.compiled.json +1 -1
- package/build/ChannelSerde.test.compiled.json +1 -0
- package/build/Classlib.test.compiled.json +1 -1
- package/build/ComputeDataSizeGas.test.compiled.json +1 -1
- package/build/Connection.compiled.json +1 -1
- package/build/Controller.assertions.test.compiled.json +1 -1
- package/build/Controller.compiled.json +1 -1
- package/build/Controller.permissions.test.compiled.json +1 -1
- package/build/Controller.test.compiled.json +1 -1
- package/build/Counter.compiled.json +1 -1
- package/build/Counter.permissions.test.compiled.json +1 -1
- package/build/Counter.setters.test.compiled.json +1 -1
- package/build/Counter.test.compiled.json +1 -1
- package/build/Dvn.compiled.json +1 -1
- package/build/Dvn.test.compiled.json +1 -1
- package/build/DvnFeeLib.compiled.json +1 -1
- package/build/DvnFeeLibSerde.test.compiled.json +1 -0
- package/build/DvnPermissions.test.compiled.json +1 -1
- package/build/DvnSerde.test.compiled.json +1 -0
- package/build/Endpoint.compiled.json +1 -1
- package/build/Endpoint.permissions.test.compiled.json +1 -1
- package/build/Endpoint.test.compiled.json +1 -1
- package/build/EndpointSerde.test.compiled.json +1 -0
- package/build/EndpointSetEpConfigDefaults.test.compiled.json +1 -1
- package/build/Executor.compiled.json +1 -1
- package/build/Executor.test.compiled.json +1 -1
- package/build/ExecutorFeeLib.compiled.json +1 -1
- package/build/ExecutorFeeLibSerde.test.compiled.json +1 -0
- package/build/ExecutorPermissions.test.compiled.json +1 -1
- package/build/ExecutorSerde.test.compiled.json +1 -0
- package/build/LzClasses.test.compiled.json +1 -1
- package/build/LzClassesSerde.test.compiled.json +1 -0
- package/build/LzUtil.test.compiled.json +1 -1
- package/build/MsgData.test.compiled.json +1 -1
- package/build/MsgDataSerde.test.compiled.json +1 -0
- package/build/MsglibPacketCodec.test.compiled.json +1 -1
- package/build/PipelinedOutOfOrder.test.compiled.json +1 -1
- package/build/PipelinedOutOfOrderSerde.test.compiled.json +1 -0
- package/build/PriceFeedCache.compiled.json +1 -1
- package/build/PriceFeedCache.test.compiled.json +1 -1
- package/build/PriceFeedCache.test.permissions.compiled.json +1 -1
- package/build/PriceFeedCacheSerde.test.compiled.json +1 -0
- package/build/PriceFeedFeeLibSerde.test.compiled.json +1 -0
- package/build/Proxy.compiled.json +1 -1
- package/build/Proxy.permissions.test.compiled.json +1 -1
- package/build/Proxy.test.compiled.json +1 -1
- package/build/SmlConnection.compiled.json +1 -1
- package/build/SmlConnection.permissions.test.compiled.json +1 -1
- package/build/SmlConnection.test.compiled.json +1 -1
- package/build/SmlManager.compiled.json +1 -1
- package/build/SmlManager.permissions.test.compiled.json +1 -1
- package/build/SmlManager.test.compiled.json +1 -1
- package/build/Uln.compiled.json +1 -1
- package/build/Uln.test.compiled.json +1 -1
- package/build/UlnConnection.compiled.json +1 -1
- package/build/UlnConnection.test.compiled.json +1 -1
- package/build/UlnConnectionPermissions.test.compiled.json +1 -1
- package/build/UlnConnectionSerde.test.compiled.json +1 -0
- package/build/UlnManagement.test.compiled.json +1 -1
- package/build/UlnManager.compiled.json +1 -1
- package/build/UlnManager.test.compiled.json +1 -1
- package/build/UlnManagerPermissions.test.compiled.json +1 -1
- package/build/UlnManagerUtil.test.compiled.json +1 -1
- package/build/UlnMsgDataSerde.test.compiled.json +1 -0
- package/build/UlnPermissions.test.compiled.json +1 -1
- package/build/UlnReceiveConfig.test.compiled.json +1 -1
- package/build/UlnSend.test.compiled.json +1 -1
- package/build/UlnSendConfig.test.compiled.json +1 -1
- package/build/UlnSendWithDvnFeeLib.test.compiled.json +1 -1
- package/build/UlnSendWithExecFeeLib.test.compiled.json +1 -1
- package/build/UlnSendWorkerFactory.test.compiled.json +1 -1
- package/build/UlnSerde.test.compiled.json +1 -0
- package/build/UlnUtil.test.compiled.json +1 -1
- package/build/WorkerCore.test.compiled.json +1 -1
- package/build/WorkerCoreMsgDataSerde.test.compiled.json +1 -0
- package/build/WorkerCoreSerde.test.compiled.json +1 -0
- package/build/badFeeLib1.test.compiled.json +1 -1
- package/build/badFeeLib10.test.compiled.json +1 -1
- package/build/badFeeLib11.test.compiled.json +1 -1
- package/build/badFeeLib12.test.compiled.json +1 -1
- package/build/badFeeLib2.test.compiled.json +1 -1
- package/build/badFeeLib3.test.compiled.json +1 -1
- package/build/badFeeLib4.test.compiled.json +1 -1
- package/build/badFeeLib5.test.compiled.json +1 -1
- package/build/badFeeLib6.test.compiled.json +1 -1
- package/build/badFeeLib7.test.compiled.json +1 -1
- package/build/badFeeLib8.test.compiled.json +1 -1
- package/build/badFeeLib9.test.compiled.json +1 -1
- package/package.json +1 -1
- package/src/classes/lz/EpConfig.fc +90 -23
- package/src/classes/lz/MsglibInfo.fc +32 -5
- package/src/classes/lz/Packet.fc +109 -48
- package/src/classes/lz/Path.fc +55 -4
- package/src/classes/lz/ReceiveEpConfig.fc +36 -5
- package/src/classes/lz/SendEpConfig.fc +55 -5
- package/src/classes/msgdata/AddMsglib.fc +11 -0
- package/src/classes/msgdata/ChannelNonceInfo.fc +20 -0
- package/src/classes/msgdata/CoinsAmount.fc +8 -0
- package/src/classes/msgdata/Deploy.fc +19 -0
- package/src/classes/msgdata/ExtendedMd.fc +52 -1
- package/src/classes/msgdata/LzReceivePrepare.fc +21 -1
- package/src/classes/msgdata/LzReceiveStatus.fc +72 -1
- package/src/classes/msgdata/LzSend.fc +143 -24
- package/src/classes/msgdata/MdAddress.fc +42 -0
- package/src/classes/msgdata/MdEid.fc +8 -0
- package/src/classes/msgdata/MdObj.fc +32 -0
- package/src/classes/msgdata/MessagingReceipt.fc +34 -1
- package/src/classes/msgdata/MsglibSendCallback.fc +82 -0
- package/src/classes/msgdata/Nonce.fc +30 -0
- package/src/classes/msgdata/OptionsV1.fc +21 -1
- package/src/classes/msgdata/OptionsV2.fc +27 -0
- package/src/classes/msgdata/PacketId.fc +24 -0
- package/src/classes/msgdata/PacketSent.fc +35 -1
- package/src/classes/msgdata/SetAddress.fc +7 -0
- package/src/classes/msgdata/SetEpConfig.fc +17 -0
- package/src/funC++/actions/event.fc +17 -2
- package/src/funC++/actions/utils.fc +2 -2
- package/src/funC++/classlib.fc +33 -43
- package/src/funC++/constants.fc +28 -28
- package/src/funC++/dataStructures/PipelinedOutOfOrder.fc +75 -59
- package/src/funC++/stdlib.fc +26 -11
- package/src/funC++/testutils.fc +2 -2
- package/src/funC++/txnContext.fc +14 -14
- package/src/funC++/utils.fc +97 -1
- package/src/protocol/channel/handler.fc +247 -189
- package/src/protocol/channel/storage.fc +206 -1
- package/src/protocol/controller/handler.fc +35 -17
- package/src/protocol/controller/main.fc +1 -1
- package/src/protocol/core/abstract/protocolHandler.fc +11 -21
- package/src/protocol/core/baseStorage.fc +24 -0
- package/src/protocol/endpoint/handler.fc +99 -57
- package/src/protocol/endpoint/storage.fc +69 -5
- package/src/protocol/msglibs/BytesEncoder.fc +11 -10
- package/src/protocol/msglibs/simpleMsglib/smlManager/handler.fc +1 -4
- package/src/protocol/msglibs/ultralightnode/feeLibInterface.fc +1 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/Attestation.fc +7 -8
- package/src/protocol/msglibs/ultralightnode/msgdata/DvnFeesPaidEvent.fc +20 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/ExecutorFeePaidEvent.fc +15 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/InitUln.fc +1 -1
- package/src/protocol/msglibs/ultralightnode/msgdata/InitUlnConnection.fc +1 -1
- package/src/protocol/msglibs/ultralightnode/msgdata/SetAdminWorkerAddresses.fc +6 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/UlnEvents.fc +20 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/UlnReceiveConfig.fc +114 -28
- package/src/protocol/msglibs/ultralightnode/msgdata/UlnSend.fc +51 -1
- package/src/protocol/msglibs/ultralightnode/msgdata/UlnSendConfig.fc +1 -1
- package/src/protocol/msglibs/ultralightnode/msgdata/UlnVerification.fc +10 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/UlnWorkerFeelibBytecode.fc +6 -0
- package/src/protocol/msglibs/ultralightnode/msgdata/UlnWorkerFeelibInfo.fc +51 -1
- package/src/protocol/msglibs/ultralightnode/msgdata/VerificationStatus.fc +15 -0
- package/src/protocol/msglibs/ultralightnode/uln/handler.fc +84 -107
- package/src/protocol/msglibs/ultralightnode/uln/storage.fc +77 -1
- package/src/protocol/msglibs/ultralightnode/ulnConnection/handler.fc +92 -66
- package/src/protocol/msglibs/ultralightnode/ulnConnection/storage.fc +113 -6
- package/src/protocol/msglibs/ultralightnode/ulnConnection/utils.fc +6 -91
- package/src/protocol/msglibs/ultralightnode/ulnManager/handler.fc +55 -31
- package/src/protocol/msglibs/ultralightnode/workerFeeLibs/dvnFeeLib/handler.fc +13 -9
- package/src/protocol/msglibs/ultralightnode/workerFeeLibs/dvnFeeLib/storage.fc +23 -0
- package/src/protocol/msglibs/ultralightnode/workerFeeLibs/executorFeeLib/handler.fc +63 -27
- package/src/protocol/msglibs/ultralightnode/workerFeeLibs/executorFeeLib/storage.fc +19 -0
- package/src/protocol/msglibs/ultralightnode/workerFeeLibs/priceFeedFeeLib/storage.fc +55 -6
- package/src/workers/core/abstract/workerHandler.fc +20 -19
- package/src/workers/core/interface.fc +2 -1
- package/src/workers/core/workerCoreStorage.fc +16 -1
- package/src/workers/dvn/handler.fc +67 -26
- package/src/workers/dvn/storage.fc +15 -2
- package/src/workers/executor/handler.fc +18 -6
- package/src/workers/executor/interface.fc +1 -0
- package/src/workers/executor/storage.fc +8 -1
- package/src/workers/msgdata/DropEvent.fc +18 -0
- package/src/workers/msgdata/ExecuteParams.fc +66 -3
- package/src/workers/msgdata/NativeDrop.fc +4 -0
- package/src/workers/msgdata/SetDict.fc +6 -4
- package/src/workers/msgdata/SetQuorum.fc +4 -2
- package/src/workers/msgdata/SignedRequest.fc +8 -0
- package/src/workers/priceFeedCache/handler.fc +21 -27
- package/src/workers/priceFeedCache/storage.fc +16 -1
- package/src/workers/proxy/handler.fc +2 -1
- package/src/workers/proxy/storage.fc +1 -1
- package/tests/baseContractTest.fc +2 -6
- package/tests/testMain.fc +2 -2
- package/src/classes/msgdata/Amount.fc +0 -16
- package/src/funC++/actions/destroy.fc +0 -27
|
@@ -15,11 +15,12 @@ const int Worker::OP::SET_PROXY = "Worker::OP::SET_PROXY"c;
|
|
|
15
15
|
const int Worker::OP::SET_ADMINS = "Worker::OP::SET_ADMINS"c;
|
|
16
16
|
|
|
17
17
|
;;; ==========================ERRORS=====================================
|
|
18
|
+
const int Worker::ERROR::invalidForwardingAddress = 2016;
|
|
18
19
|
const int Worker::ERROR::onlyAdmin = 2015;
|
|
19
20
|
const int Worker::ERROR::invalidOpcode = 2014;
|
|
20
21
|
|
|
21
22
|
const int Worker::ERROR::invalidSignedOpcode = 2013;
|
|
22
|
-
const int Worker::ERROR::
|
|
23
|
+
const int Worker::ERROR::invalidTarget = 2012;
|
|
23
24
|
|
|
24
25
|
;;; ==========================EVENTS=====================================
|
|
25
26
|
const int Worker::event::ADMINS_SET = "Worker::event::ADMINS_SET"u;
|
|
@@ -39,6 +39,21 @@ cell setCoreStorage(cell $storage, cell $newCoreStorage) impure inline {
|
|
|
39
39
|
return $storage.cl::set(WORKER_CORE_STORAGE_IDX, $newCoreStorage);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
const int WorkerCoreStorage::_proxyOffset = _HEADER_WIDTH;
|
|
43
|
+
const int WorkerCoreStorage::_versionOffset = WorkerCoreStorage::_proxyOffset + 256;
|
|
44
|
+
|
|
45
|
+
cell WorkerCoreStorage::getAdmins(cell $self) impure inline {
|
|
46
|
+
return $self.cellPreloadRefAt(0);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
int WorkerCoreStorage::getProxy(cell $self) impure inline {
|
|
50
|
+
return $self.cellPreloadAddressAt(WorkerCoreStorage::_proxyOffset);
|
|
51
|
+
}
|
|
52
|
+
|
|
42
53
|
int getProxyAddress() impure inline {
|
|
43
|
-
return getCoreStorage().
|
|
54
|
+
return getCoreStorage().WorkerCoreStorage::getProxy();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
cell getAdmins() impure inline {
|
|
58
|
+
return getCoreStorage().WorkerCoreStorage::getAdmins();
|
|
44
59
|
}
|
|
@@ -135,10 +135,16 @@ tuple setVerifiers(cell $signedRequest) impure {
|
|
|
135
135
|
incomingNonce != $storage.cl::get<uint64>(Dvn::setVerifiersNonce)
|
|
136
136
|
);
|
|
137
137
|
|
|
138
|
-
int
|
|
138
|
+
int signedOpcode = $setDict.cl::get<uint64>(md::SetDict::opcode);
|
|
139
139
|
throw_if(
|
|
140
140
|
Worker::ERROR::invalidSignedOpcode,
|
|
141
|
-
|
|
141
|
+
signedOpcode != Dvn::OP::SET_VERIFIERS
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
int target = $setDict.cl::get<address>(md::SetDict::target);
|
|
145
|
+
throw_if(
|
|
146
|
+
Worker::ERROR::invalidTarget,
|
|
147
|
+
target != getContractAddress()
|
|
142
148
|
);
|
|
143
149
|
|
|
144
150
|
actions = _verifySignatures(
|
|
@@ -172,10 +178,10 @@ tuple setQuorum(cell $signedRequest) impure {
|
|
|
172
178
|
incomingNonce != $storage.cl::get<uint64>(Dvn::setQuorumNonce)
|
|
173
179
|
);
|
|
174
180
|
|
|
175
|
-
int
|
|
181
|
+
int signedOpcode = $setQuorum.cl::get<uint64>(md::SetQuorum::opcode);
|
|
176
182
|
throw_if(
|
|
177
183
|
Worker::ERROR::invalidSignedOpcode,
|
|
178
|
-
|
|
184
|
+
signedOpcode != Dvn::OP::SET_QUORUM
|
|
179
185
|
);
|
|
180
186
|
|
|
181
187
|
int newQuorum = $setQuorum.cl::get<uint64>(md::SetQuorum::quorum);
|
|
@@ -186,6 +192,12 @@ tuple setQuorum(cell $signedRequest) impure {
|
|
|
186
192
|
(newQuorum < 1) | (newQuorum > cl::dict256::size($verifiers))
|
|
187
193
|
);
|
|
188
194
|
|
|
195
|
+
int target = $setQuorum.cl::get<address>(md::SetQuorum::target);
|
|
196
|
+
throw_if(
|
|
197
|
+
Worker::ERROR::invalidTarget,
|
|
198
|
+
target != getContractAddress()
|
|
199
|
+
);
|
|
200
|
+
|
|
189
201
|
actions = _verifySignatures(
|
|
190
202
|
actions,
|
|
191
203
|
$setQuorum.cl::hash(),
|
|
@@ -217,10 +229,16 @@ tuple setAdminsByQuorum(cell $signedRequest) impure {
|
|
|
217
229
|
incomingNonce != $storage.cl::get<uint64>(Dvn::setAdminsByQuorumNonce)
|
|
218
230
|
);
|
|
219
231
|
|
|
220
|
-
int
|
|
232
|
+
int signedOpcode = $setDict.cl::get<uint64>(md::SetDict::opcode);
|
|
221
233
|
throw_if(
|
|
222
234
|
Worker::ERROR::invalidSignedOpcode,
|
|
223
|
-
|
|
235
|
+
signedOpcode != Dvn::OP::SET_ADMINS_BY_QUORUM
|
|
236
|
+
);
|
|
237
|
+
|
|
238
|
+
int target = $setDict.cl::get<address>(md::SetDict::target);
|
|
239
|
+
throw_if(
|
|
240
|
+
Worker::ERROR::invalidTarget,
|
|
241
|
+
target != getContractAddress()
|
|
224
242
|
);
|
|
225
243
|
|
|
226
244
|
actions = _verifySignatures(
|
|
@@ -251,37 +269,51 @@ tuple setAdminsByQuorum(cell $signedRequest) impure {
|
|
|
251
269
|
tuple verify(cell $signedRequest) impure inline {
|
|
252
270
|
(cell $storage, tuple actions) = preamble();
|
|
253
271
|
|
|
254
|
-
cell $executeParams = $signedRequest.
|
|
272
|
+
cell $executeParams = $signedRequest.md::SignedRequest::getRequest();
|
|
273
|
+
|
|
274
|
+
(
|
|
275
|
+
int expiration,
|
|
276
|
+
int target,
|
|
277
|
+
int signedOpcode,
|
|
278
|
+
int forwardingAddress
|
|
279
|
+
) = $executeParams.md::ExecuteParams::deserialize();
|
|
255
280
|
|
|
256
281
|
throw_if(
|
|
257
282
|
Dvn::ERROR::expired,
|
|
258
283
|
;; now() counts as expired, per the EVM spec
|
|
259
|
-
|
|
284
|
+
expiration <= now()
|
|
260
285
|
);
|
|
261
|
-
|
|
262
|
-
int opcode = $executeParams.cl::get<uint32>(md::ExecuteParams::opcode);
|
|
286
|
+
|
|
263
287
|
throw_if(
|
|
264
288
|
Worker::ERROR::invalidSignedOpcode,
|
|
265
|
-
|
|
289
|
+
signedOpcode != Uln::OP::ULN_VERIFY
|
|
266
290
|
);
|
|
267
291
|
|
|
292
|
+
throw_if(
|
|
293
|
+
Worker::ERROR::invalidTarget,
|
|
294
|
+
target != getContractAddress()
|
|
295
|
+
);
|
|
296
|
+
|
|
297
|
+
(int quorum, cell verifiers) = $storage.Dvn::getQuorumAndVerifiers();
|
|
298
|
+
|
|
268
299
|
actions = _verifySignatures(
|
|
269
300
|
actions,
|
|
270
301
|
$executeParams.cl::hash(),
|
|
271
|
-
$signedRequest.
|
|
272
|
-
|
|
273
|
-
|
|
302
|
+
$signedRequest.md::SignedRequest::getSignatures(),
|
|
303
|
+
verifiers,
|
|
304
|
+
quorum
|
|
274
305
|
);
|
|
275
306
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
)
|
|
307
|
+
;; for the inside call, the target is the proxy address
|
|
308
|
+
$executeParams = $executeParams.cl::set(md::ExecuteParams::target, forwardingAddress);
|
|
309
|
+
|
|
310
|
+
actions~pushAction<call>(
|
|
311
|
+
getProxyAddress(),
|
|
312
|
+
Proxy::OP::CALL_CONTRACT,
|
|
313
|
+
$executeParams
|
|
284
314
|
);
|
|
315
|
+
|
|
316
|
+
return actions;
|
|
285
317
|
}
|
|
286
318
|
|
|
287
319
|
tuple verifyCallback(cell $verifyStatus) impure inline {
|
|
@@ -300,16 +332,22 @@ tuple setProxyAdmins(cell $signedRequest) impure inline {
|
|
|
300
332
|
$executeParams.cl::get<uint64>(md::ExecuteParams::expiration) <= now()
|
|
301
333
|
);
|
|
302
334
|
|
|
303
|
-
int
|
|
335
|
+
int signedOpcode = $executeParams.cl::get<uint32>(md::ExecuteParams::opcode);
|
|
304
336
|
throw_if(
|
|
305
337
|
Worker::ERROR::invalidSignedOpcode,
|
|
306
|
-
|
|
338
|
+
signedOpcode != Worker::OP::SET_ADMINS
|
|
307
339
|
);
|
|
308
340
|
|
|
309
341
|
int target = $executeParams.cl::get<address>(md::ExecuteParams::target);
|
|
310
342
|
throw_if(
|
|
311
|
-
Worker::ERROR::
|
|
312
|
-
target !=
|
|
343
|
+
Worker::ERROR::invalidTarget,
|
|
344
|
+
target != getContractAddress()
|
|
345
|
+
);
|
|
346
|
+
|
|
347
|
+
int forwardingAddress = $executeParams.cl::get<address>(md::ExecuteParams::forwardingAddress);
|
|
348
|
+
throw_if(
|
|
349
|
+
Worker::ERROR::invalidForwardingAddress,
|
|
350
|
+
forwardingAddress != getProxyAddress()
|
|
313
351
|
);
|
|
314
352
|
|
|
315
353
|
cell $newAdminList = $executeParams.cl::get<objRef>(md::ExecuteParams::callData);
|
|
@@ -326,6 +364,9 @@ tuple setProxyAdmins(cell $signedRequest) impure inline {
|
|
|
326
364
|
$storage.cl::get<uint64>(Dvn::quorum)
|
|
327
365
|
);
|
|
328
366
|
|
|
367
|
+
;; for the inside call, the target is the proxy address
|
|
368
|
+
$executeParams = $executeParams.cl::set(md::ExecuteParams::target, forwardingAddress);
|
|
369
|
+
|
|
329
370
|
return _callContract(actions, $executeParams);
|
|
330
371
|
}
|
|
331
372
|
|
|
@@ -21,7 +21,20 @@ cell Dvn::New(cell admins, int version, int quorum, cell verifiers) method_id {
|
|
|
21
21
|
[cl::t::dict256, verifiers], ;; Dvn::verifiers
|
|
22
22
|
[cl::t::uint64, 1], ;; Dvn::setQuorumNonce
|
|
23
23
|
[cl::t::uint64, 1], ;; Dvn::setVerifiersNonce
|
|
24
|
-
[cl::t::uint64, 1]
|
|
24
|
+
[cl::t::uint64, 1] ;; Dvn::setAdminsByQuorumNonce
|
|
25
25
|
])
|
|
26
26
|
);
|
|
27
|
-
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const int Dvn::_quorumOffset = _HEADER_WIDTH;
|
|
30
|
+
const int Dvn::_setQuorumNonceOffset = Dvn::_quorumOffset + 64;
|
|
31
|
+
const int Dvn::_setVerifiersNonceOffset = Dvn::_setQuorumNonceOffset + 64;
|
|
32
|
+
const int Dvn::_setAdminsByQuorumNonceOffset = Dvn::_setVerifiersNonceOffset + 64;
|
|
33
|
+
|
|
34
|
+
(int, cell) Dvn::getQuorumAndVerifiers(cell $self) impure inline {
|
|
35
|
+
slice selfSlice = $self.begin_parse();
|
|
36
|
+
return (
|
|
37
|
+
selfSlice.preloadUint64At(Dvn::_quorumOffset),
|
|
38
|
+
selfSlice.preloadRefAt(1)
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
#include "../proxy/interface.fc";
|
|
13
13
|
|
|
14
14
|
#include "../msgdata/NativeDrop.fc";
|
|
15
|
+
#include "../msgdata/DropEvent.fc";
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
#include "interface.fc";
|
|
@@ -32,28 +33,34 @@ tuple _executorNativeDrop(tuple actions, cell $mdNativeDrop) impure inline {
|
|
|
32
33
|
cell $storage = getContractStorage();
|
|
33
34
|
|
|
34
35
|
int totalAmount = 0;
|
|
35
|
-
tuple payees = deserializePayees($mdNativeDrop.
|
|
36
|
+
tuple payees = deserializePayees($mdNativeDrop.md::NativeDrop::getPayees());
|
|
36
37
|
|
|
37
38
|
repeat (payees.tlen()) {
|
|
38
39
|
[int payeeAddress, int nativeAmount] = payees~tpopPayee();
|
|
40
|
+
|
|
39
41
|
actions~pushAction<payment>(
|
|
40
42
|
payeeAddress,
|
|
41
43
|
nativeAmount,
|
|
42
44
|
0
|
|
43
45
|
);
|
|
46
|
+
|
|
47
|
+
actions~pushAction<event>(
|
|
48
|
+
Executor::event::NATIVE_DROP,
|
|
49
|
+
md::DropEvent::New(nativeAmount, payeeAddress)
|
|
50
|
+
);
|
|
44
51
|
totalAmount += nativeAmount;
|
|
45
52
|
}
|
|
46
53
|
|
|
47
54
|
throw_if(
|
|
48
55
|
Executor::ERROR::nativeDropTotalCapExceeded,
|
|
49
|
-
totalAmount > $storage.
|
|
56
|
+
totalAmount > $storage.Executor::getNativeDropTotalCap()
|
|
50
57
|
);
|
|
51
58
|
|
|
52
59
|
return actions;
|
|
53
60
|
}
|
|
54
61
|
|
|
55
62
|
tuple _executorLzReceivePrepare(tuple actions, cell $executeParams) impure inline {
|
|
56
|
-
int opcode = $executeParams.
|
|
63
|
+
int opcode = $executeParams.md::ExecuteParams::getOpcode();
|
|
57
64
|
throw_unless(
|
|
58
65
|
Worker::ERROR::invalidSignedOpcode,
|
|
59
66
|
opcode == Channel::OP::LZ_RECEIVE_PREPARE
|
|
@@ -73,15 +80,20 @@ tuple executorLzReceivePrepare(cell $executeParams) impure inline {
|
|
|
73
80
|
;; md: $mdNativeDrop
|
|
74
81
|
;; obj: $executeParams for lzReceivePrepare
|
|
75
82
|
tuple executorNativeDropAndLzReceivePrepare(cell $mdObj) impure inline {
|
|
83
|
+
(
|
|
84
|
+
cell $lzReceivePrepareMd,
|
|
85
|
+
cell $nativeDropMd
|
|
86
|
+
) = $mdObj.md::MdObj::deserialize();
|
|
87
|
+
|
|
76
88
|
return emptyActions()
|
|
77
|
-
._executorNativeDrop($
|
|
78
|
-
._executorLzReceivePrepare($
|
|
89
|
+
._executorNativeDrop($nativeDropMd)
|
|
90
|
+
._executorLzReceivePrepare($lzReceivePrepareMd);
|
|
79
91
|
}
|
|
80
92
|
|
|
81
93
|
tuple executorLzReceiveAlert(cell $executeParams) impure inline {
|
|
82
94
|
tuple actions = emptyActions();
|
|
83
95
|
|
|
84
|
-
int opcode = $executeParams.
|
|
96
|
+
int opcode = $executeParams.md::ExecuteParams::getOpcode();
|
|
85
97
|
throw_unless(
|
|
86
98
|
Worker::ERROR::invalidSignedOpcode,
|
|
87
99
|
opcode == Channel::OP::EMIT_LZ_RECEIVE_ALERT
|
|
@@ -14,6 +14,7 @@ const int Executor::OP::LZ_RECEIVE_ALERT = "Executor::OP::LZ_RECEIVE_ALERT"c;
|
|
|
14
14
|
|
|
15
15
|
;; --------- Events ---------
|
|
16
16
|
const int Executor::event::LZ_RECEIVE_ALERT = "Executor::event::LZ_RCV_ALERT"u;
|
|
17
|
+
const int Executor::event::NATIVE_DROP = "Executor::event::NATIVE_DROP"u;
|
|
17
18
|
|
|
18
19
|
;; --------- Errors ---------
|
|
19
20
|
const int Executor::ERROR::nativeDropTotalCapExceeded = 1951;
|
|
@@ -16,4 +16,11 @@ cell Executor::New(cell admins, int version, int nativeDropTotalCap) method_id {
|
|
|
16
16
|
[cl::t::coins, nativeDropTotalCap] ;; Executor::nativeDropTotalCap
|
|
17
17
|
])
|
|
18
18
|
);
|
|
19
|
-
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const int Executor::_nativeDropTotalCapOffset = _HEADER_WIDTH;
|
|
22
|
+
|
|
23
|
+
int Executor::getNativeDropTotalCap(cell $self) impure inline {
|
|
24
|
+
return $self.cellPreloadCoinsAt(Executor::_nativeDropTotalCapOffset);
|
|
25
|
+
}
|
|
26
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#include "../../funC++/classlib.fc";
|
|
2
|
+
|
|
3
|
+
;; required storage name
|
|
4
|
+
const int md::DropEvent::NAME = "DropEvent"u;
|
|
5
|
+
|
|
6
|
+
;; field names
|
|
7
|
+
const int md::DropEvent::nativeAmount = 0;
|
|
8
|
+
const int md::DropEvent::receiver = 1;
|
|
9
|
+
|
|
10
|
+
cell md::DropEvent::New(int nativeAmount, int receiver) inline method_id {
|
|
11
|
+
return cl::declare(
|
|
12
|
+
md::DropEvent::NAME,
|
|
13
|
+
unsafeTuple([
|
|
14
|
+
[cl::t::coins, nativeAmount],
|
|
15
|
+
[cl::t::address, receiver]
|
|
16
|
+
])
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -15,15 +15,78 @@ const int md::ExecuteParams::target = 0;
|
|
|
15
15
|
const int md::ExecuteParams::callData = 1;
|
|
16
16
|
const int md::ExecuteParams::expiration = 2;
|
|
17
17
|
const int md::ExecuteParams::opcode = 3;
|
|
18
|
+
const int md::ExecuteParams::forwardingAddress = 4;
|
|
18
19
|
|
|
19
|
-
cell md::ExecuteParams::New(
|
|
20
|
+
cell md::ExecuteParams::New(
|
|
21
|
+
int target,
|
|
22
|
+
cell callData,
|
|
23
|
+
int expiration,
|
|
24
|
+
int opcode,
|
|
25
|
+
int forwardingAddress
|
|
26
|
+
) method_id {
|
|
20
27
|
return cl::declare(
|
|
21
28
|
md::ExecuteParams::NAME,
|
|
22
29
|
unsafeTuple([
|
|
23
30
|
[cl::t::address, target], ;; md::ExecuteParams::target
|
|
24
31
|
[cl::t::objRef, callData], ;; md::ExecuteParams::callData
|
|
25
32
|
[cl::t::uint64, expiration], ;; md::ExecuteParams::expiration
|
|
26
|
-
[cl::t::uint32, opcode]
|
|
33
|
+
[cl::t::uint32, opcode], ;; md::ExecuteParams::opcode
|
|
34
|
+
[cl::t::address, forwardingAddress] ;; md::ExecuteParams::forwardingAddress
|
|
27
35
|
])
|
|
28
36
|
);
|
|
29
|
-
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
;; ========================== Object Builders=====================================
|
|
40
|
+
|
|
41
|
+
const int md::ExecuteParams::_headerInfoBits = _BASIC_HEADER_WIDTH + (_FIELD_INFO_WIDTH * 5);
|
|
42
|
+
const int md::ExecuteParams::_headerFillerBits = _HEADER_WIDTH - md::ExecuteParams::_headerInfoBits;
|
|
43
|
+
|
|
44
|
+
cell md::ExecuteParams::build(
|
|
45
|
+
int target,
|
|
46
|
+
cell callData,
|
|
47
|
+
int expiration,
|
|
48
|
+
int opcode,
|
|
49
|
+
int forwardingAddress
|
|
50
|
+
) inline {
|
|
51
|
+
return begin_cell()
|
|
52
|
+
.store_uint(593196021158614130743421175296147950525415477349115, md::ExecuteParams::_headerInfoBits)
|
|
53
|
+
.store_ones(md::ExecuteParams::_headerFillerBits)
|
|
54
|
+
.store_uint256(target)
|
|
55
|
+
.store_ref(callData)
|
|
56
|
+
.store_uint64(expiration)
|
|
57
|
+
.store_uint32(opcode)
|
|
58
|
+
.store_uint256(forwardingAddress)
|
|
59
|
+
.end_cell();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
;; ========================== Object Getters=====================================
|
|
63
|
+
|
|
64
|
+
const int md::ExecuteParams::_targetOffset = _HEADER_WIDTH;
|
|
65
|
+
const int md::ExecuteParams::_expirationOffset = md::ExecuteParams::_targetOffset + 256;
|
|
66
|
+
const int md::ExecuteParams::_opcodeOffset = md::ExecuteParams::_expirationOffset + 64;
|
|
67
|
+
const int md::ExecuteParams::_forwardingAddressOffset = md::ExecuteParams::_opcodeOffset + 32;
|
|
68
|
+
|
|
69
|
+
int md::ExecuteParams::getOpcode(cell $self) impure inline {
|
|
70
|
+
return $self.cellPreloadUint32At(md::ExecuteParams::_opcodeOffset);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
;; (expiration, target, opcode, forwardingAddress)
|
|
74
|
+
(int, int, int, int) md::ExecuteParams::deserialize(cell $self) impure inline {
|
|
75
|
+
slice selfSlice = $self.begin_parse();
|
|
76
|
+
return (
|
|
77
|
+
selfSlice.preloadUint64At(md::ExecuteParams::_expirationOffset),
|
|
78
|
+
selfSlice.preloadAddressAt(md::ExecuteParams::_targetOffset),
|
|
79
|
+
selfSlice.preloadUint32At(md::ExecuteParams::_opcodeOffset),
|
|
80
|
+
selfSlice.preloadAddressAt(md::ExecuteParams::_forwardingAddressOffset)
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
;; (target, opcode, callData)
|
|
85
|
+
(int, int, cell) md::ExecuteParams::getActionArgs(cell $self) impure inline {
|
|
86
|
+
slice selfSlice = $self.begin_parse();
|
|
87
|
+
return (
|
|
88
|
+
selfSlice.preloadAddressAt(md::ExecuteParams::_targetOffset),
|
|
89
|
+
selfSlice.preloadUint32At(md::ExecuteParams::_opcodeOffset),
|
|
90
|
+
selfSlice.preload_ref_at(0)
|
|
91
|
+
);
|
|
92
|
+
}
|
|
@@ -7,14 +7,16 @@ const int md::SetDict::NAME = "setDct"u;
|
|
|
7
7
|
const int md::SetDict::nonce = 0;
|
|
8
8
|
const int md::SetDict::opcode = 1;
|
|
9
9
|
const int md::SetDict::dict = 2;
|
|
10
|
+
const int md::SetDict::target = 3;
|
|
10
11
|
|
|
11
|
-
cell md::SetDict::New(int nonce, int opcode, cell _dict) inline method_id {
|
|
12
|
+
cell md::SetDict::New(int nonce, int opcode, cell _dict, int target) inline method_id {
|
|
12
13
|
return cl::declare(
|
|
13
14
|
md::SetDict::NAME,
|
|
14
15
|
unsafeTuple([
|
|
15
|
-
[cl::t::uint64, nonce],
|
|
16
|
-
[cl::t::uint64, opcode],
|
|
17
|
-
[cl::t::dict256, _dict] ;; md::SetDict::dict
|
|
16
|
+
[cl::t::uint64, nonce], ;; md::SetDict::nonce
|
|
17
|
+
[cl::t::uint64, opcode], ;; md::SetDict::opcode
|
|
18
|
+
[cl::t::dict256, _dict], ;; md::SetDict::dict
|
|
19
|
+
[cl::t::address, target] ;; md::SetDict::target
|
|
18
20
|
])
|
|
19
21
|
);
|
|
20
22
|
}
|
|
@@ -7,14 +7,16 @@ const int md::SetQuorum::NAME = "setQuorum"u;
|
|
|
7
7
|
const int md::SetQuorum::nonce = 0;
|
|
8
8
|
const int md::SetQuorum::opcode = 1;
|
|
9
9
|
const int md::SetQuorum::quorum = 2;
|
|
10
|
+
const int md::SetQuorum::target = 3;
|
|
10
11
|
|
|
11
|
-
cell md::SetQuorum::New(int nonce, int opcode, int quorum) inline method_id {
|
|
12
|
+
cell md::SetQuorum::New(int nonce, int opcode, int quorum, int target) inline method_id {
|
|
12
13
|
return cl::declare(
|
|
13
14
|
md::SetQuorum::NAME,
|
|
14
15
|
unsafeTuple([
|
|
15
16
|
[cl::t::uint64, nonce], ;; md::SetQuorum::nonce
|
|
16
17
|
[cl::t::uint64, opcode], ;; md::SetQuorum::opcode
|
|
17
|
-
[cl::t::uint64, quorum]
|
|
18
|
+
[cl::t::uint64, quorum], ;; md::SetQuorum::quorum
|
|
19
|
+
[cl::t::address, target] ;; md::SetQuorum::target
|
|
18
20
|
])
|
|
19
21
|
);
|
|
20
22
|
}
|
|
@@ -16,3 +16,11 @@ cell md::SignedRequest::New(cell $request, cell signatures) method_id {
|
|
|
16
16
|
])
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
|
+
|
|
20
|
+
cell md::SignedRequest::getRequest(cell $self) impure inline {
|
|
21
|
+
return $self.begin_parse().preload_ref_at(0);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
cell md::SignedRequest::getSignatures(cell $self) impure inline {
|
|
25
|
+
return $self.begin_parse().preload_ref_at(1);
|
|
26
|
+
}
|
|
@@ -37,35 +37,30 @@ tuple claimTon(cell $coinsAmount) impure inline {
|
|
|
37
37
|
tuple updatePrice(cell $mdAddress) impure inline {
|
|
38
38
|
(cell $storage, tuple actions) = preamble();
|
|
39
39
|
|
|
40
|
-
cell $ulnPriceFeed = $mdAddress.
|
|
40
|
+
(cell $ulnPriceFeed, int targetAddress) = $mdAddress.md::MdAddress::deserialize();
|
|
41
|
+
(
|
|
42
|
+
int priceRatio,
|
|
43
|
+
int gasPriceInUnit,
|
|
44
|
+
int gasPerByte
|
|
45
|
+
) = PriceFeedFeelib::utils::getFirstThreeFields($ulnPriceFeed);
|
|
41
46
|
|
|
42
47
|
cell $pfStorage = $storage
|
|
43
|
-
.
|
|
44
|
-
|
|
45
|
-
PriceFeedFeelib::priceRatio,
|
|
46
|
-
$ulnPriceFeed.cl::get<coins>(PriceFeedFeelib::priceRatio)
|
|
47
|
-
)
|
|
48
|
-
.cl::set(
|
|
49
|
-
PriceFeedFeelib::gasPriceInUnit,
|
|
50
|
-
$ulnPriceFeed.cl::get<uint64>(PriceFeedFeelib::gasPriceInUnit)
|
|
51
|
-
)
|
|
52
|
-
.cl::set(
|
|
53
|
-
PriceFeedFeelib::gasPerByte,
|
|
54
|
-
$ulnPriceFeed.cl::get<uint32>(PriceFeedFeelib::gasPerByte)
|
|
55
|
-
);
|
|
48
|
+
.PriceFeedCache::getPriceFeedFeeLibStorage()
|
|
49
|
+
.PriceFeedFeelib::setFirstThreeFields(priceRatio, gasPriceInUnit, gasPerByte);
|
|
56
50
|
|
|
57
51
|
setContractStorage(
|
|
58
|
-
$storage.
|
|
52
|
+
$storage.PriceFeedCache::setPriceFeedFeeLibStorage($pfStorage)
|
|
59
53
|
);
|
|
60
54
|
|
|
61
55
|
;; call into the proxy to update the priceFeedFeeLib
|
|
62
56
|
return _callViaProxy(
|
|
63
57
|
actions,
|
|
64
58
|
md::ExecuteParams::New(
|
|
65
|
-
|
|
59
|
+
targetAddress, ;; usually the uln
|
|
66
60
|
$pfStorage, ;; new priceFeedFeeLib storage
|
|
67
61
|
0,
|
|
68
|
-
Uln::OP::UPDATE_WORKER_FEELIB
|
|
62
|
+
Uln::OP::UPDATE_WORKER_FEELIB,
|
|
63
|
+
NULLADDRESS
|
|
69
64
|
)
|
|
70
65
|
);
|
|
71
66
|
}
|
|
@@ -73,27 +68,26 @@ tuple updatePrice(cell $mdAddress) impure inline {
|
|
|
73
68
|
tuple updateNativePrice(cell $mdAddress) impure inline {
|
|
74
69
|
(cell $storage, tuple actions) = preamble();
|
|
75
70
|
|
|
76
|
-
cell $ulnPriceFeed = $mdAddress.
|
|
71
|
+
(cell $ulnPriceFeed, int targetAddress) = $mdAddress.md::MdAddress::deserialize();
|
|
72
|
+
int nativePriceUsd = $ulnPriceFeed.PriceFeedFeelib::getNativePriceUsd();
|
|
77
73
|
|
|
78
74
|
cell $pfStorage = $storage
|
|
79
|
-
.
|
|
80
|
-
.
|
|
81
|
-
PriceFeedFeelib::nativePriceUsd,
|
|
82
|
-
$ulnPriceFeed.cl::get<coins>(PriceFeedFeelib::nativePriceUsd)
|
|
83
|
-
);
|
|
75
|
+
.PriceFeedCache::getPriceFeedFeeLibStorage()
|
|
76
|
+
.PriceFeedFeelib::setNativePriceUsd(nativePriceUsd);
|
|
84
77
|
|
|
85
78
|
setContractStorage(
|
|
86
|
-
$storage.
|
|
79
|
+
$storage.PriceFeedCache::setPriceFeedFeeLibStorage($pfStorage)
|
|
87
80
|
);
|
|
88
81
|
|
|
89
82
|
;; call into the proxy to update the priceFeedFeeLib
|
|
90
83
|
return _callViaProxy(
|
|
91
84
|
actions,
|
|
92
|
-
md::ExecuteParams::
|
|
93
|
-
|
|
85
|
+
md::ExecuteParams::build(
|
|
86
|
+
targetAddress, ;; usually the uln
|
|
94
87
|
$pfStorage, ;; new priceFeedFeeLib storage
|
|
95
88
|
0,
|
|
96
|
-
Uln::OP::UPDATE_WORKER_FEELIB
|
|
89
|
+
Uln::OP::UPDATE_WORKER_FEELIB,
|
|
90
|
+
NULLADDRESS
|
|
97
91
|
)
|
|
98
92
|
);
|
|
99
93
|
}
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
#include "../core/workerCoreStorage.fc";
|
|
4
4
|
|
|
5
|
+
#include "../../protocol/msglibs/ultralightnode/workerFeeLibs/priceFeedFeeLib/storage.fc";
|
|
6
|
+
|
|
7
|
+
|
|
5
8
|
;; required object name
|
|
6
9
|
const int PriceFeedCache::NAME = "pfCache"u;
|
|
7
10
|
|
|
@@ -18,4 +21,16 @@ cell PriceFeedCache::New(cell admins, int version, cell $priceFeedFeeLib) method
|
|
|
18
21
|
[cl::t::objRef, $priceFeedFeeLib] ;; PriceFeedCache::priceFeedFeeLibStorage
|
|
19
22
|
])
|
|
20
23
|
);
|
|
21
|
-
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
cell PriceFeedCache::getPriceFeedFeeLibStorage(cell $self) impure inline {
|
|
27
|
+
return $self.cellPreloadRefAt(1);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
cell PriceFeedCache::setPriceFeedFeeLibStorage(cell $self, cell $priceFeedFeeLibStorage) impure inline {
|
|
31
|
+
slice selfSlice = $self.begin_parse();
|
|
32
|
+
return begin_cell()
|
|
33
|
+
.store_slice(selfSlice.scutfirst(_HEADER_WIDTH, 1)) ;; header + refs[0]
|
|
34
|
+
.store_ref($priceFeedFeeLibStorage) ;; new refs[1]
|
|
35
|
+
.end_cell();
|
|
36
|
+
}
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
#include "../src/funC++/actions/sendJettons.fc";
|
|
8
8
|
#include "../src/funC++/actions/call.fc";
|
|
9
9
|
#include "../src/funC++/actions/deploy.fc";
|
|
10
|
-
#include "../src/funC++/actions/destroy.fc";
|
|
11
10
|
#include "../src/funC++/actions/dispatch.fc";
|
|
12
11
|
#include "../src/funC++/actions/payment.fc";
|
|
13
12
|
|
|
@@ -80,10 +79,7 @@ cell baseTest::prepare(tuple args) impure {
|
|
|
80
79
|
int actionType = actualAction.int_at(0);
|
|
81
80
|
int equal = false;
|
|
82
81
|
|
|
83
|
-
if (actionType == action::
|
|
84
|
-
terminalIndices = terminalIndices.tpush(index);
|
|
85
|
-
equal = action::destroy::equals(actualAction, expectedAction);
|
|
86
|
-
} elseif (actionType == action::deploy::NAME) {
|
|
82
|
+
if (actionType == action::deploy::NAME) {
|
|
87
83
|
terminalIndices = terminalIndices.tpush(index);
|
|
88
84
|
equal = action::deploy::equals(actualAction, expectedAction);
|
|
89
85
|
} elseif (actionType == action::call::NAME) {
|
|
@@ -135,7 +131,7 @@ cell baseTest::prepare(tuple args) impure {
|
|
|
135
131
|
} elseif (txnContext.at(index).is_cell()) {
|
|
136
132
|
mismatch = (txnContext.cell_at(index).cell_hash() != expectedTxnContext.cell_at(index).cell_hash());
|
|
137
133
|
} elseif (txnContext.at(index).is_slice()) {
|
|
138
|
-
mismatch = (~ txnContext.slice_at(index).
|
|
134
|
+
mismatch = (~ txnContext.slice_at(index).equal_slice_bits(expectedTxnContext.slice_at(index)));
|
|
139
135
|
} else {
|
|
140
136
|
mismatch = (~ txnContext.cell_at(index).cl::hash() == expectedTxnContext.cell_at(index).cl::hash());
|
|
141
137
|
}
|
package/tests/testMain.fc
CHANGED
|
@@ -121,7 +121,7 @@ tuple _get_c7() impure asm "c7 PUSH";
|
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
(int, slice) test::shouldBeTrue(int condition) {
|
|
124
|
+
(int, slice) test::shouldBeTrue(int condition) impure {
|
|
125
125
|
ifnot (condition) {
|
|
126
126
|
return (TEST_FAILED, "test::shouldBeTrue");
|
|
127
127
|
} else {
|
|
@@ -129,6 +129,6 @@ tuple _get_c7() impure asm "c7 PUSH";
|
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
(int, slice) test::shouldBeFalse(int condition) {
|
|
132
|
+
(int, slice) test::shouldBeFalse(int condition) impure {
|
|
133
133
|
return test::shouldBeTrue(condition == false);
|
|
134
134
|
}
|