1- tolk 1.1
1+ tolk 1.2
22
33import "../lib/utils";
44import "../lib/secp256k1";
@@ -586,7 +586,7 @@ struct OpPendingInfo {
586586 /// The timeout required to finalize the currently executing op
587587 opFinalizationTimeout: uint32;
588588 /// The address that the (pending) operation was sent to (and could bounce from).
589- opPendingReceiver: address;
589+ opPendingReceiver: address? ;
590590 /// The truncated body of the pending operation (256 bits from the original message),
591591 /// stored as the next expected potential bounce, and verified in onBounceMessage handler.
592592 opPendingBodyTruncated: uint256;
@@ -872,7 +872,7 @@ fun MCMS<T>.setRoot(
872872 opPendingInfo: OpPendingInfo{
873873 validAfter: blockchain.now(), // immediate
874874 opFinalizationTimeout: opPendingInfo.opFinalizationTimeout, // cp from storage
875- opPendingReceiver: createAddressNone() ,
875+ opPendingReceiver: null ,
876876 opPendingBodyTruncated: 0,
877877 }.toCell()
878878 },
@@ -1183,7 +1183,7 @@ fun MCMS<T>.setConfig(
11831183 opPendingInfo: OpPendingInfo{
11841184 validAfter: blockchain.now(), // immediate
11851185 opFinalizationTimeout: opPendingInfo.opFinalizationTimeout, // cp from storage
1186- opPendingReceiver: createAddressNone() ,
1186+ opPendingReceiver: null ,
11871187 opPendingBodyTruncated: 0
11881188 }.toCell()
11891189 },
@@ -1291,7 +1291,9 @@ fun MCMS<T>.submitErrorReport(
12911291 // Check the reported error against the stored pending operation
12921292 val opPendingInfo = lazy OpPendingInfo.fromCell(rootInfo.expiringRootAndOpCount.opPendingInfo);
12931293
1294- val matchesPendingOp = opPendingInfo.opPendingReceiver == op.to
1294+ val matchesPendingOp =
1295+ opPendingInfo.opPendingReceiver != null
1296+ && opPendingInfo.opPendingReceiver == op.to
12951297 && opPendingInfo.opPendingBodyTruncated == extractBouncedBody(op.data.beginParse());
12961298
12971299 // Store the root in a separate cell (size limit)
@@ -1499,7 +1501,7 @@ fun onBouncedMessage(in: InMessageBounced) {
14991501 //
15001502 // @dev on setRoot the OpPendingInfo is cleared, so a bounce from an old root will not match
15011503 val bouncedBody = extractBouncedBody(in.bouncedBody.skipBouncedPrefix());
1502- if (opPendingInfo.opPendingReceiver != in.senderAddress
1504+ if (opPendingInfo.opPendingReceiver! != in.senderAddress
15031505 || opPendingInfo.opPendingBodyTruncated != bouncedBody) {
15041506
15051507 // Check the case when a new root was just set and no ops yet executed
@@ -1518,7 +1520,7 @@ fun onBouncedMessage(in: InMessageBounced) {
15181520 // If the received bounce equals expected, revert state (allow op retry)
15191521 rootInfo.expiringRootAndOpCount.opCount = rootInfo.expiringRootAndOpCount.opCount - 1;
15201522 opPendingInfo.validAfter = blockchain.now(); // can be retried immediately
1521- opPendingInfo.opPendingReceiver = createAddressNone() ;
1523+ opPendingInfo.opPendingReceiver = null ;
15221524 opPendingInfo.opPendingBodyTruncated = 0;
15231525
15241526 rootInfo.expiringRootAndOpCount.opPendingInfo = opPendingInfo.toCell();
0 commit comments